# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271418976 -10800 # Node ID ccd8e69b53929119014b27e391d6ad3be0a8b59b # Parent b31261fd4e04df1f6eaeb52c8c9367360361868b Revision: 201015 Kit: 201015 diff -r b31261fd4e04 -r ccd8e69b5392 group/bld.inf --- a/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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: This file provides the information required for building the -* ipappservices -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../rom/multimediasharing.iby CORE_APP_LAYER_IBY_EXPORT_PATH(multimediasharing.iby) -../rom/multimediasharingresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(multimediasharingresources.iby) - -// Export stub sis file making possible eclipsing files in the rom image -../rom/multimediasharing_stub.SIS /epoc32/data/z/system/install/multimediasharing_stub.sis - -PRJ_MMPFILES -#include "../mmsharinguis_plat/group/bld.inf" -#include "../mmsharing/group/bld.inf" -#include "../mmshplugins/group/bld.inf" -#include "../mmsharing/mmshui/help/group/bld.inf" \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 inc/musavasettings.h --- a/inc/musavasettings.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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 - -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 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 ); - - /** - * Sets the for the manual activation - * - */ - virtual void SetManualActivation( TManualActivation aManualActivation ); - - /** - * Returns the direction of the mobile call. - * - * @return 0, if the direction of the call is unknown. - * 1, call is from public number. - * 2, call is from private number - */ - virtual TInt CallPrivacy(); - - }; - -#include "musavasettings.inl" - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 inc/musavasettings.inl --- a/inc/musavasettings.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* 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 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 void MMusAvaSettings::SetManualActivation( TManualActivation /*aManualActivation*/ ) - { - User::Leave( KErrNotSupported ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -inline TInt MMusAvaSettings::CallPrivacy() - { - User::Leave( KErrNotSupported ); - return 0; // To avoid "return value expected" warning - } - -#endif // MUSAVASETTING_INL diff -r b31261fd4e04 -r ccd8e69b5392 inc/muscallmonitorobserver.h --- a/inc/muscallmonitorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* 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 ) = 0; - - virtual void CallHoldL( const TDesC& aTelNumber ) = 0; - - virtual void ConferenceCallL() = 0; - - virtual void NoActiveCallL() = 0; - - /** - * - */ - virtual TBool ResolveAddressesL( CPbkContactItem& /*aPbkItem*/, - CDesCArrayFlat*& /*aContactsArray*/, - TPbkFieldId /*aTPbkFieldId*/ ) - { - return EFalse; - } - }; - -#endif // MUSCALLMONITOROBSERVER_H diff -r b31261fd4e04 -r ccd8e69b5392 inc/muscleanupresetanddestroy.h --- a/inc/muscleanupresetanddestroy.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __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 b31261fd4e04 -r ccd8e69b5392 inc/muscommon.h --- a/inc/muscommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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 - }; - } - -#endif // MUSMANAGERCOMMON_H - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 inc/musindicatorapi.h --- a/inc/musindicatorapi.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* 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 indicate availability - * of videosharing to user. - * @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(); - - /** - * 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(); - - void StartLiveSharingL(); - void ToggleIndicatorL(); - TBool IsSubscriber() const; - - -private: // data - - /** - * Pointer to indicator window - * Own. - */ - CMusIndicatorDsa* iIndicatorWindow; - - /** - * Sound player. - * Own. - */ - CMusSoundPlayer* iSoundPlayer; - - /** - * Reference to observer interface. - * Own. - */ - MMusIndicatorObserver* iObserver; - - RProperty iProperty; - - MUS_UNITTEST( UT_CMusIndicatorApi ) - - }; - -#endif // C_MUSINDICATORAPI_H diff -r b31261fd4e04 -r ccd8e69b5392 inc/musindicatorobserver.h --- a/inc/musindicatorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/muslogger.h --- a/inc/muslogger.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/musresourcefinderutil.h --- a/inc/musresourcefinderutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/musresourcefinderutil.inl --- a/inc/musresourcefinderutil.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/mussesseioninformationapi.h --- a/inc/mussesseioninformationapi.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 privacy */ - const TInt KMUSPrivacy( 0x102823A4 ); - /** Contains the possible values for call privacy*/ - enum TMusCallPrivacy - { - EPrivacyOn = 1, - EPrivacyOff - }; - - /** Phone's CLIR setting. This is used in MO case to determine if the - * caller's phone number/id is sent to remote party */ - const TInt KMusClirSetting( 0x102823A5 ); - /** Possible values for KMusClirSetting */ - enum TMusClirSetting - { - ESendOwnNumber, - EDoNotSendOwnNumber - }; - } - -#endif // MUSRESOURCEPROPERTIES_H diff -r b31261fd4e04 -r ccd8e69b5392 inc/mussessionproperties.h --- a/inc/mussessionproperties.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 KPrivacyStatus( 0x1C ); - const TInt KMusIndicatorStatus( KMusIndicator ); - } - -#endif // MUSPSKEYS_H diff -r b31261fd4e04 -r ccd8e69b5392 inc/mussettings.h --- a/inc/mussettings.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* 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: 9 % << 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 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::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 MultimediaSharingSettings::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 MultimediaSharingSettings::IsAvcDisabled(); - - - /** - * @return ETrue if privacy is requested - * EFalse otherwise, or if an error occurred reading cenrep - */ - static TBool PrivacySetting(); - - }; - -#include "mussettings.inl" - -#endif // MUSSETTINGS_H diff -r b31261fd4e04 -r ccd8e69b5392 inc/mussettings.inl --- a/inc/mussettings.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,558 +0,0 @@ -/* -* 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: 19 % << 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::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 ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -inline TBool MultimediaSharingSettings::PrivacySetting() - { - MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::PrivacySetting()" ) - - TInt value(0); - TRAPD( err, value = GetPropertyValueL( MusSettingsKeys::KPrivacyExchange ) ); - MUS_LOG2( "mus: [MUSSET] <- MultimediaSharingSettings::PrivacySetting() err=%d value=%d", - err, value ) - return ( err == KErrNone && value == MusSettingsKeys::EPrivacy ); - } -#endif // MUSSETTINGS_INL diff -r b31261fd4e04 -r ccd8e69b5392 inc/mussipobserver.h --- a/inc/mussipobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/mussipprofileregistryobserver.h --- a/inc/mussipprofileregistryobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/mussipprofileutils.h --- a/inc/mussipprofileutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/mussipprofileutils.inl --- a/inc/mussipprofileutils.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/mussoundplayerobserver.h --- a/inc/mussoundplayerobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/musuid.hrh --- a/inc/musuid.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 diff -r b31261fd4e04 -r ccd8e69b5392 inc/musunittesting.h --- a/inc/musunittesting.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 inc/musversionnumbers.h --- a/inc/musversionnumbers.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 layers.sysdef.xml --- a/layers.sysdef.xml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/Conf/multimediasharing.confml Binary file mmsharing/Conf/multimediasharing.confml has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/Conf/multimediasharing_1028238B.crml Binary file mmsharing/Conf/multimediasharing_1028238B.crml has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/cenrep/backup_registration.xml --- a/mmsharing/cenrep/backup_registration.xml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/group/bld.inf --- a/mmsharing/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 -../mmshshared/loc/mus.loc APP_LAYER_LOC_EXPORT_PATH(mus.loc) -../mmshshared/loc/musoperator.loc APP_LAYER_LOC_EXPORT_PATH(musoperator.loc) - -// Generic configuration interface for multimediasharing cenrep settings -// component_1028238b implementation specifics for cenrep data -// component_1028238b implementation specifics for genconf ml data -../Conf/multimediasharing.confml APP_LAYER_CONFML(multimediasharing.confml) -../Conf/multimediasharing_1028238B.crml APP_LAYER_CRML(multimediasharing_1028238B.crml) - -// Export backup registration xml file to register multimediasharing settings -// to be securely backed up as part of symbian secure backup restore operation. -// Here data owner will be musmanager server process but the real data stored -// in central repository. Hence central repository uid should be specified as proxy data owner. -../cenrep/backup_registration.xml /epoc32/data/z/private/1028238d/backup_registration.xml - -PRJ_MMPFILES -#include "../mmshavailability/group/bld.inf" -#include "../mmshindicator/group/bld.inf" -#include "../mmshmanagercli/group/bld.inf" -#include "../mmshmanagersrv/group/bld.inf" -#include "../mmshengine/group/bld.inf" -#include "../mmshui/group/bld.inf" diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/inc/musavainterface.h --- a/mmsharing/inc/musavainterface.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* 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; - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/inc/musavainterface.inl --- a/mmsharing/inc/musavainterface.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/inc/musavaobserver.h --- a/mmsharing/inc/musavaobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/inc/musavasettingsobserver.h --- a/mmsharing/inc/musavasettingsobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 - -/** - * 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; - - }; - - -#endif // __MUSAVASETTINGSOBSERVER_H__ - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/inc/musmanageripccommon.h --- a/mmsharing/inc/musmanageripccommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/bwins/musavailabilitypluginu.def --- a/mmsharing/mmshavailability/bwins/musavailabilitypluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/data/1028238E.rss --- a/mmsharing/mmshavailability/data/1028238E.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/eabi/musavailabilitypluginu.def --- a/mmsharing/mmshavailability/eabi/musavailabilitypluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/group/bld.inf --- a/mmsharing/mmshavailability/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/group/musavailabilityplugin.mmp --- a/mmsharing/mmshavailability/group/musavailabilityplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* 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 pbkeng.lib -LIBRARY phoneengine.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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/mmusavacapabilityqueryobserver.h --- a/mmsharing/mmshavailability/inc/mmusavacapabilityqueryobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 - -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; - - }; - - -#endif //MMUSAVACAPABILITYQUERYOBSERVER_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaavailability.h --- a/mmsharing/mmshavailability/inc/musavaavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* 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 ); - } - - - 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__ \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaavailabilityobserver.h --- a/mmsharing/mmshavailability/inc/musavaavailabilityobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaavailabilityobserverimp.h --- a/mmsharing/mmshavailability/inc/musavaavailabilityobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacalleventmonitor.h --- a/mmsharing/mmshavailability/inc/musavacalleventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* 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(); - - /** - * get call Privacy - * - * @return call privacy - */ - TInt CallPrivacyL(); - - - void GetTelNumberL( TDes& aTelNumber ); - - /** - * 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(); - - -private: // data - - /** - * properties for P&S - */ - RProperty iPropertyEvent; - - /** - * Reference to the observer object - */ - MMusCallMonitorObserver& iObserver; - }; - -#endif // MUSAVACALLEVENTMONITOR_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapability.h --- a/mmsharing/mmshavailability/inc/musavacapability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -/* -* 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" - - -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" ); - -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 ); -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilitybase.h --- a/mmsharing/mmshavailability/inc/musavacapabilitybase.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilitycontext.h --- a/mmsharing/mmshavailability/inc/musavacapabilitycontext.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilityexchange.h --- a/mmsharing/mmshavailability/inc/musavacapabilityexchange.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilityquery.h --- a/mmsharing/mmshavailability/inc/musavacapabilityquery.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilityquerybase.h --- a/mmsharing/mmshavailability/inc/musavacapabilityquerybase.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilitysipagent.h --- a/mmsharing/mmshavailability/inc/musavacapabilitysipagent.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacapabilitytimer.h --- a/mmsharing/mmshavailability/inc/musavacapabilitytimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaclientresolverutil.h --- a/mmsharing/mmshavailability/inc/musavaclientresolverutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaconnectionavailability.h --- a/mmsharing/mmshavailability/inc/musavaconnectionavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* 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(); - - -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. - */ - 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(); - - static TBool OperatorVariant(); - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaconnectionmonitor.h --- a/mmsharing/mmshavailability/inc/musavaconnectionmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaconnectionmonitorobserver.h --- a/mmsharing/mmshavailability/inc/musavaconnectionmonitorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavacontactavailability.h --- a/mmsharing/mmshavailability/inc/musavacontactavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* 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 "muscallmonitorobserver.h" -#include -#include - -class MMusAvaAvailabilityObserver; -class MMusAvaObserver; -class CMusAvaSharedObject; -class CPbkContactEngine; -class CContactIdArray; -class CPbkContactItem; -class CContactItem; -class CMusAvaSettingsImp; -class CMusAvaCallEventMonitor; - -/** - * Implemets register vailability. - * - * Provide interface for the client to availability class. - * - * @lib musavailabilityplugin.lib - */ -class CMusAvaContactAvailability : public CMusAvaAvailability, - public MMusCallMonitorObserver - { - -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(); - // from class MMusCallMonitorObserver - /** - * Call connected - * - * @since S60 v3.2 - * @return - */ - virtual void CallConnectedL( const TDesC& aTelNumber ); - - /** - * Call on hold - * - * @since S60 v3.2 - * @return - */ - virtual void CallHoldL( const TDesC& aTelNumber ); - - /** - * Call disconnected - * - * @since S60 v3.2 - * @return - */ - virtual void NoActiveCallL(); - - /** - * Call on hold - * - * @since S60 v3.2 - * @return - */ - virtual void ConferenceCallL(); - -private: - - /** - * - */ - TBool ActiveCallL( CDesCArrayFlat*& aContactsArray ); - - /** - * - */ - TBool ContactL( CContactIdArray*& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ); - - /** - * - */ - void UpdateContactNameL( CContactItem& aContactItem ); - - /** - * - */ - TInt ContactArrayL( CContactIdArray*& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ); - - /** - * - */ - TInt ContactItem( CContactIdArray& aContactIdArray, - CPbkContactItem*& aPbkContactItem, - CPbkContactEngine& aPbkContactEngine ); - - /** - * - */ - TBool ContactId( CPbkContactItem& aPbkItem, - TPbkFieldId aTPbkFieldId ); - /** - * - */ - TPbkFieldId ContactIdSearch( CContactIdArray& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ); - - /** - * - */ - TBool PhoneResolutionL( CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray ); - - - /** - * - */ - TBool ResolveAddressesL( CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray, - TPbkFieldId aTPbkFieldId ); - - /** - * - */ - TBool ResolvePhoneContactL( CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray ); - - /* ------------------------------------------------------------------------- - * Checks that whether aDesItem present in aDesArray. - * Utility function used to avoid dublication. - * ------------------------------------------------------------------------- - */ - TBool IsExistAlready(const MDesCArray& aDesArray, - const TDesC& aDesItem); - -private: - /** - * iPhoneStatus subscribe property resource. When the resource - * changed somewhere,availability will get notification. - */ - CMusAvaCallEventMonitor* iPhoneStatus; - - /** - * 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__ \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavadefaultimp.h --- a/mmsharing/mmshavailability/inc/musavadefaultimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* -* 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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavadefaultoptionhandler.h --- a/mmsharing/mmshavailability/inc/musavadefaultoptionhandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,324 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavailabilityplugin.hrh --- a/mmsharing/mmshavailability/inc/musavailabilityplugin.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavainvitehandler.h --- a/mmsharing/mmshavailability/inc/musavainvitehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavainviteresponder.h --- a/mmsharing/mmshavailability/inc/musavainviteresponder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavainviteresponderobserver.h --- a/mmsharing/mmshavailability/inc/musavainviteresponderobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavanetworkavailability.h --- a/mmsharing/mmshavailability/inc/musavanetworkavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* -* 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 ); - - /** - * Call on hold - * - * @since S60 v3.2 - * @return - */ - virtual void CallHoldL( const TDesC& aTelNumber ); - - /** - * Call disconnected - * - * @since S60 v3.2 - * @return - */ - virtual void NoActiveCallL(); - - /** - * Call on hold - * - * @since S60 v3.2 - * @return - */ - virtual void ConferenceCallL(); - -private: // data - - /** - * - */ - CMusAvaCallEventMonitor* iPhoneStatus; - - /** - * Pointer to CMusAvaSharedObject object - */ - CMusAvaSharedObject* iSharedObj; - - /** - * Reference to availability settings object. - */ - CMusAvaSettingsImp& iSettings; - }; - - -#endif // __MUSAVANETWORKAVAILABILITY_H__ \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavanetworkmodestatus.h --- a/mmsharing/mmshavailability/inc/musavanetworkmodestatus.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavanetworkregistrationstatus.h --- a/mmsharing/mmshavailability/inc/musavanetworkregistrationstatus.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaoptionhandler.h --- a/mmsharing/mmshavailability/inc/musavaoptionhandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* 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(); - - -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 ); - -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; - - 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__ \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaregisteravailability.h --- a/mmsharing/mmshavailability/inc/musavaregisteravailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ -/* -* 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.4 % << 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 "mussettingskeys.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; - - MusSettingsKeys::TOperatorVariant iOperatorVariant; - MUS_UNITTEST( UT_CMusAvaRegisterAvailability ) - }; - - -#endif // __MUSAVAREGISTERAVAILABILITY_H__ diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasettingavailability.h --- a/mmsharing/mmshavailability/inc/musavasettingavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasettingsimp.h --- a/mmsharing/mmshavailability/inc/musavasettingsimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ -/* -* 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 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 ); - - /** - * Sets the for the manual activation - * - */ - virtual void SetManualActivation( TManualActivation aManualActivation ); - - - /** - * Returns the direction of the mobile call. - * - * @return 0, if the direction of the call is unknown. - * 1, call is from public number. - * 2, call is from private number - */ - virtual TInt CallPrivacy(); - - -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 ); - - - /** - * Sets the call privacy e.g. current call number is from private number, - * should be shown on MT. - * - * @param aPrivacy the SIP profile id. - */ - void SetCallPrivacy( TInt aPrivacy ); - - /** - * Returns the id of the preferable SIP profile. - * - * @return The SIP profile id. - */ - CMusAvaSip& Sip(); - - - -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; - - /** - * Call privacy indicator - * - */ - - TInt iCallPrivacy; - - MUS_UNITTEST( UT_CMusAvaSettingsImp ) - MUS_UNITTEST( UT_CMusAvaOptionHandler ) - MUS_UNITTEST( UT_CMusAvaTerminal ) - }; - -#endif __MUSAVASETTINGSIMP_H__ - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasharedobject.h --- a/mmsharing/mmshavailability/inc/musavasharedobject.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasip.h --- a/mmsharing/mmshavailability/inc/musavasip.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* 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: 23 % << 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; - - /** - * Deletes unnecessary CSIPConnection - */ - void DeleteSIPConnection(); - - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipadapter.h --- a/mmsharing/mmshavailability/inc/musavasipadapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipconnectionadapter.h --- a/mmsharing/mmshavailability/inc/musavasipconnectionadapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipconnectionobserver.h --- a/mmsharing/mmshavailability/inc/musavasipconnectionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,285 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipdefaulthandler.h --- a/mmsharing/mmshavailability/inc/musavasipdefaulthandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipheaderutil.h --- a/mmsharing/mmshavailability/inc/musavasipheaderutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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 ); - - /** - * Utility class to add SIP privacy header when the PS key - * NMusSessionInformationApi::KMusClirSetting PS indicates so. - * @lib AlwaysOnlinePlugin.dll - */ - static void AddPrivacyHeaderL( - RPointerArray& aRequestHeaders ); - - }; - - -#endif // CMUSAVASIPHEADERUTIL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipobserver.h --- a/mmsharing/mmshavailability/inc/musavasipobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipprofileavailability.h --- a/mmsharing/mmshavailability/inc/musavasipprofileavailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipprofileregistryadapter.h --- a/mmsharing/mmshavailability/inc/musavasipprofileregistryadapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavasipprofileregistryobserver.h --- a/mmsharing/mmshavailability/inc/musavasipprofileregistryobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavatelephonystatusbase.h --- a/mmsharing/mmshavailability/inc/musavatelephonystatusbase.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavatelephonystatusobserver.h --- a/mmsharing/mmshavailability/inc/musavatelephonystatusobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/inc/musavaterminal.h --- a/mmsharing/mmshavailability/inc/musavaterminal.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacalleventmonitor.cpp --- a/mmsharing/mmshavailability/src/musavacalleventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,319 +0,0 @@ -/* -* 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; - } - -// -------------------------------------------------------------------------- -// Returns the direction of connected call. -// -------------------------------------------------------------------------- -// -TInt CMusAvaCallEventMonitor::CallPrivacyL() - { - MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ - CallPrivacyL" ) - // retrieve call count - TInt privacy( 0 ); - User::LeaveIfError( RProperty::Get( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - privacy ) ); - - MUS_LOG1( "mus: [CMusAvaCallEventMonitor] Call privacy = %d ", - privacy ) - MUS_LOG( "mus: [CMusAvaCallEventMonitor] <- CMusAvaCallEventMonitor::\ - CallPrivacyL" ) - return privacy; - } - -// -------------------------------------------------------------------------- -// aTelNumber will be filled with telephone number of current connected call -// -------------------------------------------------------------------------- -// -void CMusAvaCallEventMonitor::GetTelNumberL( TDes& aTelNumber ) - { - MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ - GetTelNumberL" ) - TBuf telNumber; - - MUS_LOG( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ - GetTelNumberL - a" ) - TInt error = RProperty::Get( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusTelNumber, - telNumber ); - - MUS_LOG1( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ - GetTelNumberL (%d)", error ) - - if ( error != KErrOverflow ) - { - User::LeaveIfError( error ); - } - - TInt length = telNumber.Length(); - TInt maxLength = aTelNumber.MaxLength(); - if ( maxLength < length ) - { - // buffer is too small for returned tel number. - MUS_LOG2( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ - GetTelNumberL - Buffer too small (%d, %d), leave", - maxLength, length ) - User::Leave( KErrOverflow ); - } - - aTelNumber.Copy( telNumber ); - 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: - { - // retrieve telnumber - TInt error; - TBuf telNumber; - error = RProperty::Get( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusTelNumber, - telNumber ); - - if ( error != KErrOverflow ) - { - User::LeaveIfError( error ); - } - - iObserver.CallConnectedL( telNumber ); - break; - } - - case NMusSessionInformationApi::ECallHold: - { - // retrieve telnumber - TInt error; - TBuf telNumber; - error = RProperty::Get( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusTelNumber, - telNumber ); - - if ( error != KErrOverflow ) - { - User::LeaveIfError( error ); - } - iObserver.CallHoldL( telNumber ); - 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; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapability.cpp --- a/mmsharing/mmshavailability/src/musavacapability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,533 +0,0 @@ -/* -* 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 "mussettingskeys.h" - -#include -#include -#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 ); - - 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::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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilitycontext.cpp --- a/mmsharing/mmshavailability/src/musavacapabilitycontext.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,458 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilityexchange.cpp --- a/mmsharing/mmshavailability/src/musavacapabilityexchange.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,358 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilityquery.cpp --- a/mmsharing/mmshavailability/src/musavacapabilityquery.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,455 +0,0 @@ -/* -* 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 ) ; - - } - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilityquerybase.cpp --- a/mmsharing/mmshavailability/src/musavacapabilityquerybase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,571 +0,0 @@ -/* -* 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 -#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" -#include "mussesseioninformationapi.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 ") - - TBool usePrivacy = MultimediaSharingSettings::PrivacySetting(); - if ( usePrivacy ) - { - NMusSessionInformationApi::TMusClirSetting clir = - NMusSessionInformationApi::ESendOwnNumber; - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, - reinterpret_cast( clir ) ); - usePrivacy = ( clir == NMusSessionInformationApi::EDoNotSendOwnNumber ); - } - - if (usePrivacy) - { - CMusAvaSipheaderUtil::AddPrivacyHeaderL( headers ); - MUS_LOG( "mus: [MUSAVA] AddPrivacyHeaderL -> 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 ); - - if (usePrivacy) - { - _LIT8( KAnonymous, - "\"Anonymous\" " ); - CSIPFromHeader* from = CSIPFromHeader::DecodeL( KAnonymous ); - CleanupStack::PushL( from ); - request->SetFromHeaderL( from ); - CleanupStack::Pop( from ); - } - - 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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilitysipagent.cpp --- a/mmsharing/mmshavailability/src/musavacapabilitysipagent.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,260 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacapabilitytimer.cpp --- a/mmsharing/mmshavailability/src/musavacapabilitytimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaclientresolverutil.cpp --- a/mmsharing/mmshavailability/src/musavaclientresolverutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,410 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaconnectionavailability.cpp --- a/mmsharing/mmshavailability/src/musavaconnectionavailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,590 +0,0 @@ -/* -* 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 -#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(); - if ( networkmode == RMobilePhone::ENetworkModeWcdma|| - networkmode == RMobilePhone::ENetworkModeTdcdma || - networkmode == RMobilePhone::ENetworkModeCdma95 || - networkmode == RMobilePhone::ENetworkModeCdma2000 ) - { - status = NetworkRegistrationAndSettingsL(); - if ( status == MMusAvaObserver::EMusAvaStatusAvailable ) - { - MUS_LOG( "mus: [MUSAVA] Network available" ) - SetState( status ); - } - else - { - MUS_LOG1( "mus: [MUSAVA] Activation error: %d", status ) - SetState( status ); - } - } - else if( networkmode == RMobilePhone::ENetworkModeGsm) - { - TInt edgeDtmSupport = KErrNone; - TRAPD( err, edgeDtmSupport = - MultimediaSharingSettings::EdgeDtmSupportSettingL() ); - if( err != KErrNone ) - { - MUS_LOG1( "mus: [MUSAVA] Reading activation setting error:%d", err ) - SetState( MMusAvaObserver::EMusActivationError ); - } - else if( edgeDtmSupport == MusSettingsKeys::EDtmModeAllowed ) - { - 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 - { - MUS_LOG( "mus: [MUSAVA] Edge Network Mode Not allowed in settings " ) - SetState( MMusAvaObserver::EMusAvaNetworkType ); - } - } - else - { - MUS_LOG( "mus: [MUSAVA] Network not available" ) - SetState( MMusAvaObserver::EMusAvaNetworkType ); - } - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::DoExecuteL()" ) - } - - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -TBool CMusAvaConnectionAvailability::OperatorVariant() - { - MusSettingsKeys::TOperatorVariant variantValue = MusSettingsKeys::EStandard; - TRAPD( error, variantValue = - MultimediaSharingSettings::OperatorVariantSettingL() ); - - return ( variantValue == MusSettingsKeys::EOperatorSpecific && - error == KErrNone ); - - } - -// --------------------------------------------------------------------------- -// 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 ) - - switch ( aStatus ) - { - case RMobilePhone::ENetworkModeWcdma : - case RMobilePhone::ENetworkModeTdcdma : - case RMobilePhone::ENetworkModeCdma95: - case RMobilePhone::ENetworkModeCdma2000: - { - MMusAvaObserver::TAvailabilityStatus status = - MMusAvaObserver::EMusActivationError; - TRAP_IGNORE( status = NetworkRegistrationAndSettingsL() ); - SetState( status ); - break; - } - case RMobilePhone::ENetworkModeGsm : // For EDGE /DTM support - { - TInt edgeDtmSupport = 0; - TRAPD( err, edgeDtmSupport = - MultimediaSharingSettings::EdgeDtmSupportSettingL() ); - if( err != KErrNone ) - { - MUS_LOG1( "mus: [MUSAVA] Reading activation setting error:%d", err ) - SetState( MMusAvaObserver::EMusActivationError ); - } - else if( edgeDtmSupport == MusSettingsKeys::EDtmModeAllowed ) - { - MUS_LOG( "mus: [MUSAVA] Edge Network supported " ) - SetState( MMusAvaObserver::EMusAvaEdgeDtmStatusUnknown ); - } - else - { - SetState( MMusAvaObserver::EMusAvaNetworkType ); - } - break; - } - default : - { - SetState( MMusAvaObserver::EMusAvaNetworkType ); - } - } - 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 ) - - if( OperatorVariant() && - aRegStatus != RMobilePhone::ERegisteredOnHomeNetwork ) - { - MUS_LOG( "mus: [MUSAVA] Roaming not allowed" ) - 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: - { - SetState( MMusAvaObserver::EMusAvaNetworkType ); - MUS_LOG( "mus: [MUSAVA] EConnMonPacketDataUnavailable" ) - 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()" ) - - if( OperatorVariant() ) - { - 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(); - TBool operatorVariant = OperatorVariant(); - - MUS_LOG1( "mus: [MUSAVA] ActivationSetting returned %d", - activation ) - - //VS off - if ( activation != MusSettingsKeys::EAlwaysActive ) - { - status = MMusAvaObserver::EMusActivationError; - } - //VS on - else - { - //roaming - if( regStatus == RMobilePhone::ERegisteredRoaming ) - { - status = ManualActivationL(); - } - //other states including also not registered states, thus - //failing of PDP context activation will be detected elsewhere - else - { - status = MMusAvaObserver::EMusAvaStatusAvailable; - } - } - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ -NetworkRegistrationAndSettingsL()" ) - return status; - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaconnectionmonitor.cpp --- a/mmsharing/mmshavailability/src/musavaconnectionmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,345 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavacontactavailability.cpp --- a/mmsharing/mmshavailability/src/musavacontactavailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,879 +0,0 @@ -/* -* 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 "musavacalleventmonitor.h" - -#include -#include -#include -#include -#include -#ifdef UNIT_TESTING // if unit testing -#include -#endif // UNIT_TESTING - -const TInt KNumberMatchingDigitsRequired = 7; -const TInt KContactsArraySize = 10; - - -_LIT( KMusAvaSip, "sip:" ); -_LIT( KMusAvaTel, "tel:" ); -_LIT( KMusAvaPlus, "+" ); -_LIT( KMusAvaAtSign , "@" ); -_LIT( KMusEmptyStringSymbol, "" ); -_LIT( KMusSpaceSymbol, " " ); -_LIT( KMusAvaTestString, "*#" ); - - -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; - if ( iPhoneStatus ) - { - iPhoneStatus->Cancel(); - } - delete iPhoneStatus; - iPhoneStatus = 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(); - iPhoneStatus = CMusAvaCallEventMonitor::NewL( *this ); - MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::ConstructL()" ) - } - - -// ------------------------------------------------------------------------- -// Starts the loopy execution. -// ------------------------------------------------------------------------- -// -void CMusAvaContactAvailability::DoExecuteL() - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::DoExecuteL()" ) - iPhoneStatus->StartMonitoringL(); - - CContactIdArray* idArray = NULL; - - #ifdef UNIT_TESTING // if unit testing - EUNIT_DISABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( pbkContactEngine ); - - // resolve the name order - CContactViewBase& contactView = pbkContactEngine->AllContactsView(); - const RContactViewSortOrder& sortOrder = contactView.SortOrderL(); - #ifdef UNIT_TESTING // if unit testing - EUNIT_ENABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - - iBeginWithFirstName = ETrue; - TBool foundOrder = EFalse; - for( TInt i = 0; i < sortOrder.Count() && !foundOrder; ++i ) - { - if ( sortOrder[i] == KUidContactFieldFamilyName ) - { - iBeginWithFirstName = EFalse; - foundOrder = ETrue; - } - else if ( sortOrder[i] == KUidContactFieldGivenName ) - { - iBeginWithFirstName = ETrue; - foundOrder = ETrue; - } - } - - CDesCArrayFlat* contactsArray - = new ( ELeave ) CDesCArrayFlat( KContactsArraySize ); - CleanupStack::PushL( contactsArray ); - - if ( ContactL( idArray, *pbkContactEngine ) ) - { - CleanupStack::PushL( idArray ); - - TInt idArrayCount = idArray->Count(); - MUS_LOG1( "mus: [MUSAVA] idArray->Count %d", idArrayCount ) - CPbkContactItem* pbkItem = NULL; - TPbkFieldId fieldId = ContactIdSearch( *idArray, *pbkContactEngine ); - - for ( TInt i = 0; i < idArrayCount; i++ ) - { - MUS_LOG1( "mus: [MUSAVA] i %d", i ) - TContactItemId itemId( KErrNotFound ); - itemId = ( *idArray )[i]; - - TRAPD( error, pbkItem = pbkContactEngine->ReadContactL( itemId ) ); - - if ( !error ) - { - TBool found = EFalse; - if ( fieldId == EPbkFieldIdShareView ) - { - found = ResolveAddressesL( - *pbkItem, contactsArray, EPbkFieldIdShareView ); - } - else if( fieldId == EPbkFieldIdSIPID) - { - found = ResolveAddressesL( - *pbkItem, contactsArray, EPbkFieldIdSIPID ); - } - - if ( !found ) - { - PhoneResolutionL( *pbkItem, contactsArray ); - } - - // tbd: causes test case to fail - // break; - } - - delete pbkItem; - pbkItem = NULL; - } - - idArray->Reset(); - CleanupStack::PopAndDestroy( idArray ); - } - else - { - ActiveCallL( contactsArray ); - } - - iSettings.SetSipAddressesL( *contactsArray ); - - contactsArray->Reset(); - - CleanupStack::PopAndDestroy( contactsArray ); - - CleanupStack::PopAndDestroy( pbkContactEngine ); - - SetState( MMusAvaObserver::EMusAvaStatusAvailable ); - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::DoExecuteL()" ) - } - -// ------------------------------------------------------------------------- -// This function is called when a cs call is connected. -// ------------------------------------------------------------------------- -// -void CMusAvaContactAvailability::CallConnectedL( const TDesC& aTelNumber ) - { - MUS_LOG( "mus: [MUSAVA] \ - -> CMusAvaContactAvailability::CallConnectedL()" ) - - iSettings.SetTelNumberL(aTelNumber); - DoExecuteL(); - - MUS_LOG( "mus: [MUSAVA] \ - <- CMusAvaContactAvailability::CallConnectedL()" ) - } -void CMusAvaContactAvailability::ConferenceCallL() - { - } - - -// ------------------------------------------------------------------------- -// This function is called when a cs call goes hold -// ------------------------------------------------------------------------- -// -void CMusAvaContactAvailability::CallHoldL( const TDesC& /*aTelNumber*/ ) - { - } - - -// ------------------------------------------------------------------------- -// This function is called when a cs call goes into a state -// that is not connected. -// ------------------------------------------------------------------------- -// -void CMusAvaContactAvailability::NoActiveCallL() - { - } - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::ActiveCallL( CDesCArrayFlat*& aContactsArray ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ActiveCallL()" ) - - const TDesC& phoneNumber = iSettings.TelNumber(); - TInt retval = EFalse; - - 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 - { - MUS_LOG( "mus: [MUSAVA] Phone number not found " ) - retval = EFalse; - } - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ActiveCallL return %d", retval ) - - return retval; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::ContactL( - CContactIdArray*& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ContactL()" ) - CPbkContactItem* pbkContactItem = NULL; - - TInt conRes = EFalse; - - TInt err = ContactArrayL( aContactIdArray, aPbkContactEngine ); - if ( !err ) - { - err = ContactItem( *aContactIdArray, pbkContactItem, aPbkContactEngine ); - // NOTE: KErrNotSupported means there is more than one contact id. - if ( err == KErrNotSupported ) - { - iSettings.SetContactId( KErrNotSupported ); - conRes = ETrue; - } - else if( err != KErrNone ) - { - MUS_LOG( "mus: [MUSAVA] No contact item found; contact id = \ - KErrNotFound" ) - conRes = EFalse; - } - else - { - TContactItemId itemId = pbkContactItem->Id(); - MUS_LOG1( "mus: [MUSAVA] Setting contact id to be %d", - itemId ) - CleanupStack::PushL( pbkContactItem ); - iSettings.SetContactId( itemId ); - UpdateContactNameL( pbkContactItem->ContactItem() ); - CleanupStack::Pop( pbkContactItem ); - conRes = ETrue; - } - } - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ContactL return %d", conRes ) - - delete pbkContactItem; - pbkContactItem = NULL; - - return conRes; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -void CMusAvaContactAvailability::UpdateContactNameL( - CContactItem& aContactItem ) - { - MUS_LOG( "mus: [MUSAVA ] -> CMusAvaContactAvailability::\ - UpdateContactName" ) - //TBuf givenName; - //TBuf familyName; - - HBufC* givenName = NULL; - HBufC* familyName = NULL; - - delete iContactName; - iContactName = NULL; - iContactName = HBufC::NewL( 0 ); - - CContactItemFieldSet& fieldSet = aContactItem.CardFields(); - - TInt pos = fieldSet.Find( KUidContactFieldGivenName ); - if ( pos != KErrNotFound ) - { - CContactItemField& itemField = fieldSet[pos]; - //givenName = HBufC::NewL( itemField.TextStorage()->Text().Length() ); - - //givenName.Copy( itemField.TextStorage()->Text().Alloc() ); - givenName = itemField.TextStorage()->Text().AllocLC(); - - } - else - { - //givenName = KMusEmptyStringSymbol; - givenName = KMusEmptyStringSymbol().AllocLC(); - } - - pos = fieldSet.Find( KUidContactFieldFamilyName ); - if ( pos != KErrNotFound ) - { - CContactItemField& itemField = fieldSet[pos]; - //familyName = HBufC::NewL( itemField.TextStorage()->Text().Length() ); - //familyName.Copy( field.TextStorage()->Text() ); - familyName = itemField.TextStorage()->Text().AllocLC(); - } - else - { - familyName = KMusEmptyStringSymbol().AllocLC(); - } - - TInt strLength = NULL; - TBool bothNames = givenName->Length() > 0 && familyName->Length() > 0; - - if ( bothNames ) - { - strLength = givenName->Length() + - KMusSpaceSymbol().Length() + - familyName->Length(); - } - else - { - strLength = givenName->Length() + familyName->Length(); - } - - if ( strLength > iContactName->Length() ) - { - iContactName = iContactName->ReAllocL( strLength ); - } - - if ( strLength > 1 ) - { - TPtr ptr = iContactName->Des(); - if ( iBeginWithFirstName ) - { - if ( bothNames ) - { - ptr.Append( givenName->Des() ); - ptr.Append( KMusSpaceSymbol ); - ptr.Append( familyName->Des() ); - } - else - { - ptr.Append( givenName->Des() ); - ptr.Append( familyName->Des() ); - } - } - else - { - if ( bothNames ) - { - ptr.Append( familyName->Des() ); - ptr.Append( KMusSpaceSymbol ); - ptr.Append( givenName->Des() ); - } - else - { - ptr.Append( familyName->Des() ); - ptr.Append( givenName->Des() ); - } - } - } - - CleanupStack::PopAndDestroy( familyName ); - CleanupStack::PopAndDestroy( givenName ); - - TRAP_IGNORE( iSettings.SetContactNameL( iContactName->Des() ) ) - - MUS_LOG( "mus: [MUSAVA ] <- CMusAvaContactAvailability::\ - UpdateContactName" ) - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TInt CMusAvaContactAvailability::ContactArrayL( - CContactIdArray*& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ContactArrayL()" ) - - const TDesC& phoneNumber = iSettings.TelNumber(); - TInt retval = KErrNotFound; - - if ( phoneNumber.Length() > 0 ) - { - MUS_LOG( "mus: [MUSAVA] Phone number found " ) - // Instantiate a PhonebookContactEngine object, which represents a - // connection to the Phonebook contact database: - #ifdef UNIT_TESTING // if unit testing - EUNIT_DISABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - CContactIdArray* tmpContactIdArray = - aPbkContactEngine.MatchPhoneNumberL( - phoneNumber, - KNumberMatchingDigitsRequired ); - #ifdef UNIT_TESTING // if unit testing - EUNIT_ENABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - if ( tmpContactIdArray->Count() > 0 ) - { - aContactIdArray = tmpContactIdArray; - retval = KErrNone; - } - else - { - tmpContactIdArray->Reset(); - delete tmpContactIdArray; - MUS_LOG( - "mus: [MUSAVA] Phone number not found in CPbkContactEngine" ) - } - } - else - { - MUS_LOG( "mus: [MUSAVA] Phone number not found " ) - } - - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ContactArrayL return %d", retval ) - - return retval; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TInt CMusAvaContactAvailability::ContactItem( - CContactIdArray& aContactIdArray, - CPbkContactItem*& aPbkContactItem, - CPbkContactEngine& aPbkContactEngine ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ContactItem()" ) - CPbkContactItem* pbkItem = NULL; - TInt retval = KErrNotFound; - TInt contactIdsCount = aContactIdArray.Count(); - - if( contactIdsCount > 1 ) - { - // NOTE: KErrNotSupported means there is more than one contact id. - MUS_LOG( "mus: [MUSAVA] More than one Contact ID found." ) - retval = KErrNotSupported; - } - else if ( contactIdsCount == 1 ) - { - // Contact card whose phone number matches that of the other party - // was found. The ID(s) of the contacts are recorded in iIdArray. - MUS_LOG( "mus: [MUSAVA] Contact ID found." ) - - TContactItemId itemId( KErrNotFound ); - - MUS_LOG1( "mus: [MUSAVA] ID array has <%d> elements", - contactIdsCount ) - // iterate through the contact cards we consider as belonging to - // the other party, that is, those saved in iIdArray: - for ( TInt i = 0; i < contactIdsCount; i++ ) - { - itemId = ( aContactIdArray )[i]; - MUS_LOG2( "mus: [MUSAVA] Current array index == <%d>, \ - contact ID == <%d>", i, itemId ) - TRAPD( pbkFailure, pbkItem = - aPbkContactEngine.ReadContactL( itemId ) ); - - if ( pbkFailure ) - { - // Contact lookup failed. - MUS_LOG1( "mus: [MUSAVA] Leave code <%d> occurred at call \ - of ReadContactL.", pbkFailure ) - } - else - { - aPbkContactItem = pbkItem; - retval = KErrNone; - } - } - } - else - { - MUS_LOG( "mus: [MUSAVA] No contact card whose phone number\ - matches that of the other party" ) - } - - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ContactItem() return %d", retval ) - - return retval; - } - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::PhoneResolutionL( CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::PhoneResolutionL()" ) - TInt retval = ETrue; - if ( ResolvePhoneContactL( aPbkItem, aContactsArray ) ) - { - MUS_LOG( "mus: [MUSAVA] Stop Execution" ) - } - else - { - if ( ActiveCallL( aContactsArray ) ) - { - MUS_LOG( "mus: [MUSAVA] Stop Execution" ) - } - else - { - MUS_LOG( "mus: [MUSAVA] Stop Execution" ) - retval = EFalse; - } - } - - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - PhoneResolutionL() return %d", retval ) - return retval; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::ContactId( CPbkContactItem& aPbkItem, - TPbkFieldId aTPbkFieldId ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ContactId()" ) - - CPbkFieldArray& fieldArray = aPbkItem.CardFields(); - TPbkContactItemField itemField; - TBool returnValue = EFalse; - - // Get the number of detail fields of the phonebook contact item. - const TInt fieldCount( fieldArray.Count() ); - - for ( TInt index = 0; index < fieldCount && returnValue == EFalse; - index++ ) - { - itemField = fieldArray.At( index ); - - if ( itemField.FieldInfo().Match( aTPbkFieldId ) && - itemField.Text().Find( KMusAvaAtSign() ) != KErrNotFound ) - { - returnValue = ETrue; - MUS_LOG( "mus: [MUSAVA] Contact id found" ) - } - } - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ContactId() return %d", returnValue ) - return returnValue; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TPbkFieldId CMusAvaContactAvailability::ContactIdSearch( - CContactIdArray& aContactIdArray, - CPbkContactEngine& aPbkContactEngine ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::\ - ContactIdSearch()" ) - - TInt contactIdsCount = aContactIdArray.Count(); - MUS_LOG1( "mus: [MUSAVA] aContactIdArray.Count %d", \ - contactIdsCount ) - - CPbkContactItem* pbkItem = NULL; - TPbkFieldId retFieldId = EPbkFieldIdNone; - - for ( TInt i = 0; - i < contactIdsCount && retFieldId == EPbkFieldIdNone; - i++ ) - { - MUS_LOG1( "mus: [MUSAVA] i %d", i ) - TContactItemId itemId( KErrNotFound ); - itemId = ( aContactIdArray )[i]; - - #ifdef UNIT_TESTING // if unit testing - EUNIT_DISABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - TRAPD( error, pbkItem = aPbkContactEngine.ReadContactL( itemId ) ) - #ifdef UNIT_TESTING // if unit testing - EUNIT_ENABLE_ALLOC_DECORATOR; - #endif // UNIT_TESTING - if ( error != KErrNone ) - { - return retFieldId; - } - if ( ContactId( *pbkItem, EPbkFieldIdShareView ) ) - { - MUS_LOG( "mus: [MUSAVA] Contact have a prefix = \ - EPbkFieldIdShareView" ) - delete pbkItem; - retFieldId = EPbkFieldIdShareView; - } - else if ( ContactId( *pbkItem, EPbkFieldIdSIPID ) ) - { - MUS_LOG( "mus: [MUSAVA] Contact have a prefix = \ - EPbkFieldIdSIPID" ) - delete pbkItem; - retFieldId = EPbkFieldIdSIPID; - } - else if ( ContactId( *pbkItem, EPbkFieldIdPhoneNumberGeneral ) ) - { - // this part never run!!!! - MUS_LOG( "mus: [MUSAVA] Contact have a prefix = \ - EPbkFieldIdPhoneNumberGeneral" ) - delete pbkItem; - retFieldId = EPbkFieldIdPhoneNumberGeneral; - } - else - { - MUS_LOG( "mus: [MUSAVA] Contact have no prefix " ) - delete pbkItem; - } - } - return retFieldId; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::ResolveAddressesL( CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray, - TPbkFieldId aTPbkFieldId ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::\ - ResolveAddressesL()" ) - - CPbkFieldArray& fieldArray = aPbkItem.CardFields(); - TPbkContactItemField itemField; - HBufC* tmpDescriptor( NULL ); - TBool returnValue( EFalse ); - - // Get the number of detail fields of the phonebook contact item. - const TInt fieldCount( fieldArray.Count() ); - - for ( TInt index = 0; index < fieldCount; index++ ) - { - itemField = fieldArray.At( index ); - - if ( itemField.FieldInfo().Match( aTPbkFieldId ) && - itemField.Text().Find( KMusAvaAtSign() ) != KErrNotFound && - ( iOperatorVariant != MusSettingsKeys::EOperatorSpecific || - itemField.Text().Find( KMusAvaTestString() ) != KErrNotFound ) ) - { - returnValue = ETrue; - MUS_LOG( "mus: [MUSAVA] Contact id found" ) - - HBufC* sipAddress; - if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific ) - { - sipAddress = HBufC::NewLC( itemField.Text().Length() - - KMusAvaTestString().Length() ); - TInt pos = itemField.Text().Find( KMusAvaTestString() ); - sipAddress->Des().Append( itemField.Text().Left( pos ) ); - sipAddress->Des().Append( itemField.Text().Right( - itemField.Text().Length() - - pos - KMusAvaTestString().Length() ) ); - } - else - { - sipAddress = itemField.Text().AllocLC(); - } - - if ( sipAddress->Find( KMusAvaSip() ) == KErrNotFound ) - { - // No, it doesn't, so add the prefix to the new address. - MUS_LOG( "mus: [MUSAVA] Prefix to the new address is added" ) - tmpDescriptor = HBufC::NewLC( KMusAvaSip().Length() + - sipAddress->Length() ); - tmpDescriptor->Des().Append( KMusAvaSip() ); - tmpDescriptor->Des().Append( *sipAddress ); - // if multiple contact have same phone number then - // sip address can be repeated . To avoid this check - // whether sip address exist already in array - // it not exist then add it to array. - if(! IsExistAlready(*aContactsArray,*tmpDescriptor)) - { - aContactsArray->AppendL( *tmpDescriptor ); - } - CleanupStack::PopAndDestroy( tmpDescriptor ); - } - else - { - MUS_LOG( "mus: [MUSAVA] Contact have a prefix" ) - // if multiple contact have same phone number then - // sip address can be repeated . To avoid this check - // whether sip address exist already in array - // it not exist then add it to array. - if(! IsExistAlready(*aContactsArray,*sipAddress)) - { - aContactsArray->AppendL( *sipAddress ); - } - } - - CleanupStack::PopAndDestroy( sipAddress ); - } - } - MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ResolveAddressesL() return %d", returnValue ) - return returnValue; - } - - -// ------------------------------------------------------------------------- -// -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::ResolvePhoneContactL( - CPbkContactItem& aPbkItem, - CDesCArrayFlat*& aContactsArray ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::\ - ResolvePhoneContactL()" ) - CPbkFieldArray& fieldArray = aPbkItem.CardFields(); - TPbkContactItemField itemField; - HBufC* tmpDescriptor( NULL ); - TBool returnValue = EFalse; - - // Get the number of detail fields of the phonebook contact item. - const TInt fieldCount( fieldArray.Count() ); - - for ( TInt index = 0; index < fieldCount; index++ ) - { - itemField = fieldArray.At( index ); - - if ( itemField.FieldInfo().IsPhoneNumberField() && - ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific || - itemField.Text().Left(1) == KMusAvaPlus() ) ) - { - MUS_LOG( "mus: [MUSAVA] Contact id found" ) - // No, it doesn't, so add the prefix to the new address. - MUS_LOG( "mus: [MUSAVA] Prefix to the new address is added" ) - tmpDescriptor = HBufC::NewLC( KMusAvaTel().Length() + - itemField.Text().Length() ); - tmpDescriptor->Des().Append( KMusAvaTel() ); - tmpDescriptor->Des().Append( itemField.Text() ); - aContactsArray->AppendL( *tmpDescriptor ); - CleanupStack::PopAndDestroy( tmpDescriptor ); - returnValue = ETrue; - } - } - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ - ResolvePhoneContactL()" ) - return returnValue; - } - - -MMusAvaObserver::TAvailabilityName CMusAvaContactAvailability::Name() - { - return MMusAvaObserver::EMusAvaNameContactStatus; - } - - -// ------------------------------------------------------------------------- -// Checks that whether aDesItem present in aDesArray. -// Utility function used to avoid dublication. -// ------------------------------------------------------------------------- -// -TBool CMusAvaContactAvailability::IsExistAlready(const MDesCArray& aDesArray, - const TDesC& aDesItem) - { - for ( TInt i=0;i - - -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; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavadefaultoptionhandler.cpp --- a/mmsharing/mmshavailability/src/musavadefaultoptionhandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,645 +0,0 @@ -/* -* 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 ); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavainvitehandler.cpp --- a/mmsharing/mmshavailability/src/musavainvitehandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavainviteresponder.cpp --- a/mmsharing/mmshavailability/src/musavainviteresponder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavamain.cpp --- a/mmsharing/mmshavailability/src/musavamain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavanetworkavailability.cpp --- a/mmsharing/mmshavailability/src/musavanetworkavailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -/* -* 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 - - -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; - iPhoneStatus->GetTelNumberL( telNumber ); - iSettings.SetTelNumberL( telNumber ); - iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); - iSettings.SetCallPrivacy( iPhoneStatus->CallPrivacyL() ); - - 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 ) - { - MUS_LOG( "mus: [MUSAVA] \ - -> CMusAvaNetworkAvailability::CallConnectedL()" ) - // try to resolve to contact information of the remote host - - iSettings.SetTelNumberL( aTelNumber ); - iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); - iSettings.SetCallPrivacy( iPhoneStatus->CallPrivacyL() ); - 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 ) - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkAvailability::CallHoldL()" ) - //Report line status - iSettings.SetTelNumberL( aTelNumber ); - iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); - iSettings.SetCallPrivacy( iPhoneStatus->CallPrivacyL() ); - 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() ); - - //Report line status - //Availability status - SetState( MMusAvaObserver::EMusAvaStatusNoCall ); - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkAvailability::NoActiveCallL()" ) - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavanetworkmodestatus.cpp --- a/mmsharing/mmshavailability/src/musavanetworkmodestatus.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavanetworkregistrationstatus.cpp --- a/mmsharing/mmshavailability/src/musavanetworkregistrationstatus.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaoptionhandler.cpp --- a/mmsharing/mmshavailability/src/musavaoptionhandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,539 +0,0 @@ -/* -* 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" - - -_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] <- CMusAvaOptionHandler::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusAvaOptionHandler::CapabilityQueryAnswered( TBool aAnswered ) - { - iCapabilityQueryAnswered = aAnswered ? aAnswered : iCapabilityQueryAnswered; - - 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 - SetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); - } - else if ( MusSettingsKeys::ESequential == - MultimediaSharingSettings::CapabilityQuerySettingL() - && iSettings.CallDirection() == 2 && !iCapabilitiesRequestAnswered ) - { // terminated party - SetState( 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() ) - { - SetState( MMusAvaObserver::EMusAvaStatusOptionsSent ); - } - else - { - SetState( 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 ) - { - SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); - } - // anything other than this should be considered default , means options sent - // and was not successful. - else - { - SetState( MMusAvaObserver::EMusAvaOptionNotAvailable ); - } - } - else - { - SetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); - } - } - else - { - // option sending not needed - SetState( 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::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 - SetState( MMusAvaObserver::EMusAvaStatusAvailable ); - } - else if ( aSentQuery.Result() == KCapabilityCapabilitiesForbidden ) - { - // query returned with response "403 Forbidden". VS is NOT available - SetState( MMusAvaObserver::EMusAvaFailureCode ); - } - else - { - //query failed. VS is NOT available - SetState( 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()" ) - } - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaproxy.cpp --- a/mmsharing/mmshavailability/src/musavaproxy.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaregisteravailability.cpp --- a/mmsharing/mmshavailability/src/musavaregisteravailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,599 +0,0 @@ -/* -* 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: 42.1.4.1.3 % << Don't touch! Updated by Synergy at check-out. -* -* 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 ); - iOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); - } - - -// ----------------------------------------------------------------------------- -// 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 ); - iSharedObj->MusAvaSip().DeleteSIPConnection(); - } - 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 ) - { - if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific && - aError == KErrGeneral ) - { - MUS_LOG( "SIP profile is disabled by the user" ) - SetState( MMusAvaObserver::EMusActivationError ); - } - else - { - MUS_LOG1("Error %d",aError ) - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasettingavailability.cpp --- a/mmsharing/mmshavailability/src/musavasettingavailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasettingsimp.cpp --- a/mmsharing/mmshavailability/src/musavasettingsimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,458 +0,0 @@ -/* -* 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 ; - } - - - MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::~CMusAvaSettingsImp()" ) - } - -// ----------------------------------------------------------------------------- -// C++ Constructor -// ----------------------------------------------------------------------------- -// -CMusAvaSettingsImp::CMusAvaSettingsImp() - { - - } - -// ----------------------------------------------------------------------------- -// 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" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusAvaSettingsImp::CallPrivacy() - { - return iCallPrivacy; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusAvaSettingsImp:: SetCallPrivacy( TInt aPrivacy ) - { - iCallPrivacy = aPrivacy; - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasharedobject.cpp --- a/mmsharing/mmshavailability/src/musavasharedobject.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasip.cpp --- a/mmsharing/mmshavailability/src/musavasip.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -/* -* 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.4 % << 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::DeleteSIPConnection() - { - MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::DeleteSIPConnection()" ) - delete iSipConnection; iSipConnection = NULL; - MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::DeleteSIPConnection()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasipconnectionobserver.cpp --- a/mmsharing/mmshavailability/src/musavasipconnectionobserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,402 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasipheaderutil.cpp --- a/mmsharing/mmshavailability/src/musavasipheaderutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ -/* -* 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 "mussesseioninformationapi.h" -#include -#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" ) - } - -// -------------------------------------------------------------------------- -// CMusAvaSipheaderUtil::AddPrivacyHeaderL -// -------------------------------------------------------------------------- -// -void CMusAvaSipheaderUtil::AddPrivacyHeaderL( - RPointerArray& aRequestHeaders ) - { - MUS_LOG( "mus: [MUSAVA] -> AddPrivacyHeaderL()" ) - NMusSessionInformationApi::TMusClirSetting clir = - NMusSessionInformationApi::ESendOwnNumber; - // Ignore RProperty::Get return value.Incase of error it should behave default. - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, - reinterpret_cast( clir ) ); - MUS_LOG1( "mus: [MUSAVA] - clir setting = %d", clir ) - if ( clir == NMusSessionInformationApi::EDoNotSendOwnNumber ) - { - _LIT8( KMusPrivacyHeader, "Privacy" ); - _LIT8( KMusPrivacyHeaderValue, "id" ); - CSIPExtensionHeader* header = CSIPExtensionHeader::NewLC( - KMusPrivacyHeader, KMusPrivacyHeaderValue ); - aRequestHeaders.AppendL( header ); - CleanupStack::Pop( header ); - } - MUS_LOG( "mus: [MUSAVA] <- AddPrivacyHeaderL()" ) - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasipobserver.cpp --- a/mmsharing/mmshavailability/src/musavasipobserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasipprofileavailability.cpp --- a/mmsharing/mmshavailability/src/musavasipprofileavailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavasipprofileregistryobserver.cpp --- a/mmsharing/mmshavailability/src/musavasipprofileregistryobserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavatelephonystatusbase.cpp --- a/mmsharing/mmshavailability/src/musavatelephonystatusbase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/src/musavaterminal.cpp --- a/mmsharing/mmshavailability/src/musavaterminal.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,611 +0,0 @@ -/* -* 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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/BWINS/ut_availabilityU.DEF --- a/mmsharing/mmshavailability/tsrc/ut_availability/BWINS/ut_availabilityU.DEF Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/EABI/ut_availabilityu.def --- a/mmsharing/mmshavailability/tsrc/ut_availability/EABI/ut_availabilityu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Group/bld.inf --- a/mmsharing/mmshavailability/tsrc/ut_availability/Group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 -ut_availability.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Group/ut_availability.mmp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Group/ut_availability.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* -* 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_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 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 musclirmonitor.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 - -SYSTEMINCLUDE ../../../../../tsrc/sipprofilestub/inc -SYSTEMINCLUDE ../../../../../tsrc/sipclientstub/inc -SYSTEMINCLUDE ../../../../../tsrc/musavaailabilitystub/inc -SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc -SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc - -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 PbkEng.lib -LIBRARY connmon.lib -LIBRARY etelmm.lib -LIBRARY etel.lib -LIBRARY estor.lib -DEBUGLIBRARY flogger.lib - -//EXPORTUNFROZEN -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/CSipSseTestTls.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/CSipSseTestTls.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/centralrepository.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/centralrepository.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,293 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/csipserverstub.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/csipserverstub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/etelmm.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/etelmm.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12666 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaInviteresponderobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaInviteresponderobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilityobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilityobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilitysettingobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilitysettingobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacapabilityqueryobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacapabilityqueryobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 "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 ); - - }; - - -#endif // __MUSAVACAPABQUERYOBSERVERIMP_H__ - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaconnectionMonitorobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaconnectionMonitorobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaprofileregistryadapterstub.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaprofileregistryadapterstub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasettingsobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasettingsobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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(); - -public: //data - - TBool iOptionAllowed; - - }; - -#endif //__UT_MUSAVASETTINGSOBSERVERIMP_H__ - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipadapterimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipadapterimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipstub.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipstub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatelephonystatusobserverimp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatelephonystatusobserverimp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatimer.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/rconnmon.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/rconnmon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1644 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipclienttransaction.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipclienttransaction.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipconnection.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipconnection.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,586 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipmessageelements.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipmessageelements.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofile.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofile.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofileregistry.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofileregistry.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CMusAvaAvailabilityObserverImp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CMusAvaAvailabilityObserverImp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPMessageElements.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPMessageElements.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,418 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPResponseElements.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPResponseElements.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSipSseTestTls.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSipSseTestTls.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ -/* -* 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 ) ); - - } - -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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csip.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csip.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipclienttransaction.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipclienttransaction.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipconnection.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipconnection.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipservertransaction.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipservertransaction.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csiptransactionbase.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csiptransactionbase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/RConnMon.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/RConnMon.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,877 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/centralrepositorystub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/centralrepositorystub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,456 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipcontactheaderstub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipcontactheaderstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipserverstub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipserverstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/mm_phone.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/mm_phone.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2012 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaInviteresponderobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaInviteresponderobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilityobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilityobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilitysettingobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilitysettingobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacapabilityqueryobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacapabilityqueryobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaconnectionMonitorobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaconnectionMonitorobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaprofileregistryadapterstub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaprofileregistryadapterstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasettingsobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasettingsobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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; - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasipadapterimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasipadapterimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,308 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatelephonystatusobserverimp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatelephonystatusobserverimp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatimer.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/muscallmonitorstub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/muscallmonitorstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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 ) - : CActive( EPriorityNormal ),iCall(aCall),iTsyObserver( aObserver ) - - { - } - -// ----------------------------------------------------------------------------- -// 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*/ ) - { - } - -CMusCallStatusMonitor* CMusCallStatusMonitor::NewL(const RMobileCall&, MMusTsyPropertyObserver& ) - { - return NULL; - } - -// End of File - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofile.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofile.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistry.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistry.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrybase.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrybase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,376 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrystub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrystub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofilestub.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofilestub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* 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; - -#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(); - - private: // Data - - EUNIT_DECLARE_TEST_TABLE; - - CMusAvaCapabilityExchange* iExchange; - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityExchange.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityExchange.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityQuery.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityQuery.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* 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(); - - void UT_CMusAvaCapabilityOtherSDPHeadersLL(); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilitySipAgent.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilitySipAgent.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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_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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionMonitor.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionMonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaContactAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaContactAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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_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(); - - void UT_CMusAvaController_CallConnectedLL(); - CContactTextField* EditableContactFieldL( CPbkContactEngine& aContactEngine, - CPbkContactItem& aContact, - TPbkFieldId aFieldId ); - - void AddFields(CPbkContactEngine& aContactEngine, - CPbkContactItem& contact, - const TDesC& aText, - TPbkFieldId aFieldId); - - void AddToMyContact( CPbkContactEngine& aContactEngine, - const TDesC& aText, - TPbkFieldId aFieldId, - const TDesC& aText2, - TPbkFieldId aFieldId2 ); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultImp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultImp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultOptionHandler.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultOptionHandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteHandler.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteHandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteResponder.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteResponder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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_StopL(); - - void UT_CMusAvaNetworkAvailability_NameL(); - - void UT_CMusAvaNetworkAvailability_CallConnectedLL(); - - void UT_CMusAvaNetworkAvailability_ConferenceCallLL(); - - void UT_CMusAvaNetworkAvailability_CallHoldLL(); - - void UT_CMusAvaNetworkAvailability_NoActiveCallLL(); - - private: // Data - - EUNIT_DECLARE_TEST_TABLE; - - CMusAvaNetworkAvailability* iNetworkAvailability; - CMusAvaAvailabilityObserverImp* iAvailabilityObserver; - CMusAvaSettingsImp* iSettings; - }; - -#endif // __UT_CMUSAVANETWORKAVAILABILITY_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkModeStatus.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkModeStatus.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkRegistrationStatus.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkRegistrationStatus.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaOptionHandler.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaOptionHandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* 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 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(); - - - EUNIT_DECLARE_TEST_TABLE; - CSipSseTestTls* iStorage; - - CMusAvaOptionHandler* iOptionHandler; - - CMusAvaAvailabilityObserverImp* iAvailabilityObserver; - - CMusAvaSettingsImp* iConcreteSettings; - - CMusAvaSharedObject* iSharedObject; - - CSIPProfile* iProfile; - - }; - -#endif // __UT_CMUSAVAOPTIONHANDLER_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaRegisterAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaRegisterAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* 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 -#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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingsImp.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingsImp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSharedObject.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSharedObject.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSip.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSip.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipConnectionObserver.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipConnectionObserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipObserver.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipObserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipProfileRegistryObserver.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipProfileRegistryObserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipheaderUtil.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipheaderUtil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipprofileAvailability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipprofileAvailability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaTerminal.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaTerminal.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* 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; - -#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; - - }; - -#endif // __UT_CSTCETERMINAL_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_availability.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_availability.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/capabilitytestdefs.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/capabilitytestdefs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/musavacapabilitytesthelper.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/musavacapabilitytesthelper.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,298 +0,0 @@ -/* -* 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( 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, - const TDesC8& aSdp = KNullDesC8); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/inc/ut_cmusavaclientresolverutil.h --- a/mmsharing/mmshavailability/tsrc/ut_availability/inc/ut_cmusavaclientresolverutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,399 +0,0 @@ -/* -* 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 - - -// 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(); - - } - -void UT_CMusAvaCapability::Teardown( ) - { - delete iOptionHandler; - delete iAvailabilityObserver; - delete iConcreteSettings; - CSipSseTestTls::Close(); - - 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 ); - - // Test : AVC enabled => H263 & H264 - TInt32 KMusDisableAVC = 0x0ffffff1; // some value other than disable magic value - MultimediaSharingSettings::SetPropertyValueL(MusSettingsKeys::KEncodingDevice, - KMusDisableAVC ); - 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 ); - - // Test : AVC disabled => H263 - KMusDisableAVC = 0x0fffffff; // disable magic value - MultimediaSharingSettings::SetPropertyValueL(MusSettingsKeys::KEncodingDevice, - KMusDisableAVC ); - sdpContent = CMusAvaCapability::ResponseContentLC( *options ); - 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() == 1 ); - 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(); - } - -void UT_CMusAvaCapability::Teardown1( ) - { - CSipSseTestTls::Close(); - 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 ); - } - - -// 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_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityExchange.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityExchange.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,928 +0,0 @@ -/* -* 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 "CSipSseTestTls.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(); - } - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityQuery.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityQuery.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1248 +0,0 @@ -/* -* 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 -#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" - -_LIT8( KRTPCapabilitySDPAttributeClockrate, "90000" ); -_LIT8( KRTPCapabilitySDPAttributePayloadTypeH264, "98" ); -_LIT8( KRTPCapabilitySDPAttributeCodec, "H264" ); - -_LIT8( KRTPCapabilitySDPAttributePayloadTypeH263, "96" ); -_LIT8( KRTPCapabilitySDPAttributeCodecH263, "H263-2000" ); - -// 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(); - 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 ); - - - } - -void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityOtherSDPHeadersLL() - { - CSdpDocument* content = CSdpDocument::NewLC(); - //AVC Disabled - MultimediaSharingSettings::SetPropertyValueL(MusSettingsKeys::KEncodingDevice, - KMusDisableAVC ); - iQuery->OtherSDPHeadersL(*content); - - RStringF media = MusAvaCapabilityContext::SDPStringL( - SdpCodecStringConstants::EMediaVideo ); - RStringF rtpmap = MusAvaCapabilityContext::SDPStringL( - SdpCodecStringConstants::EAttributeRtpmap ); - - RPointerArray& mediaFields = content->MediaFields(); - - for ( TInt i=0; i < mediaFields.Count(); i++ ) - { - if ( mediaFields[ i ]->Media() == media ) - { - EUNIT_ASSERT( mediaFields[ i ]->FormatList().Find( KCapabilitySwisFormatListH263Only ) >= KErrNone ); - RPointerArray& fmtLines = - mediaFields[ i ]->FormatAttributeFields(); - EUNIT_ASSERT( fmtLines.Count() == 1 ); - for ( TInt j=0; j < fmtLines.Count(); j++ ) - { - if ( fmtLines[ j ]->Attribute() == rtpmap ) - { - EUNIT_ASSERT(fmtLines[ j ]->Value().Find( KRTPCapabilitySDPAttributeCodecH263 ) == 0 ); - EUNIT_ASSERT(fmtLines[ j ]->Format().Find( KRTPCapabilitySDPAttributePayloadTypeH263 ) == 0 ); - } - } - } - } - CleanupStack::PopAndDestroy(content ); - //AVC Enabled - content = CSdpDocument::NewLC(); - MultimediaSharingSettings::SetPropertyValueL(MusSettingsKeys::KEncodingDevice, - KMusDisableAVC - 1 ); - iQuery->OtherSDPHeadersL(*content); - - mediaFields = content->MediaFields(); - - for ( TInt i=0; i < mediaFields.Count(); i++ ) - { - if ( mediaFields[ i ]->Media() == media ) - { - EUNIT_ASSERT( mediaFields[ i ]->FormatList().Find( KCapabilitySwisFormatList ) >= KErrNone ); - RPointerArray& fmtLines = - mediaFields[ i ]->FormatAttributeFields(); - EUNIT_ASSERT( fmtLines.Count() == 2 ) - for ( TInt j=0; j < fmtLines.Count(); j++ ) - { - if ( fmtLines[ j ]->Attribute() == rtpmap ) - { - if ( j == 0 ) //AVC first i.e. prefered - { - EUNIT_ASSERT(fmtLines[ j ]->Value().Find( KRTPCapabilitySDPAttributeCodec ) == 0 ); - EUNIT_ASSERT(fmtLines[ j ]->Format().Find( KRTPCapabilitySDPAttributePayloadTypeH264 ) == 0 ); - } - else - { - EUNIT_ASSERT(fmtLines[ j ]->Value().Find( KRTPCapabilitySDPAttributeCodecH263 ) == 0 ); - EUNIT_ASSERT(fmtLines[ j ]->Format().Find( KRTPCapabilitySDPAttributePayloadTypeH263 ) == 0 ); - } - } - } - } - } - CleanupStack::PopAndDestroy(content ); - } -// 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_TEST( - "OtherSDPHeadersL - test ", - "CMusAvaCapabilityQuery", - "OtherSDPHeadersL", - "FUNCTIONALITY", - SetupL,UT_CMusAvaCapabilityOtherSDPHeadersLL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilitySipAgent.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilitySipAgent.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,627 +0,0 @@ -/* -* 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(); - } - if ( !iProfile->iRegisteredContact ) - { - iProfile->iRegisteredContact = KRegisteredContact().AllocL(); - } - - CSipSseTestTls::OpenL(); - iStorage = CSipSseTestTls::Storage(); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,773 +0,0 @@ -/* -* 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() - { - 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::EMusActivationError ) - { - User::Leave( KErrNoMemory ); - } - EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType ); - iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); - - 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 ); - - // No roaming for operator variant - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); - - 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::EMusActivationError ); - - // operator variant OK - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); - - 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 ); - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); - - // 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 ); - - //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 ); - - // 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 ); - - // 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 ); - } - -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() - { - iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); - EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaNetworkType ); - iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); - MMusAvaObserver::TAvailabilityStatus state = MMusAvaObserver::EMusAvaStatusNotExecuted; - state = iConnectionAvailability->State(); - TInt count = 0; - EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); - if ( count > 0 && state == MMusAvaObserver::EMusActivationError ) - { - User::Leave( KErrNoMemory ); - } - EUNIT_ASSERT( state == MMusAvaObserver::EMusAvaStatusAvailable ); - } - -void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_NetworkRegistrationStatusL() - { - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - iConnectionAvailability->iState = MMusAvaObserver::EMusAvaStatusAvailable; - iConnectionAvailability->NetworkRegistrationStatus( RMobilePhone::ERegistrationUnknown ); - 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::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - 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::ERegisteredOnHomeNetwork ); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::ENever ); - EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() - == MMusAvaObserver::EMusActivationError ); - - 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::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::EMusActivationError ); - - iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); - 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 ); - 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::EMusActivationError ); - - iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); - iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotExecuted); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - 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::EMusActivationError ); - - MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); - iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); - iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); - iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotExecuted); - MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); - 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 ); - } - - -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( - "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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionMonitor.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionMonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,295 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaContactAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaContactAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1647 +0,0 @@ -/* -* 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 -#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"); -_LIT( KTelNumber, "12345" ); - -// 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() - { - CContactIdArray* contactIdArray = NULL; - CPbkContactItem* contactItem = NULL; - CPbkContactItem* contactItemTmp = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - //contact - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - TRAPD( error, iContactAvailability->DoExecuteL() ); - if ( error == KErrNoMemory ) User::Leave( error ); - TInt count; - EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); - if ( count > 0 && error != KErrNone ) - { - User::Leave( KErrNoMemory ); - } - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - } - - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_DoExecuteL2_L() - { - CContactIdArray* contactIdArray = NULL; - CPbkContactItem* contactItem = NULL; - CPbkContactItem* contactItemTmp = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - CContactTextField* urlAtSignField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdSIPID ); - if ( urlAtSignField ) - { - urlAtSignField->SetTextL( _L("sip:test@10.21.30.50") ); - } - else - { - EUNIT_ASSERT( !urlAtSignField ); - } - EUNIT_ENABLE_ALLOC_DECORATOR; - - 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 ); - } - - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - } -void UT_CMusAvaContactAvailability::UT_CMusAvaController_CallConnectedLL() - { - TRAPD( error, iContactAvailability->CallConnectedL( KTelNumber ) ); - if ( error == KErrNone ) - { - EUNIT_ASSERT_EQUALS( iContactAvailability->State(), - MMusAvaObserver::EMusAvaStatusAvailable ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->TelNumber(), KTelNumber ); - } - } -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() - { - CContactIdArray* contactIdArray = NULL; - CPbkContactItem* contactItem = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - EUNIT_ENABLE_ALLOC_DECORATOR; - CleanupStack::PushL( contactEngine ); - - // Non cont or phone number added to contact DB - TBool ret; - TRAPD( error, ret = iContactAvailability->ContactL( contactIdArray, *contactEngine ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( !ret ); - EUNIT_ASSERT( contactIdArray == NULL ); - - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - //contact - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber ); - - TRAP( error, ret = iContactAvailability->ContactL( contactIdArray, *contactEngine ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( ret ); - EUNIT_ASSERT( contactIdArray != NULL ); - - delete contactIdArray; - contactIdArray = NULL; - - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - - } -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactArrayLL() - { - CContactIdArray* array = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); - EUNIT_ENABLE_ALLOC_DECORATOR; - CleanupStack::PushL( pbkContactEngine ); - - //No number found - TInt ret = NULL; - TRAPD( error, ret = iContactAvailability->ContactArrayL( array, - *pbkContactEngine ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( ret == KErrNotFound ); - EUNIT_ASSERT( array == NULL ); - //Number length 0 - iConcreteSettings->SetTelNumberL( _L("") ); - TRAP( error, ret = iContactAvailability->ContactArrayL( array, - *pbkContactEngine ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( ret == KErrNotFound ); - EUNIT_ASSERT( array == NULL ); - //Number found - iConcreteSettings->SetTelNumberL( KNumber ); - TRAP( error, ret = iContactAvailability->ContactArrayL( array, - *pbkContactEngine ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( ret == KErrNone ); - EUNIT_ASSERT( array != NULL ); - EUNIT_ASSERT( array->Count() > 0 ); - - CleanupStack::PopAndDestroy( pbkContactEngine ); - - delete array; - array = NULL; - } -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactItemL() - { - CPbkContactItem* tmpItem = NULL; - CContactIdArray* tmpContactIdArray = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - // CContactIdArray == 0 - //tmpContactIdArray = CContactIdArray::NewLC(); - //EUNIT_ASSERT_EQUALS( KErrNotFound, iContactAvailability->ContactItem( - //*tmpContactIdArray, tmpItem ) ); - //CleanupStack::PopAndDestroy( ); - - - // CContactIdArray > 0 - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - contactEngine->AddNewContactL( *contactItem ); - - CContactDatabase* contactDatabase = CContactDatabase::OpenL(); - CleanupStack::PushL( contactDatabase ); - CCntFilter* newFilter = CCntFilter::NewL(); - CleanupStack::PushL( newFilter ); - newFilter->Reset(); - newFilter->SetContactFilterTypeALL( ETrue ); - contactDatabase->FilterDatabaseL( *newFilter ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - //CContactIdArray* tmpaArray = newFilter->iIds; - //Item found - - TInt err = iContactAvailability->ContactItem( *( newFilter->iIds ), tmpItem, *contactEngine ); - // NOTE: Multiple contact id's could be in database and KErrNotSupported is - // returned if more than one. Maybe first run could get result KErrNone and - // then KErrNotSupported - EUNIT_ASSERT( ( KErrNotSupported == err ) || ( KErrNone == err ) ); - - //EUNIT_ASSERT( tmpItem != NULL ); - //delete tmpaArray; - //contactDatabase->CommitContactL( *tmpItem ); - delete tmpItem; - //tmpItem = NULL; - //End test - - CleanupStack::PopAndDestroy( newFilter ); - - contactDatabase->CloseTables(); - - CleanupStack::PopAndDestroy( contactDatabase ); - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - - - - } -void UT_CMusAvaContactAvailability::UT_CMusAvaController_PhoneResulutionLL() - { - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); - CleanupStack::PushL( array ); - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - CPbkContactItem* contactItem = contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - //No prefix - contactItem->RemoveDefaultPhoneNumberField(); - EUNIT_ENABLE_ALLOC_DECORATOR; - iConcreteSettings->SetTelNumberL( KNumber ); - TBool ret; - TRAPD( error, ret = iContactAvailability->PhoneResolutionL( *contactItem, array ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( !ret ); - - EUNIT_ASSERT( array->MdcaCount() == 0); - - //Prefix - iConcreteSettings->SetTelNumberL( KPlusNumber ); - - TRAP( error, ret = iContactAvailability->PhoneResolutionL( *contactItem, array ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( ret ); - EUNIT_ASSERT( array->MdcaCount() > 0 ); - //remove object from the array - array->Reset(); - - ///Number plan is in national mode - EUNIT_DISABLE_ALLOC_DECORATOR; - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KNumber() ); - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->ReleseTelNumberL(); - TRAP( error, ret = iContactAvailability->PhoneResolutionL( *contactItem, array ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( !ret ); - EUNIT_ASSERT( array->MdcaCount() == 0 ); - - - //Number plan is in internatiolan mode - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem->RemoveDefaultPhoneNumberField(); - fieldMobile = contactItem->FindField( EPbkFieldIdPhoneNumberMobile ); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - iConcreteSettings->ReleseTelNumberL(); - TRAP( error, ret = iContactAvailability->PhoneResolutionL( *contactItem, array ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( ret ); - EUNIT_ASSERT( array->MdcaCount() > 0 ); - - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - CleanupStack::PopAndDestroy( array ); - } - - - - - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactIdL() - { - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - CPbkContactItem* contactItem = NULL; - - // dummy initialization, other ways CPbkContactEngine leaks memory - TRAP_IGNORE( contactItem = contactEngine->ReadContactL( 1 ) ); - delete contactItem; - - contactItem = contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - //Contact field not created - EUNIT_ASSERT( !iContactAvailability->ContactId( *contactItem, EPbkFieldIdSIPID ) ); - - //Contact URi not defined - CContactTextField* urlFieldNotDefined = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdShareView ); - if ( urlFieldNotDefined ) - { - urlFieldNotDefined->SetTextL( _L("sip:10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlFieldNotDefined ); - } - - EUNIT_ASSERT( !iContactAvailability->ContactId( *contactItem, EPbkFieldIdShareView ) ); - - //Contact field not found - CContactTextField* urlField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdShareView ); - if ( urlField ) - { - urlField->SetTextL( _L("test@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlField ); - } - - EUNIT_ASSERT( !iContactAvailability->ContactId( *contactItem, EPbkFieldIdSIPID ) ); - - //Contact field found - EUNIT_ASSERT( iContactAvailability->ContactId( *contactItem, EPbkFieldIdShareView ) ); - - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactIdSearchL() - { - CPbkContactItem* contactItem = NULL; - CContactIdArray* contactIdArray = NULL; - CContactTextField* phoneNumberMobiled = NULL; - CContactTextField* country = NULL; - CContactTextField* urlFieldNotDefined = NULL; - CPbkContactEngine* contactEngine = NULL; - - - //No contact ////////////////////////////////////////////////////////////// - //General info - EUNIT_DISABLE_ALLOC_DECORATOR; - contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - //Clear contacts - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - CleanupStack::PushL( contactIdArray ); - contactEngine->DeleteContactsL( *contactIdArray ); - - CleanupStack::PopAndDestroy( contactIdArray ); - - - // dummy initialization, other ways CPbkContactEngine leaks memory - TRAP_IGNORE( contactItem = contactEngine->ReadContactL( 1 ) ); - delete contactItem; - - AddToMyContact( *contactEngine, - KNumber(), - EPbkFieldIdPhoneNumberMobile, - _L("nokia"), - EPbkFieldIdCompanyName ); - - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - CleanupStack::PushL( contactIdArray ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - EUNIT_ASSERT( - iContactAvailability->ContactIdSearch( *contactIdArray, *contactEngine ) == - EPbkFieldIdNone ); - - contactEngine->DeleteContactsL( *contactIdArray ); - CleanupStack::PopAndDestroy( contactIdArray ); - - // Field Phone number general found ///////////////////////////////////////////////////////// - - //Clear contacts - EUNIT_DISABLE_ALLOC_DECORATOR; - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - CleanupStack::PushL( contactIdArray ); - contactEngine->DeleteContactsL( *contactIdArray ); - - CleanupStack::PopAndDestroy( contactIdArray ); - - AddToMyContact( *contactEngine, - KNumber(), - EPbkFieldIdPhoneNumberMobile, - _L("+35805123456789"), - EPbkFieldIdPhoneNumberGeneral ); - - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - - CleanupStack::PushL( contactIdArray ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - EUNIT_ASSERT( - iContactAvailability->ContactIdSearch( *contactIdArray, *contactEngine ) == - EPbkFieldIdNone ); - //EUNIT_ASSERT( ret == EPbkFieldIdPhoneNumberGeneral ); - contactEngine->DeleteContactsL( *contactIdArray ); - CleanupStack::PopAndDestroy( contactIdArray ); - - // Field SIP id found ///////////////////////////////////////////////////////// - - //Clear contacts - EUNIT_DISABLE_ALLOC_DECORATOR; - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - CleanupStack::PushL( contactIdArray ); - contactEngine->DeleteContactsL( *contactIdArray ); - - CleanupStack::PopAndDestroy( contactIdArray ); - - AddToMyContact( *contactEngine, - KNumber(), - EPbkFieldIdPhoneNumberMobile, - _L("test@10.21.32.51"), - EPbkFieldIdSIPID ); - - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - - CleanupStack::PushL( contactIdArray ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - TPbkFieldId ret = iContactAvailability->ContactIdSearch( *contactIdArray, *contactEngine ); - if ( ret == EPbkFieldIdNone ) - { - User::Leave( KErrNoMemory ); - } - EUNIT_ASSERT( ret == EPbkFieldIdSIPID ); - contactEngine->DeleteContactsL( *contactIdArray ); - CleanupStack::PopAndDestroy( contactIdArray ); - - // Share View found - //Clear contacts - EUNIT_DISABLE_ALLOC_DECORATOR; - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - CleanupStack::PushL( contactIdArray ); - contactEngine->DeleteContactsL( *contactIdArray ); - - CleanupStack::PopAndDestroy( contactIdArray ); - - AddToMyContact( *contactEngine, - KNumber(), - EPbkFieldIdPhoneNumberMobile, - _L("test@10.21.32.51"), - EPbkFieldIdShareView ); - - contactIdArray = contactEngine->MatchPhoneNumberL( - KNumber(), - KNumberMatchingDigitsRequired ); - - CleanupStack::PushL( contactIdArray ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - ret = iContactAvailability->ContactIdSearch( *contactIdArray, *contactEngine ); - if ( ret == EPbkFieldIdNone ) - { - User::Leave( KErrNoMemory ); - } - EUNIT_ASSERT( ret == EPbkFieldIdShareView ); - - contactEngine->DeleteContactsL( *contactIdArray ); - CleanupStack::PopAndDestroy( contactIdArray ); - CleanupStack::PopAndDestroy( contactEngine ); - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolveAddressesLL() - { - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); - CleanupStack::PushL( array ); - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - //Test cases - //Sip Uri without At sign - CContactTextField* urlSipField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdSIPID ); - - - if ( urlSipField ) - { - urlSipField->SetTextL( _L("sip:10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlSipField ); - } - - TBool ret; - TRAPD( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdSIPID ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( !ret ); - EUNIT_ASSERT( array->Count() == 0 ); - - - //Undefined Uri - CContactTextField* urlUndefinedField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdPushToTalk ); - if ( urlUndefinedField ) - { - urlUndefinedField->SetTextL( _L("test@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlUndefinedField ); - } - contactEngine->AddNewContactL( *contactItem ); - TRAP( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdSIPID ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( !ret ); - - EUNIT_ASSERT( array->Count() == 0 ); - - //Sip Uri - CContactTextField* urlAtSignField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdSIPID ); - if ( urlAtSignField ) - { - urlAtSignField->SetTextL( _L("sip:test@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlAtSignField ); - } - contactEngine->AddNewContactL( *contactItem ); - TRAP( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdSIPID ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( ret ); - EUNIT_ASSERT( array->Count() > 0 ); - - //Clear array - array->Reset(); - - //ShareView Uri - CContactTextField* urlShareViewField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdShareView ); - if ( urlShareViewField ) - { - urlShareViewField->SetTextL( _L("test@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlShareViewField ); - } - - TRAP( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdShareView ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( ret ); - EUNIT_ASSERT( array != NULL ); - EUNIT_ASSERT( array->Count() > 0 ); - array->Reset(); - - - //End test - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - CleanupStack::PopAndDestroy( array ); - - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolveAddressesLOpSpecificL() - { - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); - CleanupStack::PushL( array ); - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - //Test cases - //Sip Uri without test string - CContactTextField* urlAtSignField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdSIPID ); - if ( urlAtSignField ) - { - urlAtSignField->SetTextL( _L("sip:test@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlAtSignField ); - } - contactEngine->AddNewContactL( *contactItem ); - TBool ret; - TRAPD( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdSIPID ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( !ret ); - EUNIT_ASSERT_EQUALS( array->Count(), 0 ); - - //Clear array - array->Reset(); - - //Sip Uri with test string (*#) - urlAtSignField = - EditableContactFieldL( *contactEngine, *contactItem, EPbkFieldIdSIPID ); - if ( urlAtSignField ) - { - urlAtSignField->SetTextL( _L("sip:test*#@10.21.32.51") ); - } - else - { - EUNIT_ASSERT( !urlAtSignField ); - } - contactEngine->AddNewContactL( *contactItem ); - TRAP( error, ret = iContactAvailability->ResolveAddressesL( *contactItem, - array, - EPbkFieldIdSIPID ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( ret ); - EUNIT_ASSERT( array->Count() > 0 ); - - //Clear array - array->Reset(); - - //End test - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - CleanupStack::PopAndDestroy( array ); - - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolvePhoneContactLL() - { - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); - CleanupStack::PushL( array ); - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - ///Number plan is in national mode - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("0401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->MdcaCount() == 0 ); - //Number plan is in internatiolan mode - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem->RemoveDefaultPhoneNumberField(); - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("+358401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->MdcaCount() > 0 ); - array->Reset(); - - //tel uri - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem->RemoveDefaultPhoneNumberField(); - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("tel:+358401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->Count() == 0 ); - - //End test - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - CleanupStack::PopAndDestroy( array ); - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolvePhoneContactLOpSpecificL() - { - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); - CleanupStack::PushL( array ); - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - ///Number plan is in national mode - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("0401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->MdcaCount() > 0 ); - //Number plan is in internatiolan mode - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem->RemoveDefaultPhoneNumberField(); - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("+358401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->MdcaCount() > 0 ); - array->Reset(); - - //tel uri - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem->RemoveDefaultPhoneNumberField(); - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL(_L("tel:+358401234567")); - EUNIT_ENABLE_ALLOC_DECORATOR; - iContactAvailability->ResolvePhoneContactL( *contactItem, array ); - EUNIT_ASSERT( array->Count() > 0 ); - - //End test - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( contactEngine ); - CleanupStack::PopAndDestroy( array ); - } - -CContactTextField* UT_CMusAvaContactAvailability::EditableContactFieldL( - CPbkContactEngine& aContactEngine, - CPbkContactItem& aContact, - TPbkFieldId aFieldId ) - { - /* CContactDatabase* contactDatabase = NULL; - contactDatabase = CContactDatabase::OpenL(); - CleanupStack::PushL( contactDatabase ); - CCntFilter* newFilter = CCntFilter::NewLC(); - newFilter->Reset(); - newFilter->SetContactFilterTypeALL( ETrue ); - contactDatabase->FilterDatabaseL( *newFilter ); - - CContactIdArray* contactsId = newFilter->iIds; - if ( contactsId->Count() ) - { - aContactEngine.DeleteContactsL( *contactsId ); - } - //contactDatabase->CommitContactL(): - - CleanupStack::PopAndDestroy( 2 ); - CleanupStack::PopAndDestroy( contactDatabase );*/ - - EUNIT_DISABLE_ALLOC_DECORATOR; - const CPbkFieldsInfo& fieldsInfo = aContactEngine.FieldsInfo(); - // Try to get the SIP URI storage field for this contact - TPbkContactItemField* itemField = aContact.FindField( aFieldId ); - - if ( !itemField ) - { - CPbkFieldInfo* fieldInfo = fieldsInfo.Find( aFieldId ); - // Add field to this contact - if ( fieldInfo ) - { - CleanupStack::PushL( fieldInfo ); - // Contact takes ownership of the field. - aContact.AddFieldL( *fieldInfo ); - CleanupStack::Pop( fieldInfo ); - itemField = aContact.FindField( aFieldId ); - if ( itemField ) - { - return itemField->TextStorage(); - } - else - { - EUNIT_ASSERT( !itemField ); - } - } - else - { - EUNIT_ASSERT( !fieldInfo ); - } - } - else - { - return itemField->TextStorage(); - } - EUNIT_ENABLE_ALLOC_DECORATOR; - return NULL; // Should never reach here, just to avoid warnings. - } - -void UT_CMusAvaContactAvailability::AddFields( CPbkContactEngine& aContactEngine, - CPbkContactItem& contact, - const TDesC& aText, - TPbkFieldId aFieldId ) - { - const CPbkFieldsInfo& fieldsInfo = aContactEngine.FieldsInfo(); - // Try to get the storage field for this contact - TPbkContactItemField* itemField = contact.FindField( aFieldId ); - - if ( itemField == NULL ) - { - CPbkFieldInfo* fieldInfo = fieldsInfo.Find( aFieldId ); - // Add field to this contact - if ( fieldInfo ) - { - CleanupStack::PushL( fieldInfo ); - // Contact takes ownership of the field. - contact.AddFieldL( *fieldInfo ); - CleanupStack::Pop( fieldInfo ); - itemField = contact.FindField( aFieldId ); - if ( itemField ) - { - itemField->TextStorage()->SetTextL( aText ); - } - else - { - EUNIT_ASSERT( !itemField ); - } - } - else - { - EUNIT_ASSERT( !fieldInfo ); - } - } - else - { - // Set some default fields - itemField->TextStorage()->SetTextL(aText ); - } - } - -void UT_CMusAvaContactAvailability::AddToMyContact( CPbkContactEngine& aContactEngine, - const TDesC& aText, - TPbkFieldId aFieldId, - const TDesC& aText2, - TPbkFieldId aFieldId2 ) - { - // Create a contact with few default fields - // All the default fields are empty and won't be displayed - // until some information is stored in them - /*CPbkContactItem* contact = aContactEngine.CreateEmptyContactL(); - CleanupStack::PushL( contact ); - - // Set some default fields - contact->FindField( aFieldId )->TextStorage()->SetTextL(aText ); - // Set some default fields - contact->FindField( aFieldId2 )->TextStorage()->SetTextL(aText2 ); - - // Store the contact to the phonebook - aContactEngine.AddNewContactL( *contact ); - CleanupStack::PopAndDestroy( contact );*/ - - /*CPbkContactItem* contact = aContactEngine.CreateEmptyContactL(); - CleanupStack::PushL( contact ); - - const CPbkFieldsInfo& fieldsInfo = aContactEngine.FieldsInfo(); - // Try to get the storage field for this contact - TPbkContactItemField* itemField = contact->FindField( aFieldId ); - - if ( itemField == NULL ) - { - CPbkFieldInfo* fieldInfo = fieldsInfo.Find( aFieldId ); - // Add field to this contact - if ( fieldInfo ) - { - CleanupStack::PushL( fieldInfo ); - // Contact takes ownership of the field. - contact->AddFieldL( *fieldInfo ); - CleanupStack::Pop( fieldInfo ); - itemField = contact->FindField( aFieldId ); - if ( itemField ) - { - itemField->TextStorage()->SetTextL( aText ); - } - else - { - EUNIT_ASSERT( !itemField ); - } - } - else - { - EUNIT_ASSERT( !fieldInfo ); - } - } - else - { - // Set some default fields - itemField->TextStorage()->SetTextL(aText ); - } - // Store the contact to the phonebook - aContactEngine.AddNewContactL( *contact ); - CleanupStack::PopAndDestroy( contact );*/ - - CPbkContactItem* contact = aContactEngine.CreateEmptyContactL(); - CleanupStack::PushL( contact ); - - AddFields( aContactEngine, *contact, aText, aFieldId ); - AddFields( aContactEngine, *contact, aText2, aFieldId2 ); - // Store the contact to the phonebook - aContactEngine.AddNewContactL( *contact ); - CleanupStack::PopAndDestroy( contact ); - - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_IsExistAlreadyL() - { - _LIT( KTestUri1, "sip:1@test.net"); - _LIT( KTestUri2, "sip:2@test.net"); - _LIT( KTestUri3, "sip:3@test.net"); - _LIT( KTestUri5, "sip:5@test.net"); - - TBufC16<16> str1(KTestUri1); - HBufC16* ptr1; - ptr1 = str1.AllocLC(); - - TBufC16<16> str2(KTestUri2); - HBufC16* ptr2; - ptr2 = str2.AllocLC(); - - TBufC16<16> str3(KTestUri3); - HBufC16* ptr3; - ptr3 = str3.AllocLC(); - - CDesCArrayFlat* array = new( ELeave ) CDesCArrayFlat(1); - CleanupStack::PushL(array); - array->AppendL(*ptr1); - array->AppendL(*ptr2); - array->AppendL(*ptr3); - - TBool exist = EFalse; - - // Test 1 : - exist = iContactAvailability->IsExistAlready(*array,KTestUri1); - EUNIT_ASSERT(exist); - // Test 2 : - exist = iContactAvailability->IsExistAlready(*array,KTestUri5); - EUNIT_ASSERT(!exist); - - array->Reset(); - CleanupStack::PopAndDestroy(array); - CleanupStack::PopAndDestroy(ptr3); - CleanupStack::PopAndDestroy(ptr2); - CleanupStack::PopAndDestroy(ptr1); - } - -void UT_CMusAvaContactAvailability::UT_CMusAvaController_UpdateContactNameLL() - { - CPbkContactItem* contactItem = NULL; - - EUNIT_DISABLE_ALLOC_DECORATOR; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - //contact firstname && iBeginWithFirstName = ETrue - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - TPbkContactItemField* fieldMobile1 = contactItem->FindField(EPbkFieldIdFirstName); - fieldMobile1->TextStorage()->SetTextL( KFirstName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = ETrue; - TRAPD( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KFirstName ) == NULL ); - - CleanupStack::PopAndDestroy( contactItem ); - CContactIdArray* array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - //contact firstname && iBeginWithFirstName = EFalse - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdFirstName); - fieldMobile1->TextStorage()->SetTextL( KFirstName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = EFalse; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KFirstName ) == NULL ); - - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - //contact lastname && iBeginWithFirstName = ETrue - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdLastName); - fieldMobile1->TextStorage()->SetTextL( KLastName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = ETrue; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KLastName ) == NULL ); - - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - //contact lastname && iBeginWithFirstName = EFalse - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdLastName); - fieldMobile1->TextStorage()->SetTextL( KLastName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = EFalse; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KLastName ) == NULL ); - - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - //contact firstname && lastname && iBeginWithFirstName = ETrue - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdFirstName); - fieldMobile1->TextStorage()->SetTextL( KFirstName() ); - - TPbkContactItemField* fieldMobile2 = contactItem->FindField(EPbkFieldIdLastName); - fieldMobile2->TextStorage()->SetTextL( KLastName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = ETrue; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KFirstLastName ) == NULL ); -// - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - //contact firstname && lastname && iBeginWithFirstName = EFalse - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdFirstName); - fieldMobile1->TextStorage()->SetTextL( KFirstName() ); - - fieldMobile2 = contactItem->FindField(EPbkFieldIdLastName); - fieldMobile2->TextStorage()->SetTextL( KLastName() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = EFalse; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KLastFirstName ) == NULL ); - - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - - // contact name only contain 1 character - _LIT(KNameWithOneChar,"M"); - for (int i = 0; i < 1; ++i ) - { - EUNIT_DISABLE_ALLOC_DECORATOR; - contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - fieldMobile1 = contactItem->FindField(EPbkFieldIdFirstName); - fieldMobile1->TextStorage()->SetTextL( KNameWithOneChar() ); - - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iContactAvailability->iBeginWithFirstName = i; - TRAP( error, - iContactAvailability->UpdateContactNameL( contactItem->ContactItem() ) ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT( error == KErrNone ); - EUNIT_ASSERT( iContactAvailability->iContactName->Compare( KNameWithOneChar ) == -1 ); - - CleanupStack::PopAndDestroy( contactItem ); - array = NULL; - iContactAvailability->ContactArrayL( array, *contactEngine ); - CleanupStack::PushL( array ); - contactEngine->DeleteContactsL( *array, ETrue ); - CleanupStack::PopAndDestroy( array ); - } - - CleanupStack::PopAndDestroy( contactEngine ); - } -// 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( - "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_TEST( - "UpdateContactNameL - test ", - "CMusAvaContactAvailability", - "UpdateContactNameL", - "FUNCTIONALITY", - SetupL, UT_CMusAvaController_CallConnectedLL, Teardown) -EUNIT_END_TEST_TABLE - -// END OF FILE - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultImp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultImp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* 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 -#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; - CPbkContactEngine* contactEngine = CPbkContactEngine::NewL(); - EUNIT_ENABLE_ALLOC_DECORATOR; - CleanupStack::PushL( contactEngine ); - - // dummy initialization, other ways CPbkContactEngine leaks memory - CPbkContactItem* pbkItem = NULL; - TRAP_IGNORE( pbkItem = contactEngine->ReadContactL( 1 ) ); - delete pbkItem; - - CPbkContactItem* contactItem= contactEngine->CreateEmptyContactL(); - CleanupStack::PushL( contactItem ); - - //contact - TPbkContactItemField* fieldMobile = contactItem->FindField(EPbkFieldIdPhoneNumberMobile); - fieldMobile->TextStorage()->SetTextL( KPlusNumber() ); - - EUNIT_DISABLE_ALLOC_DECORATOR; - contactEngine->AddNewContactL( *contactItem ); - EUNIT_ENABLE_ALLOC_DECORATOR; - CleanupStack::PopAndDestroy( contactItem ); - - iConcreteSettings->SetTelNumberL( KPlusNumber() ); - - iDefaultImp->StartL(); - EUNIT_ASSERT( iDefaultImp->AvailabilityState( - MMusAvaObserver::EMusAvaOptionHandler) - == MMusAvaObserver::EMusAvaStatusNotExecuted ); - EUNIT_ASSERT( iDefaultImp->AvailabilityState( - MMusAvaObserver::EMusAvaInviteHandler) - == MMusAvaObserver::EMusAvaStatusAvailable ); - CleanupStack::PopAndDestroy( contactEngine ); - - } - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultOptionHandler.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultOptionHandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,633 +0,0 @@ -/* -* 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(); - 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(); - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteHandler.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteHandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteResponder.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteResponder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ -/* -* 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" ); - -// 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 ); - - - RProperty::Define( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - 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 )); - - User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - 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 ); - 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 )); - - User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - 0 )); - - iNetworkAvailability->CallConnectedL( KTelNumber ); - EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), - MMusAvaObserver::EMusAvaStatusAvailable ); - EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); - } - -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 )); - User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - 0 )); - - - iNetworkAvailability->CallHoldL( KTelNumber ); - EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), - MMusAvaObserver::EMusAvaStatusCallOnHold ); - EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); - } - -void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_NoActiveCallLL() - { - iNetworkAvailability->NoActiveCallL(); - EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), - MMusAvaObserver::EMusAvaStatusNoCall ); - EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KNullDesC ); - } - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusAvaNetworkAvailability, - "CMusAvaNetworkAvailability", - "UNIT" ) - -EUNIT_TEST( - "DoExecuteL - test ", - "CMusAvaNetworkAvailability", - "DoExecuteL", - "FUNCTIONALITY", - SetupL, UT_CMusAvaNetworkAvailability_DoExecuteLL, 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_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkModeStatus.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkModeStatus.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkRegistrationStatus.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkRegistrationStatus.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaOptionHandler.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaOptionHandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,401 +0,0 @@ -/* -* 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" - - -// 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(); - iConcreteSettings = CMusAvaSettingsImp::NewL(); - iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, - *iConcreteSettings ); - - MSIPConnectionObserver& connectionObserver = - iSharedObject->MusAvaSip().ConnectionObserver(); - CSIP& sip = iSharedObject->MusAvaSip().Sip(); - CSipSseTestTls::OpenL(); - iStorage = CSipSseTestTls::Storage(); - 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; - } - -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(); - - } - -// 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_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaRegisterAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaRegisterAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,518 +0,0 @@ -/* -* 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 ); - EUNIT_ASSERT( iSharedObj->MusAvaSip().iSipConnection == NULL ); - - iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileRegistered ); - EUNIT_ASSERT( iAvailabilityObserver->iStatus == MMusAvaObserver::EMusAvaStatusAvailable ); - EUNIT_ASSERT( iAvailabilityObserver->iName == MMusAvaObserver::EMusAvaNameRegistration ); - EUNIT_ASSERT( iSharedObj->MusAvaSip().iSipConnection != NULL ); - - 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->iOperatorVariant = MusSettingsKeys::EOperatorSpecific; - iRegisterAvailability->ProfileRegistryErrorOccurred(5, -5 ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - iRegisterAvailability->ProfileRegistryErrorOccurred(5, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - - iRegisterAvailability->iOperatorVariant = MusSettingsKeys::EStandard; - iRegisterAvailability->ProfileRegistryErrorOccurred(5, -5 ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - iRegisterAvailability->ProfileRegistryErrorOccurred(5, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - - // Test Profile - TRAPD( error, iSharedObj->MusAvaSip().CreateProfileL() ); - if ( error == KErrNoMemory ) User::Leave( error ); - EUNIT_ASSERT ( error == KErrNone ); - //Profile created - iRegisterAvailability->ProfileRegistryErrorOccurred(5, -5 ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - - iRegisterAvailability->iOperatorVariant = MusSettingsKeys::EOperatorSpecific; - iRegisterAvailability->ProfileRegistryErrorOccurred(5, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - - iRegisterAvailability->iOperatorVariant = MusSettingsKeys::EStandard; - iRegisterAvailability->ProfileRegistryErrorOccurred(5, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); - - MultimediaSharingSettings::SetSipProfileSettingL( 1 ); - - iRegisterAvailability->ProfileRegistryErrorOccurred(1, -5 ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotRegistered ); - - iRegisterAvailability->ProfileRegistryErrorOccurred(1, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotRegistered ); - //Operator variant. SIP profile disabled. - iRegisterAvailability->iOperatorVariant = MusSettingsKeys::EOperatorSpecific; - iRegisterAvailability->ProfileRegistryErrorOccurred(1, KErrGeneral ); - EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusActivationError ); - } - - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingsImp.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingsImp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,520 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSharedObject.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSharedObject.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSip.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSip.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,478 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipConnectionObserver.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipConnectionObserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,500 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipObserver.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipObserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipProfileRegistryObserver.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipProfileRegistryObserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipheaderUtil.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipheaderUtil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipprofileAvailability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipprofileAvailability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaTerminal.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaTerminal.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,678 +0,0 @@ -/* -* 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(); - } - - -void UT_CMusAvaTerminal::Teardown( ) - { - - CSipSseTestTls::Close(); - 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, check also that SDP of received request is used - options = - CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, - KCapabilityTestAddress_B, - KCapabilitySwisFeature, - KCapabilitySwisFeature, - KCapabilityTestAcceptHeader, - KCapabilityTestTerminalID_B, - KCapabilityPAssertedIdentity, - KCapabilityTestSDP); - CleanupStack::PushL( options ); - iTerminal->QueryRequestedL( *options ); - - - EUNIT_ASSERT( iConcreteSettings->SipAddresses().MdcaCount() == 1 ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->iVideoCodecs->MdcaCount(), 1 ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->iVideoCodecs->MdcaPoint(0), _L("H263-2000/90000") ); - CleanupStack::PopAndDestroy( options ); - - CSipSseTestTls* server = CSipSseTestTls::Storage(); - CSipSseTestTls::Storage()->Clear(); - iTerminal->iRequestedQuery = NULL; - EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); - - // with Asserted Identity, check also that SDP of received request is used - options = - CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, - KCapabilityTestAddress_B, - KCapabilitySwisFeature, - KCapabilitySwisFeature, - KCapabilityTestAcceptHeader, - KCapabilityTestTerminalID_B, - KCapabilityPAssertedIdentity, - KCapabilityTestSDP264And263); - CleanupStack::PushL( options ); - iTerminal->QueryRequestedL( *options ); - EUNIT_ASSERT( iConcreteSettings->SipAddresses().MdcaCount() == 1 ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->iVideoCodecs->MdcaCount(), 2 ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->iVideoCodecs->MdcaPoint(0), _L("H264/90000") ); - EUNIT_ASSERT_EQUALS( iConcreteSettings->iVideoCodecs->MdcaPoint(1), _L("H263-2000/90000") ); - CleanupStack::PopAndDestroy( options ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availability.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availability.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availabilityDllMain.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availabilityDllMain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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" - - -// 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(); - - CleanupStack::Pop(); // rootSuite - - return rootSuite; - } - - - -// END OF FILE - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/musavacapabilitytesthelper.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/musavacapabilitytesthelper.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,477 +0,0 @@ -/* -* 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, - const TDesC8& aSdp) - { - - 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 ) ); - - CSIPMessageElements& message = requestelements->MessageElements(); - if ( aSdp.Length() > 0 ) - { - CSIPContentTypeHeader* contenttype = - CSIPContentTypeHeader::NewLC( KMUSAVASIPMediaTypeApplication, - KMUSAVASIPMediaSubTypeSDP ); - HBufC8* content = aSdp.AllocLC(); - - message.SetContentL( content, contenttype ); - CleanupStack::Pop( content ); - CleanupStack::Pop( contenttype ); - } - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshavailability/tsrc/ut_availability/src/ut_cmusavaclientresolverutil.cpp --- a/mmsharing/mmshavailability/tsrc/ut_availability/src/ut_cmusavaclientresolverutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/bwins/musengineu.def --- a/mmsharing/mmshengine/bwins/musengineu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -EXPORTS - ?SetAudioRoutingObserver@CMusEngSession@@QAEXPAVMMusEngAudioRoutingObserver@@@Z @ 1 NONAME ; void CMusEngSession::SetAudioRoutingObserver(class MMusEngAudioRoutingObserver *) - ?ParseUriL@TMusEngUriParser@@QAEXXZ @ 2 NONAME ; void TMusEngUriParser::ParseUriL(void) - ?EnableLoudspeakerL@CMusEngSession@@QAEXHH@Z @ 3 NONAME ; void CMusEngSession::EnableLoudspeakerL(int, int) - ?CancelInviteL@CMusEngMceOutSession@@QAEXXZ @ 4 NONAME ; void CMusEngMceOutSession::CancelInviteL(void) - ?SetClipL@CMusEngClipSession@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CMusEngClipSession::SetClipL(class TDesC16 const &) - ?VolumeL@CMusEngSession@@QBEHXZ @ 6 NONAME ; int CMusEngSession::VolumeL(void) const - ?IsMicMutedL@CMusEngSession@@QAEHXZ @ 7 NONAME ; int CMusEngSession::IsMicMutedL(void) - ?FastRewindL@CMusEngClipSession@@QAEXH@Z @ 8 NONAME ; void CMusEngClipSession::FastRewindL(int) - ?ZoomDefaultL@CMusEngLiveSession@@QAEXXZ @ 9 NONAME ; void CMusEngLiveSession::ZoomDefaultL(void) - ?GetUri16L@TMusEngUriParser@@QAEPAVHBufC16@@H@Z @ 10 NONAME ; class HBufC16 * TMusEngUriParser::GetUri16L(int) - ?VolumeUpL@CMusEngSession@@UAEXXZ @ 11 NONAME ; void CMusEngSession::VolumeUpL(void) - ?UriType@TMusEngUriParser@@QAE?AW4TMusEngUriType@1@XZ @ 12 NONAME ; enum TMusEngUriParser::TMusEngUriType TMusEngUriParser::UriType(void) - ?IsMutedL@CMusEngMceSession@@QAEHXZ @ 13 NONAME ; int CMusEngMceSession::IsMutedL(void) - ?DurationL@CMusEngClipSession@@QAE?AVTTimeIntervalSeconds@@XZ @ 14 NONAME ; class TTimeIntervalSeconds CMusEngClipSession::DurationL(void) - ??0TMusEngUriParser@@QAE@ABVTDesC16@@@Z @ 15 NONAME ; TMusEngUriParser::TMusEngUriParser(class TDesC16 const &) - ?AcceptInvitationL@CMusEngReceiveSession@@QAEXABH@Z @ 16 NONAME ; void CMusEngReceiveSession::AcceptInvitationL(int const &) - ?CurrentZoomL@CMusEngLiveSession@@QBEHXZ @ 17 NONAME ; int CMusEngLiveSession::CurrentZoomL(void) const - ?MinBrightnessL@CMusEngLiveSession@@QBEHXZ @ 18 NONAME ; int CMusEngLiveSession::MinBrightnessL(void) const - ?GetUri8L@TMusEngUriParser@@QAEPAVHBufC8@@XZ @ 19 NONAME ; class HBufC8 * TMusEngUriParser::GetUri8L(void) - ?NewL@CMusEngLiveSession@@SAPAV1@ABVTRect@@AAVMMusEngSessionObserver@@AAVMMusEngOutSessionObserver@@AAVMMusEngLiveSessionObserver@@I@Z @ 20 NONAME ; class CMusEngLiveSession * CMusEngLiveSession::NewL(class TRect const &, class MMusEngSessionObserver &, class MMusEngOutSessionObserver &, class MMusEngLiveSessionObserver &, unsigned int) - ?UnmuteL@CMusEngMceSession@@UAEXXZ @ 21 NONAME ; void CMusEngMceSession::UnmuteL(void) - ?AudioRoutingCanBeChanged@CMusEngSession@@QAEHXZ @ 22 NONAME ; int CMusEngSession::AudioRoutingCanBeChanged(void) - ?MaxBrightnessL@CMusEngLiveSession@@QBEHXZ @ 23 NONAME ; int CMusEngLiveSession::MaxBrightnessL(void) const - ?MinZoomL@CMusEngLiveSession@@QBEHXZ @ 24 NONAME ; int CMusEngLiveSession::MinZoomL(void) const - ?VolumeDownL@CMusEngSession@@UAEXXZ @ 25 NONAME ; void CMusEngSession::VolumeDownL(void) - ?OrientationL@CMusEngMceSession@@QAE?AW4TDisplayOrientation@1@XZ @ 26 NONAME ; enum CMusEngMceSession::TDisplayOrientation CMusEngMceSession::OrientationL(void) - ?SetSupportedVideoCodecListL@CMusEngMceOutSession@@QAEXABVTDesC16@@@Z @ 27 NONAME ; void CMusEngMceOutSession::SetSupportedVideoCodecListL(class TDesC16 const &) - ?MuteL@CMusEngMceSession@@UAEXXZ @ 28 NONAME ; void CMusEngMceSession::MuteL(void) - ?IsRecording@CMusEngLiveSession@@QAEHXZ @ 29 NONAME ; int CMusEngLiveSession::IsRecording(void) - ?SetVolumeL@CMusEngSession@@UAEXH@Z @ 30 NONAME ; void CMusEngSession::SetVolumeL(int) - ?DecreaseBrightnessL@CMusEngLiveSession@@QAEXXZ @ 31 NONAME ; void CMusEngLiveSession::DecreaseBrightnessL(void) - ?CancelTranscodeL@CMusEngClipSession@@QAEXXZ @ 32 NONAME ; void CMusEngClipSession::CancelTranscodeL(void) - ?PauseL@CMusEngClipSession@@UAEXXZ @ 33 NONAME ; void CMusEngClipSession::PauseL(void) - ?BrightnessDefaultL@CMusEngLiveSession@@QAEXXZ @ 34 NONAME ; void CMusEngLiveSession::BrightnessDefaultL(void) - ?FastForwardL@CMusEngClipSession@@QAEXH@Z @ 35 NONAME ; void CMusEngClipSession::FastForwardL(int) - ?SetZoomL@CMusEngLiveSession@@QAEXH@Z @ 36 NONAME ; void CMusEngLiveSession::SetZoomL(int) - ?SetRectL@CMusEngSession@@QAEXABVTRect@@@Z @ 37 NONAME ; void CMusEngSession::SetRectL(class TRect const &) - ?NewL@CMusEngClipSession@@SAPAV1@ABVTRect@@AAVMMusEngSessionObserver@@AAVMMusEngOutSessionObserver@@AAVMMusEngClipSessionObserver@@I@Z @ 38 NONAME ; class CMusEngClipSession * CMusEngClipSession::NewL(class TRect const &, class MMusEngSessionObserver &, class MMusEngOutSessionObserver &, class MMusEngClipSessionObserver &, unsigned int) - ?BrightnessAutoL@CMusEngLiveSession@@QAEXXZ @ 39 NONAME ; void CMusEngLiveSession::BrightnessAutoL(void) - ?IncreaseBrightnessL@CMusEngLiveSession@@QAEXXZ @ 40 NONAME ; void CMusEngLiveSession::IncreaseBrightnessL(void) - ?InviteL@CMusEngMceOutSession@@QAEXABVTDesC16@@@Z @ 41 NONAME ; void CMusEngMceOutSession::InviteL(class TDesC16 const &) - ?SetOrientationL@CMusEngMceSession@@QAEXW4TDisplayOrientation@1@@Z @ 42 NONAME ; void CMusEngMceSession::SetOrientationL(enum CMusEngMceSession::TDisplayOrientation) - ?IsLoudSpeakerEnabled@CMusEngSession@@QBEHXZ @ 43 NONAME ; int CMusEngSession::IsLoudSpeakerEnabled(void) const - ?ContainsAudioL@CMusEngMceSession@@QAEHXZ @ 44 NONAME ; int CMusEngMceSession::ContainsAudioL(void) - ?NewL@CMusEngReceiveSession@@SAPAV1@ABVTRect@@AAVMMusEngSessionObserver@@AAVMMusEngReceiveSessionObserver@@@Z @ 45 NONAME ; class CMusEngReceiveSession * CMusEngReceiveSession::NewL(class TRect const &, class MMusEngSessionObserver &, class MMusEngReceiveSessionObserver &) - ?VolumeUpL@CMusEngMceSession@@UAEXXZ @ 46 NONAME ; void CMusEngMceSession::VolumeUpL(void) - ?IsPlayingL@CMusEngClipSession@@UAEHXZ @ 47 NONAME ; int CMusEngClipSession::IsPlayingL(void) - ?PlayL@CMusEngClipSession@@UAEXXZ @ 48 NONAME ; void CMusEngClipSession::PlayL(void) - ?ZoomInL@CMusEngLiveSession@@QAEXXZ @ 49 NONAME ; void CMusEngLiveSession::ZoomInL(void) - ?PauseL@CMusEngLiveSession@@UAEXXZ @ 50 NONAME ; void CMusEngLiveSession::PauseL(void) - ?GetSessionTime@CMusEngMceSession@@QBE?AVTTimeIntervalSeconds@@XZ @ 51 NONAME ; class TTimeIntervalSeconds CMusEngMceSession::GetSessionTime(void) const - ?SetVolumeL@CMusEngMceSession@@UAEXH@Z @ 52 NONAME ; void CMusEngMceSession::SetVolumeL(int) - ?Rect@CMusEngSession@@QBE?AVTRect@@XZ @ 53 NONAME ; class TRect CMusEngSession::Rect(void) const - ?SetBrightnessL@CMusEngLiveSession@@QBEXH@Z @ 54 NONAME ; void CMusEngLiveSession::SetBrightnessL(int) const - ?TranscodeL@CMusEngClipSession@@QAEXABV?$TBuf@$0BAA@@@@Z @ 55 NONAME ; void CMusEngClipSession::TranscodeL(class TBuf<256> const &) - ?MaxZoomL@CMusEngLiveSession@@QBEHXZ @ 56 NONAME ; int CMusEngLiveSession::MaxZoomL(void) const - ?VolumeDownL@CMusEngMceSession@@UAEXXZ @ 57 NONAME ; void CMusEngMceSession::VolumeDownL(void) - ?ZoomOutL@CMusEngLiveSession@@QAEXXZ @ 58 NONAME ; void CMusEngLiveSession::ZoomOutL(void) - ?ConnectionActive@CMusEngMceSession@@QBEHXZ @ 59 NONAME ; int CMusEngMceSession::ConnectionActive(void) const - ?PositionL@CMusEngClipSession@@QAE?AVTTimeIntervalSeconds@@XZ @ 60 NONAME ; class TTimeIntervalSeconds CMusEngClipSession::PositionL(void) - ?MuteMicL@CMusEngSession@@QAEXH@Z @ 61 NONAME ; void CMusEngSession::MuteMicL(int) - ?NewL@CMusEngLiveSession@@SAPAV1@ABVTDesC16@@ABVTRect@@AAVMMusEngSessionObserver@@AAVMMusEngOutSessionObserver@@AAVMMusEngLiveSessionObserver@@I@Z @ 62 NONAME ; class CMusEngLiveSession * CMusEngLiveSession::NewL(class TDesC16 const &, class TRect const &, class MMusEngSessionObserver &, class MMusEngOutSessionObserver &, class MMusEngLiveSessionObserver &, unsigned int) - ?EnableDisplayL@CMusEngMceSession@@UAEXH@Z @ 63 NONAME ; void CMusEngMceSession::EnableDisplayL(int) - ?CurrentBrightnessL@CMusEngLiveSession@@QBEHXZ @ 64 NONAME ; int CMusEngLiveSession::CurrentBrightnessL(void) const - ?RecordL@CMusEngLiveSession@@QAEXH@Z @ 65 NONAME ; void CMusEngLiveSession::RecordL(int) - ?IsPlayingL@CMusEngLiveSession@@UAEHXZ @ 66 NONAME ; int CMusEngLiveSession::IsPlayingL(void) - ?TerminateL@CMusEngMceSession@@QAEXXZ @ 67 NONAME ; void CMusEngMceSession::TerminateL(void) - ?PlayL@CMusEngLiveSession@@UAEXXZ @ 68 NONAME ; void CMusEngLiveSession::PlayL(void) - ?SetPositionL@CMusEngClipSession@@QAEXABVTTimeIntervalSeconds@@@Z @ 69 NONAME ; void CMusEngClipSession::SetPositionL(class TTimeIntervalSeconds const &) - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/eabi/musengineu.def --- a/mmsharing/mmshengine/eabi/musengineu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -EXPORTS - _ZN14CMusEngSession10SetVolumeLEi @ 1 NONAME - _ZN14CMusEngSession11IsMicMutedLEv @ 2 NONAME - _ZN14CMusEngSession11VolumeDownLEv @ 3 NONAME - _ZN14CMusEngSession18EnableLoudspeakerLEii @ 4 NONAME - _ZN14CMusEngSession23SetAudioRoutingObserverEP27MMusEngAudioRoutingObserver @ 5 NONAME - _ZN14CMusEngSession24AudioRoutingCanBeChangedEv @ 6 NONAME - _ZN14CMusEngSession8MuteMicLEi @ 7 NONAME - _ZN14CMusEngSession8SetRectLERK5TRect @ 8 NONAME - _ZN14CMusEngSession9VolumeUpLEv @ 9 NONAME - _ZN16TMusEngUriParser7UriTypeEv @ 10 NONAME - _ZN16TMusEngUriParser8GetUri8LEv @ 11 NONAME - _ZN16TMusEngUriParser9GetUri16LEi @ 12 NONAME - _ZN16TMusEngUriParser9ParseUriLEv @ 13 NONAME - _ZN16TMusEngUriParserC1ERK7TDesC16 @ 14 NONAME - _ZN16TMusEngUriParserC2ERK7TDesC16 @ 15 NONAME - _ZN17CMusEngMceSession10SetVolumeLEi @ 16 NONAME - _ZN17CMusEngMceSession10TerminateLEv @ 17 NONAME - _ZN17CMusEngMceSession11VolumeDownLEv @ 18 NONAME - _ZN17CMusEngMceSession12OrientationLEv @ 19 NONAME - _ZN17CMusEngMceSession14ContainsAudioLEv @ 20 NONAME - _ZN17CMusEngMceSession14EnableDisplayLEi @ 21 NONAME - _ZN17CMusEngMceSession15SetOrientationLENS_19TDisplayOrientationE @ 22 NONAME - _ZN17CMusEngMceSession5MuteLEv @ 23 NONAME - _ZN17CMusEngMceSession7UnmuteLEv @ 24 NONAME - _ZN17CMusEngMceSession8IsMutedLEv @ 25 NONAME - _ZN17CMusEngMceSession9VolumeUpLEv @ 26 NONAME - _ZN18CMusEngClipSession10IsPlayingLEv @ 27 NONAME - _ZN18CMusEngClipSession10TranscodeLERK4TBufILi256EE @ 28 NONAME - _ZN18CMusEngClipSession11FastRewindLEi @ 29 NONAME - _ZN18CMusEngClipSession12FastForwardLEi @ 30 NONAME - _ZN18CMusEngClipSession12SetPositionLERK20TTimeIntervalSeconds @ 31 NONAME - _ZN18CMusEngClipSession16CancelTranscodeLEv @ 32 NONAME - _ZN18CMusEngClipSession4NewLERK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngClipSessionObserverj @ 33 NONAME - _ZN18CMusEngClipSession5PlayLEv @ 34 NONAME - _ZN18CMusEngClipSession6PauseLEv @ 35 NONAME - _ZN18CMusEngClipSession8SetClipLERK7TDesC16 @ 36 NONAME - _ZN18CMusEngClipSession9DurationLEv @ 37 NONAME - _ZN18CMusEngClipSession9PositionLEv @ 38 NONAME - _ZN18CMusEngLiveSession10IsPlayingLEv @ 39 NONAME - _ZN18CMusEngLiveSession11IsRecordingEv @ 40 NONAME - _ZN18CMusEngLiveSession12ZoomDefaultLEv @ 41 NONAME - _ZN18CMusEngLiveSession15BrightnessAutoLEv @ 42 NONAME - _ZN18CMusEngLiveSession18BrightnessDefaultLEv @ 43 NONAME - _ZN18CMusEngLiveSession19DecreaseBrightnessLEv @ 44 NONAME - _ZN18CMusEngLiveSession19IncreaseBrightnessLEv @ 45 NONAME - _ZN18CMusEngLiveSession4NewLERK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngLiveSessionObserverj @ 46 NONAME - _ZN18CMusEngLiveSession4NewLERK7TDesC16RK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngLiveSessionObserverj @ 47 NONAME - _ZN18CMusEngLiveSession5PlayLEv @ 48 NONAME - _ZN18CMusEngLiveSession6PauseLEv @ 49 NONAME - _ZN18CMusEngLiveSession7RecordLEi @ 50 NONAME - _ZN18CMusEngLiveSession7ZoomInLEv @ 51 NONAME - _ZN18CMusEngLiveSession8SetZoomLEi @ 52 NONAME - _ZN18CMusEngLiveSession8ZoomOutLEv @ 53 NONAME - _ZN20CMusEngMceOutSession13CancelInviteLEv @ 54 NONAME - _ZN20CMusEngMceOutSession27SetSupportedVideoCodecListLERK7TDesC16 @ 55 NONAME - _ZN20CMusEngMceOutSession7InviteLERK7TDesC16 @ 56 NONAME - _ZN21CMusEngReceiveSession17AcceptInvitationLERKi @ 57 NONAME - _ZN21CMusEngReceiveSession4NewLERK5TRectR22MMusEngSessionObserverR29MMusEngReceiveSessionObserver @ 58 NONAME - _ZNK14CMusEngSession20IsLoudSpeakerEnabledEv @ 59 NONAME - _ZNK14CMusEngSession4RectEv @ 60 NONAME - _ZNK14CMusEngSession7VolumeLEv @ 61 NONAME - _ZNK17CMusEngMceSession14GetSessionTimeEv @ 62 NONAME - _ZNK17CMusEngMceSession16ConnectionActiveEv @ 63 NONAME - _ZNK18CMusEngLiveSession12CurrentZoomLEv @ 64 NONAME - _ZNK18CMusEngLiveSession14MaxBrightnessLEv @ 65 NONAME - _ZNK18CMusEngLiveSession14MinBrightnessLEv @ 66 NONAME - _ZNK18CMusEngLiveSession14SetBrightnessLEi @ 67 NONAME - _ZNK18CMusEngLiveSession18CurrentBrightnessLEv @ 68 NONAME - _ZNK18CMusEngLiveSession8MaxZoomLEv @ 69 NONAME - _ZNK18CMusEngLiveSession8MinZoomLEv @ 70 NONAME - _ZTI14CMusEngSession @ 71 NONAME ; ## - _ZTI17CMusEngMceSession @ 72 NONAME ; ## - _ZTI18CMusEngClipSession @ 73 NONAME ; ## - _ZTI18CMusEngLiveSession @ 74 NONAME ; ## - _ZTI20CMusEngMceOutSession @ 75 NONAME ; ## - _ZTI21CMusEngReceiveSession @ 76 NONAME ; ## - _ZTI21CMusEngTelephoneUtils @ 77 NONAME ; ## - _ZTI21CMusSipProfileHandler @ 78 NONAME ; ## - _ZTI27CMusEngSessionDurationTimer @ 79 NONAME ; ## - _ZTV14CMusEngSession @ 80 NONAME ; ## - _ZTV17CMusEngMceSession @ 81 NONAME ; ## - _ZTV18CMusEngClipSession @ 82 NONAME ; ## - _ZTV18CMusEngLiveSession @ 83 NONAME ; ## - _ZTV20CMusEngMceOutSession @ 84 NONAME ; ## - _ZTV21CMusEngReceiveSession @ 85 NONAME ; ## - _ZTV21CMusEngTelephoneUtils @ 86 NONAME ; ## - _ZTV21CMusSipProfileHandler @ 87 NONAME ; ## - _ZTV27CMusEngSessionDurationTimer @ 88 NONAME ; ## - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/group/bld.inf --- a/mmsharing/mmshengine/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include - -PRJ_MMPFILES -musengine.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/group/musengine.mmp --- a/mmsharing/mmshengine/group/musengine.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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 "../../../inc/musuid.hrh" - -// Capability assignment. -CAPABILITY CAP_GENERAL_DLL - -// 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 musengreceivesession.cpp -SOURCE musengtelephoneutils.cpp -SOURCE musengsessiondurationtimer.cpp -SOURCE musengclipsession.cpp -SOURCE musenguriparser.cpp -SOURCE musengmceutils.cpp - -// SIP API -SOURCE mussipprofilehandler.cpp - - -USERINCLUDE ../inc -USERINCLUDE ../../mmshshared/inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc - -APP_LAYER_SYSTEMINCLUDE - -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 efsrv.lib - -DEBUGLIBRARY flogger.lib - -PAGED diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengaudioroutingobserver.h --- a/mmsharing/mmshengine/inc/musengaudioroutingobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengclipsession.h --- a/mmsharing/mmshengine/inc/musengclipsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +0,0 @@ -/* -* 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 CMusEngClipSession : public CMusEngMceOutSession - { - MUS_UNITTEST( UT_CMusEngClipSession ) - - public: - - /** - * - */ - IMPORT_C static CMusEngClipSession* NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - TUint aSipProfileId = 0 ); - - /** - * - */ - ~CMusEngClipSession(); - - - public: // new API - - /** - * Sets file to be shared during session. - * @pre File cannot be DRM protected - * @post InviteL can be called - * @leave One of the system wide error codes - * @param aFileName Name of the file to be shared - */ - IMPORT_C void SetClipL( const TDesC& aFileName ); - - /** - * Starts or stops fast forwarding the clip. Clip is left paused after - * stopping the fast forwarding. - * @pre Session is ongoing - * @param aUseFFWD ETrue to start FFWD, EFalse to stop it. - */ - IMPORT_C void FastForwardL( TBool aUseFFWD ); - - /** - * Starts or stops fast rewinding the clip. Clip is left paused after - * stopping the fast rewinding. - * @pre Session is ongoing - * @param aUseFRWD ETrue to start FRWD, EFalse to stop it. - */ - IMPORT_C void FastRewindL( TBool aUseFRWD ); - - /** - * Returns current position as time interval. - */ - IMPORT_C TTimeIntervalSeconds PositionL(); - - /** - * Returns duration of current clip as time interval - */ - IMPORT_C TTimeIntervalSeconds DurationL(); - - /** - * - */ - IMPORT_C void SetPositionL (const TTimeIntervalSeconds &aPosition); - - /** - * Starts transcoding of file. After the transcoding is complete, - * file to be shared is changed into the transcoded file. - * @pre MMusEngClipSessionObserver::TranscodingNeeded is called - * @param aFileName Name of the transcoding output file. - */ - IMPORT_C void TranscodeL( const TFileName& aFileName ); - - /** - * Cancels transcoding of file. - * @pre TranscodeL has been called succesfully and transcoding - * is not completed - */ - IMPORT_C void CancelTranscodeL(); - - - public: // implementation of virtual API from CMusEngMceOutSession - - /** - * Resumes previously paused session. - * Continues showing file on display, resumes clip's audio, continues - * playing file and enables streaming to network. - * @leave KErrNotReady if called during FFWD or FRWD - */ - IMPORT_C void PlayL(); - - /** - * Pauses session. - * Holds display, mutes clip's audio, pauses file and - * disables all streaming to network. - * @leave KErrNotReady if called during FFWD or FRWD - */ - IMPORT_C void PauseL(); - - /** - * Tells whether session is paused or not - */ - IMPORT_C TBool IsPlayingL(); - - - 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( MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - const TRect& aRect ); - - /** - * @leave KErrPermissionDenied if file is DRM protected - */ - void ConstructL( TUint aSipProfileId ); - - - private: // HELPERS - - /** - * - */ - TBool IsProtectedFileL( const TDesC& aClipFile ); - - void AddAmrCodecL( CMceAudioStream& aAudioStream ); - - void AddVideoCodecL( CMceVideoStream& aVideoStream ); - - TBool HasClipEnded(); - - /** - * Returns current position as microseconds. - * @param aActualPosition ETrue if actual position is wanted, EFalse - * if buffering time is taken in count. - */ - TTimeIntervalMicroSeconds PositionMicroSecondsL( TBool aActualPosition = EFalse ); - - /** - * Constructs audio stream structure during session completion and adds - * it to session. - * @param aLocalBundle All local streams are supposed to be added to - * this bundle - * @pre iSession != NULL - */ - void ConstructAudioStructureL( CMceStreamBundle& aLocalBundle ); - - void DetermineBufferingPeriod( CMceMediaStream& aStream ); - - TTimeIntervalMicroSeconds GetVideoSinkRelativeFilePos( - const TTimeIntervalMicroSeconds& aActualPosition, - const TTimeIntervalMicroSeconds& aDuration ); - - TBool IsH264Supported() const; - - private: // Data - - /** - * Reference to live session observer interface. - */ - MMusEngClipSessionObserver& iClipSessionObserver; - - TFileName iFileName; - - TBool iTranscodingOngoing; - - TTime iFFWDStartTime; - TTime iFRWDStartTime; - - TTime iBufferingStartedTime; - TTimeIntervalMicroSeconds iBufferingPeriod; - - TTimeIntervalMicroSeconds iDelayFileEndingPos; - TTimeIntervalMicroSeconds iPreviousPos; - TBool iClipEnded; - - TFileName iTranscodingDestFileName; - TBool iRewindedToBeginning; - - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengclipsessionobserver.h --- a/mmsharing/mmshengine/inc/musengclipsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musenglivesession.h --- a/mmsharing/mmshengine/inc/musenglivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,415 +0,0 @@ -/* -* 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" - -// SYSTEM -#include - -// FORWARD DECLARATIONS -class MMusEngLiveSessionObserver; - -class CMusEngLiveSession : public CMusEngMceOutSession - { - MUS_UNITTEST( UT_CMusEngOutSession ) - MUS_UNITTEST( UT_CMusEngLiveSession ) - - 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 - * @param aSipProfileId SIP profile to be used, 0 is default profile - * @return CMusEngLiveSession* New instanse of specified class - */ - IMPORT_C static CMusEngLiveSession* NewL( - const TDesC& aFileName, - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - TUint aSipProfileId = 0); - - /** - * 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 - * @param aSipProfileId SIP profile to be used, 0 is default profile - * @return CMusEngLiveSession* New instanse of specified class - */ - IMPORT_C static CMusEngLiveSession* NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - TUint aSipProfileId = 0 ); - - - public: - - /** - * Destructor - */ - ~CMusEngLiveSession(); - - - - public: // NEW LIVE SESSION SPECIFIC API FUNCTIONS - - /** - * 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(); - - /** - * Starts or pauses recording - */ - IMPORT_C void RecordL( TBool aRecord ); - - /** - * Tells whether recording is paused or not - */ - IMPORT_C TBool IsRecording(); - - - public: // implementation of virtual API from CMusEngMceOutSession - - /** - * 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(); - - - protected: // inherited from CMusEngMceOutSession - - /** - * @param aLocalBundle All local streams are supposed to be added to - * this bundle - */ - void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); - - - private: // 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 ); - - /** - * 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 ); - - - private: // 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 ); - - - private: - - /** - * Constructor - */ - CMusEngLiveSession( MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - const TRect& aRect, - const TDesC& aRecordedFile = KNullDesC ); - - /** - * Second-phase constructor - */ - void ConstructL( TUint aSipProfileId ); - - - private: // Helpers - - /** - * 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; - - - /** - * Calculate the zoom step size based time escaped. - * - * @param aTime, start time. pass iZoomInTime or iZoomOutTime as parameter - * @return TInt, return calculate result of the step size - */ - TInt ZoomStepSize( TInt64& aTime ); - - /** - * Calculates iMinZoomStep and iMaxZoomStep zoom step sizes, - * should be called before first ZoomIn()/ZoomOut() call - */ - void InitializeZoomStepSize(); - - - private: - - /** - * Reference to live session observer interface. - */ - MMusEngLiveSessionObserver& iLiveSessionObserver; - - /** - * - */ - TCameraInfo iCameraInfo; - - /** - * - */ - TInt iDefaultZoomFactor; - - /** - * - */ - TInt iDefaultBrightness; - - /** - * File name for recording. If KNullDesC no recording performed. - */ - TFileName iRecordedFile; - - /** - * If true, configuration key of current AVC codec must be written to - * CenRep after session establishment. - */ - TBool iStoreEncoderConfigInfo; - - /** - * latest Zoomin time - */ - - TInt64 iZoomInTime; - - /** - * latest Zoomout time - */ - TInt64 iZoomOutTime; - - /** - * - */ - TInt iSmallZoomStep; - - /** - * - */ - TInt iBigZoomStep; - - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musenglivesessionobserver.h --- a/mmsharing/mmshengine/inc/musenglivesessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musenglogger.h --- a/mmsharing/mmshengine/inc/musenglogger.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengmceoutsession.h --- a/mmsharing/mmshengine/inc/musengmceoutsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* 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 MMusEngOutSessionObserver; -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: // NEW API FUNCTIONS - - /** - * Sends invite to specified address. Session establishment is done in - * pause mode meaning that no RTP will be sent to network as a - * consequence of established session. PlayL() can be called any time - * during session establishment or after that in order to allow - * RTP sending. - * @leave KErrAlreadyExists if session establishment is already - * in progress - */ - IMPORT_C void InviteL( const TDesC& aRecipient ); - - /** - * Cancels Invite. - * @pre Invite is sent - */ - IMPORT_C void CancelInviteL( ); - - /** - * If codecs supported by recipient are known e.g. because of OPTIONS - * query, they can be communicated to engine via this function - * @param aVideoCodecs Comma separated list of supported codecs - */ - IMPORT_C void SetSupportedVideoCodecListL( const TDesC& aVideoCodecs ); - - - public: // VIRTUAL API - - /** - * Resumes previously paused session. Exact behavior depends on - * exact session type. - */ - virtual void PlayL() = 0; - - /** - * Pauses session. Exact behavior depends on exact session type. - */ - virtual void PauseL() = 0; - - /** - * Tells whether session is paused or not - * @pre Call of InviteL has been completed - */ - virtual TBool IsPlayingL() = 0; - - - 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; - - - 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(); - - - 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 ); - - /** - * 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( const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver ); - - /** - * Second-phase constructor - */ - void ConstructL( TUint aSipProfileId ); - - - private: - - /** - * - */ - void CreateMceSessionStructureL(); - - /** - * Add privacy sip header if call privacy is switched on else otherwise. - */ - void AddPrivacyHeaderL( CDesC8Array& aHeaders ); - - - protected: // DATA - - /** - * Callback reference to outsession observer interface. - */ - MMusEngOutSessionObserver& iOutSessionObserver; - - /** - * ETrue if operator specific behavior is expected - */ - TBool iPrivate; - - /** - * ETrue if private number is turn on - */ - TBool iPrivateNumber; - - - protected: // DATA - - /** - * Recipient of session to be constructed - */ - HBufC8* iRecipient; - - HBufC8* iVideoCodecList; - - - private: - - MUS_UNITTEST ( UT_CMusEngOutSession ) - - }; -#endif //MUSHENGMCESESSION_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengmcesession.h --- a/mmsharing/mmshengine/inc/musengmcesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,586 +0,0 @@ -/* -* 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 "musengsessiondurationtimerobserver.h" -#include "musunittesting.h" -#include "mussipprofileuser.h" - -// SYSTEM -#include -#include -#include -#include -#include - -class CMceManager; -class CMceSession; -class CMceVideoStream; -class CMceAudioStream; -class CMceVideoCodec; -class CMceAudioCodec; -class CMusEngSessionDurationTimer; -class MMusEngSessionObserver; -class CMusSipProfileHandler; - -// 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( KMusPPreferredIdentity, "P-Preferred-Identity" ); -_LIT8( KMusPrivacyHeader, "Privacy" ); -_LIT8( KMusAnonymousHeader, "\"Anonymous\" " ); - -const TInt KMusEngMaxVolume = 10; -const TInt KMusEngMinVolume = 0; - -// 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 MMceSessionObserver, - public MMceInSessionObserver, - public MMceStreamObserver, - public MMceRtpObserver, - public MMusEngSessionDurationTimerObserver, - public MMusSipProfileUser - { - - public: - - /* - * Defines possible rotations - */ - enum TDisplayOrientation - { - EPortrait, // Normal - ELandscape // 90 degree's clockwise rotation - }; - - public: - - /** - * Destructor - */ - ~CMusEngMceSession(); - - - public: // API FUNCTIONS - - /** - * Terminates session. - * - * @pre Session is established - * @post Session is ready to be deleted - * @leave KErrNotReady if precondition is not fullfilled - */ - IMPORT_C void TerminateL(); - - /** - * Get session time return estabilished session time - * - * @return TTime returns time if connection established else < 0 - */ - IMPORT_C TTimeIntervalSeconds GetSessionTime() const; - - /** - * Returns current connection state - * - * @return TBool returns current connection state - */ - IMPORT_C TBool ConnectionActive() const; - - /** - * Returns presence or absence of audio in session. - * - * @pre Session is ongoing - * @return ETrue if session contains audio. - * @leave KErrNotReady if precondition is not fullfilled - */ - IMPORT_C TBool ContainsAudioL(); - - /** - * Returns state of local playback meaning if playback is muted or not. - * - * @pre Session is ongoing - * @return ETrue if session does not contain audio or contained - * audio is muted. - * @leave KErrNotReady if precondition is not fullfilled - */ - IMPORT_C TBool IsMutedL(); - - /** - * Returns current display orientation. - * - * @pre Session is ongoing - * @return Current display orientation - * @leave KErrNotReady if precondition is not fullfilled - */ - IMPORT_C TDisplayOrientation OrientationL(); - - /** - * Sets display orientation. - * - * @pre Session is ongoing - * @return Sets display orientation - * @leave KErrNotReady if precondition is not fullfilled - */ - IMPORT_C void SetOrientationL( TDisplayOrientation aOrientation ); - - - public: // VIRTUAL API - - // No virtual api - - - public: // from CMusEngSession - - /** - * Increases volume level by one - * - * @pre Session is ongoing - */ - IMPORT_C void VolumeUpL(); - - /** - * Decreases volume level by one - * - * @pre Session is ongoing - */ - IMPORT_C void VolumeDownL(); - - /** - * Set volume value - * @pre Session is ongoing - * @param aVal the value of volume - */ - IMPORT_C void SetVolumeL( TInt aVal ); - - /** - * Permission to draw on screen device. - * - * @pre Session is ongoing - */ - IMPORT_C void EnableDisplayL( TBool aEnable ); - - /** - * Implements virtual from CMusEngSession - * - * @pre Session is ongoing - */ - IMPORT_C void MuteL(); - - /** - * Implements virtual from CMusEngSession - * - * @pre Session is ongoing - */ - IMPORT_C void UnmuteL(); - - - protected: // CONSTRUCTORS - - /** - * Constructor - * - */ - CMusEngMceSession( const TRect& aRect, - MMusEngSessionObserver& aSessionObserver ); - - /** - * 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 ); - - /** - * 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 ); - - - protected: // HELPER FUNCTIONS - - /** - * - */ - void RectChangedL(); - - /** - * 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 ); - - - 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 - - TBool IsRoamingBetweenAPsAllowed(); - - private: // HELPER FUNCTIONS - - /** - * 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 ); - /** - * This function currently used to remove the AVC codec support based on - * cenrep encoder device uid value. - */ - void DoCodecConfigurationBasedRemovalL( CMceVideoStream& aVideoStream ); - - - protected: // MEMBERS - - /** - * Callback reference to session observer interface. - */ - MMusEngSessionObserver& iSessionObserver; - - /** - * 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; - - private: - - /** - * 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; - - - MUS_UNITTEST( UT_CMusEngSession ) - MUS_UNITTEST( UT_CMusEngMceSession ) - MUS_UNITTEST( UT_CMusEngReceiveSession ) - }; - -#endif //MUSHENGMCESESSION_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengmceutils.h --- a/mmsharing/mmshengine/inc/musengmceutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* 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 - - -class CMceSession; -class CMceDisplaySink; -class CMceCameraSource; -class CMceFileSource; -class CMceVideoStream; -class CMceSpeakerSink; - - -/** -* 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 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. Ownership is not transferred. - * - * @return Media sink of the spesified type. NULL if none exists - */ - static CMceMediaSink* GetMediaSink( CMceMediaStream& aStream, - TMceSinkType aType ); - - /** - * Gets handle to a media sink of spesified type contained by - * a mediastream. If there are several sink instances, first one 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 ); - - /** - * Gets handle to a media sink of spesified type contained by - * a session. If there are several sink instances, first one is - * returned. Ownership is not transferred. - * - * @return Media sink of the spesified type. NULL if none exists - */ - static CMceMediaSink* GetMediaSink( CMceSession& aSession, - TMceSinkType aType ); - - /** - * Gets handle to a media sink of spesified type contained by - * a session. If there are several sink instances, first one 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 ); - - /** - * 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 ); - - /** - * Gets handle to a display sink. If there are several display - * sink instances, first one is returned. - * Ownership is not transferred. - * - * @return Display sink - * @leave KErrNotFound if there is no display - */ - static CMceDisplaySink* GetDisplayL( 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 ); - - }; - - -#endif // MUSENGMCEUTILS_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengoutsessionobserver.h --- a/mmsharing/mmshengine/inc/musengoutsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 - -// 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 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 - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengreceivesession.h --- a/mmsharing/mmshengine/inc/musengreceivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ -/* -* 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 - - - -#include "musengmcesession.h" -#include "musenguriparser.h" -#include "musunittesting.h" - -#include - -class MMusEngReceiveSessionObserver; -class CMceInSession; - -class CMusEngReceiveSession : public CMusEngMceSession - { - MUS_UNITTEST( UT_CMusEngMceSession ) - MUS_UNITTEST( UT_CMusEngReceiveSession ) - - 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 - */ - IMPORT_C static CMusEngReceiveSession* NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngReceiveSessionObserver& aReceiveSessionObserver ); - /** - * Destructor - * - * @since S60 v3.2 - */ - ~CMusEngReceiveSession(); - - - public: // API - - /** - * Accept or deny processed invitation - * - * @param aAccept ETrue if session is to be accepted and EFalse if - * to be rejected. - */ - IMPORT_C void AcceptInvitationL(const TBool& aAccept); - - - private: // 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 ); - - /** - * 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 ); - - - private: // 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 ); - - - private: // 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 ); - - - private: // CONSTRUCTORS - - CMusEngReceiveSession( - MMusEngSessionObserver& aSessionObserver, - MMusEngReceiveSessionObserver& aReceiveSessionObserver, - const TRect& aRect ); - - void ConstructL(); - - private: // HELPERS - - CMceInSession* InSession(); - - void PrepareToRequire100RelL( - TMceTransactionDataContainer* aContainer); - - 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 ); - - private: // DATA - - MMusEngReceiveSessionObserver& iReceiveSessionObserver; - - // Set to ETrue if CMceInSession::RingL has already been called - TBool iRingLCalled; - - // identity of originator parsed form P-Asserted-Identity field - TBuf8 iIdentity; - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengreceivesessionobserver.h --- a/mmsharing/mmshengine/inc/musengreceivesessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengsession.h --- a/mmsharing/mmshengine/inc/musengsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* 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 - -// USER INCLUDES -#include "musunittesting.h" - -//SYSTEM INCLUDES -#include - - -// FORWARD DECLARATIONS -class CMusEngTelephoneUtils; -class CMusSipProfileHandler; -class CRepository; -class MMusEngAudioRoutingObserver; - -// 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 - { - MUS_UNITTEST( UT_CMusEngSession ) - - public: - - /** - * Desctructor, finalize session - * - */ - ~CMusEngSession(); - - - public: // API FUNCTIONS - - /** - * Returns currently assigned drawing area - * - * @return TRect This session drawing area recttangle - */ - IMPORT_C TRect Rect() const; - - /** - * Sets new drawing area - * - * @param TRect This session new drawing area rectangle - */ - IMPORT_C void SetRectL( const TRect& aRect ); - - /** - * Checks if audio routing can be changed using EnableLoudspeakerL - * - * @return ETrue if audio routing can be changed using EnableLoudspeakerL - */ - IMPORT_C TBool AudioRoutingCanBeChanged(); - - /** - * Activates/deactivates loadspeaker - * - * @param TBool Enable or disable loudspeaker - * @param TBool Show activation dialog - */ - IMPORT_C void EnableLoudspeakerL( TBool aEnable, TBool aShowDialog ); - - /** - * Checks is loudspeaker enabled or disabled. - * - * @return TBool true if enabled - */ - IMPORT_C TBool IsLoudSpeakerEnabled() const; - - /** - * Returns current volume level - */ - IMPORT_C TInt VolumeL() const; - - /** - * Mutes CS call microphone. - */ - IMPORT_C void MuteMicL( TBool aMute ); - - /** - * Returns current CS call mic mute state. - */ - IMPORT_C TBool IsMicMutedL(); - - /** - * Sets audio routing observer. Can be set to NULL in order to indicate - * ending of observing changes in audio routing. - */ - IMPORT_C void SetAudioRoutingObserver( - MMusEngAudioRoutingObserver* aObserver ); - - - public: // VIRTUAL API FUNCTIONS - - /** - * Increases volume level by one. - */ - IMPORT_C virtual void VolumeUpL(); - - /** - * Decreases volume level by one. - */ - IMPORT_C virtual void VolumeDownL(); - - /** - * Set volume value - * @param aVal the value of volume - */ - IMPORT_C virtual void SetVolumeL( TInt aVal ); - - /** - * 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; - - /** - * Mutes current audio stream meaning that any audio is not played or - * sent to network. - */ - virtual void MuteL() = 0; - - /** - * Unmute current audio stream meaning that all the audio is played - * and if needed also sent to network. - */ - virtual void UnmuteL() = 0; - - - protected: // INTERNAL - - virtual void RectChangedL() = 0; - - - protected: - - /** - * Constructor, private cannot be instantiate - * - * @param aRect reserved drawing area for this session - */ - CMusEngSession( const TRect& aRect ); - - - protected: - - /** - * second-phase constructor, called by those session specific - * constructors - */ - void ConstructL(); - - - private: // MEMBERS - - /** - * Drawing area rect. - */ - TRect iRect; - - /** - * Telephone utilities. - */ - CMusEngTelephoneUtils* iTelephoneUtils; - - }; - -#endif //MUSENGSESSION_H \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengsessiondurationtimer.h --- a/mmsharing/mmshengine/inc/musengsessiondurationtimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengsessiondurationtimerobserver.h --- a/mmsharing/mmshengine/inc/musengsessiondurationtimerobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengsessionobserver.h --- a/mmsharing/mmshengine/inc/musengsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musengtelephoneutils.h --- a/mmsharing/mmshengine/inc/musengtelephoneutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/musenguriparser.h --- a/mmsharing/mmshengine/inc/musenguriparser.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 - */ - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/mussipprofilehandler.h --- a/mmsharing/mmshengine/inc/mussipprofilehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* 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 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(); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/inc/mussipprofileuser.h --- a/mmsharing/mmshengine/inc/mussipprofileuser.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef 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; - }; - - -#endif // MUSSIPPROFILEUSER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengclipsession.cpp --- a/mmsharing/mmshengine/src/musengclipsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1078 +0,0 @@ -/* -* 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 "musengclipsessionobserver.h" -#include "musengsessionobserver.h" -#include "musengmceoutsession.h" -#include "musenglivesession.h" -#include "musengmceutils.h" -#include "musenglogger.h" - -// SYSTEM -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// CONSTANTS - -const TInt64 KMicroSecondsInOneSecond = 1000000; -const TInt KMusEngAmrBitRate = KMceAmrNbBitrate475; -const TUint KMusEngAllowedAmrBitrates = KMceAllowedAmrNbBitrate475; - -const TInt KFastWindingFactor = 4; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngClipSession* CMusEngClipSession::NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - TUint aSipProfileId ) - { - CMusEngClipSession* self = new( ELeave ) CMusEngClipSession( - aSessionObserver, - aOutSessionObserver, - aClipSessionObserver, - aRect ); - CleanupStack::PushL( self ); - self->ConstructL( aSipProfileId ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngClipSession::~CMusEngClipSession() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::~CMusEngClipSession()" ) - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::~CMusEngClipSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::SetClipL( const TDesC& aFileName ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::SetClipL(...)" ) - - __ASSERT_ALWAYS( !IsProtectedFileL( aFileName ), - User::Leave( KErrPermissionDenied ) ); - - if ( iSession ) - { - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - file->UpdateL( aFileName ); - } - - iFileName = aFileName; - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::SetClipL(...)" ) - - } - - -// ----------------------------------------------------------------------------- -// 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. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::FastForwardL( TBool aUseFFWD ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngClipSession::FastForward(%d)", aUseFFWD ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - 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 ) - { - FastRewindL( 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 ) ); - MUS_LOG( " SetPositionL returned without error " ) - - // Reset timer - iFFWDStartTime = TTime( 0 ); - } - - MUS_LOG1( "mus: [ENGINE] <- CMusEngClipSession::FastForward(%d)", aUseFFWD ) - } - - -// ----------------------------------------------------------------------------- -// 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. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::FastRewindL( TBool aUseFRWD ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngClipSession::FastRewind(%d)", aUseFRWD ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - 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 ) - { - FastForwardL( 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 ) ); - MUS_LOG( " SetPositionL returned without error " ) - - // Reset timer - iFRWDStartTime = TTime( 0 ); - } - - MUS_LOG1( "mus: [ENGINE] <- CMusEngClipSession::FastRewind(%d)", aUseFRWD ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalSeconds CMusEngClipSession::PositionL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::PositionL()" ) - - TTimeIntervalMicroSeconds currentPosition = PositionMicroSecondsL(); - - MUS_LOG1( "mus: [ENGINE] <- CMusEngClipSession::PositionL(), pos:%d", - currentPosition.Int64() ) - return TTimeIntervalSeconds( static_cast( - currentPosition.Int64() / KMicroSecondsInOneSecond ) ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalSeconds CMusEngClipSession::DurationL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::DurationL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - TTimeIntervalMicroSeconds duration = file->DurationL(); - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::DurationL()" ) - return TTimeIntervalSeconds( - static_cast( duration.Int64() / KMicroSecondsInOneSecond ) ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::SetPositionL ( - const TTimeIntervalSeconds& aPosition ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngClipSession::SetPositionL (%d)", - aPosition.Int() ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - TTimeIntervalMicroSeconds position( - KMicroSecondsInOneSecond * static_cast(aPosition.Int()) ); - - if ( position == 0 ) - { - iRewindedToBeginning = ETrue; - } - - file->SetPositionL( position ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::SetPositionL ()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::TranscodeL( const TFileName& aFileName ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::TranscodeL(...)" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - const RPointerArray& streams = iSession->Streams(); - - for ( TInt i = 0; i < streams.Count(); ++i ) - { - if ( streams[i]->State() == CMceMediaStream::ETranscodingRequired ) - { - if ( streams[i]->Type() == KMceAudio ) - { - AddAmrCodecL( static_cast( *streams[i] ) ); - } - else - { - AddVideoCodecL( static_cast( *streams[i] ) ); - } - } - } - - file->TranscodeL( aFileName ); - - iTranscodingOngoing = ETrue; - - iTranscodingDestFileName = aFileName; - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::TranscodeL(...)" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::CancelTranscodeL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::CancelTranscodeL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - TRAPD( err, file->CancelTranscodeL() ); - err = err; // Silence warning in UREL build - MUS_LOG1( "mus: [ENGINE] - cancel result %d", err ) - // Even if cancel fails, try to delete the partial clip - - MUS_LOG( "mus: [ENGINE] - delete the partially converted clip" ) - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - - CFileMan* fileMan = CFileMan::NewL( fs ); - CleanupStack::PushL( fileMan ); - - MUS_LOG_TDESC8( "mus: [ENGINE] - trascoding destination filename", - iTranscodingDestFileName ) - err = fileMan->Delete( iTranscodingDestFileName ); - MUS_LOG1( "mus: [ENGINE] - file delete result %d", err ) - - CleanupStack::PopAndDestroy( fileMan ); - CleanupStack::PopAndDestroy(); // fs - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::CancelTranscodeL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::PlayL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::PlayL()" ) - - __ASSERT_ALWAYS( iSession && - iFFWDStartTime.Int64() == 0 && - iFRWDStartTime.Int64() == 0, - User::Leave( KErrNotReady ) ); - - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - if ( !file->IsEnabled() ) - { - file->EnableL(); - - iClipEnded = EFalse; - // No need to enable audio separarely - } - else - { - MUS_LOG( "mus: [ENGINE] File is already enabled, ignore request" ) - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::PlayL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::PauseL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::PauseL()" ) - - __ASSERT_ALWAYS( iSession && - iFFWDStartTime.Int64() == 0 && - iFRWDStartTime.Int64() == 0, - User::Leave( KErrNotReady ) ); - - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - if ( file->IsEnabled() ) - { - file->DisableL(); - - // No need to disable audio separarely - } - else - { - MUS_LOG( "mus: [ENGINE] File is already disabled, ignore request" ) - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::PauseL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngClipSession::IsPlayingL() - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - return ( MusEngMceUtils::GetFileSourceL( *iSession )->IsEnabled() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngClipSession::CompleteSessionStructureL( - CMceStreamBundle& aLocalBundle ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::CompleteSessionStructureL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - __ASSERT_ALWAYS( iFileName != KNullDesC(), 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, - iFileName ); - fileSource->DisableL(); // Start session in pause mode. - videoStream->SetSourceL( fileSource ); - CleanupStack::Pop( fileSource ); - - iSession->AddStreamL( videoStream ); - CleanupStack::Pop( videoStream ); - - ConstructAudioStructureL( aLocalBundle ); - - 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(); - - TBool transcodingRequired = EFalse; - - 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 ) - { - transcodingRequired = ETrue; - } - 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() ) - { - transcodingRequired = ETrue; - MUS_LOG( " -> Removing H264 codec from video stream" ) - videoStream->RemoveCodecL( *codecs[codecIndex] ); - codecIndex = 0; - } - } - - if ( codecs.Count() == 0) - { - // At least one codec should be in the stream list. - MUS_LOG( " -> Adding codec, since codecs list is empty " ) - AddVideoCodecL( *videoStream ); - } - } - } - - if ( transcodingRequired ) - { - iClipSessionObserver.TranscodingNeeded(); - } - else - { - CMusEngMceOutSession::EstablishSessionL(); - // Now session state is right to adjust volume - SetSpeakerVolumeL( VolumeL() ); - } - - 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 ( aStream.State() == CMceMediaStream::ETranscoding ) - { - CMceFileSource* file = static_cast(aStream.Source()); - TInt progressPercentage = 0; - TRAP_IGNORE( progressPercentage = file->TranscodingProgressL() ) - iClipSessionObserver.TranscodingProgressed( progressPercentage ); - } - else if ( aStream.State() == CMceMediaStream::EInitialized ) - { - if ( iTranscodingOngoing ) - { - MUS_LOG( "mus: [ENGINE] Transcoding completed." ) - - // Filename has been updated in MCE side but unfortunately - // there's no getter for the filename in API. - iFileName = iTranscodingDestFileName; - - iTranscodingOngoing = EFalse; - - iClipSessionObserver.TranscodingCompletedInit(); - - TRAPD( error, EstablishSessionL() ) - if ( error != KErrNone ) - { - iSessionObserver.SessionFailed(); - } - - // Next call does not return before session establishment - iClipSessionObserver.TranscodingCompletedFinalize(); - } - } - else if ( aStream.State() == CMceMediaStream::ETranscodingRequired && - iTranscodingOngoing ) - { - MUS_LOG( "mus: [ENGINE] Transcoding failed." ) - - iClipSessionObserver.TranscodingFailed(); - iTranscodingOngoing = EFalse; - } - else if ( HasClipEnded() ) - { - MUS_LOG( "mus: [ENGINE] Clip ended." ) - - iDelayFileEndingPos = 0; - iClipEnded = ETrue; - - iClipSessionObserver.EndOfClip(); - } - else - { - // Cannot handle, forward to the ancestor class - CMusEngMceSession::StreamStateChanged( aStream, aSource ); - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::StreamStateChanged( src )" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngClipSession::CMusEngClipSession( - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngClipSessionObserver& aClipSessionObserver, - const TRect& aRect ) - : CMusEngMceOutSession( aRect, - aSessionObserver, - aOutSessionObserver ), - iClipSessionObserver( aClipSessionObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngClipSession::ConstructL( TUint aSipProfileId ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::ConstructL(...)" ) - - CMusEngMceOutSession::ConstructL( aSipProfileId ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::ConstructL(...)" ) - } - - -// ----------------------------------------------------------------------------- -// Check is file DRM protected. -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngClipSession::IsProtectedFileL( const TDesC& aClipFile ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::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] <- CMusEngClipSession::IsProtectedFileL(...)" ) - return isDRMProtected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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& 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" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngClipSession::HasClipEnded() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::HasClipEnded()" ) - - TBool hasClipEnded = EFalse; - - if ( iSession ) - { - - CMceVideoStream* videoOut = NULL; - - TRAPD( error, - videoOut = MusEngMceUtils::GetVideoOutStreamL( *iSession ) ); - if( error != KErrNone ) - { - MUS_LOG1( "mus: [ENGINE] Error in GetVideoOutStreamL #%d", error ) - return hasClipEnded; - } - - CMceFileSource* filesource = NULL; - TRAP( error, filesource = MusEngMceUtils::GetFileSourceL( *iSession ) ) - - if ( error == KErrNone ) - { - TTimeIntervalMicroSeconds position; - TTimeIntervalMicroSeconds duration; - TRAP( error, position = filesource->PositionL() ); - TRAPD( error1, duration = filesource->DurationL() ); - if ( error != KErrNone || error1 != KErrNone ) - { - return hasClipEnded; - } - - MUS_LOG2( "mus: [ENGINE] position = %Ld, duration = %Ld", - position.Int64(), - duration.Int64() ) - - TRAP( error, hasClipEnded = - ( position.Int64() == 0 && - !filesource->IsEnabled() && - videoOut->State() == CMceMediaStream::EDisabled ) ) - if( hasClipEnded ) - { - MUS_LOG( "mus: [ENGINE] End of clip" ) - } - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::HasClipEnded()" ) - return hasClipEnded; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TTimeIntervalMicroSeconds CMusEngClipSession::PositionMicroSecondsL( - TBool aActualPosition ) - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iSession ); - - 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; - } - - -// ----------------------------------------------------------------------------- -// 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 ) - { - iBufferingPeriod = bufferingPeriod; - } - - MUS_LOG1( "mus: [ENGINE] current buffering period:%d", - iBufferingPeriod.Int64() ) - - iBufferingStartedTime = 0; - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::DetermineBufferingPeriod()" ) - } - -// ----------------------------------------------------------------------------- -// 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 CMusEngClipSession::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 && - !iClipEnded && - 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; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngClipSession::IsH264Supported() const - { - return ( iVideoCodecList && iVideoCodecList->FindF( KMceSDPNameH264() ) >= 0 ); - } - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musenglivesession.cpp --- a/mmsharing/mmshengine/src/musenglivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1124 +0,0 @@ -/* -* 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 "mussettings.h" - -// SYSTEM -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const TInt KMaxBrightness = 100; -const TInt KMinBrightness = -100; -const TInt KBrightnessStepSize = 10; - -// 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, ";" ); - -//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 - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL( - const TDesC& aFileName, - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - TUint aSipProfileId ) - { - CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( - aSessionObserver, - aOutSessionObserver, - aLiveSessionObserver, - aRect, - aFileName ); - CleanupStack::PushL( self ); - self->ConstructL( aSipProfileId ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - TUint aSipProfileId ) - { - CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( - aSessionObserver, - aOutSessionObserver, - aLiveSessionObserver, - aRect ); - CleanupStack::PushL( self ); - self->ConstructL( aSipProfileId ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngLiveSession::~CMusEngLiveSession() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::~CMusEngLiveSession()" ) - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::~CMusEngLiveSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::CurrentZoomL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::CurrentZoomL()" ) - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - - TInt currentZoom = camera->ZoomFactorL() + camera->DigitalZoomFactorL(); - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::CurrentZoomL( %d )", - currentZoom ) - - return currentZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::SetZoomL( TInt aNewZoomFactor ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::SetZoomL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MinZoomL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::MinZoomL( %d )", - iCameraInfo.iMinZoom ) - - return iCameraInfo.iMinZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MaxZoomL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::MaxZoomL( %d )", - maxZoom ) - - return maxZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomInL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] CMusEngLiveSession::ZoomInL(): Optical \ - and digital zoom factors are in maximum value" ) - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ZoomInL()" ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomOutL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] CMusEngLiveSession::ZoomOutL(): Optical and \ - digital zoom factors are in minimum value" ) - camera->SetZoomFactorL( iCameraInfo.iMinZoom ); - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ZoomOutL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomDefaultL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ZoomDefaultL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - - camera->SetZoomFactorL( iDefaultZoomFactor ); - camera->SetDigitalZoomFactorL( 0 ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ZoomDefaultL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::SetBrightnessL( TInt aBrightness ) const - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveSession::SetBrightnessL( %d )", - aBrightness ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - camera->SetBrightnessL( aBrightness ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::SetBrightnessL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::CurrentBrightnessL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::CurrentBrightnessL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - TInt currentBrightness = camera->BrightnessL(); - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::CurrentBrightnessL(): %d", - currentBrightness ) - - return currentBrightness; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MaxBrightnessL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::MaxBrightnessL()" ) - - // maximum brightness is not in camera info, but a constant 100 - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::MaxBrightnessL(): %d", - KMaxBrightness ) - - return KMaxBrightness; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MinBrightnessL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::MinBrightnessL()" ) - - // maximum brightness is not in camera info, but a constant -100 - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::MinBrightnessL(): %d", - KMinBrightness ) - - return KMinBrightness; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::IncreaseBrightnessL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::IncreaseBrightnessL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::DecreaseBrightnessL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::DecreaseBrightnessL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::BrightnessDefaultL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::BrightnessDefaultL()" ) - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - - camera->SetBrightnessL( iDefaultBrightness ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::BrightnessDefaultL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::BrightnessAutoL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::BrightnessAutoL()" ) - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); - - camera->SetBrightnessL( CCamera::EBrightnessAuto ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::BrightnessAutoL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::RecordL( TBool aRecord ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveSession::RecordL( %d )", aRecord ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMceMediaSink* fileSink = MusEngMceUtils::GetMediaSink( *iSession, - KMceFileSink ); - - __ASSERT_ALWAYS( fileSink, User::Leave( KErrNotReady ) ); - - if( aRecord && !fileSink->IsEnabled() ) - { - fileSink->EnableL(); - } - else if ( !aRecord && fileSink->IsEnabled() ) - { - fileSink->DisableL(); - } - else - { - // NOP - } - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::RecordL( %d )", aRecord ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngLiveSession::IsRecording() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::IsRecording()" ) - - TBool isRecording( EFalse ); - - CMceMediaSink* fileSink = MusEngMceUtils::GetMediaSink( *iSession, - KMceFileSink ); - if ( fileSink ) - { - isRecording = fileSink->IsEnabled(); - } - - MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveSession::IsRecording(%d)", - isRecording ) - - return isRecording; - } - - -// ----------------------------------------------------------------------------- -// Enable camera if not already enabled -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::PlayL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::PlayL()" ) - } - - -// ----------------------------------------------------------------------------- -// Disable camera if not already disabled -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::PauseL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::PauseL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngLiveSession::IsPlayingL() - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - return ( MusEngMceUtils::GetCameraL( *iSession )->IsEnabled() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::InitializeZoomStepSize() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::InitializeZoomStepSize()" ) - - 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] <- CMusEngLiveSession::InitializeZoomStepSize()" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::CompleteSessionStructureL( - CMceStreamBundle& /*aLocalBundle*/ ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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 ); - - CMceCameraSource* camera = CMceCameraSource::NewLC( *iManager ); - camera->DisableL(); // Start session in pause mode. - camera->GetCameraInfo( iCameraInfo ); - iDefaultZoomFactor = camera->ZoomFactorL(); - - InitializeZoomStepSize(); - - videoStream->SetSourceL( camera ); - CleanupStack::Pop( camera ); - - iSession->AddStreamL( videoStream ); - CleanupStack::Pop( videoStream ); - - // Construct recording stream if needed - if ( iRecordedFile != KNullDesC ) - { - CMceVideoStream* streamForRecording = CMceVideoStream::NewLC(); - - CMceFileSink* fileSink = CMceFileSink::NewLC( iRecordedFile ); - fileSink->DisableL(); // Start in not recording mode - streamForRecording->AddSinkL( fileSink ); - CleanupStack::Pop( fileSink ); - - streamForRecording->SetSourceL( camera ); - iSession->AddStreamL( streamForRecording ); - CleanupStack::Pop( streamForRecording ); - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::CompleteSessionStructureL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::HandleSessionStateChanged( - CMceSession& aSession, - TInt aStatusCode, - const TDesC8& aReasonPhrase ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::HandleSessionStateChanged" ) - - MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) - - if ( iSession && - iSession == &aSession && - aSession.State() == CMceSession::EEstablished && - 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. - iSessionObserver.SessionFailed(); - } - } - - CMusEngMceSession::HandleSessionStateChanged( aSession, - aStatusCode, - aReasonPhrase ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::HandleSessionStateChanged" ) - } - - -// ----------------------------------------------------------------------------- -// Sets video codec attributes -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::AdjustVideoCodecL()" ) - - CMusEngMceOutSession::AdjustVideoCodecL( aVideoCodec ); - - // 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 ) ); - - SetCodecConfigKeyL( aVideoCodec ); - SetEncodingDeviceL( aVideoCodec ); - } - 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 && - iVideoCodecList->Length() > 0 && - iVideoCodecList->FindF( KMceSDPNameH264 ) == KErrNotFound ) - { - // 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 ) - { - iLiveSessionObserver.DiskFull(); - } - else - { - // Cannot handle, forward to a base class - CMusEngMceSession::StreamStateChanged( aStream, aSink ); - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::StreamStateChanged( sink )" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngLiveSession::CMusEngLiveSession( - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver, - MMusEngLiveSessionObserver& aLiveSessionObserver, - const TRect& aRect, - const TDesC& aRecordedFile ) - : CMusEngMceOutSession( aRect, - aSessionObserver, - aOutSessionObserver ), - iLiveSessionObserver( aLiveSessionObserver ), - iDefaultZoomFactor( -1 ), - iDefaultBrightness( 0 ), - iRecordedFile( aRecordedFile ), - iZoomInTime(0), - iZoomOutTime(0), - iSmallZoomStep( KZoomStepMinSize ), - iBigZoomStep( KZoomStepMinSize ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::ConstructL( TUint aSipProfileId ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ConstructL()" ) - - CMusEngMceOutSession::ConstructL( aSipProfileId ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::SetEncodingDeviceL( CMceVideoCodec& aVideoCodec ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::SetEncodingDeviceL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::SetCodecConfigKeyL( CMceVideoCodec& aVideoCodec ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::SetCodecConfigKeyL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC8* CMusEngLiveSession::ReadCodecConfigKeyL( - const CMceVideoCodec& aVideoCodec ) const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::ReadCodecConfigKeyL()" ) - - return key; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::StoreEncoderConfigInfoL() const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::StoreEncoderConfigInfoL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TPtrC8 CMusEngLiveSession::ConfigKeyIdL( - const CMceVideoCodec& aVideoCodec ) const - { - MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::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] <- CMusEngLiveSession::ConfigKeyIdL()" ) - - return configKeyTokenId; - } - - -// ----------------------------------------------------------------------------- -// Calculate the zoom step based time escaped -// ----------------------------------------------------------------------------- -TInt CMusEngLiveSession::ZoomStepSize( TInt64& aTime ) - { -// MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ZoomStepSize()" ) - 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 ); -// MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ZoomStepSize()" ) - return stepSize; - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengmceoutsession.cpp --- a/mmsharing/mmshengine/src/musengmceoutsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,506 +0,0 @@ -/* -* 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 "musengoutsessionobserver.h" -#include "musenglivesessionobserver.h" -#include "mussettings.h" -#include "musengmceutils.h" -#include "musenguriparser.h" -#include "musenglogger.h" -#include "mussesseioninformationapi.h" -#include "mussipprofilehandler.h" - -// SYSTEM -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - - -const TInt KMusEngSipReasonCodeBadRequest = 400; -const TInt KMusEngSipReasonCodeUnauthorized = 401; -const TInt KMusEngSipReasonCodePaymentRequired = 402; -const TInt KMusEngSipReasonCodeRecipientNotFound = 404; -const TInt KMusEngSipReasonCodeProxyAuthenticationRequired = 407; -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 -// "478 Unresolveable Destination, we were not able to process the URI (478/TM) -const TInt KMusEngSipReasonCode478NotAbleToProcessURI = 478; -// 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; - -using namespace NMusSessionInformationApi; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession::~CMusEngMceOutSession() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::~CMusEngMceOutSession()" ) - - delete iRecipient; - delete iVideoCodecList; - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::~CMusEngMceOutSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceOutSession::InviteL( const TDesC& aRecipient ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::InviteL()") - - 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 ); - } - - } - - MUS_LOG_TDESC( "mus: [ENGINE] CMusEngMceOutSession::InviteL() recipient=", - aRecipient ) - - // delete possibly existing recipient - delete iRecipient; - iRecipient = NULL; - - TMusEngUriParser parser( aRecipient ); - parser.ParseUriL(); - iRecipient = parser.GetUri8L(); - - CreateMceSessionStructureL(); - - EstablishSessionL(); - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::InviteL()") - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceOutSession::CancelInviteL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::CancelInviteL()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - MUS_ENG_LOG_SESSION_STATE( *iSession ) - - if( iSession->State() == CMceSession::EOffering ) - { - MUS_LOG( "mus: [ENGINE] CMceOutSession->CancelL()" ) - static_cast( iSession )->CancelL(); - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::CancelInviteL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceOutSession::SetSupportedVideoCodecListL( - const TDesC& aVideoCodecs ) - { - MUS_LOG_TDESC( "mus: [ENGINE] -> CMusEngMceOutSession::SetSupportedVideoCodecListL: ", - aVideoCodecs ) - - HBufC8* newVideoCodecList = - CnvUtfConverter::ConvertFromUnicodeToUtf8L( aVideoCodecs ); - delete iVideoCodecList; - iVideoCodecList = newVideoCodecList; - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::SetSupportedVideoCodecListL" ) - } - - -// ----------------------------------------------------------------------------- -// 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 ); - } - - /* Add the privacy header if cs call privacy setting is switched on */ - if ( iPrivate && iPrivateNumber ) - { - AddPrivacyHeaderL( *headers ); - } - 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 KMusEngSipReasonCodeBadRequest : - { - iOutSessionObserver.SessionBadRequest(); - break; - } - case KMusEngSipReasonCodeUnauthorized : - { - iOutSessionObserver.SessionUnauthorized(); - break; - } - case KMusEngSipReasonCodePaymentRequired : - { - iOutSessionObserver.SessionPaymentRequired(); - break; - } - case KMusEngSipReasonCodeRecipientNotFound : - //lint -fallthrough - case KMusEngSipReasonCode478NotAbleToProcessURI: - //lint -fallthrough - case KMusEngSipReasonCode479NotAbleToProcessURI: - //lint -fallthrough - case KMusEngSipReasonCodeUnsupportedUriScheme : - { - iOutSessionObserver.SessionRecipientNotFound(); - break; - } - case KMusEngSipReasonCodeProxyAuthenticationRequired : - { - iOutSessionObserver.SessionProxyAuthenticationRequired(); - break; - } - case KMusEngSipReasonCodeRequestTimeout : - { - iOutSessionObserver.SessionRequestTimeOut(); - break; - } - case KMusEngSipReasonCodeUnsupportedMediaType : - //lint -fallthrough - case KMusEngSipReasonCodeNotAcceptableHere: - //lint -fallthrough - case KMusEngSipReasonCodeNotAcceptable: - { - iOutSessionObserver.SessionUnsupportedMediaType(); - break; - } - case KMusEngSipReasonCodeBusyHere : - { - // Operator variant uses 486 to rejection instead of 603 - if ( iOperatorVariant ) - { - iOutSessionObserver.SessionRejected(); - } - else - { - iOutSessionObserver.SessionBusyHere(); - } - break; - } - case KMusEngSipReasonCodeRequestCancelled : - { - iOutSessionObserver.SessionRequestCancelled(); - break; - } - case KMusEngSipReasonCodeDecline : - { - iOutSessionObserver.SessionRejected(); - break; - } - case KMusEngSipReasonCodeTemporarilyNotAvailable : - { - iOutSessionObserver.SessionTemporarilyNotAvailable(); - 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 ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::AdjustVideoCodecL()" ) - - CMusEngMceSession::AdjustVideoCodecL( aVideoCodec ); - - 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()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession::CMusEngMceOutSession( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngOutSessionObserver& aOutSessionObserver ) - : CMusEngMceSession( aRect, aSessionObserver ), - iOutSessionObserver( aOutSessionObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceOutSession::ConstructL( TUint aSipProfileId ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::ConstructL()" ) - - CMusEngMceSession::ConstructL(); - iSipProfileHandler->CreateProfileL( aSipProfileId ); - - // Check if feature specific behavior is expected - iPrivate = ( MultimediaSharingSettings::PrivacySetting()); - - NMusSessionInformationApi::TMusClirSetting clir; - // Ignore RProperty::Get return value.Incase of error it should behave default. - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, - reinterpret_cast( clir ) ); - iPrivateNumber = ( clir == NMusSessionInformationApi::ESendOwnNumber )? EFalse: ETrue; - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceOutSession::CreateMceSessionStructureL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::CreateMceSessionStructureL()" ) - - CSIPProfile* profile = iSipProfileHandler->Profile(); - __ASSERT_ALWAYS( profile != NULL, User::Leave( KErrNotReady ) ); - - // Create session - if ( iPrivate && iPrivateNumber ) - { - HBufC8* originator = KMusAnonymousHeader().AllocLC(); - iSession = CMceOutSession::NewL( *iManager, *profile, *iRecipient, originator ); - CleanupStack::Pop(); - } - else - { - 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 ); - - // 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 ); - - streamForDisplay->SetSourceL( videoOut->Source() ); - - MusEngMceUtils::AddDisplayL( *streamForDisplay, *iManager, Rect() ); - - 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()" ) - } - - -// ----------------------------------------------------------------------------- -// Add Privacy header if own phone number/id should not be sent to remote party -// ----------------------------------------------------------------------------- -// -void CMusEngMceOutSession::AddPrivacyHeaderL( CDesC8Array& aHeaders ) - { - MUS_LOG( "mus: [ENGINE] -> AddPrivacyHeaderL()" ) - _LIT8( KMusPrivacyHeaderValue, "id" ); - CSIPExtensionHeader* header = CSIPExtensionHeader::NewLC( - KMusPrivacyHeader, KMusPrivacyHeaderValue ); - HBufC8* headInText = header->ToTextL(); - MUS_LOG_TDESC8( " mus: [ENGINE] Privacy header : ", headInText->Des() ); - CleanupStack::PopAndDestroy( header ); - CleanupStack::PushL( headInText ); - aHeaders.AppendL( *headInText ); - CleanupStack::PopAndDestroy( headInText ); - MUS_LOG( "mus: [ENGINE] <- AddPrivacyHeaderL()" ) - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengmcesession.cpp --- a/mmsharing/mmshengine/src/musengmcesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1458 +0,0 @@ -/* -* 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 "musengsessionobserver.h" -#include "musengmceutils.h" -#include "musuid.hrh" -#include "musenglogger.h" -#include "musengclipsessionobserver.h" -#include "mussipprofilehandler.h" - -// SYSTEM -#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 ) ) - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession::~CMusEngMceSession() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::~CMusEngMceSession()" ) - delete iSipProfileHandler; - delete iSession; - delete iManager; - delete iUpdateTimer; - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::~CMusEngMceSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::TerminateL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TerminateL()" ) - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - iSession->TerminateL(); - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::TerminateL()" ) - } - - -// ----------------------------------------------------------------------------- -// Returns estabilished session time. If not established return -// value is < 0 -// ----------------------------------------------------------------------------- -// -EXPORT_C 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 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngMceSession::ConnectionActive() const - { - if ( iSession ) - { - return iSession->ConnectionActive(); - } - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngMceSession::ContainsAudioL() - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - for ( TInt i = 0; i < iSession->Streams().Count(); ++i ) - { - if ( iSession->Streams()[i]->Type() == KMceAudio ) - { - return ETrue; - } - } - - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngMceSession::IsMutedL() - { - // Precondition checked in ContainsAudioL - - if ( ContainsAudioL() && !iExplicitlyMuted ) - { - return EFalse; - } - - return ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngMceSession::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; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C 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()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::VolumeUpL() - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMusEngSession::VolumeUpL(); - - SetSpeakerVolumeL( VolumeL() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::VolumeDownL() - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMusEngSession::VolumeDownL(); - - SetSpeakerVolumeL( VolumeL() ); - } - - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::SetVolumeL( TInt aVal ) - { - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - CMusEngSession::SetVolumeL( aVal ); - - SetSpeakerVolumeL( VolumeL() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C 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()") - } - - -// ----------------------------------------------------------------------------- -// Mutes playback of sended audio streams. Audio data is still streamed. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::MuteL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::Mute()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - DoMuteSpeakerL( ETrue ); - - // Mark speaker as explicitly muted instead of muted because of disabling - // bundled display - iExplicitlyMuted = ETrue; - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::Mute()" ) - } - - -// ----------------------------------------------------------------------------- -// Unmutes playback of sended audio streams. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::UnmuteL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::Unmute()" ) - - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - DoMuteSpeakerL( EFalse ); - - // Mark speaker as explicitly unmuted instead of unmuted because of - // enabling bundled display - iExplicitlyMuted = EFalse; - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::Unmute()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession::CMusEngMceSession( const TRect& aRect, - MMusEngSessionObserver& aSessionObserver ) - : CMusEngSession( aRect ), - iSessionObserver( aSessionObserver ), - iSecondsFromLastRtcpReport ( 0 ), - // Although speaker is constructed as muted, it is not explicitly muted - iExplicitlyMuted( EFalse ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::ConstructL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConstructL()" ) - CMusEngSession::ConstructL(); // Base class ConstructL -first - - // Creating new MCE Manager and set all needed observers to this class. - iManager = CMceManager::NewL( TUid::Uid( KMusUiUid ), - &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 ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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()" ) - } - - -// ----------------------------------------------------------------------------- -// Setting session level sdp lines. Bandwith attribute is always used in -// operator variant mode and at receiver side (using force). -// 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. -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::SetSessionSdpLinesL( - CMceSession& aSession, - TBool aForceBandwidthLine ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SetSessionSdpLinesL()" ) - - MDesC8Array* oldSessionSdpLines = aSession.SessionSDPLinesL(); - CleanupDeletePushL( oldSessionSdpLines ); - TBool bandwidthAtSessionLevel( ContainsText( oldSessionSdpLines, - KMusEngSessionSdpLineBandwidthLine() ) ); - CleanupStack::PopAndDestroy( oldSessionSdpLines ); - - 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 ) ) - { - MUS_LOG( "mus: [ENGINE] setting bandwidth to session level" ) - newSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); - } - - aSession.SetSessionSDPLinesL( newSessionSDPLines ); - - CleanupStack::Pop( newSessionSDPLines ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetSessionSdpLinesL()" ) - } - -// ----------------------------------------------------------------------------- -// Setting media level sdp lines. Bandwidth is not set to media level if -// it is used already at session level. -// ----------------------------------------------------------------------------- -// -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() ) ); - CleanupStack::PopAndDestroy( sessionSdpLines ); - - if ( !bandwidthAtSessionLevel && ( iOperatorVariant || aForceBandwidthLine ) ) - { - MUS_LOG( "mus: [ENGINE] setting bandwidth to media level" ) - - //Add media attribute to sdp - const TInt KMusMediaSdpLinesGranularity = 1; - CDesC8Array* headers = - new ( ELeave ) CDesC8ArrayFlat( KMusMediaSdpLinesGranularity ); - CleanupStack::PushL( headers ); - headers->AppendL( KMusEngSessionSdpLineBandwidthField() ); - 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 <= KMusEngMaxVolume ) - { - // MCE might have different scale for volume than MUS - // so adjust MUS volume to MCE scale before setting. - TInt maxVol = speaker->MaxVolumeL(); - TInt setVol = maxVol * aNewVolume / KMusEngMaxVolume; - setVol = Max(setVol, 1); - - MUS_LOG2( -"mus: [ENGINE] -> CMusEngMceSession::SetSpeakerVolumeL() orig:%d, adjusted:%d", -aNewVolume, setVol ); - - if ( setVol <= maxVol ) - { - speaker->SetVolumeL( setVol ); - } - } - } - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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(); - - for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) - { - AdjustVideoCodecL( *codecs[codecIndex] ); - } - - 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 - { - // If streaming stream is complete video out- or instream, inform UI - if ( aStream.Type() == KMceVideo && - aStream.Source() && - aStream.Sinks().Count() >= 0 && - ( aStream.Source()->Type() == KMceRTPSource || - aStream.Sinks()[0]->Type() == KMceRTPSink ) ) - { - iSessionObserver.StreamStreaming(); - } - 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 - iSessionObserver.SessionFailed(); - 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" ) - iSessionObserver.SessionConnectionLost(); - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::\ - SessionConnectionStateChanged()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// - -#if ( defined( _DEBUG ) && !defined( UNIT_TESTING ) ) -void CMusEngMceSession::Failed( CMceSession& aSession, TInt aError ) -#else -void CMusEngMceSession::Failed( CMceSession& aSession, TInt /*aError*/ ) -#endif - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::Failed() error #%d", - aError ) - - if ( iSession && iSession == &aSession ) - { - MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Failed: Notify observer" ) - iSessionObserver.SessionFailed(); - } - - 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 - iSessionObserver.SessionFailed(); - return; - } - - if ( iSession && iSession == &aSession ) - { - MUS_LOG( "mus: [ENGINE] CMusEngMceSession::UpdateFailed: \ - Notify observer" ) - iSessionObserver.SessionFailed(); - } - - 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 ) - { - iSessionObserver.StreamIdle(); - } - - 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::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: - { - MUS_LOG( "mus: [ENGINE] Unexpected asynchronous \ - state transition, consider session as failed." ) - iSessionObserver.SessionFailed(); - break; - } - case CMceSession::EOffering : - { - break; - } - case CMceSession::EIncoming: - { - MUS_LOG( "mus: [ENGINE] Unexpected asynchronous \ - state transition, consider session as failed." ) - iSessionObserver.SessionFailed(); - break; - } - case CMceSession::EReserving : - { - // UpdateL called to incoming session during - // session establishment - break; - } - case CMceSession::EAnswering : // Answering an incoming call - { - break; - } - case CMceSession::EProceeding : - { - break; - } - case CMceSession::EEstablished: - { - // 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 ); - iSessionObserver.SessionEstablished(); - } - - break; - } - case CMceSession::ECancelling: - { - // MCE has for some reason started to cancel session - break; - } - case CMceSession::ETerminating: - { - // MCE has for some reason started to terminate session - 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. - iSessionObserver.SessionTerminated(); - break; - } - case KMusEngSipReasonCodeOk: - { - // Normal session termination by this end: We have sent BYE - // and now received 200 OK to it. - iSessionObserver.SessionTerminated(); - break; - } - default: - { - // Termination reason cannot be determined, handle as internal - // error. - iSessionObserver.SessionFailed(); - break; - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::HandleTermination()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustVideoCodecL()" ) - - aVideoCodec.SetMMFPriorityL( KAudioPrioritySwisPlayback ); - aVideoCodec.SetMMFPriorityPreferenceL( KAudioPrefSwisPlayback ); - MUS_LOG( "mus: [ENGINE] Video MMF priority and preference set" ) - - 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 != NULL ) - { - DoBitrateBasedRemovalL( aVideoStream, *bestBitrateCodec ); - } - - /* Codec removal based on configuration */ - DoCodecConfigurationBasedRemovalL( aVideoStream ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::DoCodecSelectionL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::UpdateTimerEvent() - { - // Update timer is used also to detect RTCP inactivity - ++iSecondsFromLastRtcpReport; - - iSessionObserver.SessionTimeChanged( GetSessionTime() ); - - if ( iSecondsFromLastRtcpReport >= KMusEngRtcpInactivityThreshold ) - { - iSessionObserver.InactivityTimeout(); - // 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::DoCodecConfigurationBasedRemovalL( CMceVideoStream& aVideoStream ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::DoCodecConfigurationBasedRemovalL()" ) - if( MultimediaSharingSettings::IsAvcDisabled()) - { - RPointerArray& codecs = - MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); - TInt codecIndex = 0; - while ( codecIndex < codecs.Count() ) - { - CMceVideoCodec& currentCodec = *codecs[codecIndex++]; - if ( !currentCodec.SdpName().CompareF( KMceSDPNameH264 ) ) - { - MUS_LOG( "mus: [ENGINE] - Removing avc from supported codec list" ) - aVideoStream.RemoveCodecL( currentCodec ); - codecs = MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); - codecIndex = 0; - } - } - } - MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::DoCodecConfigurationBasedRemovalL()" ) - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengmceutils.cpp --- a/mmsharing/mmshengine/src/musengmceutils.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,457 +0,0 @@ -/* -* 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 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 ( streams[i]->Type() == KMceVideo ) - { - CMceMediaSink* rtpSink = MusEngMceUtils::GetMediaSink( - *streams[i], - KMceRTPSink ); - if ( rtpSink ) - { - __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); - - videoOut = static_cast( streams[i] ); - } - - // There is no need to investigate bound stream since - // outstream is always constructed by Mus instead of MCE - } - } - - __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 ) - { - const RPointerArray& sinks = aStream.Sinks(); - for ( TInt i = 0; i < sinks.Count(); ++i ) - { - if ( sinks[i]->Type() == aType ) - { - 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 ) - { - - CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( aStream, aType ); - - __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 ) - { - CMceMediaSink* sink = NULL; - - TRAP_IGNORE( sink = MusEngMceUtils::GetMediaSinkL( aSession, aType ) ) - - return sink; - } - - -// ----------------------------------------------------------------------------- -// Gets handle to a media sink of spesified type contained by a session. -// ----------------------------------------------------------------------------- -// -CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceSession& aSession, - TMceSinkType aType ) - { - CMceMediaSink* sink = NULL; - - const RPointerArray& streams = aSession.Streams(); - - for ( TInt i = 0; i < streams.Count(); ++i ) - { - sink = MusEngMceUtils::GetMediaSink( *streams[i], aType ); - if ( sink ) - { - return sink; - } - - if ( streams[i]->BoundStream() ) - { - sink = MusEngMceUtils::GetMediaSink( streams[i]->BoundStreamL(), - aType ); - if ( sink ) - { - return sink; - } - } - } - - __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 ) - { - MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplay()" ) - MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplay()" ) - return static_cast( - MusEngMceUtils::GetMediaSink( aSession, KMceDisplaySink ) ); - - } - - -// ----------------------------------------------------------------------------- -// Gets handle to a display sink. -// ----------------------------------------------------------------------------- -// -CMceDisplaySink* MusEngMceUtils::GetDisplayL( CMceSession& aSession ) - { - MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplayL()" ) - - CMceDisplaySink* display = MusEngMceUtils::GetDisplay( aSession ); - - __ASSERT_ALWAYS( display, User::Leave( KErrNotFound ) ); - - MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplayL()" ) - return display; - } - - -// ----------------------------------------------------------------------------- -// 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()" ) - } - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengreceivesession.cpp --- a/mmsharing/mmshengine/src/musengreceivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,756 +0,0 @@ -/* -* 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 "mussettings.h" -#include "mussipprofilehandler.h" - -// SYSTEM INCLUDES -#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() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::~CMusEngReceiveSession()" ) - MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::~CMusEngReceiveSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngReceiveSession* CMusEngReceiveSession::NewL( - const TRect& aRect, - MMusEngSessionObserver& aSessionObserver, - MMusEngReceiveSessionObserver& aReceiveSessionObserver ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::NewL(...)" ) - - CMusEngReceiveSession* self = new( ELeave ) CMusEngReceiveSession( - aSessionObserver, - aReceiveSessionObserver, - aRect ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::NewL(...)" ) - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngReceiveSession::AcceptInvitationL( - const TBool& aAccept ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusEngReceiveSession::\ - AcceptInvitationL( %d )", aAccept ) - - __ASSERT_ALWAYS( iSession && iSession->State() == CMceSession::EProceeding, - User::Leave( KErrNotReady ) ); - - // Accept or reject - if ( aAccept ) - { - InSession()->AcceptL(); - } - else - { - 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(); - } - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::\ - AcceptInvitationL(...)" ) - } - - -// ----------------------------------------------------------------------------- -// 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; - - // Notify user - TBuf16 originator; - CnvUtfConverter::ConvertToUnicodeFromUtf8( originator, - iSession->Originator() ); - - TBuf16 identity; - CnvUtfConverter::ConvertToUnicodeFromUtf8( identity, - iIdentity ); - iReceiveSessionObserver.IncomingSession( originator, identity ); - } - 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 ) - { - MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::AdjustVideoCodecL()" ) - - CMusEngMceSession::AdjustVideoCodecL( aVideoCodec ); - - aVideoCodec.SetKeepAliveTimerL( KMusEngRtpKeepAliveTimer ); - 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( KMusEngRtpKeepAliveTimer ); - 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() && - !MultimediaSharingSettings::IsAvcDisabled() ) - { - 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; - } - - iReceiveSessionObserver.IncomingSessionPreNotification(); - - 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 ) - { - iReceiveSessionObserver.StreamBuffering(); - } - else if ( aStream.State() == CMceMediaStream::EStreaming ) - { - CMceRtpSource* rtpSource = - static_cast( aStream.Source() ); - TRAPD( err , - rtpSource->EnableInactivityTimerL( KMusEngInactivityTimer ) ); - if ( err != KErrNone ) - { - MUS_LOG1("mus: [ENGINE] EnableInactivityTimerL Fails %d",err) - iSessionObserver.SessionFailed(); - } - else - { - iSessionObserver.StreamStreaming(); - } - } - else - { - // Cannot handle, forward to CMusEngMceSession - CMusEngMceSession::StreamStateChanged( aStream ); - } - - } - else - { - // Cannot handle, forward to CMusEngMceSession - CMusEngMceSession::StreamStateChanged( aStream ); - } - - MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::StreamStateChanged()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngReceiveSession::CMusEngReceiveSession( - MMusEngSessionObserver& aSessionObserver, - MMusEngReceiveSessionObserver& aReceiveSessionObserver, - const TRect& aRect ) - : CMusEngMceSession( aRect, aSessionObserver ), - iReceiveSessionObserver( aReceiveSessionObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngReceiveSession::ConstructL() - { - MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::ConstructL()" ) - - CMusEngMceSession::ConstructL(); - - MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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( VolumeL() ); - - iSipProfileHandler->CreateProfileL( iSession->Profile() ); - - 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()" ) - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengsession.cpp --- a/mmsharing/mmshengine/src/musengsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +0,0 @@ -/* -* 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 "musengsessionobserver.h" -#include "musengtelephoneutils.h" -#include "muslogger.h" - -// SYSTEM INCLUDES - -#include - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngSession::~CMusEngSession() // destruct - virtual, so no export - { - MUS_LOG( "mus: [ENGINE] -> CMusEngSession::~CMusEngSession()" ) - delete iTelephoneUtils; - MUS_LOG( "mus: [ENGINE] <- CMusEngSession::~CMusEngSession()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TRect CMusEngSession::Rect() const - { - MUS_LOG( "mus: [ENGINE] CMusEngSession::Rect()" ) - return iRect; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::SetRectL( const TRect& aRect ) - { - MUS_LOG( "mus: [ENGINE] CMusEngSession::SetRect()" ) - iRect = aRect; - RectChangedL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngSession::AudioRoutingCanBeChanged() - { - return iTelephoneUtils->AudioRoutingCanBeChanged(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::EnableLoudspeakerL( TBool aEnable, - TBool aShowDialog ) - { - TRAPD( error, iTelephoneUtils->LoudspeakerL( aEnable, aShowDialog ) ) - - 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 - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngSession::IsLoudSpeakerEnabled() const - { - return iTelephoneUtils->IsLoudSpeakerEnabled(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngSession::VolumeL() const - { - return iTelephoneUtils->GetVolumeL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::MuteMicL( TBool aMute ) - { - iTelephoneUtils->MuteMicL( aMute ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngSession::IsMicMutedL() - { - return iTelephoneUtils->IsMicMutedL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::SetAudioRoutingObserver( - MMusEngAudioRoutingObserver* aObserver ) - { - iTelephoneUtils->SetAudioRoutingObserver( aObserver ); - } - - -// ----------------------------------------------------------------------------- -// Increases CS call volume level by one. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::VolumeUpL( ) - { - TInt currentVolume = iTelephoneUtils->GetVolumeL(); - iTelephoneUtils->SetVolumeL( currentVolume + 1 ); - } - - -// ----------------------------------------------------------------------------- -// Decreases CS call volume level by one. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::VolumeDownL( ) - { - TInt currentVolume = iTelephoneUtils->GetVolumeL(); - iTelephoneUtils->SetVolumeL( currentVolume - 1 ); - } - -// ----------------------------------------------------------------------------- -// Set CS call volume value -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::SetVolumeL( TInt aVal ) - { - iTelephoneUtils->SetVolumeL( aVal ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngSession::CMusEngSession( const TRect& aRect ) - :iRect( aRect ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngSession::ConstructL() // second-phase constructor - { - MUS_LOG( "mus: [ENGINE] -> CMusEngSession::ConstructL()" ) - iTelephoneUtils = CMusEngTelephoneUtils::NewL(); - MUS_LOG( "mus: [ENGINE] <- CMusEngSession::ConstructL()" ) - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengsessiondurationtimer.cpp --- a/mmsharing/mmshengine/src/musengsessiondurationtimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musengtelephoneutils.cpp --- a/mmsharing/mmshengine/src/musengtelephoneutils.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -/* -* 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 "musengmcesession.h" -#include "muslogger.h" - -// SYSTEM -#include -#include -#include -#include -#include // for CPhCltCommandHandler - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/musenguriparser.cpp --- a/mmsharing/mmshengine/src/musenguriparser.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -* 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( 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() - { - // Remove leading and trailing whitespaces - 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(); - - // Remove whitespaces and extra chracters like parentheses. Check that the - // rest characters are digits - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/src/mussipprofilehandler.cpp --- a/mmsharing/mmshengine/src/mussipprofilehandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,503 +0,0 @@ -/* -* 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 "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(); - } - CleanupStack::PushL( profile ); - TBool profileRegistered = EFalse; - User::LeaveIfError( profile->GetParameter( KSIPProfileRegistered, - profileRegistered ) ); - CleanupStack::Pop( profile ); - delete iSipProfile; - iSipProfile = profile; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CSIPProfile* CMusSipProfileHandler::Profile() - { - return iSipProfile; - } - -#if 0 //TODO: should this be removed? -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CSIPProfile& CMusSipProfileHandler::SipProfileL( TInt aSipProfileId ) - { - MUS_LOG1( "mus: [ENGINE] -> CMusSipProfileHandler::SipProfileL(),\ - od #%d", aSipProfileId ) - - if ( !iSipProfile ) - { - if ( aSipProfileId != 0 ) - { - iSipProfile = iProfileRegistry->ProfileL( aSipProfileId ); - } - else - { - iSipProfile = iProfileRegistry->DefaultProfileL(); - } - } - - // The parameter val indicates if the profile can be immediately - // used for creating a session, or if the client must wait for - // the profile to be registered. - TBool profileRegistered = EFalse; - - User::LeaveIfError( iSipProfile->GetParameter( KSIPProfileRegistered, - profileRegistered ) ); - - if ( !profileRegistered ) - { - - #if (defined (__WINS__) || defined(__WINSCW__)) - - iProfileRegistry->EnableL( *iSipProfile, *this ); - - User::LeaveIfError( iSipProfile->GetParameter( KSIPProfileRegistered, - profileRegistered ) ); - - if( !profileRegistered ) - { - CActiveScheduler::Start(); - - User::LeaveIfError( iSipProfile->GetParameter( - KSIPProfileRegistered, - profileRegistered ) ); - - if ( !profileRegistered ) - { - User::Leave( KErrNotReady ); - } - } - - #else - - User::Leave( KErrNotReady ); - - #endif - - } - - - MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::SipProfileL()" ) - - return *iSipProfile; - } -#endif - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ) ); - if( !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() ) ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusSipProfileHandler::ProfileRegistryEventOccurred( - TUint32 /*aProfileId*/, - MSIPProfileRegistryObserver::TEvent /*aEvent*/ ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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*/ ) - { - MUS_LOG( "mus: [ENGINE] CMusSipProfileHandler::CSIPServerTransaction") - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/BWINS/ut_musengineU.DEF --- a/mmsharing/mmshengine/tsrc/ut_engine/BWINS/ut_musengineU.DEF Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/eabi/ut_musengineu.def --- a/mmsharing/mmshengine/tsrc/ut_engine/eabi/ut_musengineu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - _ZN11CRepository16StartTransactionENS_16TTransactionModeE @ 2 NONAME - _ZN11CRepository17CommitTransactionERm @ 3 NONAME - _ZN11CRepository3GetEmR5TDes8 @ 4 NONAME - _ZN11CRepository3GetEmR6TDes16 @ 5 NONAME - _ZN11CRepository3GetEmRi @ 6 NONAME - _ZN11CRepository3SetEmRK6TDesC8 @ 7 NONAME - _ZN11CRepository3SetEmRK7TDesC16 @ 8 NONAME - _ZN11CRepository3SetEmi @ 9 NONAME - _ZN11CRepository4NewLE4TUid @ 10 NONAME - _ZN11CRepository5FindLEmmR6RArrayImE @ 11 NONAME - _ZN11CRepository5NewLCE4TUid @ 12 NONAME - _ZN11CRepository6CreateEmRK6TDesC8 @ 13 NONAME - _ZN11CRepository6CreateEmi @ 14 NONAME - _ZN11CRepository6DeleteEmmRm @ 15 NONAME - _ZN11CRepository7FindEqLEmmRK6TDesC8R6RArrayImE @ 16 NONAME - _ZN11CRepositoryD0Ev @ 17 NONAME - _ZN11CRepositoryD1Ev @ 18 NONAME - _ZN11CRepositoryD2Ev @ 19 NONAME - _ZN11CSIPProfileD0Ev @ 20 NONAME - _ZN11CSIPProfileD1Ev @ 21 NONAME - _ZN11CSIPProfileD2Ev @ 22 NONAME - _ZN14CMusEngSession10SetVolumeLEi @ 23 NONAME - _ZN14CMusEngSession11IsMicMutedLEv @ 24 NONAME - _ZN14CMusEngSession11VolumeDownLEv @ 25 NONAME - _ZN14CMusEngSession18EnableLoudspeakerLEii @ 26 NONAME - _ZN14CMusEngSession23SetAudioRoutingObserverEP27MMusEngAudioRoutingObserver @ 27 NONAME - _ZN14CMusEngSession24AudioRoutingCanBeChangedEv @ 28 NONAME - _ZN14CMusEngSession8MuteMicLEi @ 29 NONAME - _ZN14CMusEngSession8SetRectLERK5TRect @ 30 NONAME - _ZN14CMusEngSession9VolumeUpLEv @ 31 NONAME - _ZN15CMceMediaSourceD0Ev @ 32 NONAME - _ZN15CMceMediaSourceD1Ev @ 33 NONAME - _ZN15CMceMediaSourceD2Ev @ 34 NONAME - _ZN16CMceCameraSource11BrightnessLEv @ 35 NONAME - _ZN16CMceCameraSource11ZoomFactorLEv @ 36 NONAME - _ZN16CMceCameraSource12SetContrastLEi @ 37 NONAME - _ZN16CMceCameraSource12SetExposureLEN7CCamera9TExposureE @ 38 NONAME - _ZN16CMceCameraSource13WhiteBalanceLEv @ 39 NONAME - _ZN16CMceCameraSource14SetBrightnessLEi @ 40 NONAME - _ZN16CMceCameraSource14SetZoomFactorLEi @ 41 NONAME - _ZN16CMceCameraSource15SetCameraIndexLEi @ 42 NONAME - _ZN16CMceCameraSource16SetWhiteBalanceLEN7CCamera13TWhiteBalanceE @ 43 NONAME - _ZN16CMceCameraSource18DigitalZoomFactorLEv @ 44 NONAME - _ZN16CMceCameraSource21SetDigitalZoomFactorLEi @ 45 NONAME - _ZN16CMceCameraSource4NewLER11CMceManager @ 46 NONAME - _ZN16CMceCameraSource5NewLCER11CMceManager @ 47 NONAME - _ZN16CMceCameraSource7EnableLEv @ 48 NONAME - _ZN16CMceCameraSource8DisableLEv @ 49 NONAME - _ZN16CMceCameraSource9ContrastLEv @ 50 NONAME - _ZN16CMceCameraSource9ExposureLEv @ 51 NONAME - _ZN16CMceCameraSourceD0Ev @ 52 NONAME - _ZN16CMceCameraSourceD1Ev @ 53 NONAME - _ZN16CMceCameraSourceD2Ev @ 54 NONAME - _ZN16TMusEngUriParser7UriTypeEv @ 55 NONAME - _ZN16TMusEngUriParser8GetUri8LEv @ 56 NONAME - _ZN16TMusEngUriParser9GetUri16LEi @ 57 NONAME - _ZN16TMusEngUriParser9ParseUriLEv @ 58 NONAME - _ZN16TMusEngUriParserC1ERK7TDesC16 @ 59 NONAME - _ZN16TMusEngUriParserC2ERK7TDesC16 @ 60 NONAME - _ZN17CMusEngMceSession10SetVolumeLEi @ 61 NONAME - _ZN17CMusEngMceSession10TerminateLEv @ 62 NONAME - _ZN17CMusEngMceSession11VolumeDownLEv @ 63 NONAME - _ZN17CMusEngMceSession12OrientationLEv @ 64 NONAME - _ZN17CMusEngMceSession14ContainsAudioLEv @ 65 NONAME - _ZN17CMusEngMceSession14EnableDisplayLEi @ 66 NONAME - _ZN17CMusEngMceSession15SetOrientationLENS_19TDisplayOrientationE @ 67 NONAME - _ZN17CMusEngMceSession5MuteLEv @ 68 NONAME - _ZN17CMusEngMceSession7UnmuteLEv @ 69 NONAME - _ZN17CMusEngMceSession8IsMutedLEv @ 70 NONAME - _ZN17CMusEngMceSession9VolumeUpLEv @ 71 NONAME - _ZN18CMusEngClipSession10IsPlayingLEv @ 72 NONAME - _ZN18CMusEngClipSession10TranscodeLERK4TBufILi256EE @ 73 NONAME - _ZN18CMusEngClipSession11FastRewindLEi @ 74 NONAME - _ZN18CMusEngClipSession12FastForwardLEi @ 75 NONAME - _ZN18CMusEngClipSession12SetPositionLERK20TTimeIntervalSeconds @ 76 NONAME - _ZN18CMusEngClipSession16CancelTranscodeLEv @ 77 NONAME - _ZN18CMusEngClipSession4NewLERK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngClipSessionObserverj @ 78 NONAME - _ZN18CMusEngClipSession5PlayLEv @ 79 NONAME - _ZN18CMusEngClipSession6PauseLEv @ 80 NONAME - _ZN18CMusEngClipSession8SetClipLERK7TDesC16 @ 81 NONAME - _ZN18CMusEngClipSession9DurationLEv @ 82 NONAME - _ZN18CMusEngClipSession9PositionLEv @ 83 NONAME - _ZN18CMusEngLiveSession10IsPlayingLEv @ 84 NONAME - _ZN18CMusEngLiveSession11IsRecordingEv @ 85 NONAME - _ZN18CMusEngLiveSession12ZoomDefaultLEv @ 86 NONAME - _ZN18CMusEngLiveSession15BrightnessAutoLEv @ 87 NONAME - _ZN18CMusEngLiveSession18BrightnessDefaultLEv @ 88 NONAME - _ZN18CMusEngLiveSession19DecreaseBrightnessLEv @ 89 NONAME - _ZN18CMusEngLiveSession19IncreaseBrightnessLEv @ 90 NONAME - _ZN18CMusEngLiveSession4NewLERK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngLiveSessionObserverj @ 91 NONAME - _ZN18CMusEngLiveSession4NewLERK7TDesC16RK5TRectR22MMusEngSessionObserverR25MMusEngOutSessionObserverR26MMusEngLiveSessionObserverj @ 92 NONAME - _ZN18CMusEngLiveSession5PlayLEv @ 93 NONAME - _ZN18CMusEngLiveSession6PauseLEv @ 94 NONAME - _ZN18CMusEngLiveSession7RecordLEi @ 95 NONAME - _ZN18CMusEngLiveSession7ZoomInLEv @ 96 NONAME - _ZN18CMusEngLiveSession8SetZoomLEi @ 97 NONAME - _ZN18CMusEngLiveSession8ZoomOutLEv @ 98 NONAME - _ZN19CSIPProfileRegistry4NewLER4CSIPR27MSIPProfileRegistryObserver @ 99 NONAME - _ZN19CSIPProfileRegistry5NewLCER4CSIPR27MSIPProfileRegistryObserver @ 100 NONAME - _ZN19CSIPProfileRegistry7DisableER11CSIPProfile @ 101 NONAME - _ZN19CSIPProfileRegistry7EnableLER11CSIPProfileR22MSIPConnectionObserver @ 102 NONAME - _ZN19CSIPProfileRegistryD0Ev @ 103 NONAME - _ZN19CSIPProfileRegistryD1Ev @ 104 NONAME - _ZN19CSIPProfileRegistryD2Ev @ 105 NONAME - _ZN20CMusEngMceOutSession13CancelInviteLEv @ 106 NONAME - _ZN20CMusEngMceOutSession27SetSupportedVideoCodecListLERK7TDesC16 @ 107 NONAME - _ZN20CMusEngMceOutSession7InviteLERK7TDesC16 @ 108 NONAME - _ZN21CMusEngReceiveSession17AcceptInvitationLERKi @ 109 NONAME - _ZN21CMusEngReceiveSession4NewLERK5TRectR22MMusEngSessionObserverR29MMusEngReceiveSessionObserver @ 110 NONAME - _ZN23CSIPProfileRegistryBase15DefaultProfileLEv @ 111 NONAME - _ZN23CSIPProfileRegistryBase22SupportedProfileTypesLER6RArrayI19TSIPProfileTypeInfoE @ 112 NONAME - _ZN23CSIPProfileRegistryBase8ProfileLEm @ 113 NONAME - _ZN23CSIPProfileRegistryBase9ProfilesLER13RPointerArrayI11CSIPProfileE @ 114 NONAME - _ZN23CSIPProfileRegistryBase9ProfilesLERK19TSIPProfileTypeInfoR13RPointerArrayI11CSIPProfileE @ 115 NONAME - _ZN23CSIPProfileRegistryBase9ProfilesLERK6TDesC8R13RPointerArrayI11CSIPProfileE @ 116 NONAME - _ZN23CSIPProfileRegistryBaseD0Ev @ 117 NONAME - _ZN23CSIPProfileRegistryBaseD1Ev @ 118 NONAME - _ZN23CSIPProfileRegistryBaseD2Ev @ 119 NONAME - _ZN4CSIP28NegotiatedSecurityMechanismLERK6TDesC8 @ 120 NONAME - _ZN4CSIP4NewLERK4TUidR12MSIPObserver @ 121 NONAME - _ZN4CSIP5NewLCERK4TUidR12MSIPObserver @ 122 NONAME - _ZN4CSIPD0Ev @ 123 NONAME - _ZN4CSIPD1Ev @ 124 NONAME - _ZN4CSIPD2Ev @ 125 NONAME - _ZN9DRMCommon10ConstructLEv @ 126 NONAME - _ZN9DRMCommon10DisconnectEv @ 127 NONAME - _ZN9DRMCommon15IsProtectedFileERK7TDesC16Ri @ 128 NONAME - _ZN9DRMCommon4NewLEv @ 129 NONAME - _ZN9DRMCommon7ConnectEv @ 130 NONAME - _ZN9DRMCommonC1Ev @ 131 NONAME - _ZN9DRMCommonC2Ev @ 132 NONAME - _ZN9DRMCommonD0Ev @ 133 NONAME - _ZN9DRMCommonD1Ev @ 134 NONAME - _ZN9DRMCommonD2Ev @ 135 NONAME - _ZNK11CSIPProfile12GetParameterEmRPK11MDesC8Array @ 136 NONAME - _ZNK11CSIPProfile12GetParameterEmRPK6TDesC8 @ 137 NONAME - _ZNK11CSIPProfile12GetParameterEmRi @ 138 NONAME - _ZNK11CSIPProfile12GetParameterEmRm @ 139 NONAME - _ZNK11CSIPProfile4TypeEv @ 140 NONAME - _ZNK14CMusEngSession20IsLoudSpeakerEnabledEv @ 141 NONAME - _ZNK14CMusEngSession4RectEv @ 142 NONAME - _ZNK14CMusEngSession7VolumeLEv @ 143 NONAME - _ZNK15CMceMediaSource4TypeEv @ 144 NONAME - _ZNK15CMceMediaSource9IsEnabledEv @ 145 NONAME - _ZNK16CMceCameraSource13GetCameraInfoER11TCameraInfo @ 146 NONAME - _ZNK16CMceCameraSource16CamerasAvailableEv @ 147 NONAME - _ZNK17CMusEngMceSession14GetSessionTimeEv @ 148 NONAME - _ZNK17CMusEngMceSession16ConnectionActiveEv @ 149 NONAME - _ZNK18CMusEngLiveSession12CurrentZoomLEv @ 150 NONAME - _ZNK18CMusEngLiveSession14MaxBrightnessLEv @ 151 NONAME - _ZNK18CMusEngLiveSession14MinBrightnessLEv @ 152 NONAME - _ZNK18CMusEngLiveSession14SetBrightnessLEi @ 153 NONAME - _ZNK18CMusEngLiveSession18CurrentBrightnessLEv @ 154 NONAME - _ZNK18CMusEngLiveSession8MaxZoomLEv @ 155 NONAME - _ZNK18CMusEngLiveSession8MinZoomLEv @ 156 NONAME - _ZNK19CSIPProfileRegistry3SIPEv @ 157 NONAME - _ZNK19CSIPProfileRegistry9IsEnabledERK11CSIPProfile @ 158 NONAME - _ZNK23CSIPProfileRegistryBase21LastRegistrationErrorERK11CSIPProfile @ 159 NONAME - _ZNK4CSIP10ConnectionEm @ 160 NONAME - _ZNK4CSIP19IsSigCompSupportedLEv @ 161 NONAME - _ZNK4CSIP28SupportedSecurityMechanismsLEv @ 162 NONAME - _ZTI11CRepository @ 163 NONAME ; ## - _ZTI11CSIPProfile @ 164 NONAME ; ## - _ZTI14CMusEngSession @ 165 NONAME ; ## - _ZTI15CMceMediaSource @ 166 NONAME ; ## - _ZTI16CMceCameraSource @ 167 NONAME ; ## - _ZTI17CMusEngMceSession @ 168 NONAME ; ## - _ZTI18CMusEngClipSession @ 169 NONAME ; ## - _ZTI18CMusEngLiveSession @ 170 NONAME ; ## - _ZTI19CMusEngObserverStub @ 171 NONAME ; ## - _ZTI19CSIPProfileRegistry @ 172 NONAME ; ## - _ZTI20CMusEngMceOutSession @ 173 NONAME ; ## - _ZTI21CMusEngReceiveSession @ 174 NONAME ; ## - _ZTI21CMusEngTelephoneUtils @ 175 NONAME ; ## - _ZTI21CMusSipProfileHandler @ 176 NONAME ; ## - _ZTI22CSIPProfileBehaviorTls @ 177 NONAME ; ## - _ZTI23CSIPProfileRegistryBase @ 178 NONAME ; ## - _ZTI27CMusEngSessionDurationTimer @ 179 NONAME ; ## - _ZTI4CSIP @ 180 NONAME ; ## - _ZTI9DRMCommon @ 181 NONAME ; ## - _ZTV11CRepository @ 182 NONAME ; ## - _ZTV11CSIPProfile @ 183 NONAME ; ## - _ZTV14CMusEngSession @ 184 NONAME ; ## - _ZTV15CMceMediaSource @ 185 NONAME ; ## - _ZTV16CMceCameraSource @ 186 NONAME ; ## - _ZTV17CMusEngMceSession @ 187 NONAME ; ## - _ZTV18CMusEngClipSession @ 188 NONAME ; ## - _ZTV18CMusEngLiveSession @ 189 NONAME ; ## - _ZTV19CMusEngObserverStub @ 190 NONAME ; ## - _ZTV19CSIPProfileRegistry @ 191 NONAME ; ## - _ZTV20CMusEngMceOutSession @ 192 NONAME ; ## - _ZTV21CMusEngReceiveSession @ 193 NONAME ; ## - _ZTV21CMusEngTelephoneUtils @ 194 NONAME ; ## - _ZTV21CMusSipProfileHandler @ 195 NONAME ; ## - _ZTV22CSIPProfileBehaviorTls @ 196 NONAME ; ## - _ZTV23CSIPProfileRegistryBase @ 197 NONAME ; ## - _ZTV27CMusEngSessionDurationTimer @ 198 NONAME ; ## - _ZTV4CSIP @ 199 NONAME ; ## - _ZTV9DRMCommon @ 200 NONAME ; ## - _ZThn4_N11CSIPProfileD0Ev @ 201 NONAME ; ## - _ZThn4_N11CSIPProfileD1Ev @ 202 NONAME ; ## - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/group/bld.inf --- a/mmsharing/mmshengine/tsrc/ut_engine/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_TESTMMPFILES - -../../../../../tsrc/mceclientstub/group/mceclientstub.mmp -ut_musengine.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/group/ut_musengine.mmp --- a/mmsharing/mmshengine/tsrc/ut_engine/group/ut_musengine.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include - -TARGET ut_musengine.dll -TARGETTYPE dll -EPOCALLOWDLLDATA -TARGETPATH /DigiaEUnit/Tests -UID 0x1000af5a 0x10282394 - -CAPABILITY EUNIT_CAPS -VENDORID VID_DEFAULT - -MACRO UNIT_TESTING - -// 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 - - - -// Test classes -SOURCEPATH ../src -SOURCE ut_musengsession.cpp -SOURCE ut_musengmcesession.cpp -SOURCE ut_musengoutsession.cpp -SOURCE ut_musenglivesession.cpp -SOURCE ut_musengclipsession.cpp -SOURCE ut_musengreceivesession.cpp -SOURCE ut_musengsipprofilehandler.cpp -SOURCE ut_musengmceutils.cpp -SOURCE ut_musengtelephoneutils.cpp -SOURCE ut_musengsessiondurationtimer.cpp -SOURCE ut_musenguriparser.cpp - -// Tested classes -SOURCEPATH ../../../src -SOURCE musengsession.cpp -SOURCE musengmcesession.cpp -SOURCE musengmceoutsession.cpp -SOURCE musenglivesession.cpp -SOURCE musengclipsession.cpp -SOURCE musengreceivesession.cpp -SOURCE mussipprofilehandler.cpp -SOURCE musengtelephoneutils.cpp -SOURCE musengsessiondurationtimer.cpp -SOURCE musengmceutils.cpp -SOURCE musenguriparser.cpp - -// Includes - -USERINCLUDE ../inc -USERINCLUDE ../../../inc -USERINCLUDE ../../../../mmshshared/inc -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../../inc -USERINCLUDE ../../../../../tsrc/sipprofilestub/inc -USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc - -// to replace SIP profiles with a stub -SYSTEMINCLUDE ../inc -// to replace profile with a stub -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 - -#if defined ( APP_LAYER_SYSTEMINCLUDE ) -APP_LAYER_SYSTEMINCLUDE -#else -SYSTEMINCLUDE /epoc32/include -#endif - -LIBRARY euser.lib -LIBRARY bafl.lib -LIBRARY phoneclient.lib -LIBRARY eunit.lib -LIBRARY charconv.lib -LIBRARY inetprotutil.lib -LIBRARY sipcodec.lib -LIBRARY efsrv.lib -LIBRARY mceclientstub.lib - -DEBUGLIBRARY flogger.lib - -//EXPORTUNFROZEN - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* 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 "musengsessionobserver.h" -#include "musengoutsessionobserver.h" -#include "musenglivesessionobserver.h" -#include "musengclipsessionobserver.h" -#include "musengreceivesessionobserver.h" -#include "musengsessiondurationtimerobserver.h" -#include "musengaudioroutingobserver.h" - -#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 MMusEngSessionObserver, - public MMusEngOutSessionObserver, - public MMusEngLiveSessionObserver, - public MMusEngClipSessionObserver, - public MMusEngReceiveSessionObserver, - public MMusEngAudioRoutingObserver - { - - public: - - CMusEngObserverStub(); - - ~CMusEngObserverStub(); - - // From MMusEngSessionDurationTimerObserver - - void UpdateTimerEvent(); - - // From MMusEngSessionObserver - - void SessionEstablished(); - void SessionTerminated(); - void SessionConnectionLost(); - void SessionFailed(); - void StreamIdle(); - void StreamStreaming(); - void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds ); - void InactivityTimeout(); - - - // From MMusEngOutSessionObserver - - void SessionRejected(); - void SessionBadRequest(); // 400 - void SessionUnauthorized(); // 401 - void SessionPaymentRequired(); // 402 - void SessionRecipientNotFound(); // 404 - void SessionProxyAuthenticationRequired(); // 407 - void SessionRequestTimeOut(); // 408 - void SessionUnsupportedMediaType(); // 415 - void SessionBusyHere(); // 486 - void SessionRequestCancelled(); // 487 - void SessionTemporarilyNotAvailable(); // 480 - - // From MMusEngLiveSessionObserver - - void DiskFull(); - - // From MMusEngClipSessionObserver - - void EndOfClip(); - - void TranscodingNeeded(); - - void TranscodingProgressed( TInt aPercentage ); - - void TranscodingCompletedInit(); - - void TranscodingCompletedFinalize(); - - void TranscodingFailed(); - - - // From MMusEngReceiveSessionObserver - - void IncomingSessionPreNotification(); - - void IncomingSession( const TDesC& aOriginator, - const TDesC& aOriginatorIdentity ); - - void StreamBuffering(); - - - // From MMusEngAudioRoutingObserver - - void AudioRoutingChanged( TBool aShowNote ); - - TBool AudioRouteChangeAllowed() const; - - - 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 iSessionEstablishedCalled; - TBool iSessionTerminatedCalled; - TBool iSessionConnectionLostCalled; - TBool iSessionFailedCalled; - TBool iStreamIdleCalled; - TBool iStreamStreamingCalled; - TBool iSessionTimeChangedCalled; - TBool iInactivityTimeoutCalled; - - TBool iSessionRejectedCalled; - TBool iSessionBadRequestCalled; - TBool iSessionUnauthorizedCalled; - TBool iSessionPaymentRequiredCalled; - TBool iSessionRecipientNotFoundCalled; - TBool iSessionProxyAuthenticationRequiredCalled; - TBool iSessionRequestTimeOutCalled; - TBool iSessionUnsupportedMediaTypeCalled; - TBool iSessionBusyHereCalled; - TBool iSessionRequestCancelledCalled; - TBool iDiskFullCalled; - - TBool iEndOfClipCalled; - TBool iTranscodingNeededCalled; - TBool iTranscodingCompletedInitCalled; - TBool iTranscodingCompletedFinalizeCalled; - TBool iTranscodingFailedCalled; - - TBool iIncomingSessionPreNotificationCalled; - TBool iIncomingSessionCalled; - TBool iStreamBufferingCalled; - - TBool iAudioRoutingChangedCalled; - TBool iShowNote; - TBool iAudioRouteChangeAllowed; - - TInt iTranscodingProgressedPercentage; - TBool iSessionTemporarilyNotAvailable; - HBufC* iIncomingSessionOriginator; - - }; - - -// Dummy implementations -inline void CActiveScheduler::Start() - { - } - -inline void CActiveScheduler::Stop() - { - } - - -#endif // UT_MUSSTUBS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/musengtestdefs.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/musengtestdefs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* 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 - -// 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( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" ); -_LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); -_LIT( KTestRecipientTelUri, "tel:+3581111111"); -_LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); - -_LIT8( KTestRecipientSipUri8, "sip:TestRecipient@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 );\ - } - -#define ESTABLISH_OUT_SESSION( outSession )\ - outSession->InviteL( KTestRecipientSipUri );\ - 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->PlayL(); - - -#endif // MUSENGTESTDEFS_H - - \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/sipprofilealrcontroller.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/sipprofilealrcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipsession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGCLIPSESSION_H__ -#define __UT_MUSENGCLIPSESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusEngClipSession; -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 Setup2L(); - - void Teardown(); - - private: // Test methdods - - void UT_NewLL(); - void UT_SetClipLL(); - void UT_FastForwardLL(); - void UT_FastRewindLL(); - void UT_PositionLL(); - void UT_DurationLL(); - void UT_SetPositionLL(); - void UT_TranscodeLToAvcL(); - void UT_TranscodeLToH263L(); - void UT_CancelTranscodeLL(); - void UT_PlayLL(); - void UT_PauseLL(); - void UT_IsPlayingLL(); - void UT_CompleteSessionStructureLL(); - void UT_StreamStateChangedL(); - void UT_StreamStateChangedWithSourceL(); - void UT_StreamStateChangedWithSinkL(); - void UT_AddAmrCodecLL(); - void UT_AddVideoCodecLL(); - void UT_HasClipEndedL(); - void UT_ConstructAudioStructureLL(); - void UT_ConstructAudioStructureL_OperatorVariantL(); - void UT_EstablishSessionLL(); - - private: // Data - - CMusEngClipSession* iClipSession; - CMusEngObserverStub* iObserver; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGCLIPSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivesession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGLIVESESSION_H__ -#define __UT_MUSENGLIVESESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusEngLiveSession; -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_CurrentZoomLL(); - void UT_MaxZoomLL(); - void UT_ZoomInLL(); - void UT_ZoomOutLL(); - void UT_ZoomDefaultLL(); - void UT_RecordL_and_IsRecordingLL(); - void UT_PlayLL(); - void UT_PauseLL(); - void UT_IsPlayingLL(); - 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_SetBrightnessLL(); - void UT_CurrentBrightnessLL(); - void UT_MaxBrightnessLL(); - void UT_MinBrightnessLL(); - void UT_IncreaseBrightnessLL(); - void UT_DecreaseBrightnessLL(); - void UT_BrightnessDefaultLL(); - void UT_BrightnessAutoLL(); - void UT_SetEncodingDeviceLL(); - void UT_SetCodecConfigKeyLL(); - void UT_ReadCodecConfigKeyLL(); - void UT_StoreEncoderConfigInfoLL(); - void UT_InitializeZoomStepSizeL(); - - private: // Data - - CMusEngLiveSession* iLiveSession; - CMusEngLiveSession* iRecordedLiveSession; - CMusEngObserverStub* iObserver; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGLIVESESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmcesession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmcesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGMCESESSION_H__ -#define __UT_MUSENGMCESESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include -#include - -// FORWARD DECLARATIONS -class CMusEngLiveSession; -class CMusEngReceiveSession; -class CMusEngClipSession; -class CMusEngObserverStub; -class CMceSession; - -// 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_CMusEngMceSession_TerminateLL(); - void UT_CMusEngMceSession_GetSessionTimeL(); - void UT_CMusEngMceSession_ConnectionActiveL(); - void UT_CMusEngMceSession_ContainsAudioLL(); - void UT_CMusEngMceSession_IsMutedLL(); - void UT_CMusEngMceSession_OrientationLL(); - void UT_CMusEngMceSession_SetOrientationLL(); - void UT_CMusEngMceSession_VolumeUpLL(); - void UT_CMusEngMceSession_VolumeDownLL(); - void UT_CMusEngMceSession_SetVolumeLL(); - void UT_CMusEngMceSession_EnableDisplayL(); - void UT_CMusEngMceSession_MuteLL(); - void UT_CMusEngMceSession_UnmuteLL(); - void UT_CMusEngMceSession_HandleTerminationL(); - - void UT_CMusEngMceSession_AdjustVideoCodecLL(); - void UT_CMusEngMceSession_AdjustAudioCodecLL(); - void UT_CMusEngMceSession_RectChangedLL(); - void UT_CMusEngMceSession_SetSessionSdpLinesLL(); - void UT_CMusEngMceSession_AdjustStreamsAndCodecsLL(); - void UT_CMusEngMceSession_IncomingSessionL(); - void UT_CMusEngMceSession_IncomingUpdateL(); - void UT_CMusEngMceSession_StreamStateChangedL(); - void UT_CMusEngMceSession_StreamStateChangedWithSourceL(); - void UT_CMusEngMceSession_StreamStateChangedWithSinkL(); - void UT_CMusEngMceSession_SessionStateChangedL(); - void UT_CMusEngMceSession_SessionConnectionStateChangedL(); - void UT_CMusEngMceSession_FailedL(); - void UT_CMusEngMceSession_UpdateFailedL(); - - void UT_CMusEngMceSession_SRReceivedL(); - void UT_CMusEngMceSession_RRReceivedL(); - void UT_CMusEngMceSession_InactivityTimeoutL(); - void UT_CMusEngMceSession_SsrcAddedL(); - void UT_CMusEngMceSession_SsrcRemovedL(); - void UT_CMusEngMceSession_UpdateTimerEventL(); - void UT_CMusEngMceSession_IsRoamingBetweenAPsAllowedL(); - - private: - - void SetMaxVolForSpeakersL(CMceSession& aSession, TInt aMaxVol); - - private: // Data - - CMusEngLiveSession* iLiveSession; - CMusEngReceiveSession* iReceiveSession; - CMusEngClipSession* iClipSession; - CMusEngLiveSession* iSomeOtherSession; - CMusEngObserverStub* iObserver; - - TMceTransactionDataContainer iContainer; - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // __UT_MUSENGMCESESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmceutils.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmceutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGMCEUTILS_H__ -#define __UT_MUSENGMCEUTILS_H__ - - -// EXTERNAL INCLUDES -#include "mussipprofileuser.h" -#include -#include - -// FORWARD DECLARATIONS -class CMceManager; -class CMusSipProfileHandler; -class CMceSession; - -#ifndef NONSHARABLE_CLASS - #define NONSHARABLE_CLASS(x) class x -#endif - -// CLASS DEFINITION -/** - * Tester class for MusEngMceUtils. - * - */ -NONSHARABLE_CLASS( UT_MusEngMceUtils ): - public CEUnitTestSuiteClass, - public MMusSipProfileUser - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_MusEngMceUtils* NewL(); - static UT_MusEngMceUtils* NewLC(); - - /** - * Destructor - */ - ~UT_MusEngMceUtils(); - - public: // From MMusSipProfileUser - - TBool IsRoamingBetweenAPsAllowed(); - - private: // Constructors and destructors - - UT_MusEngMceUtils(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methdods - - void UT_MusEngMceUtils_IsVideoInStreamL(); - void UT_MusEngMceUtils_IsAudioInStreamL(); - void UT_MusEngMceUtils_GetVideoOutStreamLL(); - void UT_MusEngMceUtils_GetVideoInStreamLL(); - void UT_MusEngMceUtils_GetRecordingStreamL(); - void UT_MusEngMceUtils_GetMediaSinkL(); // From stream - void UT_MusEngMceUtils_GetMediaSinkLL(); // From stream - void UT_MusEngMceUtils_GetMediaSink2L(); // From session - void UT_MusEngMceUtils_GetMediaSinkL2L(); // From session - void UT_MusEngMceUtils_GetCameraLL(); - void UT_MusEngMceUtils_GetFileSourceLL(); - void UT_MusEngMceUtils_GetDisplayL(); - void UT_MusEngMceUtils_GetDisplayLL(); - void UT_MusEngMceUtils_AddDisplayLL(); - void UT_MusEngMceUtils_AddSpeakerLL(); - void UT_MusEngMceUtils_DisableStreamLL(); - - private: // Data - - CMceManager* iManager; - CMusSipProfileHandler* iProfileHandler; - CMceSession* iEmptySession; - CMceSession* iVideoOutSession; - CMceSession* iVideoInSession; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGMCEUTILS_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengoutsession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengoutsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGOUTSESSION_H__ -#define __UT_MUSENGOUTSESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusEngLiveSession; -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_CMusEngOutSession_InviteLL(); - void UT_CMusEngOutSession_CancelInviteLL(); - void UT_CMusEngOutSession_EstablishSessionLL(); - void UT_CMusEngOutSession_HandleTerminationL(); - void UT_CMusEngOutSession_AdjustVideoCodecLL(); - void UT_CMusEngOutSession_AdjustAudioCodecLL(); - void UT_CMusEngOutSession_CreateMceSessionStructureLL(); - - private: // Data - - CMusEngLiveSession* iLiveSession; - CMusEngObserverStub* iObserver; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGOUTSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengreceivesession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengreceivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGRECEIVESESSION_H__ -#define __UT_MUSENGRECEIVESESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMceInSession; -class CMusEngReceiveSession; -class CMusEngObserverStub; -class CMceVideoStream; -class CMceAudioStream; - -#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_AcceptInvitationLL(); - void UT_HandleSessionStateChangedL(); - void UT_AdjustVideoCodecLL(); - void UT_AdjustAudioCodecLL(); - void UT_DoCodecSelectionLL(); - void UT_IncomingSessionL(); - void UT_IncomingUpdateL(); - void UT_StreamStateChangedL(); - - // All the following functions test - // CMusEngReceiveSession::CompleteSessionStructureL - 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_ParseAssertedIdentityL(); - - private: // Data - - CMusEngReceiveSession* iReceiveSession; - CMusEngObserverStub* iObserver; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGRECEIVESESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsession.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGSESSION_H__ -#define __UT_MUSENGSESSION_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusEngLiveSession; -class CMusEngObserverStub; - - -// 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_CMusEngSession ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusEngSession* NewL(); - static UT_CMusEngSession* NewLC(); - - /** - * Destructor - */ - ~UT_CMusEngSession(); - - private: // Constructors and destructors - - UT_CMusEngSession(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - void UT_RectL(); - void UT_SetRectLL(); - void UT_AudioRoutingCanBeChangedL(); - void UT_EnableLoudspeakerLL(); - void UT_IsLoudSpeakerEnabledL(); - void UT_VolumeLL(); - void UT_MuteMicLL(); - void UT_IsMicMutedLL(); - void UT_SetAudioRoutingObserverL(); - void UT_VolumeUpLL(); - void UT_VolumeDownLL(); - void UT_SetVolumeLL(); - - private: // Data - - CMusEngLiveSession* iLiveSession; - CMusEngObserverStub* iObserver; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessiondurationtimer.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessiondurationtimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsipprofilehandler.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsipprofilehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSENGSIPPROFILEHANDLER_H__ -#define __UT_MUSENGSIPPROFILEHANDLER_H__ - - -// INCLUDES -#include "mussipprofileuser.h" -#include -#include - -// FORWARD DECLARATIONS -class CMusSipProfileHandler; - - -// CLASS DEFINITION -/** - * Tester class for CMusSipProfileHandler. - * - */ -NONSHARABLE_CLASS( UT_CMusEngSipProfileHandler ): - public CEUnitTestSuiteClass, - public MMusSipProfileUser - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusEngSipProfileHandler* NewL(); - static UT_CMusEngSipProfileHandler* NewLC(); - - /** - * Destructor - */ - ~UT_CMusEngSipProfileHandler(); - - public: // From MMusSipProfileUser - - TBool IsRoamingBetweenAPsAllowed(); - - private: // Constructors and destructors - - UT_CMusEngSipProfileHandler(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - void UT_CMusEngSipProfileHandler_CreateSipProfileLL(); - void UT_CMusEngSipProfileHandler_ProfileIdL(); - void UT_CMusEngSipProfileHandler_AlrEventL(); - void UT_CMusEngSipProfileHandler_NullTestsL(); - void UT_CMusEngSipProfileHandler_UserFromProfileLCL(); - - private: // Data - - CMusSipProfileHandler* iProfileHandler; - TBool iRoamingBetweenAPsAllowed; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // __UT_MUSENGSIPPROFILEHANDLER_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtelephoneutils.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtelephoneutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenguriparser.h --- a/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenguriparser.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,529 +0,0 @@ -/* -* 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 - - -// ---- MEMBER FUNCTIONS OF CMusEngObserverStub -------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngObserverStub::CMusEngObserverStub() - { - Reset(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngObserverStub::~CMusEngObserverStub() - { - delete iIncomingSessionOriginator; - } - - -// -------- Functions from MMusEngSessionDurationTimerObserver ----------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::UpdateTimerEvent() - { - iUpdateTimerEventCalled = ETrue; - } - - -// ----------- Functions from MusEngSessionObserver ---------------------------- - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionEstablished() - { - iSessionEstablishedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionTerminated() - { - iSessionTerminatedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionConnectionLost() - { - iSessionConnectionLostCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionFailed() - { - iSessionFailedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::StreamIdle() - { - iStreamIdleCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::StreamStreaming() - { - iStreamStreamingCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionTimeChanged( - const TTimeIntervalSeconds& /*aSeconds*/ ) - { - iSessionTimeChangedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::InactivityTimeout() - { - iInactivityTimeoutCalled = ETrue; - } - - - - - - -// ---- FUNCTIONS OF MMusEngOutSessionObserver -------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionRejected() - { - iSessionRejectedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionBadRequest() - { - iSessionBadRequestCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionUnauthorized() - { - iSessionUnauthorizedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionPaymentRequired() - { - iSessionPaymentRequiredCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionRecipientNotFound() - { - iSessionRecipientNotFoundCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionProxyAuthenticationRequired() - { - iSessionProxyAuthenticationRequiredCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionRequestTimeOut() - { - iSessionRequestTimeOutCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionUnsupportedMediaType() - { - iSessionUnsupportedMediaTypeCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionBusyHere() - { - iSessionBusyHereCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::SessionRequestCancelled() - { - iSessionRequestCancelledCalled = ETrue; - } - - -void CMusEngObserverStub::SessionTemporarilyNotAvailable() - { - iSessionTemporarilyNotAvailable = ETrue; - } - - - -// ---- FUNCTIONS OF MMusEngLiveSessionObserver ---------------------------------- - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::DiskFull() - { - iDiskFullCalled = ETrue; - } - - - - -// ---- FUNCTIONS OF MMusEngClipSessionObserver ---------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::EndOfClip() - { - iEndOfClipCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::TranscodingNeeded() - { - iTranscodingNeededCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::TranscodingProgressed( TInt aPercentage ) - { - iTranscodingProgressedPercentage = aPercentage; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::TranscodingCompletedInit() - { - iTranscodingCompletedInitCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::TranscodingCompletedFinalize() - { - iTranscodingCompletedFinalizeCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::TranscodingFailed() - { - iTranscodingFailedCalled = ETrue; - } - - -// ---- FUNCTIONS OF MMusEngInSessionObserver ---------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::IncomingSessionPreNotification() - { - iIncomingSessionPreNotificationCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::IncomingSession( const TDesC& aOriginator, - const TDesC& /*aOriginatorIdentity*/ ) - { - iIncomingSessionCalled = ETrue; - iIncomingSessionOriginator = aOriginator.Alloc(); - - if ( !iIncomingSessionOriginator ) - { - // TODO: Handle out of memory. - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::StreamBuffering() - { - iStreamBufferingCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::AudioRoutingChanged( TBool aShowNote ) - { - iAudioRoutingChangedCalled = ETrue; - iShowNote = aShowNote; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngObserverStub::AudioRouteChangeAllowed() const - { - return iAudioRouteChangeAllowed; - } - - - -// ----- HELPERS --------------------------------------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngObserverStub::IsReseted() - { - return ( !iUpdateTimerEventCalled && - !iSessionEstablishedCalled && - !iSessionTerminatedCalled && - !iSessionConnectionLostCalled && - !iSessionFailedCalled && - !iStreamIdleCalled && - !iStreamStreamingCalled && - !iSessionTimeChangedCalled && - !iInactivityTimeoutCalled && - !iSessionRejectedCalled && - !iSessionBadRequestCalled && - !iSessionUnauthorizedCalled && - !iSessionPaymentRequiredCalled && - !iSessionRecipientNotFoundCalled && - !iSessionProxyAuthenticationRequiredCalled && - !iSessionRequestTimeOutCalled && - !iSessionUnsupportedMediaTypeCalled && - !iSessionBusyHereCalled && - !iSessionRequestCancelledCalled && - !iDiskFullCalled && - !iEndOfClipCalled && - !iTranscodingNeededCalled && - !iTranscodingCompletedInitCalled && - !iTranscodingCompletedFinalizeCalled && - !iTranscodingFailedCalled && - !iIncomingSessionPreNotificationCalled && - !iIncomingSessionCalled && - !iStreamBufferingCalled && - !iAudioRoutingChangedCalled && - iTranscodingProgressedPercentage == 0 && - !iSessionTemporarilyNotAvailable && - !iIncomingSessionOriginator && - !iShowNote && - iAudioRouteChangeAllowed ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngObserverStub::Reset() - { - iUpdateTimerEventCalled = EFalse; - iSessionEstablishedCalled = EFalse; - iSessionTerminatedCalled = EFalse; - iSessionConnectionLostCalled = EFalse; - iSessionFailedCalled = EFalse; - iStreamIdleCalled = EFalse; - iStreamStreamingCalled = EFalse; - iSessionTimeChangedCalled = EFalse; - iInactivityTimeoutCalled = EFalse; - iSessionRejectedCalled = EFalse; - iSessionBadRequestCalled = EFalse; - iSessionUnauthorizedCalled = EFalse; - iSessionPaymentRequiredCalled = EFalse; - iSessionRecipientNotFoundCalled = EFalse; - iSessionProxyAuthenticationRequiredCalled = EFalse; - iSessionRequestTimeOutCalled = EFalse; - iSessionUnsupportedMediaTypeCalled = EFalse; - iSessionBusyHereCalled = EFalse; - iSessionRequestCancelledCalled = EFalse; - iDiskFullCalled = EFalse; - iEndOfClipCalled = EFalse; - iTranscodingNeededCalled = EFalse; - iTranscodingCompletedInitCalled = EFalse; - iTranscodingCompletedFinalizeCalled = EFalse; - iTranscodingFailedCalled = EFalse; - iIncomingSessionPreNotificationCalled = EFalse; - iIncomingSessionCalled = EFalse; - iStreamBufferingCalled = EFalse; - iAudioRoutingChangedCalled = EFalse; - iTranscodingProgressedPercentage = 0; - delete iIncomingSessionOriginator; - iSessionTemporarilyNotAvailable = EFalse; - iIncomingSessionOriginator = NULL; - iShowNote = EFalse; - iAudioRouteChangeAllowed = ETrue; - } - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipsession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1693 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musengClipsession.h" -#include "musengstubs.h" -#include "musengtestdefs.h" -#include "musengclipsession.h" -#include "mussipprofilehandler.h" -#include "musengmceutils.h" - - -// SYSTEM INCLUDES -#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() - { - iObserver = new( ELeave ) CMusEngObserverStub; - iClipSession = CMusEngClipSession::NewL( TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - iClipSession->SetClipL( KTestVideoFileName ); - iClipSession->iVideoCodecList = KMceSDPNameH264().AllocL(); - - SIPStrings::OpenL(); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::Setup2L() - { - iObserver = new( ELeave ) CMusEngObserverStub; - iClipSession = CMusEngClipSession::NewL( TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - iClipSession->SetClipL( KTestVideoFileName ); - iClipSession->iVideoCodecList = KMceSDPNameH263().AllocL(); - - SIPStrings::OpenL(); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::Teardown() - { - SIPStrings::Close(); - delete iClipSession; - delete iObserver; - } - - - -// TEST CASES - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_NewLL() - { - EUNIT_ASSERT( iClipSession ) - EUNIT_ASSERT( iClipSession->iFileName != KNullDesC() ) - EUNIT_ASSERT( !iClipSession->iSession ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_SetClipLL() - { - // Try with protected file, cannot use EUNIT_ASSERT_SPECIFIC_LEAVE - TRAPD( error, iClipSession->SetClipL( KMusDrmProtectedFileName() ) ) - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrPermissionDenied ) - EUNIT_ASSERT_EQUALS( iClipSession->iFileName, KTestVideoFileName() ) - - // Change the file before session is established - iClipSession->SetClipL( KTestAvcVideoFileName() ); - EUNIT_ASSERT_EQUALS( iClipSession->iFileName, KTestAvcVideoFileName() ) - EUNIT_ASSERT( !iClipSession->iSession ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iClipSession ); - - // Now test with established session - iClipSession->SetClipL( KTestVideoFileName() ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - - EUNIT_ASSERT_EQUALS( iClipSession->iFileName, KTestVideoFileName() ) - EUNIT_ASSERT_EQUALS( file->iFileName, KTestVideoFileName() ) - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_FastForwardLL() - { - // Try before establishment - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->FastForwardL( ETrue ), - KErrNotReady ) - - // Establish session, simulate position and duration and try again - ESTABLISH_OUT_SESSION( iClipSession ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - - file->iDuration = KMusEngTestFileDuration; - file->iPosition = KMusEngTestFilePosition; - - iClipSession->FastForwardL( ETrue ); - - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() > 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - // Simulate fastforwarding for a while - User::After( 1000 ); - - // Try to fastforward when already fastforwarding, will be ignored - iClipSession->FastForwardL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() > 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - // Stop fastforwarding - iClipSession->FastForwardL( EFalse ); - EUNIT_ASSERT( file->iPosition > KMusEngTestFilePosition ) - EUNIT_ASSERT( file->iPosition != file->iDuration ) - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - // Try to stop fastforwarding again, leaves - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->FastForwardL( EFalse ), - KErrAlreadyExists ) - - // Start fastrewinding - iClipSession->FastRewindL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() > 0 ) - - // Start fastforwarding, rewinding should be stopped and FFWD started - iClipSession->FastForwardL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() > 0 ) - EUNIT_ASSERT( iClipSession->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 ); - - iClipSession->FastForwardL( EFalse ); - EUNIT_ASSERT( file->iPosition == file->iDuration ) - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_FastRewindLL() - { - // Try before establishment - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->FastRewindL( ETrue ), - KErrNotReady ) - - // Establish session, simulate position and duration and try again - ESTABLISH_OUT_SESSION( iClipSession ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - - file->iDuration = KMusEngTestFileDuration; - file->iPosition = KMusEngTestFilePosition; - - iClipSession->FastRewindL( ETrue ); - - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() > 0 ) - - // Simulate fastrewinding for a while - User::After( 1000 ); - - // Try to fastrewind when already fastrewinding, will be ignored - iClipSession->FastRewindL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() > 0 ) - - // Stop fastrewinding - iClipSession->FastRewindL( EFalse ); - EUNIT_ASSERT( file->iPosition < KMusEngTestFilePosition ) - EUNIT_ASSERT( file->iPosition != TTimeIntervalMicroSeconds( 0 ) ) - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - // Try to stop fastrewinding again, leaves - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->FastRewindL( EFalse ), - KErrAlreadyExists ) - - // Start fastforwarding - iClipSession->FastForwardL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() >= 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - - // Start fastrewinding, forwarding should be stopped and FFWD started - iClipSession->FastRewindL( ETrue ); - EUNIT_ASSERT( !file->iIsEnabled ); - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->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 ); - - iClipSession->FastRewindL( EFalse ); - EUNIT_ASSERT( file->iPosition == TTimeIntervalMicroSeconds( 0 ) ) - EUNIT_ASSERT( !file->iIsEnabled ) - EUNIT_ASSERT( iClipSession->iFFWDStartTime.Int64() == 0 ) - EUNIT_ASSERT( iClipSession->iFRWDStartTime.Int64() == 0 ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_PositionLL() - { - // Try before establishment - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PositionL(), KErrNotReady ) - - // Establish session and try again - ESTABLISH_OUT_SESSION( iClipSession ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - file->iPosition = 2000000; - - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 == - file->iPosition.Int64() ) - - // Ask position while fastforwarding, it should be bigger than real position - iClipSession->FastForwardL( ETrue ); - - User::After( 1000000 ); // We have to wait since dividing in PositionL and - // multiplying before comparison loses difference - - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 > - file->iPosition.Int64() ) - - // Ask position while fastforwarding beyond end of clip, clip duration is - // returned - file->iPosition = file->iDuration; - - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 == - file->iDuration.Int64() ) - - // Stop fastforwarding, start fastrewinding, position is set to the end clip - iClipSession->FastForwardL( EFalse ); - iClipSession->FastRewindL( ETrue ); - - User::After( 1000000 ); // We have to wait since dividing in PositionL and - // multiplying before comparison loses difference - - // Ask position while fastrewinding, it should be smaller than real - // position - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 < - file->iPosition.Int64() ) - - // Ask position while fastrewinding beyond the beginning of clip, zero - // returned - file->iPosition = 0; - - EUNIT_ASSERT( iClipSession->PositionL().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) - iClipSession->iRewindedToBeginning = ETrue; - file->iPosition = 0; - iClipSession->iFRWDStartTime = TTime( 0 ); - - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 == 0 ) - - // Position has proceeded from beginning, rewinding to beginning info - // is cleared. - file->iPosition = 10000000; - iClipSession->iFRWDStartTime = TTime( 0 ); - - EUNIT_ASSERT( iClipSession->PositionL().Int() * 1000000 == 10000000 ) - EUNIT_ASSERT( iClipSession->iRewindedToBeginning == EFalse ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_DurationLL() - { - // Try before establishment - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->DurationL(), KErrNotReady ) - - // Establish session and try again - ESTABLISH_OUT_SESSION( iClipSession ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - file->iDuration = 2000000; - - EUNIT_ASSERT( iClipSession->DurationL().Int() * 1000000 == - file->iDuration.Int64() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_SetPositionLL() - { - TTimeIntervalSeconds time( 20 ); - - // Try before establishment - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->SetPositionL( time ), - KErrNotReady ) - - // Normal case with already disabled file source - ESTABLISH_OUT_SESSION( iClipSession ); - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *iClipSession->iSession ); - file->iIsEnabled = EFalse; - - iClipSession->SetPositionL( time ); - - EUNIT_ASSERT( file->iPosition.Int64() == - static_cast(time.Int()) * 1000000 ) - EUNIT_ASSERT( !file->iIsEnabled ) - - // Normal case with enabled file source - TTimeIntervalSeconds anotherTime( 30 ); - - file->iIsEnabled = ETrue; - iClipSession->SetPositionL( anotherTime ); - - EUNIT_ASSERT( file->iPosition.Int64() == - static_cast(anotherTime.Int()) * 1000000 ) - EUNIT_ASSERT( file->iIsEnabled ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_TranscodeLToAvcL() - { - // Check that transcoding is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( - iClipSession->TranscodeL( KTestVideoFileName() ), - KErrNotReady ) - - // Construct session with video and audio streams that must transcoded - - CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); - - iClipSession->iSession = CMceOutSession::NewL( - *(iClipSession->iManager), - *profile, - KTestRecipientSipUri8() ); - - CMceVideoStream* videoStream = CMceVideoStream::NewLC(); - - CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); - videoStream->AddSinkL( rtpsink ); - CleanupStack::Pop( rtpsink ); - - CMceFileSource* fileSource = - CMceFileSource::NewLC( *iClipSession->iManager, KTestAvcVideoFileName() ); - videoStream->SetSourceL( fileSource ); - CleanupStack::Pop( fileSource ); - - iClipSession->iSession->AddStreamL( videoStream ); - CleanupStack::Pop( videoStream ); - - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - - audioStream->AddSinkL( CMceRtpSink::NewLC() ); - CleanupStack::Pop(); - - audioStream->SetSourceL( fileSource ); - - iClipSession->iSession->AddStreamL( audioStream ); - CleanupStack::Pop( audioStream ); - - videoStream->iState = CMceMediaStream::ETranscodingRequired; - audioStream->iState = CMceMediaStream::ETranscodingRequired; - - // Remove all codecs (file has some unknown codec type) - RPointerArray videoCodecs = videoStream->Codecs(); - for ( TInt i = 0; i < videoCodecs.Count(); i++ ) - { - videoStream->RemoveCodecL( *videoCodecs[ i ] ); - } - RPointerArray videoCodecs2 = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( videoCodecs2.Count(), 0 ) - EUNIT_ASSERT( audioStream->Codecs().Count() > 1 ) - - // Add some stream which must not be transcoded - - CMceAudioStream* inStream = CMceAudioStream::NewLC(); - - inStream->AddSinkL( CMceSpeakerSink::NewLC() ); - CleanupStack::Pop(); - - inStream->SetSourceL( CMceRtpSource::NewLC() ); - CleanupStack::Pop(); - - iClipSession->iSession->AddStreamL( inStream ); - CleanupStack::Pop( inStream ); - - // Transcode - iClipSession->TranscodeL( KTestAvcVideoFileName() ); - - // Check that transcoding has begun (transcoding to AVC as we know - // that other end supports it - EUNIT_ASSERT( iClipSession->iTranscodingOngoing ) - EUNIT_ASSERT( videoStream->State() == CMceMediaStream::ETranscoding ) - EUNIT_ASSERT( audioStream->State() == CMceMediaStream::ETranscoding ) - EUNIT_ASSERT( inStream->State() != CMceMediaStream::ETranscoding ) - - // Check that codecs have been replaced - const RPointerArray videoCodecs3 = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( videoCodecs3.Count(), 1 ) - EUNIT_ASSERT( videoCodecs3[0]->SdpName().FindF( KMceSDPNameH264() ) >= 0 ) - EUNIT_ASSERT( audioStream->Codecs().Count() == 1 ) - EUNIT_ASSERT( audioStream->Codecs()[0]->AllowedBitrates() == - KMceAllowedAmrNbBitrate475 ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_TranscodeLToH263L() - { - // Check that transcoding is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( - iClipSession->TranscodeL( KTestVideoFileName() ), - KErrNotReady ) - - // Construct session with video and audio streams that must transcoded - - CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); - - iClipSession->iSession = CMceOutSession::NewL( - *(iClipSession->iManager), - *profile, - KTestRecipientSipUri8() ); - - CMceVideoStream* videoStream = CMceVideoStream::NewLC(); - - CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); - videoStream->AddSinkL( rtpsink ); - CleanupStack::Pop( rtpsink ); - - CMceFileSource* fileSource = - CMceFileSource::NewLC( *iClipSession->iManager, KTestAvcVideoFileName() ); - videoStream->SetSourceL( fileSource ); - CleanupStack::Pop( fileSource ); - - iClipSession->iSession->AddStreamL( videoStream ); - CleanupStack::Pop( videoStream ); - - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - - audioStream->AddSinkL( CMceRtpSink::NewLC() ); - CleanupStack::Pop(); - - audioStream->SetSourceL( fileSource ); - - iClipSession->iSession->AddStreamL( audioStream ); - CleanupStack::Pop( audioStream ); - - videoStream->iState = CMceMediaStream::ETranscodingRequired; - audioStream->iState = CMceMediaStream::ETranscodingRequired; - - const RPointerArray videoCodecs = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( videoCodecs.Count(), 1 ) - EUNIT_ASSERT( videoCodecs[0]->SdpName().FindF( KMceSDPNameH264() ) >= 0 ) - EUNIT_ASSERT( audioStream->Codecs().Count() > 1 ) - - TSize resolution(200,200); // Some value - videoStream->Codecs()[0]->SetResolutionL( resolution ); - audioStream->Codecs()[0]->SetBitrate( KMceAllowedAmrNbBitrateAll ); - - // Add some stream which must not be transcoded - - CMceAudioStream* inStream = CMceAudioStream::NewLC(); - - inStream->AddSinkL( CMceSpeakerSink::NewLC() ); - CleanupStack::Pop(); - - inStream->SetSourceL( CMceRtpSource::NewLC() ); - CleanupStack::Pop(); - - iClipSession->iSession->AddStreamL( inStream ); - CleanupStack::Pop( inStream ); - - // Transcode - iClipSession->TranscodeL( KTestAvcVideoFileName() ); - - // Check that transcoding has begun (transcoding to H263 as we don't - // know whether other end supports H264) EUNIT_ASSERT( iClipSession->iTranscodingOngoing ) - EUNIT_ASSERT( videoStream->State() == CMceMediaStream::ETranscoding ) - EUNIT_ASSERT( audioStream->State() == CMceMediaStream::ETranscoding ) - EUNIT_ASSERT( inStream->State() != CMceMediaStream::ETranscoding ) - - // Check that codecs have been replaced - const RPointerArray videoCodecs2 = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( videoCodecs2.Count(), 1 ) - EUNIT_ASSERT( videoCodecs2[0]->SdpName().FindF( KMceSDPNameH263() ) >= 0 ) - EUNIT_ASSERT( audioStream->Codecs().Count() == 1 ) - - EUNIT_ASSERT( videoStream->Codecs()[0]->Resolution() != resolution ) - EUNIT_ASSERT( audioStream->Codecs()[0]->AllowedBitrates() == - KMceAllowedAmrNbBitrate475 ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_CancelTranscodeLL() - { - // Check that canceling transcoding is not possible before actual - // transcoding - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->CancelTranscodeL(), - KErrNotReady ) - - // Construct session structure - - CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); - - iClipSession->iSession = CMceOutSession::NewL( - *(iClipSession->iManager), - *profile, - KTestRecipientSipUri8() ); - - CMceVideoStream* videoStream = CMceVideoStream::NewLC(); - - CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); - videoStream->AddSinkL( rtpsink ); - CleanupStack::Pop( rtpsink ); - - CMceFileSource* fileSource = - CMceFileSource::NewLC( *iClipSession->iManager, KTestVideoFileName() ); - videoStream->SetSourceL( fileSource ); - CleanupStack::Pop( fileSource ); - - iClipSession->iSession->AddStreamL( videoStream ); - CleanupStack::Pop( videoStream ); - - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - - audioStream->AddSinkL( CMceRtpSink::NewLC() ); - CleanupStack::Pop(); - - audioStream->SetSourceL( fileSource ); - - iClipSession->iSession->AddStreamL( audioStream ); - CleanupStack::Pop( audioStream ); - - // Set need for transcoding - videoStream->iState = CMceMediaStream::ETranscodingRequired; - audioStream->iState = CMceMediaStream::ETranscodingRequired; - - // Transcode - iClipSession->TranscodeL( KTestAvcVideoFileName() ); - - EUNIT_ASSERT( videoStream->State() == CMceMediaStream::ETranscoding ) - EUNIT_ASSERT( audioStream->State() == CMceMediaStream::ETranscoding ) - - // Cancel - iClipSession->CancelTranscodeL(); - - EUNIT_ASSERT( videoStream->State() == - CMceMediaStream::ETranscodingRequired ) - EUNIT_ASSERT( audioStream->State() == - CMceMediaStream::ETranscodingRequired ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_PlayLL() - { - // Check that resuming is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PlayL(), KErrNotReady ) - - ESTABLISH_OUT_SESSION( iClipSession ); - - // Check that playing is not possible during FFWD - iClipSession->iFFWDStartTime = TTime( 10 ); - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PlayL(), KErrNotReady ) - iClipSession->iFFWDStartTime = TTime( 0 ); - - // Check that playing is not possible during FRWD - iClipSession->iFRWDStartTime = TTime( 10 ); - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PlayL(), KErrNotReady ) - iClipSession->iFRWDStartTime = TTime( 0 ); - - // Successful case - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *(iClipSession->iSession) ); - - file->iIsEnabled = EFalse; - - iClipSession->PlayL(); - - EUNIT_ASSERT( file->IsEnabled() ) - - // Try to play again, request should be ignored - - iClipSession->PlayL(); - - EUNIT_ASSERT( file->IsEnabled() ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_PauseLL() - { - // Check that pausing is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PauseL(), KErrNotReady ) - - ESTABLISH_OUT_SESSION( iClipSession ); - - // Check that pausing is not possible during FFWD - iClipSession->iFFWDStartTime = TTime( 10 ); - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PauseL(), KErrNotReady ) - iClipSession->iFFWDStartTime = TTime( 0 ); - - // Check that pausing is not possible during FRWD - iClipSession->iFRWDStartTime = TTime( 10 ); - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->PauseL(), KErrNotReady ) - iClipSession->iFRWDStartTime = TTime( 0 ); - - // Successful case - - CMceFileSource* file = - MusEngMceUtils::GetFileSourceL( *(iClipSession->iSession) ); - - file->iIsEnabled = ETrue; - - iClipSession->PauseL(); - - EUNIT_ASSERT( !file->IsEnabled() ) - - // Try to pause again, request should be ignored - - iClipSession->PauseL(); - - EUNIT_ASSERT( !file->IsEnabled() ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngClipSession::UT_IsPlayingLL() - { - // Try without a session - EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->IsPlayingL(), KErrNotReady ); - - // Normal cases - ESTABLISH_OUT_SESSION( iClipSession ); - - iClipSession->PlayL(); - EUNIT_ASSERT( iClipSession->IsPlayingL() ) - - iClipSession->PauseL(); - EUNIT_ASSERT( !iClipSession->IsPlayingL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ) - - // Check that structure cannot be completed before setting the file name - iClipSession->iFileName = KNullDesC(); - CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); - - iClipSession->iSession = CMceOutSession::NewL( - *(iClipSession->iManager), - *profile, - KTestRecipientSipUri8() ); - - EUNIT_ASSERT_SPECIFIC_LEAVE( - iClipSession->CompleteSessionStructureL( *localBundle ), - KErrNotReady ) - - // Normal case - iClipSession->iFileName = KTestVideoFileName(); - 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->IsPlayingL() ) - 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->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ) - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ) - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - static_cast(iClipSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->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->InviteL( KTestRecipientSipUri() ); - - // 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 ); - - EUNIT_ASSERT( iObserver->iEndOfClipCalled == ETrue ) - changedSource->iIsEnabled = ETrue; - iObserver->Reset(); - - // ETranscodingRequired, transcoding has failed - iClipSession->iSession->iState = CMceSession::EIdle; - iClipSession->iTranscodingOngoing = ETrue; - changedStream->iState = CMceMediaStream::ETranscodingRequired; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iTranscodingFailedCalled ) - EUNIT_ASSERT( !iClipSession->iTranscodingOngoing ) - iObserver->Reset(); - - // ETranscoding, transcoding has progresssed - iClipSession->iSession->iState = CMceSession::EIdle; - changedStream->iState = CMceMediaStream::ETranscoding; - static_cast(changedSource)->iTranscodingPercentage = 20; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iTranscodingProgressedPercentage == 20 ) - iObserver->Reset(); - - // ETranscoding, transcoding has progresssed, querying percentage fails - iClipSession->iSession->iState = CMceSession::EIdle; - changedStream->iState = CMceMediaStream::ETranscoding; - iObserver->iTranscodingProgressedPercentage = -1; // make assertion possible - static_cast(changedSource)->iFailWithCode = KErrNotReady; - static_cast(changedSource)->iTranscodingPercentage = 30; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iTranscodingProgressedPercentage == 0 ) - iObserver->Reset(); - - // EInitialized, transcoding has completed, establishment fails - iClipSession->iSession->iState = CMceSession::EIdle; - iClipSession->iSession->iFailWithCode = KErrCorrupt; // != KErrNone - iClipSession->iTranscodingOngoing = ETrue; - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(changedSource)->iTranscodingPercentage = 100; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iTranscodingCompletedInitCalled ) - EUNIT_ASSERT( iObserver->iTranscodingCompletedFinalizeCalled ) - EUNIT_ASSERT( iObserver->iSessionFailedCalled ) - EUNIT_ASSERT( !iClipSession->iTranscodingOngoing ) - iObserver->Reset(); - - // EInitialized, transcoding has completed, establishment succeeds - iClipSession->iSession->iState = CMceSession::EIdle; - iClipSession->iTranscodingOngoing = ETrue; - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(changedSource)->iTranscodingPercentage = 100; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iTranscodingCompletedInitCalled ) - EUNIT_ASSERT( iObserver->iTranscodingCompletedFinalizeCalled ) - // Next cannot be asserted since it is not true with alloc decoration - // EUNIT_ASSERT( !iObserver->iSessionFailedCalled ) - EUNIT_ASSERT( !iClipSession->iTranscodingOngoing ) - iObserver->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( iObserver->IsReseted() ) - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // Special meaning (Transcoding ready), tested separately - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ) - iObserver->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( iObserver->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->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ) - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ) - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - static_cast(iClipSession)->StreamStateChanged( - *changedStream, - *changedSink ); - EUNIT_ASSERT( iObserver->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_HasClipEndedL() - { - // Try before establishing the session - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // Try with session, but without video out stream - - CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); - - iClipSession->iSession = CMceOutSession::NewL( - *(iClipSession->iManager), - *profile, - KTestRecipientSipUri8() ); - - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // Try with video out stream without source... - CMceVideoStream* videoOut = CMceVideoStream::NewLC(); - - videoOut->AddSinkL( CMceRtpSink::NewLC() ); - CleanupStack::Pop(); - - iClipSession->iSession->AddStreamL( videoOut ); - CleanupStack::Pop( videoOut ); - - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // And with enabled source and stream - videoOut->SetSourceL( CMceFileSource::NewLC( *iClipSession->iManager, - iClipSession->iFileName ) ); - CleanupStack::Pop(); - - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // try with different position and duration - (static_cast (videoOut->Source()))->iPosition = 90; - (static_cast (videoOut->Source()))->iDuration = 111; - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // Disapling source - (static_cast (videoOut->Source()))->DisableL(); - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // Disapling stream - videoOut->iState = CMceMediaStream::EDisabled; - EUNIT_ASSERT( !iClipSession->HasClipEnded() ) - - // and finaly try with "real" end of clip - (static_cast (videoOut->Source()))->iPosition = 0; - (static_cast (videoOut->Source()))->iDuration = 111; - - EUNIT_ASSERT( iClipSession->HasClipEnded() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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->iFileName ) ); - 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->SetClipL( 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->InviteL( KTestRecipientSipUri ); - - 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 ) - - } - } - - EUNIT_ASSERT( !iObserver->iTranscodingNeededCalled ) - - /////// - // 2.Test the case when we don't know whether peer supports H264, - // transcoding is needed, H264 codec has to be removed from the codec list - - delete iClipSession->iSession; - iClipSession->iSession = NULL; - - delete iClipSession->iVideoCodecList; - iClipSession->iVideoCodecList = NULL; - - // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL - iClipSession->InviteL( KTestRecipientSipUri ); - - const RPointerArray& streams2 = iClipSession->iSession->Streams(); - - for ( TInt i = 0; i < streams2.Count(); ++i ) - { - if ( streams2[i]->Type() == KMceVideo ) - { - CMceVideoStream* videoStream = static_cast( streams2[i] ); - const RPointerArray codecs = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( codecs.Count(), 1 ) - EUNIT_ASSERT( codecs[0]->SdpName().FindF( KMceSDPNameH263() ) >= 0 ) - } - } - - EUNIT_ASSERT( iObserver->iTranscodingNeededCalled ) - - - /////// - // 3.Test that if peer doesn't supports H264, transcoding is needed - // H264 codec has to be removed from the codec list - - iObserver->iTranscodingNeededCalled = EFalse; - - delete iClipSession->iSession; - iClipSession->iSession = NULL; - - iClipSession->iVideoCodecList = KMceSDPNameH263().AllocL(); - - // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL - iClipSession->InviteL( KTestRecipientSipUri ); - - const RPointerArray& streams3 = iClipSession->iSession->Streams(); - - for ( TInt i = 0; i < streams3.Count(); ++i ) - { - if ( streams2[i]->Type() == KMceVideo ) - { - CMceVideoStream* videoStream = static_cast( streams3[i] ); - const RPointerArray codecs = videoStream->Codecs(); - EUNIT_ASSERT_EQUALS( codecs.Count(), 1 ) - EUNIT_ASSERT( codecs[0]->SdpName().FindF( KMceSDPNameH263() ) >= 0 ) - } - } - - EUNIT_ASSERT( iObserver->iTranscodingNeededCalled ) - - } - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngClipSession, - "UT_CMusEngClipSesssion", - "UNIT" ) - -EUNIT_TEST( - "NewL - test ", - "CMusEngClipSession", - "NewL", - "FUNCTIONALITY", - SetupL, UT_NewLL, Teardown) - -EUNIT_TEST( - "SetClipL - test ", - "CMusEngClipSession", - "AetClipL", - "FUNCTIONALITY", - SetupL, UT_SetClipLL, Teardown) - -EUNIT_TEST( - "FastForwardL - test ", - "CMusEngClipSession", - "FastForwardL", - "FUNCTIONALITY", - SetupL, UT_FastForwardLL, Teardown) - -EUNIT_TEST( - "FastRewindL - test ", - "CMusEngClipSession", - "FastRewindL", - "FUNCTIONALITY", - SetupL, UT_FastRewindLL, Teardown) - -EUNIT_TEST( - "PositionL - test ", - "CMusEngClipSession", - "PositionL", - "FUNCTIONALITY", - SetupL, UT_PositionLL, Teardown) - -EUNIT_TEST( - "DurationL - test ", - "CMusEngClipSession", - "DurationL", - "FUNCTIONALITY", - SetupL, UT_DurationLL, Teardown) - -EUNIT_TEST( - "SetPositionL - test ", - "CMusEngClipSession", - "SetPositionL", - "FUNCTIONALITY", - SetupL, UT_SetPositionLL, Teardown) - -EUNIT_TEST( - "TranscodeL - To AVC test ", - "CMusEngClipSession", - "TranscodeL", - "FUNCTIONALITY", - SetupL, UT_TranscodeLToAvcL, Teardown) - -EUNIT_TEST( - "TranscodeL - To H263 test ", - "CMusEngClipSession", - "TranscodeL", - "FUNCTIONALITY", - Setup2L, UT_TranscodeLToH263L, Teardown) - -EUNIT_TEST( - "CancelTranscodeL - test ", - "CMusEngClipSession", - "CancelTranscodeL", - "FUNCTIONALITY", - SetupL, UT_CancelTranscodeLL, Teardown) - -EUNIT_TEST( - "PlayL - test ", - "CMusEngClipSession", - "PlayL", - "FUNCTIONALITY", - SetupL, UT_PlayLL, Teardown) - -EUNIT_TEST( - "PauseL - test ", - "CMusEngClipSession", - "PauseL", - "FUNCTIONALITY", - SetupL, UT_PauseLL, Teardown) - -EUNIT_TEST( - "IsPlayingL - test ", - "CMusEngClipSession", - "IsPlayingL", - "FUNCTIONALITY", - SetupL, UT_IsPlayingLL, 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( - "HasClipEnded - test ", - "CMusEngClipSession", - "HasClipEnded", - "FUNCTIONALITY", - SetupL, UT_HasClipEndedL, 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenginedllmain.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenginedllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// USER INCLUDES -#include "ut_musengsession.h" -#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" - - -// SYSTEM INCLUDES -#include - - -// ----------------------------------------------------------------------------- -// Test suite factory function. -// ----------------------------------------------------------------------------- -// -EXPORT_C MEUnitTest* CreateTestSuiteL() - { - - CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Mush Engine" ) ); - - rootSuite->AddL( UT_CMusEngSipProfileHandler::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_MusEngMceUtils::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusEngSessionDurationTimer::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusEngSession::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_CMusEngTelephoneUtils::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_TMusEngUriParser::NewLC() ); - CleanupStack::Pop(); - - CleanupStack::Pop( rootSuite ); - - return rootSuite; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivesession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1729 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musenglivesession.h" -#include "musengstubs.h" -#include "musengtestdefs.h" -#include "musenglivesession.h" -#include "mussipprofilehandler.h" -#include "musengmceutils.h" -#include "mussettings.h" - -// SYSTEM INCLUDES -#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) - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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() - { - iObserver = new( ELeave ) CMusEngObserverStub; - - iLiveSession = CMusEngLiveSession::NewL( TRect(0, 0, 100, 100), - *iObserver, - *iObserver, - *iObserver ); - - iRecordedLiveSession = CMusEngLiveSession::NewL( KTestVideoFileName(), - TRect(0, 0, 100, 100), - *iObserver, - *iObserver, - *iObserver ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::Teardown() - { - delete iLiveSession; - delete iRecordedLiveSession; - delete iObserver; - - // Delete static data from CenRep stub - CRepository::iStaticWriteAvcKeysToStaticData = EFalse; - CRepository::DeleteStubAvcConfigKeys(); - CRepository::iForceFailWithCode = KErrNone; - } - - - -// TEST CASES - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_NewLL() - { - EUNIT_ASSERT( iLiveSession ); - EUNIT_ASSERT( iLiveSession->iRecordedFile == KNullDesC() ); - EUNIT_ASSERT( iRecordedLiveSession ); - EUNIT_ASSERT( iRecordedLiveSession->iRecordedFile == KTestVideoFileName() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_CurrentZoomLL() - { - // Check that checking current zoom is not possible before invite - TRAPD( error, iLiveSession->CurrentZoomL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - // Check that originally current and default zoom are the same - EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == - iLiveSession->CurrentZoomL() ); - - // Zoom to maximum optical value - while ( camera->iZoomFactor < iLiveSession->iCameraInfo.iMaxZoom ) - { - iLiveSession->ZoomInL(); - } - - EUNIT_ASSERT( iLiveSession->iCameraInfo.iMaxZoom == - iLiveSession->CurrentZoomL() ); - - // Zoom using digital zoom - - iLiveSession->ZoomInL(); - - EUNIT_ASSERT( iLiveSession->CurrentZoomL() == - iLiveSession->iCameraInfo.iMaxZoom + - camera->iDigitalZoomFactor ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_MaxZoomLL() - { - // Check that checking maximum zoom is not possible before invite - TRAPD( error, iLiveSession->MaxZoomL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - EUNIT_ASSERT( iLiveSession->MaxZoomL() == - iLiveSession->iCameraInfo.iMaxZoom + - iLiveSession->iCameraInfo.iMaxDigitalZoom ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_ZoomInLL() - { - // Check that zooming is not possible before invite - TRAPD( error, iLiveSession->ZoomInL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - // Check the default value - EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor ); - - // Check that zoom factor can be increased - USER_SLEEP; //insure that small step is used - iLiveSession->ZoomInL(); - EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iDefaultZoomFactor + - iLiveSession->iSmallZoomStep ); - - //Check the "burst" mode (immediate second ZoomIn), big step should be used - TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor; - iLiveSession->ZoomInL(); - TInt nStep = camera->iZoomFactor + camera->iDigitalZoomFactor - nZoom; - EUNIT_ASSERT( nStep == iLiveSession->iBigZoomStep ); - - // Zoom to maximum optical value - while ( camera->iZoomFactor < iLiveSession->iCameraInfo.iMaxZoom ) - { - iLiveSession->ZoomInL(); - } - - TInt maxOpticalZoomFactor = camera->ZoomFactorL(); - - // Check that digital zoom is used instead of optical - iLiveSession->ZoomInL(); - EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor ); - EUNIT_ASSERT( camera->iDigitalZoomFactor > 0 ); - - // Zoom to maximum digital value - while ( camera->iDigitalZoomFactor < - iLiveSession->iCameraInfo.iMaxDigitalZoom ) - { - iLiveSession->ZoomInL(); - } - - TInt maxDigitalZoomFactor = camera->DigitalZoomFactorL(); - - // Check that further zooming is impossible - iLiveSession->ZoomInL(); - EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor ); - EUNIT_ASSERT( camera->iDigitalZoomFactor == maxDigitalZoomFactor ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_ZoomOutLL() - { - // Check that zooming is not possible before invite - TRAPD( error, iLiveSession->ZoomOutL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - // Check the default value - EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor ); - - // Simulate maximum zoom - camera->iZoomFactor = iLiveSession->iCameraInfo.iMaxZoom; - camera->iDigitalZoomFactor = iLiveSession->iCameraInfo.iMaxDigitalZoom; - - // Check that digital zoom factor can be decreased - USER_SLEEP; //insure that small step is used - iLiveSession->ZoomOutL(); - EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iCameraInfo.iMaxZoom ); - EUNIT_ASSERT( camera->iDigitalZoomFactor == - iLiveSession->iCameraInfo.iMaxDigitalZoom - - iLiveSession->iSmallZoomStep ); - - //Check the "burst" mode (immediate second ZoomOut), big step should be used - TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor; - iLiveSession->ZoomOutL(); - TInt nStep; - nStep = nZoom - (camera->iZoomFactor + camera->iDigitalZoomFactor ); - EUNIT_ASSERT( nStep == iLiveSession->iBigZoomStep ); - - // Simulate maximum zoom again - camera->iZoomFactor = iLiveSession->iCameraInfo.iMaxZoom; - camera->iDigitalZoomFactor = iLiveSession->iCameraInfo.iMaxDigitalZoom; - - // Zoom to minimum digital zoom - while ( camera->iDigitalZoomFactor > 0 ) - { - iLiveSession->ZoomOutL(); - } - - EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->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 - iLiveSession->ZoomOutL(); - EUNIT_ASSERT( camera->iZoomFactor == - iLiveSession->iCameraInfo.iMaxZoom - - iLiveSession->iSmallZoomStep ); - EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); - - // Zoom to minimum optical zoom - while ( camera->iZoomFactor > iLiveSession->iCameraInfo.iMinZoom ) - { - iLiveSession->ZoomOutL(); - } - - // Check that further zooming is impossible - iLiveSession->ZoomOutL(); - EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iCameraInfo.iMinZoom ); - EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_ZoomDefaultLL() - { - // Check that zooming is not possible before invite - TRAPD( error, iLiveSession->ZoomDefaultL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - // Check the default value - EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor ); - - // increase zoom factor so much that optical zoom is in maximum value - // and digital zoom is in use - while ( camera->iDigitalZoomFactor == 0 ) - { - iLiveSession->ZoomInL(); - } - EUNIT_ASSERT( camera->iZoomFactor > iLiveSession->iDefaultZoomFactor ); - EUNIT_ASSERT( camera->iDigitalZoomFactor > 0 ); - - // back to default - iLiveSession->ZoomDefaultL(); - EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iDefaultZoomFactor ); - EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_SetBrightnessLL() - { - // Check that setting brightness is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( - iLiveSession->SetBrightnessL( KTestSomeBrightness ), - KErrNotReady ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - camera->iCameraInfo.iOptionsSupported = - camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported; - - // Check that originally current and default brightness are the same - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - - // Test setting brightness - iLiveSession->SetBrightnessL( KTestSomeBrightness ); - - EUNIT_ASSERT_EQUALS( KTestSomeBrightness, - iLiveSession->CurrentBrightnessL() ) - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_CurrentBrightnessLL() - { - // Check that checking current brightness is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->CurrentBrightnessL(), - KErrNotReady ) - - // All the other stuff checked in tests of SetBrightnessL - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_MaxBrightnessLL() - { - // MaxBrightness should return a constant - - EUNIT_ASSERT_EQUALS( KTestMaxBrightness, iLiveSession->MaxBrightnessL() ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_MinBrightnessLL() - { - // MinBrightness should return a constant - - EUNIT_ASSERT_EQUALS( KTestMinBrightness, iLiveSession->MinBrightnessL() ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_IncreaseBrightnessLL() - { - // Check that increasing brightness is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IncreaseBrightnessL(), - KErrNotReady ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - camera->iCameraInfo.iOptionsSupported = - camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported; - - // Check that originally current and default brightness are the same - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - - // Check that brightness can be increased... - iLiveSession->IncreaseBrightnessL(); - - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness + KTestBrightnessStepSize, - iLiveSession->CurrentBrightnessL() ) - - // ... but only to maximum - - iLiveSession->SetBrightnessL( KTestMaxBrightness ); - - iLiveSession->IncreaseBrightnessL(); - - EUNIT_ASSERT_EQUALS( KTestMaxBrightness, - iLiveSession->CurrentBrightnessL() ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_DecreaseBrightnessLL() - { - // Check that decreasing brightness is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->DecreaseBrightnessL(), - KErrNotReady ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - camera->iCameraInfo.iOptionsSupported = - camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported; - - // Check that originally current and default brightness are the same - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - - // Check that brightness can be decreased... - iLiveSession->DecreaseBrightnessL(); - - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness - KTestBrightnessStepSize, - iLiveSession->CurrentBrightnessL() ) - - // ... but only to minimum - - iLiveSession->SetBrightnessL( KTestMinBrightness ); - - iLiveSession->DecreaseBrightnessL(); - - EUNIT_ASSERT_EQUALS( KTestMinBrightness, - iLiveSession->CurrentBrightnessL() ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_BrightnessDefaultLL() - { - // Check that setting default brightness is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->BrightnessDefaultL(), - KErrNotReady ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - camera->iCameraInfo.iOptionsSupported = - camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported; - - // Check that originally current and default brightness are the same - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - - // set brightness to max - iLiveSession->SetBrightnessL( KTestMaxBrightness ); - EUNIT_ASSERT_NOT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - - // set brightness to default and check it - iLiveSession->BrightnessDefaultL(); - - EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness, - iLiveSession->CurrentBrightnessL() ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_BrightnessAutoLL() - { - // Check that setting brightness to auto is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->BrightnessAutoL(), - KErrNotReady ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - camera->iCameraInfo.iOptionsSupported = - camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported; - - // Check that originally brightness is not auto - EUNIT_ASSERT_NOT_EQUALS( CCamera::EBrightnessAuto, - iLiveSession->CurrentBrightnessL() ) - - // check that brightness is set to auto - iLiveSession->BrightnessAutoL(); - EUNIT_ASSERT_EQUALS( CCamera::EBrightnessAuto, - iLiveSession->CurrentBrightnessL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_RecordL_and_IsRecordingLL() - { - // Check that recording is not possible before invite - EUNIT_ASSERT_SPECIFIC_LEAVE( iRecordedLiveSession->RecordL( ETrue ), - KErrNotReady ) - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - ESTABLISH_OUT_SESSION( iRecordedLiveSession ); - - // Check that recording is off by default - EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() ); - - // Check that recording can be set on - iRecordedLiveSession->RecordL( ETrue ); - EUNIT_ASSERT( iRecordedLiveSession->IsRecording() ); - - // Check that recording cannot be set on if recording stream does not exist - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->RecordL( ETrue ), - KErrNotReady ) - - // Check that setting on the recording twice does not harm - iRecordedLiveSession->RecordL( ETrue ); - EUNIT_ASSERT( iRecordedLiveSession->IsRecording() ); - - // Check that recording can be set off again - iRecordedLiveSession->RecordL( EFalse ); - EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() ); - - // Check that setting off the recording twice does not harm - iRecordedLiveSession->RecordL( EFalse ); - EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_PlayLL() - { - // Check that resuming is not possible before invite - TRAPD( error, iLiveSession->PlayL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - ESTABLISH_OUT_SESSION( iLiveSession ); - - iLiveSession->PauseL(); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - iLiveSession->PlayL(); - - EUNIT_ASSERT( camera->IsEnabled() ); - - // Try to enable camera again, request should be ignored - - iLiveSession->PlayL(); - - EUNIT_ASSERT( camera->IsEnabled() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_PauseLL() - { - // Check that pausing is not possible before invite - TRAPD( error, iLiveSession->PauseL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - ESTABLISH_OUT_SESSION( iLiveSession ); - - iLiveSession->PlayL(); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - iLiveSession->PauseL(); - - EUNIT_ASSERT( !camera->IsEnabled() ); - - // Try to disable camera again, request should be ignored - - iLiveSession->PauseL(); - - EUNIT_ASSERT( !camera->IsEnabled() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_IsPlayingLL() - { - // Try without a session - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IsPlayingL(), KErrNotReady ); - - // Normal cases - ESTABLISH_OUT_SESSION( iLiveSession ); - - iLiveSession->PlayL(); - EUNIT_ASSERT( iLiveSession->IsPlayingL() ) - - iLiveSession->PauseL(); - EUNIT_ASSERT( !iLiveSession->IsPlayingL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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->IsPlayingL() ) - 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 ) - - CleanupStack::PopAndDestroy( localBundle ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_HandleSessionStateChangedL() - { - // Make Repository empty, config keys must be written - CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); - - // Invite - iLiveSession->InviteL( KTestRecipientSipUri ); - 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( iObserver->iSessionFailedCalled ); - - // Normal case, something will be written to CenRep - iRecordedLiveSession->InviteL( KTestRecipientSipUri ); - iRecordedLiveSession->iSession->iState = CMceSession::EEstablished; - iRecordedLiveSession->HandleSessionStateChanged( - *iRecordedLiveSession->iSession, - 200, KNullDesC8() ); - - HBufC8* info = MultimediaSharingSettings::EncoderConfigInfoLC(); - EUNIT_ASSERT_NOT_EQUALS( *info, KMusAvcBitrateLevel_1b_ConfigKey() ) - CleanupStack::PopAndDestroy( info ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ); - iLiveSession->AdjustVideoCodecL( *codecH2632000 ); - iLiveSession->AdjustVideoCodecL( *codecAvc ); - iLiveSession->AdjustVideoCodecL( *codecUnknown ); - - // 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 - iLiveSession->SetSupportedVideoCodecListL( _L( "SomethingThatIsNotAVC" ) ); - 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->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream ); - EUNIT_ASSERT( iObserver->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->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource );; - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - static_cast(iLiveSession)->StreamStateChanged( - *changedStream, *changedSource ); - EUNIT_ASSERT( iObserver->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 ) - iRecordedLiveSession->RecordL( 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( iObserver->iStreamStreamingCalled ) - iObserver->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( iObserver->iDiskFullCalled ) - iObserver->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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->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( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - iLiveSession->StreamStateChanged( *changedStream, *changedSink ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::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_CMusEngLiveSession::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_CMusEngLiveSession::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_CMusEngLiveSession::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. - __ASSERT_ALWAYS( !iObserver->iSessionFailedCalled, - 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() ); - - ESTABLISH_OUT_SESSION( iRecordedLiveSession ) - // If StoreEncoderConfigInfoL leaves with KErrNoMemory, - // MMusEngSessionObserver::SessionFailed will be called. - __ASSERT_ALWAYS( !iObserver->iSessionFailedCalled, - User::Leave( KErrNoMemory ) ); - - keys = MultimediaSharingSettings::EncoderConfigInfoLC(); - EUNIT_ASSERT_EQUALS( *keys, - KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys() ) - CleanupStack::PopAndDestroy( keys ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngLiveSession::UT_InitializeZoomStepSizeL() - { - //Check that zooming steps have defualt values before session establishment - iLiveSession->InitializeZoomStepSize(); - EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize ); - EUNIT_ASSERT( iLiveSession->iBigZoomStep == KZoomStepMinSize ); - - // simulate session establishment - ESTABLISH_OUT_SESSION( iLiveSession ); - - CMceCameraSource* camera = - MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) ); - - //Check that zooming step sizes have default value KZoomStepMinSize - //in case of zooming values range is smaller than KZoomBigStepCount - iLiveSession->iCameraInfo.iMinZoom = 0; - iLiveSession->iCameraInfo.iMaxZoom = 0; - iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount / 2; - iLiveSession->InitializeZoomStepSize(); - EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize ); - EUNIT_ASSERT( iLiveSession->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) - iLiveSession->iCameraInfo.iMaxDigitalZoom = 2*KZoomBigStepCount - 1; - iLiveSession->InitializeZoomStepSize(); - EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize ); - EUNIT_ASSERT( iLiveSession->iBigZoomStep == KZoomStepMinSize ); - - - //Check zooming steps sizes in case of zooming values range is - //bigger than 2*KZoomBigStepCount and smaller than 2*KZoomSmallStepCount - iLiveSession->iCameraInfo.iMinZoom = - KZoomBigStepCount; - iLiveSession->iCameraInfo.iMaxZoom = KZoomBigStepCount; - iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount; - //zooming range is (-KZoomBigStepCount, 2*KZoomBigStepCount) - iLiveSession->InitializeZoomStepSize(); - EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize ); - EUNIT_ASSERT( iLiveSession->iBigZoomStep == 3 ); - - - //Check zooming steps sizes in case of zooming values range is - //bigger than 2*KZoomSmallStepCount - iLiveSession->iCameraInfo.iMaxZoom = KZoomSmallStepCount; - iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomSmallStepCount; - iLiveSession->iCameraInfo.iMinZoom = - KZoomSmallStepCount; - //zooming range is (-KZoomSmallStepCount, 2*KZoomSmallStepCount) - iLiveSession->InitializeZoomStepSize(); - EUNIT_ASSERT( iLiveSession->iSmallZoomStep == 3 ); - EUNIT_ASSERT( iLiveSession->iBigZoomStep == 6 ); - } - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngLiveSession, - "UT_CMusEngLiveSesssion", - "UNIT" ) - -EUNIT_TEST( - "NewL - test ", - "CMusEngLiveSession", - "NewL", - "FUNCTIONALITY", - SetupL, UT_NewLL, Teardown) - -EUNIT_TEST( - "CurrentZoomL - test ", - "CMusEngLiveSession", - "CurrentZoomL", - "FUNCTIONALITY", - SetupL, UT_CurrentZoomLL, Teardown) - -EUNIT_TEST( - "MaxZoomL - test ", - "CMusEngLiveSession", - "MaxZoomL", - "FUNCTIONALITY", - SetupL, UT_MaxZoomLL, Teardown) - -EUNIT_TEST( - "ZoomInL - test ", - "CMusEngLiveSession", - "ZoomInL", - "FUNCTIONALITY", - SetupL, UT_ZoomInLL, Teardown) - -EUNIT_TEST( - "ZoomOutL - test ", - "CMusEngLiveSession", - "ZoomOutL", - "FUNCTIONALITY", - SetupL, UT_ZoomOutLL, Teardown) - -EUNIT_TEST( - "ZoomDefaultL - test ", - "CMusEngLiveSession", - "ZoomDefaultL", - "FUNCTIONALITY", - SetupL, UT_ZoomDefaultLL, Teardown) - -EUNIT_TEST( - "SetBrightnessL - test ", - "CMusEngLiveSession", - "SetBrightnessL", - "FUNCTIONALITY", - SetupL, UT_SetBrightnessLL, Teardown) - -EUNIT_TEST( - "CurrentBrightnessL - test ", - "CMusEngLiveSession", - "CurrentBrightnessL", - "FUNCTIONALITY", - SetupL, UT_CurrentBrightnessLL, Teardown) - -EUNIT_TEST( - "MaxBrightnessL - test ", - "CMusEngLiveSession", - "MaxBrightnessL", - "FUNCTIONALITY", - SetupL, UT_MaxBrightnessLL, Teardown) - -EUNIT_TEST( - "MinBrightnessL - test ", - "CMusEngLiveSession", - "MinBrightnessL", - "FUNCTIONALITY", - SetupL, UT_MinBrightnessLL, Teardown) - -EUNIT_TEST( - "IncreaseBrightnessL - test ", - "CMusEngLiveSession", - "IncreaseBrightnessL", - "FUNCTIONALITY", - SetupL, UT_IncreaseBrightnessLL, Teardown) - -EUNIT_TEST( - "DecreaseBrightnessL - test ", - "CMusEngLiveSession", - "DecreaseBrightnessL", - "FUNCTIONALITY", - SetupL, UT_DecreaseBrightnessLL, Teardown) - -EUNIT_TEST( - "BrightnessDefaultL - test ", - "CMusEngLiveSession", - "BrightnessDefaultL", - "FUNCTIONALITY", - SetupL, UT_BrightnessDefaultLL, Teardown) - -EUNIT_TEST( - "BrightnessAutoL - test ", - "CMusEngLiveSession", - "BrightnessAutoL", - "FUNCTIONALITY", - SetupL, UT_BrightnessAutoLL, Teardown) - -EUNIT_TEST( - "RecordL_and_IsRecordingL - test ", - "CMusEngLiveSession", - "RecordL_and_IsRecordingL", - "FUNCTIONALITY", - SetupL, UT_RecordL_and_IsRecordingLL, Teardown) - -EUNIT_TEST( - "PlayL - test ", - "CMusEngLiveSession", - "PlayL", - "FUNCTIONALITY", - SetupL, UT_PlayLL, Teardown) - -EUNIT_TEST( - "PauseL - test ", - "CMusEngLiveSession", - "PauseL", - "FUNCTIONALITY", - SetupL, UT_PauseLL, Teardown) - -EUNIT_TEST( - "IsPlayingL - test ", - "CMusEngLiveSession", - "IsPlayingL", - "FUNCTIONALITY", - SetupL, UT_IsPlayingLL, Teardown) - -EUNIT_TEST( - "CompleteSessionStructureL - test ", - "CMusEngLiveSession", - "CompleteSessionStructureL", - "FUNCTIONALITY", - SetupL, UT_CompleteSessionStructureLL, Teardown) - -EUNIT_TEST( - "HandleSessionStateChanged - test ", - "CMusEngLiveSession", - "HandleSessionStateChanged", - "FUNCTIONALITY", - SetupL, UT_HandleSessionStateChangedL, 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( - "SetEncodingDeviceL - test ", - "CMusEngLiveSession", - "SetEncodingDeviceL", - "FUNCTIONALITY", - SetupL, UT_SetEncodingDeviceLL, Teardown) - -EUNIT_TEST( - "SetCodecConfigKeyL - test ", - "CMusEngLiveSession", - "SetCodecConfigKeyL", - "FUNCTIONALITY", - SetupL, UT_SetCodecConfigKeyLL, Teardown) - -EUNIT_TEST( - "ReadCodecConfigKeyL - test ", - "CMusEngLiveSession", - "ReadCodecConfigKeyL", - "FUNCTIONALITY", - SetupL, UT_ReadCodecConfigKeyLL, Teardown) - -EUNIT_TEST( - "StoreEncoderConfigInfoL - test ", - "CMusEngLiveSession", - "StoreEncoderConfigInfoL", - "FUNCTIONALITY", - SetupL, UT_StoreEncoderConfigInfoLL, Teardown) - -EUNIT_TEST( - "InitializeZoomStepSize - test ", - "CMusEngLiveSession", - "InitializeZoomStepSize", - "FUNCTIONALITY", - SetupL, UT_InitializeZoomStepSizeL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2011 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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" - -// SYSTEM INCLUDES - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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( ) - { - iObserver = new( ELeave ) CMusEngObserverStub; - iLiveSession = CMusEngLiveSession::NewL( KNullDesC, - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - - iSomeOtherSession = CMusEngLiveSession::NewL( KNullDesC, - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - ESTABLISH_OUT_SESSION( iSomeOtherSession ); - - iClipSession = CMusEngClipSession::NewL( TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - iClipSession->SetClipL( KTestVideoFileName() ); - - TBuf<50> videoCodec; - videoCodec.Copy( KMceSDPNameH264() ); - iClipSession->SetSupportedVideoCodecListL(videoCodec); - - // Construct and establish an incoming session - iReceiveSession = CMusEngReceiveSession::NewL( TRect(0,0, 100,100), - *iObserver, - *iObserver ); - 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->AcceptInvitationL( ETrue ); - - iObserver->Reset(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::Teardown( ) - { - delete iLiveSession; - delete iClipSession; - delete iReceiveSession; - delete iObserver; - delete iSomeOtherSession; - - } - - - -// TEST CASES - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_TerminateLL() - { - TRAPD( error, iLiveSession->TerminateL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - ESTABLISH_OUT_SESSION( iLiveSession ); - - EUNIT_ASSERT( iLiveSession->iSession->iState == CMceSession::EEstablished ); - - iLiveSession->TerminateL(); - - EUNIT_ASSERT( iLiveSession->iSession->iState == CMceSession::ETerminating ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_GetSessionTimeL() - { - EUNIT_ASSERT( iLiveSession->GetSessionTime() < TTimeIntervalSeconds( 0 ) ); - - // Invite - iLiveSession->InviteL( KTestRecipientSipUri ); - - 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_CMusEngMceSession_ConnectionActiveL() - { - EUNIT_ASSERT( !iLiveSession->ConnectionActive() ); - - ESTABLISH_OUT_SESSION( iLiveSession ); - - EUNIT_ASSERT( iLiveSession->ConnectionActive() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_ContainsAudioLL() - { - // Try without session, fails - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->ContainsAudioL(), KErrNotReady ) - - // Establish session without audio - ESTABLISH_OUT_SESSION( iLiveSession ) - - EUNIT_ASSERT( !iLiveSession->ContainsAudioL() ) - - // Establish session with audio - ESTABLISH_OUT_SESSION( iClipSession ) - - EUNIT_ASSERT( iClipSession->ContainsAudioL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_IsMutedLL() - { - // Try without session, fails - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IsMutedL(), KErrNotReady ) - - // Establish session without audio - ESTABLISH_OUT_SESSION( iLiveSession ) - - EUNIT_ASSERT( iLiveSession->IsMutedL() ) - - // Establish session with audio - ESTABLISH_OUT_SESSION( iClipSession ) - - EUNIT_ASSERT( !iClipSession->IsMutedL() ) // Not muted although disabled - - iClipSession->EnableDisplayL( ETrue ); // Enabled also speaker - - EUNIT_ASSERT( !iClipSession->IsMutedL() ) // Enabled and not muted - - iClipSession->MuteL(); - - EUNIT_ASSERT( iClipSession->IsMutedL() ) // Explicitly muted - - iClipSession->UnmuteL(); - - EUNIT_ASSERT( !iClipSession->IsMutedL() ) // Explicitly unmuted - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_OrientationLL() - { - // Try without session, fails - EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->OrientationL(), KErrNotReady ) - - // Establish a session and try all the MCE rotation values - ESTABLISH_OUT_SESSION( iLiveSession ) - - CMceDisplaySink* display = - MusEngMceUtils::GetDisplayL( *iLiveSession->iSession ); - - display->iRotation = CMceDisplaySink::ENone; - EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), - CMusEngMceSession::EPortrait ) - - display->iRotation = CMceDisplaySink::EClockwise90Degree; - EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), - CMusEngMceSession::ELandscape ) - - display->iRotation = CMceDisplaySink::EClockwise180Degree; - EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), - CMusEngMceSession::ELandscape ) - - display->iRotation = CMceDisplaySink::EClockwise270Degree; - EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), - CMusEngMceSession::ELandscape ) - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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_CMusEngMceSession_VolumeUpLL() - { - // Try without session, fails - TRAPD( error, iLiveSession->VolumeUpL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // Test only usage of CMceSpeaker, phone part is tested in base class - - // Check that nothing crashes without any speakers - iReceiveSession->VolumeUpL(); - - // Establish session - ESTABLISH_OUT_SESSION( iClipSession ) - - TInt initialVolume = iClipSession->VolumeL(); - - iClipSession->VolumeUpL(); - - // Check that all speaker volumes are adjusted and store one speaker pointer - - CMceSpeakerSink* speaker = NULL; - - CMceSession* session = iClipSession->iSession; - - for ( TInt i = 0; i < session->Streams().Count(); ++i ) - { - for ( TInt j = 0; j < session->Streams()[i]->Sinks().Count(); ++j ) - { - if ( session->Streams()[i]->Sinks()[j]->Type() == KMceSpeakerSink ) - { - speaker = static_cast( - session->Streams()[i]->Sinks()[j] ); - EUNIT_ASSERT( speaker->VolumeL() == initialVolume + 1 ); - } - } - } - - while ( iClipSession->VolumeL() < speaker->MaxVolumeL() ) - { - iClipSession->VolumeUpL(); - } - - iClipSession->VolumeUpL(); // Does not do anything to volume - - EUNIT_ASSERT( iClipSession->VolumeL() == speaker->MaxVolumeL() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_VolumeDownLL() - { - // Try without session, fails - TRAPD( error, iLiveSession->VolumeDownL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // Test only usage of CMceSpeaker, phone part is tested in base class - - // Check that nothing crashes without any speakers - iReceiveSession->VolumeUpL(); - - // Establish session - ESTABLISH_OUT_SESSION( iClipSession ) - - TInt initialVolume = iClipSession->VolumeL(); - - iClipSession->VolumeDownL(); - - // Check that all speaker volumes are adjusted and store one speaker pointer - - CMceSpeakerSink* speaker = NULL; - - CMceSession* session = iClipSession->iSession; - - for ( TInt i = 0; i < session->Streams().Count(); ++i ) - { - for ( TInt j = 0; j < session->Streams()[i]->Sinks().Count(); ++j ) - { - if ( session->Streams()[i]->Sinks()[j]->Type() == KMceSpeakerSink ) - { - speaker = static_cast( - session->Streams()[i]->Sinks()[j] ); - EUNIT_ASSERT( speaker->VolumeL() == initialVolume - 1 ); - } - } - } - - while ( iClipSession->VolumeL() > 0 ) - { - iClipSession->VolumeDownL(); - } - - iClipSession->VolumeDownL(); // Does not do anything to volume - - EUNIT_ASSERT_EQUALS( iClipSession->VolumeL(), 0 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_SetVolumeLL() - { - // Try without session, fails - TInt newVolume = KTelephonyVolumeDefaultValue + 1; - - TRAPD( error, iLiveSession->SetVolumeL( newVolume ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // Test only usage of CMceSpeaker, phone part is tested in base class - - // Check that nothing crashes without any speakers - iReceiveSession->SetVolumeL( newVolume ); - - // Establish session - ESTABLISH_OUT_SESSION( iClipSession ) - - TInt initialVolume = iClipSession->VolumeL(); - - iClipSession->SetVolumeL( newVolume ); - - // Check that all speaker volumes are adjusted and store one speaker pointer - - CMceSpeakerSink* speaker = NULL; - - CMceSession* session = iClipSession->iSession; - - for ( TInt i = 0; i < session->Streams().Count(); ++i ) - { - for ( TInt j = 0; j < session->Streams()[i]->Sinks().Count(); ++j ) - { - if ( session->Streams()[i]->Sinks()[j]->Type() == KMceSpeakerSink ) - { - speaker = static_cast( - session->Streams()[i]->Sinks()[j] ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume ); - } - } - } - - newVolume = speaker->MaxVolumeL() + 1; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == speaker->MaxVolumeL() ); - - newVolume = -1; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == 0 ); - - // Test situation where MCE max volume is bigger than MUS max vol - SetMaxVolForSpeakersL(*session, KMusEngMaxVolume * 10); - newVolume = 5; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 10 ); - newVolume = 1; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 10 ); - newVolume = KMusEngMaxVolume; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 10 ); - - SetMaxVolForSpeakersL(*session, KMusEngMaxVolume * 1000); - newVolume = 7; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 1000 ); - newVolume = 1; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 1000 ); - newVolume = KMusEngMaxVolume; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume * 1000 ); - - - // Test situation where MCE max volume is smaller than MUS max vol - SetMaxVolForSpeakersL(*session, KMusEngMaxVolume / 2); - newVolume = 3; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume / 2 ); - newVolume = 1; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == 1 ); - newVolume = KMusEngMaxVolume; - iClipSession->SetVolumeL( newVolume ); - EUNIT_ASSERT( iClipSession->VolumeL() == newVolume ); - EUNIT_ASSERT( speaker->VolumeL() == newVolume / 2 ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_EnableDisplayL() - { - 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 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_MuteLL() - { - TRAPD( error, iClipSession->MuteL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - ESTABLISH_OUT_SESSION_AND_START_STREAMING( iClipSession ); - - const RPointerArray streams = - iClipSession->iSession->Streams(); - - iClipSession->MuteL(); - - // Check that all audio speaker sinks are disabled and only those - for ( TInt i = 0; i < streams.Count(); ++i ) - { - for ( TInt j = 0; j < streams[i]->Sinks().Count(); ++j ) - { - CMceMediaSink* sink = streams[i]->Sinks()[j]; - if ( sink->Type() == KMceSpeakerSink && - streams[i]->Type() == KMceAudio ) - { - EUNIT_ASSERT( sink->IsEnabled() == EFalse ) - } - else - { - EUNIT_ASSERT( sink->IsEnabled() == ETrue ) - } - } - } - - EUNIT_ASSERT( iClipSession->iExplicitlyMuted ) - - // Try to mute again, request should be ignored without actions or leaving - - iClipSession->MuteL(); - - } - - -// ----------------------------------------------------------------------------- -// Relies on previous test -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_UnmuteLL() - { - TRAPD( error, iClipSession->UnmuteL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - ESTABLISH_OUT_SESSION( iClipSession ); - - const RPointerArray streams = - iClipSession->iSession->Streams(); - - iClipSession->MuteL(); - - iClipSession->UnmuteL(); - - // Check that all audio speaker sinks are enabled - - for ( TInt i = 0; i < streams.Count(); ++i ) - { - for ( TInt j = 0; j < streams[i]->Sinks().Count(); ++j ) - { - if ( streams[i]->Sinks()[j]->Type() == KMceSpeakerSink ) - { - EUNIT_ASSERT( streams[i]->Sinks()[j]->IsEnabled() == ETrue ) - } - } - } - - EUNIT_ASSERT( !iClipSession->iExplicitlyMuted ) - - // Try to unmute again, request should be ignored without actions or leaving - - iClipSession->UnmuteL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_HandleTerminationL() - { - // Try different values - iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCodeNoCodeSet, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionTerminatedCalled ); - iObserver->Reset(); - - iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCode200OK, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionTerminatedCalled ); - iObserver->Reset(); - - iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCodeUnknown, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_AdjustVideoCodecLL() - { - // CMusEngMceSession::AdjustVideoCodecL does nothing, so NULL test is enough - CMceVideoCodec* codec = - iLiveSession->iManager->SupportedVideoCodecs()[0]->CloneL(); - CleanupStack::PushL( codec ); - iLiveSession->CMusEngMceSession::AdjustVideoCodecL( *codec ); - CleanupStack::PopAndDestroy( codec ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_AdjustAudioCodecLL() - { - 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_CMusEngMceSession_RectChangedLL() - { - - // 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_CMusEngMceSession_SetSessionSdpLinesLL() - { - // set operator variant off - MultimediaSharingSettings::SetOperatorVariantSettingL( - MusSettingsKeys::EStandard ); - - // There is no sdp lines in session, right one is added - - CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, - KTestOriginator ); - CleanupStack::PushL( inSession ); - - iReceiveSession->SetSessionSdpLinesL( *inSession ); - - MDesC8Array* sdpLines = inSession->SessionSDPLinesL(); - CleanupDeletePushL( sdpLines ); - - EUNIT_ASSERT( sdpLines ); - EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); - - CleanupStack::PopAndDestroy(); // sdplines - - // There is one line ready, replace it with right one - CDesC8Array* newSdpLines = new ( ELeave ) CDesC8ArrayFlat( 3 ); - CleanupStack::PushL( newSdpLines ); - newSdpLines->AppendL( KTestRecipientRandomText8() ); - inSession->SetSessionSDPLinesL( newSdpLines ); - CleanupStack::Pop( newSdpLines ); - - iReceiveSession->SetSessionSdpLinesL( *inSession ); - - sdpLines = inSession->SessionSDPLinesL(); - CleanupDeletePushL( sdpLines ); - - EUNIT_ASSERT( sdpLines ); - EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); - - CleanupStack::PopAndDestroy(); // sdplines - - - CleanupStack::PopAndDestroy( inSession ); - - // for operator variant testing - // set operator variant - iReceiveSession->iOperatorVariant = ETrue; - - // There is no sdp lines in session, right ones are added to session and media level - inSession = CMceInSession::NewL( *iReceiveSession->iManager, - KTestOriginator ); - CleanupStack::PushL( inSession ); - - iReceiveSession->SetSessionSdpLinesL( *inSession ); - - sdpLines = inSession->SessionSDPLinesL(); - CleanupDeletePushL( sdpLines ); - - EUNIT_ASSERT( sdpLines ); - EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineApplication() ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineType() ); - - CleanupStack::PopAndDestroy(); // sdplines - - MDesC8Array* mediaSdpLines = - iReceiveSession->iSession->Streams()[ 0 ]->MediaAttributeLinesL(); - CleanupDeletePushL( mediaSdpLines ); - TBool bandwidthFoundFromMediaLevel = EFalse; - for ( TInt i = 0; mediaSdpLines && i < mediaSdpLines->MdcaCount(); i++ ) - { - if ( mediaSdpLines->MdcaPoint( i ).Compare( - KMusEngSessionSdpLineBandwidthField() ) == 0 ) - { - bandwidthFoundFromMediaLevel = ETrue; - } - } - EUNIT_ASSERT( bandwidthFoundFromMediaLevel ); - CleanupStack::PopAndDestroy( mediaSdpLines ); - - // There is one line ready, replace it with right ones - newSdpLines = new ( ELeave ) CDesC8ArrayFlat( 3 ); - CleanupStack::PushL( newSdpLines ); - newSdpLines->AppendL( KTestRecipientRandomText8() ); - inSession->SetSessionSDPLinesL( newSdpLines ); - CleanupStack::Pop( newSdpLines ); - - iReceiveSession->SetSessionSdpLinesL( *inSession ); - - sdpLines = inSession->SessionSDPLinesL(); - CleanupDeletePushL( sdpLines ); - - EUNIT_ASSERT( sdpLines ); - EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineApplication() ); - EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineType() ); - - CleanupStack::PopAndDestroy(); // sdplines - - - CleanupStack::PopAndDestroy( inSession ); - - - // set operator variant off - MultimediaSharingSettings::SetOperatorVariantSettingL( - MusSettingsKeys::EStandard ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_AdjustStreamsAndCodecsLL() - { - // 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 ); - } - - // Test for Configuration based codec removal. Magic uid not set. - CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); - videoStream->AddCodecL( codecAvc ); - CleanupStack::Pop( codecAvc ); - iClipSession->AdjustStreamsAndCodecsL(); - TBool avcCodecFound(EFalse); - for ( TInt i = 0; i < videoStream->Codecs().Count(); i++ ) - { - if( !videoStream->Codecs()[ i ]->SdpName().CompareF( KMceSDPNameH264 ) ) - { - avcCodecFound = ETrue; - } - } - // AVC should present - EUNIT_ASSERT(avcCodecFound); - - // Test for Configuration based codec removal. Magic uid set. - // Store the real value and revert back later , so that other tests will not be affected. - TUid uid = MultimediaSharingSettings::EncodingDeviceL(); - TInt32 KMusDisableAVC = 0x0fffffff; - MultimediaSharingSettings::SetPropertyValueL( MusSettingsKeys::KEncodingDevice,KMusDisableAVC); - codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); - videoStream->AddCodecL( codecAvc ); - CleanupStack::Pop( codecAvc ); - codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); - videoStream->AddCodecL( codecH2632000 ); - CleanupStack::Pop( codecH2632000 ); - iClipSession->AdjustStreamsAndCodecsL(); - for ( TInt i = 0; i < videoStream->Codecs().Count(); i++ ) - { - // H264 ( AVC ) codec should be removed - EUNIT_ASSERT( - videoStream->Codecs()[ i ]->SdpName().CompareF( KMceSDPNameH264 ) ); - } - - - MultimediaSharingSettings::SetPropertyValueL( MusSettingsKeys::KEncodingDevice,uid.iUid); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_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_CMusEngMceSession_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_CMusEngMceSession_StreamStateChangedL() - { - // Try without a session, nothing happens - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - iLiveSession->CMusEngMceSession::StreamStateChanged( *audioStream ); - CleanupStack::PopAndDestroy( audioStream ); - - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EStreaming, stream is streaming, other than video out- or instream - changedStream->iState = CMceMediaStream::EStreaming; - iLiveSession->CMusEngMceSession::StreamStateChanged( - *iLiveSession->iSession->Streams()[1] ); - EUNIT_ASSERT( iObserver->IsReseted() ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - } - - -// ----------------------------------------------------------------------------- -// All the possibilities are tested in order to make sure unit tests are changed -// when function is changed -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_StreamStateChangedWithSourceL() - { - // Try without a session, nothing happens - iLiveSession->CMusEngMceSession::StreamStateChanged( - *CMceAudioStream::NewLC(), - *CMceRtpSource::NewLC() ); - - CleanupStack::PopAndDestroy(); // rtp - CleanupStack::PopAndDestroy(); // audiostream - - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - } - - -// ----------------------------------------------------------------------------- -// All the possibilities are tested in order to make sure unit tests are changed -// when function is changed -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_StreamStateChangedWithSinkL() - { - // Try without a session, nothing happens - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - iLiveSession->CMusEngMceSession::StreamStateChanged( *audioStream ); - CleanupStack::PopAndDestroy( audioStream ); - - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // 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( iObserver->IsReseted() ); - - // EInitialized, stream is initialized - changedStream->iState = CMceMediaStream::EInitialized; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EBuffering, stream is buffering - changedStream->iState = CMceMediaStream::EBuffering; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIdle, stream is not receiving RTP - changedStream->iState = CMceMediaStream::EIdle; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EStreaming, stream is streaming - changedStream->iState = CMceMediaStream::EStreaming; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ); - iObserver->Reset(); - - // EDisabled, stream is explicitly disabled - changedStream->iState = CMceMediaStream::EDisabled; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ENoResources, stream has no needed resources to stream - changedStream->iState = CMceMediaStream::ENoResources; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscodingRequired, stream requires non-realtime transcoding - changedStream->iState = CMceMediaStream::ETranscodingRequired; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // ETranscoding, stream is transcoding in non-realtime - changedStream->iState = CMceMediaStream::ETranscoding; - iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_SessionStateChangedL() - { - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // No container, so expect to be handled as internal error - iLiveSession->SessionStateChanged( *iLiveSession->iSession, NULL ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - - // Try to tell session about some other session's state transition - - TMceTransactionDataContainer container; - - iLiveSession->SessionStateChanged( *iSomeOtherSession->iSession, &container ); - EUNIT_ASSERT( iObserver->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( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - container.Clear(); - - // EOffering - iLiveSession->iSession->iState = CMceSession::EOffering; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EIncoming - iLiveSession->iSession->iState = CMceSession::EIncoming; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - - // EReserving - iLiveSession->iSession->iState = CMceSession::EReserving; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EAnswering - iLiveSession->iSession->iState = CMceSession::EAnswering; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EProceeding - iLiveSession->iSession->iState = CMceSession::EProceeding; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - // EEstablished - iLiveSession->iSession->iState = CMceSession::EEstablished; - container.SetStatusCode( KSipStatusCode200OK ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->iSessionEstablishedCalled ); - iObserver->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( iObserver->IsReseted() ); - - // ECancelling - iLiveSession->iSession->iState = CMceSession::ECancelling; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - iObserver->Reset(); - - // ETerminating - iLiveSession->iSession->iState = CMceSession::ETerminating; - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - iObserver->Reset(); - - // ETerminated - iLiveSession->iSession->iState = CMceSession::ETerminated; - container.SetStatusCode( KSipStatusCode200OK ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, - &container ); - EUNIT_ASSERT( iObserver->iSessionTerminatedCalled ); - iObserver->Reset(); - - // Default case - iLiveSession->iSession->iState = static_cast( 10 ); - container.SetStatusCode( KSipStatusCodeNoCodeSet ); - iLiveSession->SessionStateChanged( *iLiveSession->iSession, &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_SessionConnectionStateChangedL() - { - - // Try to tell session about another session's connection state change - - iLiveSession->SessionConnectionStateChanged( *iSomeOtherSession->iSession, - ETrue ); - EUNIT_ASSERT( iObserver->IsReseted() ); // No session yet, nothing happened - - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // Now try again to notify session about session connection state change - // of an another session - iLiveSession->SessionConnectionStateChanged( *iSomeOtherSession->iSession, - ETrue ); - EUNIT_ASSERT( iObserver->IsReseted() ); // Wrong session, nothing happened - - // Try tell session connection state is active - iLiveSession->SessionConnectionStateChanged( *iLiveSession->iSession, - ETrue ); - EUNIT_ASSERT( iObserver->IsReseted() ); // Session active, nothing happened - - // Try tell session connection state is inactive - iLiveSession->SessionConnectionStateChanged( *iLiveSession->iSession, - EFalse ); - EUNIT_ASSERT( iObserver->iSessionConnectionLostCalled ); - iObserver->Reset(); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_FailedL() - { - // Try to tell session about failure of another session - - iLiveSession->Failed( *iSomeOtherSession->iSession, 0 ); - EUNIT_ASSERT( iObserver->IsReseted() ); // No session yet, nothing happened - - // Simulate sending invite - iLiveSession->InviteL( KTestRecipientSipUri() ); - - // Now try again to notify session about failure of an another session - iLiveSession->Failed( *iSomeOtherSession->iSession, 0 ); - EUNIT_ASSERT( iObserver->IsReseted() ); // Wrong session, nothing happened - - // Tell session that it has failed - iLiveSession->Failed( *iLiveSession->iSession, 0 ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_UpdateFailedL() - { - // Try to tell session about update failure of another session - iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, NULL ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); // No container, internal error - iObserver->Reset(); - - // Try again with container - TMceTransactionDataContainer container; - iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); // No session yet, nothing happened - - // Invite and try again. - iLiveSession->InviteL( KTestRecipientSipUri() ); - iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, &container ); - EUNIT_ASSERT( iObserver->IsReseted() ); // Wrong session, nothing happened¨ - - // Try with right session - iLiveSession->UpdateFailed( *iLiveSession->iSession, &container ); - EUNIT_ASSERT( iObserver->iSessionFailedCalled ); - iObserver->Reset(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_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_CMusEngMceSession_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_CMusEngMceSession_InactivityTimeoutL() - { - // Construct an audio stream for this test - - CMceAudioStream* audioStream = CMceAudioStream::NewLC(); - - CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); - audioStream->SetSourceL( rtpSource ); - CleanupStack::Pop( rtpSource ); - - iReceiveSession->InactivityTimeout( *audioStream, *rtpSource ); - - EUNIT_ASSERT( iObserver->IsReseted() ) - - CleanupStack::PopAndDestroy( audioStream ); - - // And now real inactivity timeout - - iReceiveSession->InactivityTimeout( - *iReceiveSession->iSession->Streams()[0], - *static_cast - (iReceiveSession->iSession->Streams()[0]->Source()) ); - - EUNIT_ASSERT( iObserver->iStreamIdleCalled ) - - iObserver->Reset(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_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_CMusEngMceSession_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_CMusEngMceSession_UpdateTimerEventL() - { - iLiveSession->UpdateTimerEvent(); - EUNIT_ASSERT( iObserver->iSessionTimeChangedCalled ) - EUNIT_ASSERT( iLiveSession->iUpdateTimer->IsActive() ) - iLiveSession->iUpdateTimer->Cancel(); - iObserver->Reset(); - - iLiveSession->iSecondsFromLastRtcpReport = 25; // >KMusEngRtcpInactivityThreshold - iLiveSession->UpdateTimerEvent(); - EUNIT_ASSERT( iObserver->iSessionTimeChangedCalled ) - EUNIT_ASSERT( iObserver->iInactivityTimeoutCalled ); - EUNIT_ASSERT( iLiveSession->iUpdateTimer->IsActive() ) - iLiveSession->iUpdateTimer->Cancel(); - iObserver->Reset(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::UT_CMusEngMceSession_IsRoamingBetweenAPsAllowedL() - { - // No session - EUNIT_ASSERT( iLiveSession->IsRoamingBetweenAPsAllowed() ) - - // Session idle - _LIT( KRecipientSipUri, "sip:user@some.where" ); - iLiveSession->InviteL( KRecipientSipUri ); - 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() ) - } - -// HELPERS - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngMceSession::SetMaxVolForSpeakersL(CMceSession& aSession, TInt aMaxVol) - { - for ( TInt i = 0; i < aSession.Streams().Count(); ++i ) - { - for ( TInt j = 0; j < aSession.Streams()[i]->Sinks().Count(); ++j ) - { - if ( aSession.Streams()[i]->Sinks()[j]->Type() == KMceSpeakerSink ) - { - CMceSpeakerSink* speaker = static_cast( - aSession.Streams()[i]->Sinks()[j] ); - speaker->iMaxVolume = aMaxVol; - } - } - } - } - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngMceSession, - "UT_CMusEngMceSesssion", - "UNIT" ) - -EUNIT_TEST( - "TerminateL - test ", - "CMusEngMceSession", - "TerminateL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_TerminateLL, Teardown) - -EUNIT_TEST( - "GetSessionTime - test ", - "CMusEngMceSession", - "GetSessionTime", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_GetSessionTimeL, Teardown) - -EUNIT_TEST( - "ConnectionActive - test ", - "CMusEngMceSession", - "ConnectionActive", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_ConnectionActiveL, Teardown) - -EUNIT_TEST( - "ContainsAudioL - test ", - "CMusEngMceSession", - "ContainsAudioL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_ContainsAudioLL, Teardown) - -EUNIT_TEST( - "IsMutedL - test ", - "CMusEngMceSession", - "IsMutedL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_IsMutedLL, Teardown) - -EUNIT_TEST( - "OrientationL - test ", - "CMusEngMceSession", - "OrientationL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_OrientationLL, Teardown) - -EUNIT_TEST( - "SetOrientationL - test ", - "CMusEngMceSession", - "SetOrientationL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SetOrientationLL, Teardown) - -EUNIT_TEST( - "VolumeUpL - test ", - "CMusEngMceSession", - "VolumeUpL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_VolumeUpLL, Teardown) - -EUNIT_TEST( - "VolumeDownL - test ", - "CMusEngMceSession", - "VolumeDownL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_VolumeDownLL, Teardown) - -EUNIT_TEST( - "SetVolumeL - test ", - "CMusEngMceSession", - "SetVolumeL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SetVolumeLL, Teardown) - -EUNIT_TEST( - "EnableDisplay - test ", - "CMusEngMceSession", - "EnableDisplay", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_EnableDisplayL, Teardown) - -EUNIT_TEST( - "MuteL - test ", - "CMusEngMceSession", - "MuteL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_MuteLL, Teardown) - -EUNIT_TEST( - "UnmuteL - test ", - "CMusEngMceSession", - "UnmuteL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_UnmuteLL, Teardown) - -EUNIT_TEST( - "HandleTermination - test ", - "CMusEngMceSession", - "HandleTermination", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_HandleTerminationL, Teardown) - -EUNIT_TEST( - "AdjustVideoCodecL - test ", - "CMusEngMceSession", - "AdjustVideoCodecL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_AdjustVideoCodecLL, Teardown) - -EUNIT_TEST( - "AdjustAudioCodecL - test ", - "CMusEngMceSession", - "AdjustAudioCodecL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_AdjustAudioCodecLL, Teardown) - -EUNIT_TEST( - "RectChangedL - test ", - "CMusEngMceSession", - "RectChangedL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_RectChangedLL, Teardown) - -EUNIT_TEST( - "SetSessionSdpLinesL - test ", - "CMusEngMceSession", - "SetSessionSdpLinesL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SetSessionSdpLinesLL, Teardown) - -EUNIT_TEST( - "AdjustStreamsAndCodecsL - test ", - "CMusEngMceSession", - "AdjustStreamsAndCodecsL", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_AdjustStreamsAndCodecsLL, Teardown) - -EUNIT_TEST( - "IncomingSession - test ", - "CMusEngMceSession", - "IncomingSession", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_IncomingSessionL, Teardown) - -EUNIT_TEST( - "IncomingUpdate - test ", - "CMusEngMceSession", - "IncomingUpdate", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_IncomingUpdateL, Teardown) - -EUNIT_TEST( - "StreamStateChangedL( source ) - test ", - "CMusEngMceSession", - "StreamStateChangedL( source )", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_StreamStateChangedWithSourceL, Teardown) - -EUNIT_TEST( - "SessionStateChanged - test ", - "CMusEngMceSession", - "SessionStateChanged", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SessionStateChangedL, Teardown) - -EUNIT_TEST( - "SessionConnectionStateChanged - test ", - "CMusEngMceSession", - "SessionConnectionStateChanged", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SessionConnectionStateChangedL, Teardown) - -EUNIT_TEST( - "Failed - test ", - "CMusEngMceSession", - "Failed", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_FailedL, Teardown) - -EUNIT_TEST( - "UpdateFailed - test ", - "CMusEngMceSession", - "UpdateFailed", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_UpdateFailedL, Teardown) - -EUNIT_TEST( - "StreamStateChanged - test ", - "CMusEngMceSession", - "StreamStateChanged", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_StreamStateChangedL, Teardown) - -EUNIT_TEST( - "StreamStateChangedL (sink ) - test ", - "CMusEngMceSession", - "StreamStateChangedL( sink )", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_StreamStateChangedWithSinkL, Teardown) - -EUNIT_TEST( - "SRReceived - test ", - "CMusEngMceSession", - "SRReceived", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SRReceivedL, Teardown) - -EUNIT_TEST( - "RRReceived - test ", - "CMusEngMceSession", - "RRReceived", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_RRReceivedL, Teardown) - -EUNIT_TEST( - "InactivityTimeout - test ", - "CMusEngMceSession", - "InactivityTimeout", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_InactivityTimeoutL, Teardown) - -EUNIT_TEST( - "SsrcAdded - test ", - "CMusEngMceSession", - "SsrcAdded", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SsrcAddedL, Teardown) - -EUNIT_TEST( - "SsrcRemoved - test ", - "CMusEngMceSession", - "SsrcRemoved", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_SsrcRemovedL, Teardown) - -EUNIT_TEST( - "UpdateTimerEvent - test ", - "CMusEngMceSession", - "UpdateTimerEvent", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_UpdateTimerEventL, Teardown) - -EUNIT_TEST( - "IsRoamingBetweenAPsAllowed - test ", - "CMusEngMceSession", - "IsRoamingBetweenAPsAllowed", - "FUNCTIONALITY", - SetupL, UT_CMusEngMceSession_IsRoamingBetweenAPsAllowedL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmceutils.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmceutils.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,836 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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(); - } - - -// ----------------------------------------------------------------------------- -// From MMusSipProfileUser -// ----------------------------------------------------------------------------- -// -TBool UT_MusEngMceUtils::IsRoamingBetweenAPsAllowed() - { - return ETrue; // Dummy implementation - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_MusEngMceUtils::SetupL() - { - iManager = CMceManager::NewL( TUid::Null(), NULL ); - iProfileHandler = CMusSipProfileHandler::NewL( *this ); - - 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(); - - videoIn->AddSinkL( CMceDisplaySink::NewLC( *iManager ) ); - CleanupStack::Pop(); - - videoIn->SetSourceL( CMceRtpSource::NewLC() ); - CleanupStack::Pop(); - - iVideoInSession->AddStreamL( videoIn ); - CleanupStack::Pop( videoIn ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_MusEngMceUtils::Teardown() - { - delete iEmptySession; - delete iVideoOutSession; - delete iVideoInSession; - delete iProfileHandler; - delete iManager; - } - - - -// TEST CASES - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_MusEngMceUtils::UT_MusEngMceUtils_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_MusEngMceUtils_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_MusEngMceUtils_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 outgoing video stream, succeeds - CMceVideoStream* 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_MusEngMceUtils_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_MusEngMceUtils_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_MusEngMceUtils_GetMediaSinkL() - { - 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_MusEngMceUtils_GetMediaSinkLL() - { - 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_MusEngMceUtils_GetMediaSink2L() - { - 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_MusEngMceUtils_GetMediaSinkL2L() - { - 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_MusEngMceUtils_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_MusEngMceUtils_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_MusEngMceUtils_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_MusEngMceUtils_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_MusEngMceUtils_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 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_MusEngMceUtils::UT_MusEngMceUtils_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_MusEngMceUtils_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 ); - } - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_MusEngMceUtils, - "UT_MusEngMceUtils", - "UNIT" ) - -EUNIT_TEST( - "IsVideoInStream - test ", - "MusEngMceUtils", - "IsVideoInStream", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_IsVideoInStreamL, Teardown) - -EUNIT_TEST( - "IsAudioInStream - test ", - "MusEngMceUtils", - "IsAudioInStream", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_IsAudioInStreamL, Teardown) - -EUNIT_TEST( - "GetVideoOutStreamL - test ", - "MusEngMceUtils", - "GetVideoOutStreamL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetVideoOutStreamLL, Teardown) - -EUNIT_TEST( - "GetVideoInStreamL - test ", - "MusEngMceUtils", - "GetVideoInStreamL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetVideoInStreamLL, Teardown) - -EUNIT_TEST( - "GetRecordingStream - test ", - "MusEngMceUtils", - "GetRecordingStream", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetRecordingStreamL, Teardown) - -EUNIT_TEST( - "GetMediaSink - test ", - "MusEngMceUtils", - "GetMediaSink", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetMediaSinkL, Teardown) - -EUNIT_TEST( - "GetMediaSinkL - test ", - "MusEngMceUtils", - "GetMediaSinkL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetMediaSinkLL, Teardown) - -EUNIT_TEST( - "GetMediaSink2 - test ", - "MusEngMceUtils", - "GetMediaSink2", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetMediaSink2L, Teardown) - -EUNIT_TEST( - "GetMediaSinkL2 - test ", - "MusEngMceUtils", - "GetMediaSinkL2", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetMediaSinkL2L, Teardown) - -EUNIT_TEST( - "GetCameraL - test ", - "MusEngMceUtils", - "GetCameraL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetCameraLL, Teardown) - -EUNIT_TEST( - "GetFileSourceL - test ", - "MusEngMceUtils", - "GetFileSourceL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetFileSourceLL, Teardown) - -EUNIT_TEST( - "GetDisplay - test ", - "MusEngMceUtils", - "GetDisplay", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetDisplayL, Teardown) - -EUNIT_TEST( - "GetDisplayL - test ", - "MusEngMceUtils", - "GetDisplayL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_GetDisplayLL, Teardown) - -EUNIT_TEST( - "AddDisplayL - test ", - "MusEngMceUtils", - "AddDisplayL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_AddDisplayLL, Teardown) - -EUNIT_TEST( - "AddSpeakerL - test ", - "MusEngMceUtils", - "AddSpeakerL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_AddSpeakerLL, Teardown) - -EUNIT_TEST( - "DisableStreamL - test ", - "MusEngMceUtils", - "DisableStreamL", - "FUNCTIONALITY", - SetupL, UT_MusEngMceUtils_DisableStreamLL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengoutsession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengoutsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,614 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musengoutsession.h" -#include "musengstubs.h" -#include "musengtestdefs.h" - -#include "musenglivesession.h" -#include "musengclipsession.h" -#include "mussipprofilehandler.h" - - -// SYSTEM INCLUDES -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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() - { - iObserver = new( ELeave ) CMusEngObserverStub; - iLiveSession = CMusEngLiveSession::NewL( KNullDesC(), - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - SIPStrings::OpenL(); - - iLiveSession->iPrivate = EFalse; - iLiveSession->iPrivateNumber = EFalse; - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::Teardown() - { - SIPStrings::Close(); - delete iLiveSession; - delete iObserver; - } - - - -// TEST CASES - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_InviteLL() - { - - // Initial state - EUNIT_ASSERT( !iLiveSession->iSession ); - - // Simulate failing session structure construction. - iLiveSession->InviteL( KTestRecipientSipUri ); - - iLiveSession->iSession->iState = CMceSession::EIdle; - delete iLiveSession->iSession->Streams()[0]; - const RPointerArray& constStreams = - iLiveSession->iSession->Streams(); - const_cast&>(constStreams)[0] = NULL; - - // Normal invite - iLiveSession->InviteL( KTestRecipientSipUri ); - - EUNIT_ASSERT( iLiveSession->iSession ); - // Next assertion ensures that session structure is new - 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() ); - - // Normal operator invite - delete iLiveSession; - iLiveSession = NULL; - iLiveSession = CMusEngLiveSession::NewL( KNullDesC, - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - 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->InviteL( KTestRecipientSipUri ); - - EUNIT_ASSERT( iLiveSession->iSession ); - // Next assertion ensures that session structure is new - 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() == 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() ); - - 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 ); - TBool foundBandwidthLineFromMediaLevel( EFalse ); - for ( TInt i = 0; i < iLiveSession->iSession->Streams().Count(); i++ ) - { - if ( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo ) - { - if ( iLiveSession->iSession->Streams()[0]->iMediaSDPLines->MdcaCount() > 0 && - iLiveSession->iSession->Streams()[0]->iMediaSDPLines->MdcaPoint( 0 ) == - KMusEngSessionSdpLineBandwidthField() ) - { - foundBandwidthLineFromMediaLevel = ETrue; - } - } - } - EUNIT_ASSERT( foundBandwidthLineFromMediaLevel ); - - // Try invite again, must fail - TRAPD( error, iLiveSession->InviteL( KTestRecipientSipUri ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrAlreadyExists ); - - // 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->InviteL( KTestRecipientSipUri ); - EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_CancelInviteLL() - { - // Try to cancel, must fail - TRAPD( error, iLiveSession->CancelInviteL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // Invite - iLiveSession->InviteL( KTestRecipientSipUri ); - EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); - - // Cancel - iLiveSession->CancelInviteL(); - EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::ECancelling ); - - // Try to cancel again, does nothing - iLiveSession->CancelInviteL(); - EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::ECancelling ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_EstablishSessionLL() - { - // Try to establish, must fail, because of missing session - TRAPD( error, iLiveSession->EstablishSessionL() ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - iLiveSession->iPrivate = ETrue; - iLiveSession->iPrivateNumber = EFalse; - - // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL - iLiveSession->InviteL( KTestRecipientSipUri ); - - // 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 ); - - // Privacy test : Check Private -header & originator - delete iLiveSession; - iLiveSession = NULL; - iLiveSession = CMusEngLiveSession::NewL( KNullDesC(), - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - iLiveSession->iPrivate = ETrue; - iLiveSession->iPrivateNumber = ETrue; - - // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL - iLiveSession->InviteL( KTestRecipientSipUri ); - EUNIT_ASSERT( *iLiveSession->iSession->iOriginator == KMusAnonymousHeader ); - - 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 ).Find( KMusPrivacyHeader() ) == 0 ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_HandleTerminationL() - { - - // Try different values - iLiveSession->HandleTermination( KSipStatusCode400BadRequest, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionBadRequestCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode401Unauthorized, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionUnauthorizedCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode402PaymentRequired, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionPaymentRequiredCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode404RecipientNotFound, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRecipientNotFoundCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode416UnsupportedUriScheme, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRecipientNotFoundCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode479NotAbleToProcessURI, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRecipientNotFoundCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( - KSipStatusCode407ProxyAuthenticationRequired, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionProxyAuthenticationRequiredCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode408ConnectionTimeOut, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRequestTimeOutCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode415UnsupportedMediaType, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionUnsupportedMediaTypeCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode488NotAcceptableHere, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionUnsupportedMediaTypeCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode606NotAcceptable, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionUnsupportedMediaTypeCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode486BusyHere, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionBusyHereCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode487RequestCancelled, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRequestCancelledCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode603Decline, KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRejectedCalled ); - iObserver->Reset(); - - iLiveSession->HandleTermination( KSipStatusCode480TemporarilyNotAvailable, - KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionTemporarilyNotAvailable ); - iObserver->Reset(); - - // Receive 486 with operator variant - iLiveSession->iOperatorVariant = ETrue; - iLiveSession->HandleTermination( KSipStatusCode486BusyHere, KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionRejectedCalled ) - EUNIT_ASSERT( !iObserver->iSessionBusyHereCalled ) - iObserver->Reset(); - iLiveSession->iOperatorVariant = EFalse; - - // Normal termination, let the base class handle - iLiveSession->HandleTermination( KSipStatusCode200OK, KNullDesC8() ); - EUNIT_ASSERT( iObserver->iSessionTerminatedCalled ); // called by base class - iObserver->Reset(); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_AdjustVideoCodecLL() - { - //H263 - CMceH263Codec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); - iLiveSession->CMusEngMceOutSession::AdjustVideoCodecL( *codecH263 ); - // Test payloadtype - EUNIT_ASSERT( codecH263->iPayloadType == 96 ) - CleanupStack::PopAndDestroy( codecH263 ); - - //H264 - CMceAvcCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); - iLiveSession->CMusEngMceOutSession::AdjustVideoCodecL( *codecAvc ); - // Test payloadtype - EUNIT_ASSERT( codecAvc->iPayloadType == 98 ) - CleanupStack::PopAndDestroy( codecAvc ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngOutSession::UT_CMusEngOutSession_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_CMusEngOutSession_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( - TRect(0, 100, 200, 300 ), - *iObserver, - *iObserver, - *iObserver ); - CleanupStack::PushL( clipSession ); - - clipSession->SetClipL( 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 ); - } - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngOutSession, - "UT_CMusEngOutSesssion", - "UNIT" ) - -EUNIT_TEST( - "InviteL - test ", - "CMusEngOutSession", - "InviteL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_InviteLL, Teardown) - -EUNIT_TEST( - "CancelInviteL - test ", - "CMusEngOutSession", - "CancelInviteL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_CancelInviteLL, Teardown) - -EUNIT_TEST( - "EstablishSessionL - test ", - "CMusEngOutSession", - "EstablishSessionL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_EstablishSessionLL, Teardown) - -EUNIT_TEST( - "HandleTermination - test ", - "CMusEngOutSession", - "HandleTermination", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_HandleTerminationL, Teardown) - -EUNIT_TEST( - "AdjustVideoCodecL - test ", - "CMusEngOutSession", - "AdjustVideoCodecL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_AdjustVideoCodecLL, Teardown) - -EUNIT_TEST( - "AdjustAudioCodecL - test ", - "CMusEngOutSession", - "AdjustAudioCodecL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_AdjustAudioCodecLL, Teardown) - -EUNIT_TEST( - "CreateMceSessionStructureL - test ", - "CMusEngOutSession", - "CreateMceSessionStructureL", - "FUNCTIONALITY", - SetupL, UT_CMusEngOutSession_CreateMceSessionStructureLL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengreceivesession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengreceivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1482 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musengreceivesession.h" -#include "musengstubs.h" -#include "musengtestdefs.h" -#include "musengreceivesession.h" -#include "centralrepository.h" - -// SYSTEM INCLUDES -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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( ) - { - CRepository::iStaticEncoderUid = 0; - iObserver = new( ELeave ) CMusEngObserverStub; - iReceiveSession = CMusEngReceiveSession::NewL( TRect(0,0, 100,100), - *iObserver, - *iObserver ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngReceiveSession::Teardown( ) - { - delete iReceiveSession; - delete iObserver; - CRepository::iStaticEncoderUid = 0; - - } - - -// 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 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngReceiveSession::UT_AcceptInvitationLL() - { - TMceTransactionDataContainer container; - - // There is no pending session to accept, must fail - TRAPD( error, iReceiveSession->AcceptInvitationL( ETrue ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // There is pending session, but it is not yet reserved resources, - // so accepting fails - CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); - iReceiveSession->IncomingSession( inSession, &container ); - CleanupStack::Pop( inSession ); - - TRAP( error, iReceiveSession->AcceptInvitationL( ETrue ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrNotReady ); - - // Simulate resource reservation and reject - iReceiveSession->iSession->iState = CMceSession::EProceeding; - iReceiveSession->AcceptInvitationL( EFalse ); - - EUNIT_ASSERT( iReceiveSession->iSession->iState == - CMceSession::ETerminated ); - - // Construct new session and reject it with operator variant - inSession = ConstructInSessionLC( 1, 0 ); - iReceiveSession->IncomingSession( inSession, &container ); - CleanupStack::Pop( inSession ); - iReceiveSession->iSession->iState = CMceSession::EProceeding; - iReceiveSession->iOperatorVariant = ETrue; - - iReceiveSession->AcceptInvitationL( EFalse ); - - EUNIT_ASSERT( iReceiveSession->iSession->iState == - CMceSession::ETerminated ); - - // Construct new session and accept it - inSession = ConstructInSessionLC( 1, 0 ); - iReceiveSession->IncomingSession( inSession, &container ); - CleanupStack::Pop( inSession ); - iReceiveSession->iSession->iState = CMceSession::EProceeding; - - iReceiveSession->AcceptInvitationL( ETrue ); - - EUNIT_ASSERT( iReceiveSession->iSession ); - EUNIT_ASSERT( iReceiveSession->iSession == inSession ); - EUNIT_ASSERT( iReceiveSession->iSession->iState == - CMceSession::EAnswering ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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( iObserver->iIncomingSessionCalled ) - EUNIT_ASSERT( iReceiveSession->iRingLCalled ) - iObserver->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. - iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); - EUNIT_ASSERT( iObserver->IsReseted() ) - iObserver->Reset(); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ); - iReceiveSession->AdjustVideoCodecL( *codecH2632000 ); - iReceiveSession->AdjustVideoCodecL( *codecAvc ); - iReceiveSession->AdjustVideoCodecL( *codecUnknown ); - - 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( iObserver->iIncomingSessionPreNotificationCalled ) - - 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 ); - - // Try again when there is usage of avc is turned off - iReceiveSession->iSession->iState = CMceSession::ETerminated; - TInt32 KMusDisableAVC = 0x0fffffff; - CRepository::iStaticEncoderUid = KMusDisableAVC; - - inSession = ConstructInSessionLC( 1, 0 ); - - // There will 3 AVC codecs and 1 H263 codec - EUNIT_ASSERT( static_cast( inSession->Streams()[0] )->Codecs().Count() == 4 ); - iReceiveSession->IncomingSession( inSession, &container ); - CleanupStack::Pop( inSession ); - - EUNIT_ASSERT( iReceiveSession->iSession->iState == - CMceSession::EReserving || - iReceiveSession->iSession->iState == - CMceSession::ETerminated ); - - // Should be only the H263 codec - EUNIT_ASSERT( static_cast( iReceiveSession->iSession->Streams()[0] )->Codecs().Count() <= 4 ); - - //No supported codecs - iReceiveSession->iSession->iState = CMceSession::ETerminated; - iReceiveSession->iManager->iSupportedVideoCodecs.ResetAndDestroy(); - inSession = ConstructInSessionLC( 1, 0 ); - - // There will no codecs, simulates situation where no codecs were match - //currently session is not been rejected - EUNIT_ASSERT( static_cast( inSession->Streams()[0] )->Codecs().Count() == 0 ); - iReceiveSession->IncomingSession( inSession, &container ); - CleanupStack::Pop( inSession ); - - EUNIT_ASSERT( iReceiveSession->iSession->iState == - CMceSession::EReserving || - iReceiveSession->iSession->iState == - CMceSession::ETerminated ); - - // Should be only the H263 codec - EUNIT_ASSERT( static_cast( inSession->Streams()[0] )->Codecs().Count() == 0 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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->AcceptInvitationL( ETrue ); - - // 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 ); - iObserver->Reset(); - - // Try with audiostream, nothing happens - audioStream->iState = CMceMediaStream::EBuffering; - iReceiveSession->StreamStateChanged( *audioStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // Try with videostream, but without a source, nothing happens - - // Needed hacking - CMceRtpSource* rtpSource = - static_cast( videoStream->Source() ); - videoStream->iSource = NULL; - - iReceiveSession->StreamStateChanged( *videoStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // Try with videostream and a camera source, nothing happens - - // Needed hacking - videoStream->iSource = - CMceCameraSource::NewLC( *iReceiveSession->iManager ); - CleanupStack::Pop(); - - iReceiveSession->StreamStateChanged( *videoStream ); - EUNIT_ASSERT( iObserver->IsReseted() ) - - // Remove hacks - delete videoStream->iSource; - videoStream->iSource = rtpSource; - - // Buffering, normal case - videoStream->iState = CMceMediaStream::EBuffering; - iReceiveSession->StreamStateChanged( *videoStream ); - EUNIT_ASSERT( iObserver->iStreamBufferingCalled ) - iObserver->Reset(); - - // Streaming, normal case - videoStream->iState = CMceMediaStream::EStreaming; - iReceiveSession->StreamStateChanged( *videoStream ); - EUNIT_ASSERT( iObserver->iStreamStreamingCalled ) - EUNIT_ASSERT( rtpSource->iInactivityTimer == 2000 ) - iObserver->Reset(); - - // Try default behaviors - videoStream->iState = CMceMediaStream::EIdle; - iReceiveSession->StreamStateChanged( *videoStream ); - EUNIT_ASSERT( iObserver->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->VolumeL() ) - - // 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->VolumeL() ) - - 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->VolumeL() ) - - // 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 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 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ) - } - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngReceiveSession, - "UT_CMusEngReceiveSesssion", - "UNIT" ) - -EUNIT_TEST( - "NewL - test ", - "CMusEngReceiveSession", - "NewL", - "FUNCTIONALITY", - SetupL, UT_NewLL, Teardown) - -EUNIT_TEST( - "AcceptInvitationL - test ", - "CMusEngReceiveSession", - "AcceptInvitationL", - "FUNCTIONALITY", - SetupL, UT_AcceptInvitationLL, 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( - "ParseAssertedIdentity", - "CMusEngReceiveSession", - "ParseAssertedIdentity", - "FUNCTIONALITY", - SetupL, UT_ParseAssertedIdentityL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsession.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,535 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "telephonyaudiorouting.h" -#include "ut_musengsession.h" -#include "musengstubs.h" -#include "musengtestdefs.h" - -#include "musenglivesession.h" -#include "musengtelephoneutils.h" -#include "musengmceutils.h" - -// SYSTEM INCLUDES -#include -#include -#include -#include -#include - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusEngSession* UT_CMusEngSession::NewL() - { - UT_CMusEngSession* self = UT_CMusEngSession::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusEngSession* UT_CMusEngSession::NewLC() - { - UT_CMusEngSession* self = new( ELeave ) UT_CMusEngSession(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusEngSession::~UT_CMusEngSession() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusEngSession::UT_CMusEngSession() - :iLiveSession( NULL ), - iObserver( NULL ) - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::SetupL() - { - iObserver = new( ELeave ) CMusEngObserverStub; - iLiveSession = CMusEngLiveSession::NewL( KNullDesC(), - TRect(0,0, 100,100), - *iObserver, - *iObserver, - *iObserver ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::Teardown() - { - delete iLiveSession; - delete iObserver; - } - - - -// TEST CASES - - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_RectL() - { - 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_CMusEngSession::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_CMusEngSession::UT_AudioRoutingCanBeChangedL() - { - iLiveSession->iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = - CTelephonyAudioRouting::ELoudspeaker; - EUNIT_ASSERT( iLiveSession->AudioRoutingCanBeChanged() ); - - iLiveSession->iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = - CTelephonyAudioRouting::EWiredAudioAccessory; - EUNIT_ASSERT( !iLiveSession->AudioRoutingCanBeChanged() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_EnableLoudspeakerLL() - { - // Almost dummy case is enough, because IsLoudSpeakerEnabled forwards - // requests to CMusEngTelephonyUtils and is tested there. So test only - // fail handling - iLiveSession->EnableLoudspeakerL( EFalse, EFalse ); - - CMusEngTelephoneUtils* telephone = iLiveSession->iTelephoneUtils; - - EUNIT_ASSERT( telephone->iTelephonyAudioRouting->iShowNoteMode == EFalse ); - EUNIT_ASSERT( telephone->iTelephonyAudioRouting->iCurrentOutput != - CTelephonyAudioRouting::ELoudspeaker ); - - telephone->iTelephonyAudioRouting->iForceFailWithCode = KErrNotSupported; - - //Must fail in HW, but not in emulator - TRAPD( error, iLiveSession->EnableLoudspeakerL( ETrue, ETrue ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - - #if (!defined (__WINS__) && !defined(__WINSCW__)) - EUNIT_ASSERT( error == KErrNotSupported ); - #else - EUNIT_ASSERT( error == KErrNone ); - #endif - - EUNIT_ASSERT( telephone->iTelephonyAudioRouting->iCurrentOutput != - CTelephonyAudioRouting::ELoudspeaker ); - - telephone->iTelephonyAudioRouting->iForceFailWithCode = KErrGeneral; - - // Must fail in all cases - TRAP( error, iLiveSession->EnableLoudspeakerL( EFalse, ETrue ) ); - MUS_TEST_FORWARD_ALLOC_FAILURE( error ); - EUNIT_ASSERT( error == KErrGeneral ); - - EUNIT_ASSERT( telephone->iTelephonyAudioRouting->iCurrentOutput != - CTelephonyAudioRouting::ELoudspeaker ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_IsLoudSpeakerEnabledL() - { - // Dummy case is enough, because IsLoudSpeakerEnabled forwards requests - // to CMusEngTelephonyUtils and is tested there. - - // By default loudspeaker is not enabled. - EUNIT_ASSERT( !iLiveSession->IsLoudSpeakerEnabled() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_VolumeLL() - { - // Dummy case is enough, because VolumeL forwards requests - // to CMusEngTelephonyUtils and is tested there. - - iLiveSession->IsLoudSpeakerEnabled(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_MuteMicLL() - { - // Cannot test since EUnit notices some error leak if - // the state of the mute is actually changed. Still, from MusEngine - // point of view everything is done identically despite the fact if - // real state changes or not. => Problem is in EUnit or leak happens - // elsewhere. - } - - -// ----------------------------------------------------------------------------- -// Almost a dummy test since we cannot write -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_IsMicMutedLL() - { - // Ignore error (KErrAlreadyExists etc), just make sure this property exists - RProperty::Define( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - RProperty::EInt, - 0 ); - - User::LeaveIfError( RProperty::Set( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - EPSTelMicMuteStateUninitialized ) ); - - EUNIT_ASSERT( !iLiveSession->IsMicMutedL() ) - - User::LeaveIfError( RProperty::Set( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - EPSTelMicMuteOn ) ); - - EUNIT_ASSERT( iLiveSession->IsMicMutedL() ) - - User::LeaveIfError( RProperty::Set( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - EPSTelMicMuteOff ) ); - - EUNIT_ASSERT( !iLiveSession->IsMicMutedL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_SetAudioRoutingObserverL() - { - EUNIT_ASSERT( !iLiveSession->iTelephoneUtils->iAudioRoutingObserver ) - - iLiveSession->SetAudioRoutingObserver( iObserver ); - - EUNIT_ASSERT_EQUALS( iLiveSession->iTelephoneUtils->iAudioRoutingObserver, - iObserver ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_VolumeUpLL() - { - CMusEngTelephoneUtils* telephone = iLiveSession->iTelephoneUtils; - - // Next ones must leave if runs out of memory, so that test - // does not fail when executed with alloc fail simulation - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallEarVolume, - KTelephonyVolumeDefaultValue ) ); - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallLoudspeakerVolume, - KTelephonyVolumeDefaultValue ) ); - - - TInt earVolume = 0; - TInt speakerVolume = 0; - - iLiveSession->CMusEngSession::VolumeUpL(); - - telephone->iRepository->Get( KTelIncallEarVolume, - earVolume ); - telephone->iRepository->Get( KTelIncallLoudspeakerVolume, - speakerVolume ); - - EUNIT_ASSERT( earVolume == KTelephonyVolumeDefaultValue + 1 ); - EUNIT_ASSERT( speakerVolume == KTelephonyVolumeDefaultValue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_VolumeDownLL() - { - CMusEngTelephoneUtils* telephone = iLiveSession->iTelephoneUtils; - - // Next ones must leave if runs out of memory, so that test - // does not fail when executed with alloc fail simulation - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallEarVolume, - KTelephonyVolumeDefaultValue ) ); - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallLoudspeakerVolume, - KTelephonyVolumeDefaultValue ) ); - - - TInt earVolume = 0; - TInt speakerVolume = 0; - - iLiveSession->CMusEngSession::VolumeDownL(); - - telephone->iRepository->Get( KTelIncallEarVolume, - earVolume ); - telephone->iRepository->Get( KTelIncallLoudspeakerVolume, - speakerVolume ); - - EUNIT_ASSERT( earVolume == KTelephonyVolumeDefaultValue - 1 ); - EUNIT_ASSERT( speakerVolume == KTelephonyVolumeDefaultValue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSession::UT_SetVolumeLL() - { - CMusEngTelephoneUtils* telephone = iLiveSession->iTelephoneUtils; - - // Next ones must leave if runs out of memory, so that test - // does not fail when executed with alloc fail simulation - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallEarVolume, - KTelephonyVolumeDefaultValue ) ); - User::LeaveIfError( telephone->iRepository->Set( - KTelIncallLoudspeakerVolume, - KTelephonyVolumeDefaultValue ) ); - - - TInt earVolume = 0; - TInt speakerVolume = 0; - TInt newVolume = KTelephonyVolumeDefaultValue + 1; - - iLiveSession->CMusEngSession::SetVolumeL( newVolume ); - - telephone->iRepository->Get( KTelIncallEarVolume, - earVolume ); - telephone->iRepository->Get( KTelIncallLoudspeakerVolume, - speakerVolume ); - - EUNIT_ASSERT( earVolume == newVolume ); - EUNIT_ASSERT( speakerVolume == KTelephonyVolumeDefaultValue ); - } - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngSession, - "UT_CMusEngSesssion", - "UNIT" ) - -EUNIT_TEST( - "Rect - test ", - "CMusEngSession", - "Rect", - "FUNCTIONALITY", - SetupL, UT_RectL, Teardown) - -EUNIT_TEST( - "SetRectL - test ", - "CMusEngSession", - "SetRectL", - "FUNCTIONALITY", - SetupL, UT_SetRectLL, Teardown) - -EUNIT_TEST( - "AudioRoutingCanBeChanged - test ", - "CMusEngSession", - "AudioRoutingCanBeChanged", - "FUNCTIONALITY", - SetupL, UT_AudioRoutingCanBeChangedL, Teardown) - -EUNIT_TEST( - "EnableLoudspeakerL - test ", - "CMusEngSession", - "EnableLoudspeakerL", - "FUNCTIONALITY", - SetupL, UT_EnableLoudspeakerLL, Teardown) - -EUNIT_TEST( - "IsLoudSpeakerEnabled - test ", - "CMusEngSession", - "IsLoudSpeakerEnabled", - "FUNCTIONALITY", - SetupL, UT_IsLoudSpeakerEnabledL, Teardown) - -EUNIT_TEST( - "VolumeL - test ", - "CMusEngSession", - "VolumeL", - "FUNCTIONALITY", - SetupL, UT_VolumeLL, Teardown) - -EUNIT_TEST( - "MuteMicL - test ", - "CMusEngSession", - "MuteMicL", - "FUNCTIONALITY", - SetupL, UT_MuteMicLL, Teardown) - -EUNIT_TEST( - "IsMicMutedL - test ", - "CMusEngSession", - "IsMicMutedL", - "FUNCTIONALITY", - SetupL, UT_IsMicMutedLL, Teardown) - -EUNIT_TEST( - "SetAudioRoutingObserverL - test ", - "CMusEngSession", - "SetAudioRoutingObserverL", - "FUNCTIONALITY", - SetupL, UT_SetAudioRoutingObserverL, Teardown) - -EUNIT_TEST( - "VolumeUpL - test ", - "CMusEngSession", - "VolumeUpL", - "FUNCTIONALITY", - SetupL, UT_VolumeUpLL, Teardown) - -EUNIT_TEST( - "VolumeDownL - test ", - "CMusEngSession", - "VolumeDownL", - "FUNCTIONALITY", - SetupL, UT_VolumeDownLL, Teardown) - -EUNIT_TEST( - "SetVolumeL - test ", - "CMusEngSession", - "SetVolumeL", - "FUNCTIONALITY", - SetupL, UT_SetVolumeLL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessiondurationtimer.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessiondurationtimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsipprofilehandler.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsipprofilehandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,362 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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(); - } - - -// ----------------------------------------------------------------------------- -// From MMusSipProfileUser -// ----------------------------------------------------------------------------- -// -TBool UT_CMusEngSipProfileHandler::IsRoamingBetweenAPsAllowed() - { - return iRoamingBetweenAPsAllowed; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSipProfileHandler::SetupL() - { - iProfileHandler = CMusSipProfileHandler::NewL( *this ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSipProfileHandler::Teardown() - { - delete iProfileHandler; - iRoamingBetweenAPsAllowed = EFalse; - } - - - -// TEST CASES - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngSipProfileHandler::UT_CMusEngSipProfileHandler_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_CMusEngSipProfileHandler_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_CMusEngSipProfileHandler_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 - 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_CMusEngSipProfileHandler_NullTestsL() - { - // Dummies - CSIPTransactionBase transactionBase; - CSIPServerTransaction serverTransaction; - CSIPDialog dialog; - CSIPClientTransaction clientTransaction; - CSIPDialogAssocBase dialogAssocBase; - CSIPRegistrationBinding registrationBinding; - CSIPRefresh refresh; - - // Tests - iProfileHandler->ProfileRegistryEventOccurred( 0, - MSIPProfileRegistryObserver::EProfileCreated ); - 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_CMusEngSipProfileHandler_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 ); - } - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusEngSipProfileHandler, - "UT_CMusEngSipProfileHandler", - "UNIT" ) - -EUNIT_TEST( - "CreateSipProfileL - test ", - "CMusSipProfileHandler", - "CreateSipProfileL", - "FUNCTIONALITY", - SetupL, UT_CMusEngSipProfileHandler_CreateSipProfileLL, Teardown) - -EUNIT_TEST( - "ProfileId - test ", - "CMusSipProfileHandler", - "ProfileId", - "FUNCTIONALITY", - SetupL, UT_CMusEngSipProfileHandler_ProfileIdL, Teardown) - -EUNIT_TEST( - "AlrEventL - test ", - "CMusEngSipProfileHandler", - "AlrEventL", - "FUNCTIONALITY", - SetupL, UT_CMusEngSipProfileHandler_AlrEventL, Teardown) - -EUNIT_TEST( - "Null tests for NOP functions", - "CMusEngSipProfileHandler", - "Several NOP functions", - "FUNCTIONALITY", - SetupL, UT_CMusEngSipProfileHandler_NullTestsL, Teardown) - -EUNIT_TEST( - "UserFromProfileLC - test ", - "CMusEngOutSession", - "UserFromProfileLC", - "FUNCTIONALITY", - SetupL, UT_CMusEngSipProfileHandler_UserFromProfileLCL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtelephoneutils.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtelephoneutils.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,549 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "telephonyaudiorouting.h" -#include "ut_musengtelephoneutils.h" -#include "musengstubs.h" -#include "musengtestdefs.h" - -#include "musengtelephoneutils.h" - -// SYSTEM INCLUDES -#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(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusEngTelephoneUtils::Teardown() - { - delete iObserver; - delete iTelephoneUtils; - } - - - -// 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, ETrue ); - EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput == - CTelephonyAudioRouting::ELoudspeaker ); - EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iShowNoteMode == - EFalse ); - EUNIT_ASSERT( iTelephoneUtils->iShowDialog == ETrue ); - - // Change conditions - iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = - CTelephonyAudioRouting::EWiredAudioAccessory; - - // Try to set loudspeaker on, fails because current set is not handset - iTelephoneUtils->LoudspeakerL( ETrue, 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, ETrue ); - 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, ETrue ); - 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() - { - iTelephoneUtils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; - - iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = - CTelephonyAudioRouting::ELoudspeaker; - - iTelephoneUtils->OutputChanged( *iTelephoneUtils->iTelephonyAudioRouting ); - - EUNIT_ASSERT_EQUALS( iTelephoneUtils->iAudioOutputAtStartup, - CTelephonyAudioRouting::ELoudspeaker ) - - // Test observer - - iTelephoneUtils->SetAudioRoutingObserver( iObserver ); - - 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() - { - iTelephoneUtils->SetAudioRoutingObserver( iObserver ); - - // Setoutput fails - iTelephoneUtils->SetOutputComplete( - *iTelephoneUtils->iTelephonyAudioRouting, - KErrGeneral ); - - EUNIT_ASSERT( !iObserver->iAudioRoutingChangedCalled ) - - // Setoutput succesful and note is shown by audiorouting api - // There's already next pending setoutput for which we are going to - // show note -> that cannot be forgotten - iTelephoneUtils->iShowDialog = ETrue; - iTelephoneUtils->iTelephonyAudioRouting->SetShowNote( ETrue ); - iTelephoneUtils->SetOutputComplete( - *iTelephoneUtils->iTelephonyAudioRouting, - KErrNone ); - EUNIT_ASSERT( iObserver->iAudioRoutingChangedCalled == ETrue ) - EUNIT_ASSERT( iObserver->iShowNote == EFalse ) - EUNIT_ASSERT( iTelephoneUtils->iShowDialog == ETrue ) - - iObserver->Reset(); - - // Setoutput succesful and note is shown by us - iTelephoneUtils->iTelephonyAudioRouting->SetShowNote( EFalse ); - iTelephoneUtils->SetOutputComplete( - *iTelephoneUtils->iTelephonyAudioRouting, - KErrNone ); - EUNIT_ASSERT( iObserver->iAudioRoutingChangedCalled == ETrue ) - EUNIT_ASSERT( iObserver->iShowNote == ETrue ) - EUNIT_ASSERT( iTelephoneUtils->iShowDialog == EFalse ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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(); - 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(); - 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(); - 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(); - 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->iAudioRouteChangeAllowed = EFalse; - utils->SetAudioRoutingObserver( 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenguriparser.cpp --- a/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenguriparser.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,405 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musenguriparser.h" -#include "musenguriparser.h" -#include "musengtestdefs.h" -#include "mussettingskeys.h" -#include "mussettings.h" - -// SYSTEM INCLUDES -#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() - { - - } - - - -// 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, KErrCorrupt ); - - // 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/bwins/musindicatoru.def --- a/mmsharing/mmshindicator/bwins/musindicatoru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - ?NewL@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 1 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(class MMusIndicatorObserver &) - ?NewL@CMusIndicatorApi@@SAPAV1@XZ @ 2 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(void) - ?NewLC@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 3 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewLC(class MMusIndicatorObserver &) - ?IndicateAvailabilityL@CMusIndicatorApi@@QAEXXZ @ 4 NONAME ; void CMusIndicatorApi::IndicateAvailabilityL(void) - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/data/musindicator.rss --- a/mmsharing/mmshindicator/data/musindicator.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/data/tone.amr Binary file mmsharing/mmshindicator/data/tone.amr has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/eabi/musindicatoru.def --- a/mmsharing/mmshindicator/eabi/musindicatoru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - _ZN16CMusIndicatorApi21IndicateAvailabilityLEv @ 1 NONAME - _ZN16CMusIndicatorApi4NewLER21MMusIndicatorObserver @ 2 NONAME - _ZN16CMusIndicatorApi4NewLEv @ 3 NONAME - _ZN16CMusIndicatorApi5NewLCER21MMusIndicatorObserver @ 4 NONAME - _ZTI15CMusSoundPlayer @ 5 NONAME - _ZTI16CMusIndicatorApi @ 6 NONAME - _ZTI16CMusIndicatorDsa @ 7 NONAME - _ZTV15CMusSoundPlayer @ 8 NONAME - _ZTV16CMusIndicatorApi @ 9 NONAME - _ZTV16CMusIndicatorDsa @ 10 NONAME - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/graphics/qgn_mus_ready.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/graphics/qgn_mus_ready_mask.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/graphics/qgn_mus_ready_mask_soft.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready_mask_soft.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/group/bld.inf --- a/mmsharing/mmshindicator/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/group/musindicator.mmp --- a/mmsharing/mmshindicator/group/musindicator.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/inc/musindicatordsa.h --- a/mmsharing/mmshindicator/inc/musindicatordsa.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/inc/musresourceutil.h --- a/mmsharing/mmshindicator/inc/musresourceutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/inc/mussoundplayer.h --- a/mmsharing/mmshindicator/inc/mussoundplayer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/src/musindicatorapi.cpp --- a/mmsharing/mmshindicator/src/musindicatorapi.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,350 +0,0 @@ -/* -* 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 - - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 iIndicatorWindow; - delete iSoundPlayer; - if ( !IsSubscriber() ) - { - Indicator( EFalse ); - } - - iProperty.Close(); - - MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::~CMusIndicatorApi" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusIndicatorApi::IsSubscriber() const - { - return !iObserver; - } - - -// ----------------------------------------------------------------------------- -// Indicates VS availability to user. -// In operator specific variant this can include 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::AuditoryNotificationSettingL() == - MusSettingsKeys::EAuditoryNotificationOn ) - { - MUS_LOG( "mus: [MUSIND] 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" ) - - 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() == - MusSettingsKeys::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 ( 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" ) - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/src/musindicatordsa.cpp --- a/mmsharing/mmshindicator/src/musindicatordsa.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,491 +0,0 @@ -/* -* 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") - if ( AknLayoutUtils::LayoutMirrored() ) - { - CGraphicsContext::TDrawTextExtendedParam drawParam; - drawParam.iParRightToLeft = ETrue; - gc.DrawTextExtended(*iText, iTextpos,drawParam); - } - else - { - 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; - if ( AknLayoutUtils::LayoutMirrored() ) - { - // Text position - iTextpos.iX = ( iScreenRect.Width() - imagePlusTextWidth ) >> 1; - - iTextpos.iY = ( iScreenRect.Height() >> 1 ) + - ( Font().HeightInPixels() >> 1 ) + - iScreenRect.iTl.iY; - - iImagepos.iX = iTextpos.iX + - Font().TextWidthInPixels( *iText ) + - KMusSpaceBetweenImageAndText; - iImagepos.iY = ( iScreenRect.Height() - iImageSize.iHeight ) >> 1; - } - else - { - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/src/musresourceutil.cpp --- a/mmsharing/mmshindicator/src/musresourceutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/src/mussoundplayer.cpp --- a/mmsharing/mmshindicator/src/mussoundplayer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.mmp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.rss --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 = EIndicatorTestAppIconNotification; txt = "Set icon notification";}, - MENU_ITEM {command = EIndicatorTestAppNoIconNotification; txt = "Set no icon notification";}, - - MENU_ITEM {command = EAknSoftkeyExit; txt = "Exit";} - }; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rls --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rls Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rss --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_reg.rss --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_reg.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/bld.inf --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_MMPFILES - -IndicatorTestApp.mmp - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestApp.hrh --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestApp.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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, - EIndicatorTestAppIconNotification, - EIndicatorTestAppNoIconNotification - - }; - - -#endif // __IndicatorTestApp_HRH__ diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppApplication.h --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppApplication.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppui.h --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppui.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppview.h --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppDocument.h --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppDocument.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/sis/IndicatorTestApp.pkg --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/sis/IndicatorTestApp.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestApp.cpp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestApp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppApplication.cpp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppApplication.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* 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: - { - break; - } - case EIndicatorTestAppSharingNotAvailable: - { - 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::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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppview.cpp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppDocument.cpp --- a/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppDocument.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/BWINS/ut_musindicatoru.def --- a/mmsharing/mmshindicator/tsrc/ut_indicator/BWINS/ut_musindicatoru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/group/bld.inf --- a/mmsharing/mmshindicator/tsrc/ut_indicator/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* 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_TESTMMPFILES -ut_musindicator.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/group/ut_musindicator.mmp --- a/mmsharing/mmshindicator/tsrc/ut_indicator/group/ut_musindicator.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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 - -// STUB SOURCES -SOURCEPATH ../../../../../tsrc/propertystub/src -SOURCE e32property.cpp -SOURCEPATH ../../../../../tsrc/fbsbitmapstub/src -SOURCE fbs.cpp - -// STUB INCLUDES - -// To replace RProperty with a stub -SYSTEMINCLUDE ../../../../../tsrc/propertystub/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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatorapi.h --- a/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatorapi.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* 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_IndicateAvailabilityLL(); - void UT_CMusIndicatorApi_RunLL(); - void UT_CMusIndicatorApi_DoCancelL(); - void UT_CMusIndicatorApi_RunErrorL(); - void UT_CMusIndicatorApi_PlaySoundCompleteL(); - void UT_CMusIndicatorApi_PlayToneLL(); - - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatordsa.h --- a/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatordsa.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmussoundplayer.h --- a/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmussoundplayer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/src/dllmain.cpp --- a/mmsharing/mmshindicator/tsrc/ut_indicator/src/dllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatorapi.cpp --- a/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatorapi.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,279 +0,0 @@ -/* -* 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 - - -// ======== 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 ); - iStartLiveSharingLCalled = EFalse; - } - - -// ---------------------------------------------------------------------------- -// Finalizes a test by releasing used resources. -// ---------------------------------------------------------------------------- -// -void UT_CMusIndicatorApi::Teardown() - { - delete iIndicatorApi; - 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 ); - } - - -// ---------------------------------------------------------------------------- -// 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() - { - User::LeaveIfError( RProperty::Define( - KPSUidCoreApplicationUIs, - KCoreAppUIsVideoSharingIndicator, - RProperty::EInt, - 0 ) ); - - User::LeaveIfError( RProperty::Set( - KPSUidCoreApplicationUIs, - KCoreAppUIsVideoSharingIndicator, - ( TInt ) ECoreAppUIsVideoSharingIndicatorOn ) ); - - iIndicatorApi->Cancel(); - iIndicatorApi->iStatus = KErrNotFound; - iIndicatorApi->RunL(); - EUNIT_ASSERT( !iStartLiveSharingLCalled ); - - iIndicatorApi->Cancel(); - iIndicatorApi->iStatus = KErrNone; - iIndicatorApi->RunL(); - EUNIT_ASSERT( iStartLiveSharingLCalled ); - - EUNIT_ASSERT( !iIndicatorApi->IsSubscriber() ); - - iIndicatorApi->iObserver = NULL; - EUNIT_ASSERT( iIndicatorApi->IsSubscriber() ); - iIndicatorApi->Indicator( ETrue ); - - iIndicatorApi->Cancel(); - - iIndicatorApi->RunL(); - - } - - -// ---------------------------------------------------------------------------- -// Asserts that DoCancel removes current activity. -// ---------------------------------------------------------------------------- -// -void UT_CMusIndicatorApi::UT_CMusIndicatorApi_DoCancelL() - { - iIndicatorApi->Cancel(); - 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 ); - } - - -// ======== 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( - "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_END_TEST_TABLE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatordsa.cpp --- a/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatordsa.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,501 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmussoundplayer.cpp --- a/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmussoundplayer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,288 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/BWINS/musmanagerclientu.def --- a/mmsharing/mmshmanagercli/BWINS/musmanagerclientu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/EABI/musmanagerclientu.def --- a/mmsharing/mmshmanagercli/EABI/musmanagerclientu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/group/bld.inf --- a/mmsharing/mmshmanagercli/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for project MUSH -* -*/ - - -#include - -PRJ_PLATFORMS -WINSCW ARMV5 - -PRJ_EXPORTS -// None. - -PRJ_MMPFILES -musmanagerclient.mmp - - -PRJ_TESTEXPORTS diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/group/musmanagerclient.mmp --- a/mmsharing/mmshmanagercli/group/musmanagerclient.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/inc/musmanagerclientsession.h --- a/mmsharing/mmshmanagercli/inc/musmanagerclientsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/inc/musmanagerimpl.h --- a/mmsharing/mmshmanagercli/inc/musmanagerimpl.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/inc/musmanagerserverstarter.h --- a/mmsharing/mmshmanagercli/inc/musmanagerserverstarter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/src/musmanager.cpp --- a/mmsharing/mmshmanagercli/src/musmanager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/src/musmanagerclientsession.cpp --- a/mmsharing/mmshmanagercli/src/musmanagerclientsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/src/musmanagerimpl.cpp --- a/mmsharing/mmshmanagercli/src/musmanagerimpl.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,415 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/src/musmanagerserverstarter.cpp --- a/mmsharing/mmshmanagercli/src/musmanagerserverstarter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/bwins/ut_musmanagerclientu.def --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/bwins/ut_musmanagerclientu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/eabi/ut_musmanagerclientu.def --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/eabi/ut_musmanagerclientu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.bat --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.txt diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/bld.inf --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* 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_TESTMMPFILES -ut_musmanagerclient.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ct_en_example.cmd --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ct_en_example.cmd Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ut_musmanagerclient.mmp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ut_musmanagerclient.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanager.h --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanagerimpl.h --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanagerimpl.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerclientsessionstub.cpp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerclientsessionstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerserverstarterstub.cpp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerserverstarterstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanager.cpp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,260 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanagerimpl.cpp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanagerimpl.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,290 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_musmanagerclientDllMain.cpp --- a/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_musmanagerclientDllMain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/group/bld.inf --- a/mmsharing/mmshmanagersrv/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for project MUSH -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// None. - -PRJ_MMPFILES -musmanagerserver.mmp - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/group/musmanagerserver.mmp --- a/mmsharing/mmshmanagersrv/group/musmanagerserver.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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 - -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 - - -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 - -PAGED diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musapplicationmanager.h --- a/mmsharing/mmshmanagersrv/inc/musapplicationmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?Description -* -*/ - - -#ifndef MUSAPPLICATIONMANAGER_H -#define MUSAPPLICATIONMANAGER_H - -#include "musmanagercommon.h" -#include "musunittesting.h" - -#include -#include -#include -#include - -//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 ); - - - private: // helper functions - - /** - * - */ - void SetPropertyL( TUint aProperty, const TDesC& aValue ); - - /** - * - */ - void SetPropertyL( TUint aProperty, TInt aValue ); - - /** - * - */ - TApaTask GetApaTask(); - - - private: // owned data - - /** - * Window server session handle - */ - RWsSession iWsSession; - - /** - * - */ - RApaLsSession iApaSession; - }; - - -#endif // ? MUSAPPLICATIONMANAGER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musavailabilitymonitorobserver.h --- a/mmsharing/mmshmanagersrv/inc/musavailabilitymonitorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musavailabilitypluginloader.h --- a/mmsharing/mmshmanagersrv/inc/musavailabilitypluginloader.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanager.h --- a/mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,240 +0,0 @@ -/* -* 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 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(); - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanagerobserver.h --- a/mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanagerobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 StartLiveSharingL() = 0; - }; - - -#endif // ? MUSAVAILABILITYPLUGINMANAGEROBSERVER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerpanics.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerpanics.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserver.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserverclosetimer.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserverclosetimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerservercommon.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerservercommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?Description -* -*/ - - -#ifndef MUSMANAGERSERVERCOMMON_H -#define MUSMANAGERSERVERCOMMON_H - -const TInt KParameterCount = 7; - -enum EMusManagerServerParameter - { - KTelNumber = 0, - KSipAddress, - KSipAddressProposal, - KContactId, - KVideoCodec, - KSipProfileId, - KContactName, - KPrivacyStatus - }; - -#endif // ? MUSMANAGERSERVERCOMMON_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerservercore.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerservercore.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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" - -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 StartLiveSharingL(); - -private: // owned data: - - CMusAvailabilityPluginManager* iPluginManager; - - CMusApplicationManager* iApplicationManager; - -private: // not owned data - - MMusManagerServerCoreObserver& iObserver; - - RPointerArray iAvailabilityMonitors; - - RArray iAvailabilityStatus; - }; - -#endif // MUSMANAGERSERVERCORE_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerservercoreobserver.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerservercoreobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserveritcutility.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserveritcutility.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerservermain.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerservermain.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserverpanics.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserverpanics.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserverplatsecpolicy.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserverplatsecpolicy.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserversession.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserversession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmanagerserversessionobserver.h --- a/mmsharing/mmshmanagersrv/inc/musmanagerserversessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/inc/musmonitoravailabilityobserver.h --- a/mmsharing/mmshmanagersrv/inc/musmonitoravailabilityobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musapplicationmanager.cpp --- a/mmsharing/mmshmanagersrv/src/musapplicationmanager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,382 +0,0 @@ -/* -* 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 -#include -//#include -#include -#include - -// CONSTANTS - - -// ----------------------------------------------------------------------------- -// 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()" ); - - iApaSession.Close(); - iWsSession.Close(); - - MUS_LOG( "mus: [MUSSRV] <- \ - CMusApplicationManager::~CMusApplicationManager()" ); - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::ConstructL -// ----------------------------------------------------------------------------- -// -void CMusApplicationManager::ConstructL() - { - MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::ConstructL()" ); - - User::LeaveIfError( iApaSession.Connect() ); - User::LeaveIfError( iWsSession.Connect() ); - - MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::ConstructL()" ); - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::CMusApplicationManager -// ----------------------------------------------------------------------------- -// -CMusApplicationManager::CMusApplicationManager() - { - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::ApplicationRunning -// ----------------------------------------------------------------------------- -// -TBool CMusApplicationManager::ApplicationRunning() - { - MUS_LOG( "mus: [MUSSRV] <> CMusApplicationManager::ApplicationRunning()" ); - return GetApaTask().Exists(); - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::ApplicationRunning -// ----------------------------------------------------------------------------- -// -void CMusApplicationManager::StartApplicationL() - { - MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::StartApplicationL()" ); - - if( ApplicationRunning() ) - { - ShowApplicationL(); - } - else - { - TUid appUid; - appUid.iUid = KMusUiUid; - - TThreadId aThreadId; - - User::LeaveIfError( - iApaSession.StartDocument( KNullDesC, appUid, aThreadId) ); - } - - MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::StartApplicationL()" ); - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::ApplicationRunning -// ----------------------------------------------------------------------------- -// -void CMusApplicationManager::StopApplicationL() - { - MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::StopApplicationL()" ); - - TApaTask task = GetApaTask(); - if( task.Exists() ) - { - SetPropertyL( NMusSessionApi::KStatus, - MultimediaSharing::EMultimediaSharingNotAvailable ); - } - - MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::StopApplicationL()" ); - } - - -// ----------------------------------------------------------------------------- -// CMusApplicationManager::ShowApplication -// ----------------------------------------------------------------------------- -// -void CMusApplicationManager::ShowApplicationL() - { - MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::ShowApplicationL()" ); - - // does a task for multimediasharing exist? - TApaTask task = GetApaTask(); - if( task.Exists() ) - { - task.BringToForeground(); - } - - 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 ); - - // 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 ) ); - - // set status property - SetStatusL( aStatus ); - - // set privacy property - lex.Assign( aSessionParameters.MdcaPoint( KPrivacyStatus ) ); - lex.Val( val ); - - SetPropertyL( NMusSessionApi::KPrivacyStatus, val ); - - 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()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TApaTask CMusApplicationManager::GetApaTask() - { - MUS_LOG( "mus: [MUSSRV] <> CMusApplicationManager::GetApaTask()" ); - TUid appUid; - appUid.iUid = KMusUiUid; - return TApaTaskList( iWsSession ).FindApp( appUid ); - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musavailabilitypluginmanager.cpp --- a/mmsharing/mmshmanagersrv/src/musavailabilitypluginmanager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,765 +0,0 @@ -/* -* 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 - -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::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" ) - - settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); - iPlugin->StartL(); - - 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()" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 MMusIndicatorObserver. -// Starts live video sharing. -// ----------------------------------------------------------------------------- -// -void CMusAvailabilityPluginManager::StartLiveSharingL() - { - iObserver.StartLiveSharingL(); - } - -// ----------------------------------------------------------------------------- -// 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() ); - - // Unsafe Magic number 16 is used but unsigned 32 bit integer (TInt32) - // can't go beyond 16 digits . - TBuf<16> contactIdBuf; - contactIdBuf.Num( settings.ContactId() ); - - // append contact id - iSessionParameters->AppendL( contactIdBuf ); - - // append video codec - HBufC* videoCodecs = VideoCodecsLC(); - iSessionParameters->AppendL( *videoCodecs ); - CleanupStack::PopAndDestroy( videoCodecs ); - - // Unsafe Magic number 16 is used but unsigned 32 bit integer (TInt32) - // can't go beyond 16 digits . - TBuf<16> 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 ); - - // append call privacy indication - MUS_LOG1("iSessionParameters -> Call Privacy = %d ", - settings.CallPrivacy() ) - TBuf<16> callPrivacy; - callPrivacy.Num( settings.CallPrivacy() ); - iSessionParameters->AppendL( callPrivacy ); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerserver.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerserver.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerserverclosetimer.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerserverclosetimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerservercore.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerservercore.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -/* -* 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" - -using namespace MultimediaSharing; - -// CONSTANTS - -// ----------------------------------------------------------------------------- -// 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(); - - 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 - = iPluginManager->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 ) - { - 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" ); - 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 && - iPluginManager->ApplicationAllowed() ) - { - // write session boundary values - iApplicationManager->WriteSessionPropertiesL( - MultimediaSharing::EMusReceive, - iPluginManager->Availability(), - iPluginManager->SessionParametersL() ); - - iApplicationManager->StartApplicationL(); - } - else 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" ); - iPluginManager->OptionsReceivedL(); - MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::OptionsReceivedL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusManagerServerCore::StartMultimediaSharingL( MultimediaSharing::TMusUseCase aUseCase ) - { - MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::StartMultimediaSharingL" ); - if( !iApplicationManager->ApplicationRunning() && - iPluginManager->ApplicationAllowed() ) - { - // write session boundary values - iApplicationManager->WriteSessionPropertiesL( - aUseCase, - iPluginManager->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" ); - 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 ); - // inform ui via application manager (via session api) - - iApplicationManager->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::StartLiveSharingL() - { - StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusManagerServerCore::StopMonitoring() - { - // go through interested client sessions - for( TInt i=0; iRequestComplete(); - iAvailabilityMonitors.Remove( i ); - } - } - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerserveritcutility.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerserveritcutility.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerservermain.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerservermain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/src/musmanagerserversession.cpp --- a/mmsharing/mmshmanagersrv/src/musmanagerserversession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BMARM/ut_musmanagerserveru.def --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BMARM/ut_musmanagerserveru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BWINS/ut_musmanagerserveru.def --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BWINS/ut_musmanagerserveru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) - ?KillTask@TApaTask@@QAEXXZ @ 2 NONAME ; void TApaTask::KillTask(void) - ?Complete@RMessagePtr2@@QBEXH@Z @ 3 NONAME ; void RMessagePtr2::Complete(int) const - ?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 4 NONAME ; class TApaTask TApaTaskList::FindApp(class TUid) - ?ReStart@CServer2@@QAEXXZ @ 5 NONAME ; void CServer2::ReStart(void) - ?ListImplementationsL@REComSession@@SAXVTUid@@AAV?$RPointerArray@VCImplementationInformation@@@@@Z @ 6 NONAME ; void REComSession::ListImplementationsL(class TUid, class RPointerArray &) - ?Connect@RApaLsSession@@QAEHXZ @ 7 NONAME ; int RApaLsSession::Connect(void) - ?StartDocument@RApaLsSession@@QAEHABVTDesC16@@VTUid@@AAVTThreadId@@W4TLaunchType@1@@Z @ 8 NONAME ; int RApaLsSession::StartDocument(class TDesC16 const &, class TUid, class TThreadId &, enum RApaLsSession::TLaunchType) - ?Client@RMessagePtr2@@QBEHAAVRThread@@W4TOwnerType@@@Z @ 9 NONAME ; int RMessagePtr2::Client(class RThread &, enum TOwnerType) const - ?Exists@TApaTask@@QAEHXZ @ 10 NONAME ; int TApaTask::Exists(void) - ?NewLC@CApaCommandLine@@SAPAV1@XZ @ 11 NONAME ; class CApaCommandLine * CApaCommandLine::NewLC(void) - ??0TApaTask@@QAE@AAVRWsSession@@@Z @ 12 NONAME ; TApaTask::TApaTask(class RWsSession &) - ?DestroyedImplementation@REComSession@@SAXVTUid@@@Z @ 13 NONAME ; void REComSession::DestroyedImplementation(class TUid) - ?GetAppInfo@RApaLsSession@@QBEHAAVTApaAppInfo@@VTUid@@@Z @ 14 NONAME ; int RApaLsSession::GetAppInfo(class TApaAppInfo &, class TUid) const - ?CreateImplementationL@REComSession@@SAPAXVTUid@@J@Z @ 15 NONAME ; void * REComSession::CreateImplementationL(class TUid, long) - ?Install@CActiveScheduler@@SAXPAV1@@Z @ 16 NONAME ; void CActiveScheduler::Install(class CActiveScheduler *) - ??0RApaLsSession@@QAE@XZ @ 17 NONAME ; RApaLsSession::RApaLsSession(void) - ?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 18 NONAME ; class TApaTask TApaTaskList::FindApp(class TDesC16 const &) - ?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@@Z @ 19 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &) - ?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@AAVTThreadId@@PAVTRequestStatus@@@Z @ 20 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &, class TThreadId &, class TRequestStatus *) - ??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 21 NONAME ; TApaTaskList::TApaTaskList(class RWsSession &) - ?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 22 NONAME ; class TApaTask TApaTaskList::FindDoc(class TDesC16 const &) - ?SetExecutableNameL@CApaCommandLine@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void CApaCommandLine::SetExecutableNameL(class TDesC16 const &) - ?RequestComplete@RThread@@QBEXAAPAVTRequestStatus@@H@Z @ 24 NONAME ; void RThread::RequestComplete(class TRequestStatus * &, int) const - ?Version@RApaLsSession@@QBE?AVTVersion@@XZ @ 25 NONAME ; class TVersion RApaLsSession::Version(void) const - ?BringToForeground@TApaTask@@QAEXXZ @ 26 NONAME ; void TApaTask::BringToForeground(void) - ?EndTask@TApaTask@@QAEXXZ @ 27 NONAME ; void TApaTask::EndTask(void) - ?SendToBackground@TApaTask@@QAEXXZ @ 28 NONAME ; void TApaTask::SendToBackground(void) - ?WriteL@RMessagePtr2@@QBEXHABVTDesC8@@H@Z @ 29 NONAME ; void RMessagePtr2::WriteL(int, class TDesC8 const &, int) const - ?ReadL@RMessagePtr2@@QBEXHAAVTDes8@@H@Z @ 30 NONAME ; void RMessagePtr2::ReadL(int, class TDes8 &, int) const - ?StartApp@RApaLsSession@@QAEHABVCApaCommandLine@@@Z @ 31 NONAME ; int RApaLsSession::StartApp(class CApaCommandLine const &) - ?GetDesMaxLength@RMessagePtr2@@QBEHH@Z @ 32 NONAME ; int RMessagePtr2::GetDesMaxLength(int) const - ?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 33 NONAME ; class TApaTask TApaTaskList::FindByPos(int) - ?Close@RApaLsSession@@QAEXXZ @ 34 NONAME ; void RApaLsSession::Close(void) - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/EABI/ut_musmanagerserveru.def --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/EABI/ut_musmanagerserveru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - _ZTI16CMusAvaSettings2 @ 2 NONAME ; ## - _ZTI17CMusAvaInterface2 @ 3 NONAME ; ## - _ZTI17CMusManagerServer @ 4 NONAME ; ## - _ZTI21CMusManagerServerCore @ 5 NONAME ; ## - _ZTI22CMusApplicationManager @ 6 NONAME ; ## - _ZTI24CMusManagerServerSession @ 7 NONAME ; ## - _ZTI27CMusManagerServerCloseTimer @ 8 NONAME ; ## - _ZTI29CMusAvailabilityPluginManager @ 9 NONAME ; ## - _ZTV16CMusAvaSettings2 @ 10 NONAME ; ## - _ZTV17CMusAvaInterface2 @ 11 NONAME ; ## - _ZTV17CMusManagerServer @ 12 NONAME ; ## - _ZTV21CMusManagerServerCore @ 13 NONAME ; ## - _ZTV22CMusApplicationManager @ 14 NONAME ; ## - _ZTV24CMusManagerServerSession @ 15 NONAME ; ## - _ZTV27CMusManagerServerCloseTimer @ 16 NONAME ; ## - _ZTV29CMusAvailabilityPluginManager @ 17 NONAME ; ## - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/bld.inf --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* 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_TESTMMPFILES -ut_musmanagerserver.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/ut_musmanagerserver.mmp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/ut_musmanagerserver.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* 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/apastub/src -SOURCE apgtask.cpp -SOURCE apgcli.cpp -SOURCE apacmdln.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 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 ../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 - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusapplicationmanager.h --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusapplicationmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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_GetApaTaskL(); - void UT_CMusApplicationManager_MapAvailabilitiesL(); - void UT_CMusApplicationManager_SetStatusLL(); - -private: // data - - /** - * Instance of tested class. - * Own. - */ - CMusApplicationManager* iManager; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // UT_CMUSAPPLICATIONMANAGER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusavailabilitypluginmanager.h --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusavailabilitypluginmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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 StartLiveSharingL(); - -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(); - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserverclosetimer.h --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserverclosetimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerservercore.h --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerservercore.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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(); - - -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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserversession.h --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserversession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusApplicationManager.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusApplicationManager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,394 +0,0 @@ -/* -* 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 -#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(); - } - - -// ======== TEST METHODS ======== - - -// --------------------------------------------------------------------------- -// Asserts that instantiation is successful. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_NewLL() - { - EUNIT_ASSERT( iManager ); - EUNIT_ASSERT( iManager->iApaSession.iConnected ); - } - - -// --------------------------------------------------------------------------- -// Asserts that instantiation is successful. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_NewLCL() - { - CMusApplicationManager* manager = CMusApplicationManager::NewLC(); - EUNIT_ASSERT( manager ); - EUNIT_ASSERT( manager->iApaSession.iConnected ); - CleanupStack::PopAndDestroy( manager ); - } - - -// --------------------------------------------------------------------------- -// Asserts that correct functions from TApaTask are called. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_ApplicationRunningL() - { - TApaTask::iApplicationExist = EFalse; - EUNIT_ASSERT( !iManager->ApplicationRunning() ); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - TApaTask::iApplicationExist = ETrue; - EUNIT_ASSERT( iManager->ApplicationRunning() ); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - } - - -// --------------------------------------------------------------------------- -// Else branch of tested method can't be tested since it tries to start real -// application. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_StartApplicationLL() - { - TApaTask::iApplicationExist = EFalse; - iManager->StartApplicationL(); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - EUNIT_ASSERT_EQUALS( PropertyHelper::GetCalledFunction(), RProperty::ENone ) - - TApaTask::iApplicationExist = ETrue; - iManager->StartApplicationL(); - EUNIT_ASSERT_EQUALS( PropertyHelper::GetCalledFunction(), RProperty::ENone ) - - } - - -// --------------------------------------------------------------------------- -// Asserts that tested method calls TApaTask::Exists and if task exists it -// should also call TApaTask::KillTask. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_StopApplicationLL() - { - TApaTask::iApplicationExist = EFalse; - iManager->StopApplicationL(); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - - - TApaTask::iApplicationExist = ETrue; - 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 ) - } - - -// --------------------------------------------------------------------------- -// Asserts that tested method calls TApaTask::Exists and if task exists it -// calls TApaTask::BringToForeground. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_ShowApplicationLL() - { - TApaTask::iApplicationExist = EFalse; - iManager->ShowApplicationL(); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - TApaTask::iApplicationExist = ETrue; - iManager->ShowApplicationL(); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EBringToForeground ) - } - - -// --------------------------------------------------------------------------- -// 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( "h" ) ); - - 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); - - 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 ) ); - } - - -// --------------------------------------------------------------------------- -// Asserts that TApaTaskList::FindApp is called by tested method. -// --------------------------------------------------------------------------- -// -void UT_CMusApplicationManager::UT_CMusApplicationManager_GetApaTaskL() - { - TApaTask::iApplicationExist = EFalse; - iManager->GetApaTask(); - EUNIT_ASSERT( TApaTaskList::iCalledFunction == TApaTaskList::EFindApp ) - } - - -// --------------------------------------------------------------------------- -// 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 ) ); - } - - -// ======== 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( - "GetApaTask - test ", - "CMusApplicationManager", - "GetApaTask", - "FUNCTIONALITY", - SetupL, UT_CMusApplicationManager_GetApaTaskL, Teardown ) - -EUNIT_TEST( - "SetStatusL - test ", - "CMusApplicationManager", - "SetStatusL", - "FUNCTIONALITY", - SetupL, UT_CMusApplicationManager_SetStatusLL, Teardown ) - -EUNIT_END_TEST_TABLE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCloseTimer.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCloseTimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCore.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCore.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,468 +0,0 @@ -/* -* 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 - - -// ======== 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; - TApaTask::iApaTaskCalledFunction = TApaTask::ENone; - } - - -// --------------------------------------------------------------------------- -// Finalizes test by deleting instance of tested class. -// --------------------------------------------------------------------------- -// -void UT_CMusManagerServerCore::Teardown() - { - delete iCore; - PropertyHelper::Close(); - } - - -// ======== 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() - { - 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 - EUNIT_ASSERT_NO_LEAVE( iCore->InvitationReceivedL( uid ) ); - - uid.iUid = 0x10282391; // ESipInviteDesired from musmanager.h - EUNIT_ASSERT_SPECIFIC_LEAVE( - iCore->InvitationReceivedL( uid ), KErrNotReady ); - } - - -// --------------------------------------------------------------------------- -// Dummy test to increase execution coverage. -// --------------------------------------------------------------------------- -// -void UT_CMusManagerServerCore::UT_CMusManagerServerCore_OptionsReceivedLL() - { - TUid uid = { 0x10101010 }; - 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. Checks also that -// TApaTask function TaskExists is called. -// --------------------------------------------------------------------------- -// -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 -> - // ----------------------------------------------------------------------- - - // CMusApplicationManager::ApplicationRunning = EFalse - TApaTask::iApplicationExist = EFalse; - - // 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 ); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ); - - // <- 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 - TApaTask::iApplicationExist = EFalse; - MUS_EUNIT_ASSERT_NO_LEAVE( - iCore->StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ) ); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ); - - // <- Test for else branch - } - - -// --------------------------------------------------------------------------- -// Asserts that tested method checks if task exists and calls -// TApaTask::KillTask if task exists. -// --------------------------------------------------------------------------- -// -void UT_CMusManagerServerCore:: - UT_CMusManagerServerCore_StopMultimediaSharingLL() - { - TApaTask::iApplicationExist = EFalse; - iCore->StopMultimediaSharingL(); - EUNIT_ASSERT( TApaTask::iApaTaskCalledFunction == TApaTask::EExists ) - - TApaTask::iApplicationExist = ETrue; - 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->EventNoSessions(); - 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() - { - 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 ); - } - - -// ======== 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_END_TEST_TABLE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerSession.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerSession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,326 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusavailabilityPluginManager.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusavailabilityPluginManager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,608 +0,0 @@ -/* -* 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 "mussesseioninformationapi.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" ); - -/* - * Privacy status from MusAvaSettingsStub. - */ -_LIT( KUsedPrivacyStatus, "1" ); - -// ======== 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::StartLiveSharingL() - { - 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(); - - } - - -// ======== 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() - { - CMusAvaInterface* interface = iManager->iPlugin; - CMusAvaInterface2* interface2 = static_cast( interface ); - interface2->iSettings->iCallPrivacy = 1; - - 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 ) ); - EUNIT_ASSERT( !params->MdcaPoint( KPrivacyStatus ).Compare( KUsedPrivacyStatus() ) ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -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(); - CMusAvaInterface* interface = iManager->iPlugin; - CMusAvaInterface2* interface2 = static_cast( interface ); - interface2->iSettings->iCallPrivacy = 1; - EUNIT_ASSERT_EQUALS( KUsedTelNumber(), iManager->SessionParametersL().MdcaPoint( KTelNumber ) ); - EUNIT_ASSERT_EQUALS( KUsedSipAddress(), iManager->SessionParametersL().MdcaPoint( KSipAddress ) ); - EUNIT_ASSERT_EQUALS( KUsedVideoCodec(), iManager->SessionParametersL().MdcaPoint( KVideoCodec ) ); - EUNIT_ASSERT( !iManager->SessionParametersL().MdcaPoint( KPrivacyStatus ).Compare( KUsedPrivacyStatus() ) ); - } - - -// --------------------------------------------------------------------------- -// 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(); - } - -// ======== 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_END_TEST_TABLE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/ut_musmanagerserverDllMain.cpp --- a/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/ut_musmanagerserverDllMain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshshared/loc/mus.loc --- a/mmsharing/mmshshared/loc/mus.loc Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,820 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshshared/loc/musoperator.loc --- a/mmsharing/mmshshared/loc/musoperator.loc Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/data/musui.rss --- a/mmsharing/mmshui/data/musui.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1628 +0,0 @@ -/* -* 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: application resource file -* -*/ - - - -// ----------------------------------------------------------------------------- -// FOUR-LETTER RESOURCE IDENTIFIER -// ----------------------------------------------------------------------------- -// -NAME MUSH - - -// ----------------------------------------------------------------------------- -// INCLUDE FILES -// ----------------------------------------------------------------------------- -// -#include "musui.hrh" -#include // localization -#include //localization - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -// ----------------------------------------------------------------------------- -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf = "MUSUI"; } - -RESOURCE EIK_APP_INFO - { - } - - -// ----------------------------------------------------------------------------- -// CONSTANTS -// ----------------------------------------------------------------------------- -// -#define KMyBitmapRomFile "Z:\\resource\\apps\\musuiicons.mif" -#define KMyBitmapRamFile "C:\\resource\\apps\\musuiicons.mif" - -RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info - { - short_caption = qtn_apps_msh_grid; - caption_and_icon = CAPTION_AND_ICON_INFO - { - caption = qtn_apps_msh_list; - number_of_icons = 1; - icon_file = APP_BITMAP_DIR"\\musui_aif.mif"; - }; - } - - -// ----------------------------------------------------------------------------- -// Hotkeys defined for application -// ----------------------------------------------------------------------------- -// -RESOURCE HOTKEYS r_musui_hotkeys - { - control = - { - HOTKEY { command = EEikCmdExit; key = 'e'; } - }; - } - - -// ----------------------------------------------------------------------------- -// Items for general menu -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_musui_general_menu - { - items = - { - MENU_ITEM { command = EMusuiGenCmdExit; txt = qtn_options_exit; } - }; - } - - -// ----------------------------------------------------------------------------- -// View-resource definition for general view -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_musui_generalview - { - menubar = r_musui_generalview_menubar; - toolbar = r_mus_toolbar; - cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; - } - - -// ----------------------------------------------------------------------------- -// View-resource definition for null view -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_musui_nullview - { - menubar = r_musui_generalview_menubar; - cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; - } - - -// ----------------------------------------------------------------------------- -// Menubar definition for general view -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_musui_generalview_menubar - { - titles = - { - MENU_TITLE { menu_pane = r_musui_general_menu; txt = "--"; }, - MENU_TITLE { menu_pane = r_musui_generalview_menu; txt = "--"; } - }; - } - - -// ----------------------------------------------------------------------------- -// Items for menupane in general view -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_musui_generalview_menu - { - items = - { - MENU_ITEM { command = EMusuiCmdAppTest; txt = "Test"; } // TODO: Fixme - }; - } - - -// ----------------------------------------------------------------------------- -// View-resource definition for live sharing view -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_musui_view - { - menubar = r_musui_view_menubar; -// toolbar = r_mus_toolbar; - cba = r_musui_view_cba; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE CBA r_musui_view_cba - { - buttons= - { - CBA_BUTTON - { - txt = text_softkey_option; - id = EAknSoftkeyOptions; - }, - CBA_BUTTON - { - txt = qtn_msh_softkey_stop; - id = EAknSoftkeyExit; - }, - CBA_BUTTON - { - //txt = text_softkey_option; // qgn_prop_msk_select; - id = EEikBidBlank; // EAknSoftkeyOptions; - } - }; - } - - -// ----------------------------------------------------------------------------- -// Operator Specific Middle softkeys -// ----------------------------------------------------------------------------- -// -RESOURCE CBA_BUTTON r_musui_view_ops_msk_ihf_off - { - id = EMusuiCmdViewHandset; - txt = qtn_msh_msk_ihf_off; - } - -RESOURCE CBA_BUTTON r_musui_view_ops_msk_ihf_on - { - id = EMusuiCmdViewLoadspeaker; - txt = qtn_msh_msk_ihf_on; - } - -RESOURCE CBA_BUTTON r_musui_view_msk_ok - { - id = EMusuiCmdViewMiddleSoftkeyOk; - txt = qtn_msh_msk_done; - } - - -// ----------------------------------------------------------------------------- -// Menubar definition for live sharing view -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_musui_view_menubar - { - titles = - { - MENU_TITLE { menu_pane = r_musui_general_menu; txt = "--"; }, - MENU_TITLE { menu_pane = r_musui_view_menu; txt = "--"; } - }; - } - - -// ----------------------------------------------------------------------------- -// Items for menupane in live sharing view -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_musui_view_menu - { - items = - { - MENU_ITEM - { - command = EMusuiCmdViewReplay; - txt = qtn_msh_shareview_softk_replay; - }, - MENU_ITEM - { - command = EMusuiCmdViewShareVideo; - txt = qtn_msh_options_gen_shareclip; - }, - MENU_ITEM - { - command = EMusuiCmdViewShareImage; - txt = qtn_msh_options_gen_shareimage; - }, - MENU_ITEM - { - command = EMusuiCmdViewShareLive; - txt = qtn_msh_options_gen_sharelive; - }, - MENU_ITEM - { - command = EMusuiCmdViewAudioNormal; - txt = qtn_msh_options_clip_audio_normal; - }, - MENU_ITEM - { - command = EMusuiCmdViewAudioMute; - txt = qtn_msh_options_clip_audio_mute; - }, - MENU_ITEM - { - command = EMusuiCmdToolbarZoom; - txt = qtn_msh_tooltip_zoom; // Adjust zoom - }, - MENU_ITEM - { - command = EMusuiCmdToolbarBrightness; - txt = qtn_msh_tooltip_brightness; // Adjust brightness - }, - MENU_ITEM - { - command = EMusuiCmdViewFullScreen; - txt = qtn_msh_options_fullscreen; - }, - MENU_ITEM - { - command = EMusuiCmdViewZoom; - txt = qtn_msh_options_zoom; - }, - MENU_ITEM - { - command = EMusuiCmdViewBrightness; - txt = qtn_msh_options_brightness; - }, - MENU_ITEM - { - command = EMusuiCmdRecord; - txt = qtn_msh_options_rec_start; - }, - MENU_ITEM - { - command = EMusuiCmdStopRecording; - txt = qtn_msh_options_rec_stop; - }, - MENU_ITEM - { - command = EMusuiCmdViewMicrophoneMute; - txt = qtn_incal_mute_option; - }, - MENU_ITEM - { - command = EMusuiCmdViewMicrophoneUnmute; - txt = qtn_incal_unmute_option; - }, - MENU_ITEM - { - command = EMusuiCmdViewEndActiveCall; - txt = qtn_incal_drop_option; - }, -#ifdef __SERIES60_HELP - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - } -#endif // __SERIES60_HELP - }; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_LAYOUT_RECT r_mus_navi_media_icon_layout_size - { - l = 0; t = 0; W = 13; H = 16; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_LAYOUT_TEXT r_mus_navi_media_text_left_layout - { - font = ELatinPlain12; - C = 10; - l = 43; - r = 4; - B = 13; - W = 73; - J = ELayoutAlignLeft; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_LAYOUT_TEXT r_mus_navi_media_text_right_layout - { - font = ELatinPlain12; - C = 0; - l = 43; - r = 4; - B = 13; - W = 73; - J = ELayoutAlignRight; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE AKN_ICON_ARRAY r_mus_navi_media_icon_array_rom - { - bmpfile = KMyBitmapRomFile; // HERE - icons = - { - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_forw; - maskId = EMbmMusuiiconsQgn_indi_video_forw_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_pause; - maskId = EMbmMusuiiconsQgn_indi_video_pause_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_play; - maskId = EMbmMusuiiconsQgn_indi_video_play_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_record; - maskId = EMbmMusuiiconsQgn_indi_video_record_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_record_not; - maskId = EMbmMusuiiconsQgn_indi_video_record_not_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_rew; - maskId = EMbmMusuiiconsQgn_indi_video_rew_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_stop; - maskId = EMbmMusuiiconsQgn_indi_video_stop_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait1; - maskId = EMbmMusuiiconsQgn_indi_video_wait1_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait2; - maskId = EMbmMusuiiconsQgn_indi_video_wait2_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait3; - maskId = EMbmMusuiiconsQgn_indi_video_wait3_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait4; - maskId = EMbmMusuiiconsQgn_indi_video_wait4_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait5; - maskId = EMbmMusuiiconsQgn_indi_video_wait5_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait6; - maskId = EMbmMusuiiconsQgn_indi_video_wait6_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait7; - maskId = EMbmMusuiiconsQgn_indi_video_wait7_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait8; - maskId = EMbmMusuiiconsQgn_indi_video_wait8_mask; } - }; - } - - // ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE AKN_ICON_ARRAY r_mus_navi_media_icon_array_ram - { - bmpfile = KMyBitmapRamFile; // HERE - icons = - { - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_forw; - maskId = EMbmMusuiiconsQgn_indi_video_forw_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_pause; - maskId = EMbmMusuiiconsQgn_indi_video_pause_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_play; - maskId = EMbmMusuiiconsQgn_indi_video_play_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_record; - maskId = EMbmMusuiiconsQgn_indi_video_record_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_record_not; - maskId = EMbmMusuiiconsQgn_indi_video_record_not_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_rew; - maskId = EMbmMusuiiconsQgn_indi_video_rew_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_stop; - maskId = EMbmMusuiiconsQgn_indi_video_stop_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait1; - maskId = EMbmMusuiiconsQgn_indi_video_wait1_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait2; - maskId = EMbmMusuiiconsQgn_indi_video_wait2_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait3; - maskId = EMbmMusuiiconsQgn_indi_video_wait3_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait4; - maskId = EMbmMusuiiconsQgn_indi_video_wait4_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait5; - maskId = EMbmMusuiiconsQgn_indi_video_wait5_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait6; - maskId = EMbmMusuiiconsQgn_indi_video_wait6_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait7; - maskId = EMbmMusuiiconsQgn_indi_video_wait7_mask; }, - AKN_ICON { iconId = EMbmMusuiiconsQgn_indi_video_wait8; - maskId = EMbmMusuiiconsQgn_indi_video_wait8_mask; } - }; - } - -///////////////////////////////////////////////////LG/////////////////////////////////////////// -// ----------------------------------------------------------------------------- -// Toolbar for non-touch mode -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_mus_toolbar_nontouch - { - //KAknToolbarFlexiblePosition - //3.2.3 -> KAknToolbarWithoutCba - //5.0 -> KAknToolbarFixed - flags = KAknToolbarWithoutCba | KAknToolbarFloatingUnTransparent; - - items = - { - // ****************************************************************** // - TBAR_CTRL // Sending Live/Clip & Receiving: Activate Volume Mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarVolume; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_volume; // Adjust call volume - helptxt = qtn_msh_tooltip_volume; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_call_volume; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_call_volume_mask; - } - }; - }; - }, - // ****************************************************************** // - - TBAR_CTRL // Receiving: Change to full screen mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarFullScreen; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_fullscreen; // View in full screen mode - helptxt = qtn_msh_tooltip_fullscreen; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_fullscreen; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_fullscreen_mask; -// extension = r_mus_fullscreen_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - - TBAR_CTRL // Sending Live: Pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarPauseLive; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_pause_live; // Pause sharing - helptxt = qtn_msh_tooltip_pause_live; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_pause_send_video; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_pause_send_video_mask; -// extension = r_mus_pause_send_video_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip: Un-pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnPauseLive; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unpause_live; - helptxt = qtn_msh_tooltip_unpause_live; - // TODO: ROM/RAM - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_video; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_video_mask; -// extension = r_mus_video_button_state_extension; - } - }; - }; - }, - // ****************************************************************** // - - TBAR_CTRL // Sending Clip: Pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarPause; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_pause_live; // Pause sharing - helptxt = qtn_msh_tooltip_pause_live; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_cams_tb_rec_pause; - bmpmask = EMbmMusuitoolbariconsQgn_indi_cams_tb_rec_pause_mask; - // extension = r_mus_rec_pause_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip: Un-pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnPause; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unpause_live; - helptxt = qtn_msh_tooltip_unpause_live; - // TODO: ROM/RAM - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_play; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_play_mask; - // extension = r_mus_play_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - TBAR_CTRL // Sending Clip: Activate fast forward / reverse mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarFFRev; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_ffrev; // Fast forward or rewind clip - helptxt = qtn_msh_tooltip_ffrev; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ffw_frew; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_ffw_frew_mask; - }, - AVKON_BUTTON_STATE - { - flags = KAknButtonStateHasLatchedFrame; - //txt = qtn_msh_tooltip_ffrev; - helptxt = qtn_msh_tooltip_ffrev; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ffw_frew; - // bmpmask = 0x8000; /*32768, tumma*/ - bmpmask = 0x7FFF; /*32767, vaalea*/ - } - }; - }; - }, - // ****************************************************************** // - TBAR_CTRL // Sending Live: Activate zoom mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarZoom; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_zoom; // Adjust zoom - helptxt = qtn_msh_tooltip_zoom; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_zoom; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_zoom_mask; - }, - AVKON_BUTTON_STATE - { - flags = KAknButtonStateHasLatchedFrame; - //txt = qtn_msh_tooltip_zoom; // Adjust zoom - helptxt = qtn_msh_tooltip_zoom; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_zoom; // TODO: Correct bitmap!!! - // bmpmask = 0x8000; /*32768, tumma*/ - bmpmask = 0x7FFF; /*32767, vaalea*/ - } - }; - }; - }, - // ****************************************************************** // - TBAR_CTRL // Sending Live: Activate brightness mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarBrightness; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_brightness; // Adjust brightness - helptxt = qtn_msh_tooltip_brightness; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_brightness; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_brightness_mask; - }, - AVKON_BUTTON_STATE - { - flags = KAknButtonStateHasLatchedFrame; - //txt = qtn_msh_tooltip_brightness; // Adjust brightness - helptxt = qtn_msh_tooltip_brightness; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_brightness; - // bmpmask = 0x8000; /*32768, tumma*/ - bmpmask = 0x7FFF; /*32767, vaalea*/ - } - }; - }; - }, - // ****************************************************************** // - - TBAR_CTRL // Sending Live/Clip & Receiving: Mute microphone <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarMute; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_mute; // Mute Microphone - helptxt = qtn_msh_tooltip_mute; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_microphone_mute; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_microphone_mute_mask; -// extension = r_mus_microphone_mute_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip & Receiving: Unmute microphone <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnmute; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unmute; // Unmute Microphone - helptxt = qtn_msh_tooltip_unmute; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_microphone_unmute; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_microphone_unmute_mask; - // extension = r_mus_microphone_unmute_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - - TBAR_CTRL // Sending LiveClip & Receiving: Speaker off <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarSpeakerOff; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_ihf_off; // Loudspeaker off - helptxt = qtn_msh_tooltip_ihf_off; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ihf_off; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_ihf_off_mask; - // extension = r_mus_ihf_off_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip & Receiving: Speaker on <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarSpeakerOn; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_ihf_on; // Loudspeaker on - helptxt = qtn_msh_tooltip_ihf_on; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ihf_on; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_ihf_on_mask; - // extension = r_mus_ihf_on_button_state_extension; - } - }; - }; - } - }; - } -///////////////////////////////////////////////////LG/////////////////////////////////////////// - - - -// ----------------------------------------------------------------------------- -// Toolbar -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_mus_toolbar - { - flags = KAknToolbarFixed; - - items = - { - // ****************************************************************** // - - TBAR_CTRL // Receiving: Change to full screen mode - { - type = EAknCtButton; - id = EMusuiCmdToolbarFullScreen; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_fullscreen; // View in full screen mode - helptxt = qtn_msh_tooltip_fullscreen; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_fullscreen; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_fullscreen_mask; - extension = r_mus_fullscreen_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - - TBAR_CTRL // Sending Live: Pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarPauseLive; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_pause_live; // Pause sharing - helptxt = qtn_msh_tooltip_pause_live; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_pause_send_video; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_pause_send_video_mask; - extension = r_mus_pause_send_video_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip: Un-pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnPauseLive; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unpause_live; - helptxt = qtn_msh_tooltip_unpause_live; - // TODO: ROM/RAM - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_video; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_video_mask; - extension = r_mus_video_button_state_extension; - } - }; - }; - }, - // ****************************************************************** // - - TBAR_CTRL // Sending Clip: Pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarPause; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_pause_live; // Pause sharing - helptxt = qtn_msh_tooltip_pause_live; - // TODO: ROM/RAM: - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_cams_tb_rec_pause; - bmpmask = EMbmMusuitoolbariconsQgn_indi_cams_tb_rec_pause_mask; - extension = r_mus_rec_pause_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip: Un-pause sharing <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnPause; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unpause_live; - helptxt = qtn_msh_tooltip_unpause_live; - // TODO: ROM/RAM - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_play; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_play_mask; - extension = r_mus_play_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - - TBAR_CTRL // Sending Live/Clip & Receiving: Mute microphone <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarMute; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_mute; // Mute Microphone - helptxt = qtn_msh_tooltip_mute; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_microphone_mute; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_microphone_mute_mask; - extension = r_mus_microphone_mute_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip & Receiving: Unmute microphone <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarUnmute; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_unmute; // Unmute Microphone - helptxt = qtn_msh_tooltip_unmute; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_microphone_unmute; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_microphone_unmute_mask; - extension = r_mus_microphone_unmute_button_state_extension; - } - }; - }; - }, - - // ****************************************************************** // - - TBAR_CTRL // Sending LiveClip & Receiving: Speaker off <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarSpeakerOff; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText ; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_ihf_off; // Loudspeaker off - helptxt = qtn_msh_tooltip_ihf_off; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ihf_off; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_ihf_off_mask; - extension = r_mus_ihf_off_button_state_extension; - } - }; - }; - }, - TBAR_CTRL // Sending Live/Clip & Receiving: Speaker on <=> Toggled - { - type = EAknCtButton; - id = EMusuiCmdToolbarSpeakerOn; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - //txt = qtn_msh_tooltip_ihf_on; // Loudspeaker on - helptxt = qtn_msh_tooltip_ihf_on; - bmpfile = "Z:\\Resource\\apps\\musuitoolbaricons.mif"; // Only ROM . RAM is unofficial - bmpid = EMbmMusuitoolbariconsQgn_indi_tb_ihf_on; - bmpmask = EMbmMusuitoolbariconsQgn_indi_tb_ihf_on_mask; - extension = r_mus_ihf_on_button_state_extension; - } - }; - }; - } - }; - } - - - -// BUTTON STATE EXTENSION needed for skinning - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_call_volume_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbCallVolume; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_fullscreen_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbFullscreen; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_pause_send_video_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbPauseSendVideo; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_video_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbVideo; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_rec_pause_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiCamsTbRecPause; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_play_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbPlay; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_ffw_frew_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbFfwFrew; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_zoom_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbZoom; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_brightness_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbBrightness; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_microphone_mute_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbMicrophoneMute; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_microphone_unmute_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbMicrophoneUnmute; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_ihf_off_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbIhfOff; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_mus_ihf_on_button_state_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbIhfOn; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_mus_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 - { - flags = EEikEdwinOnlyASCIIChars; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - default_input_mode = EAknEditorTextInputMode; - allowed_input_modes = EAknEditorTextInputMode | - EAknEditorNumericInputMode; - }; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// Resource for the address selection query. -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_mus_confirmation_query_dialog - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EMusConfirmationQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// Resource for the address selection query. -// ----------------------------------------------------------------------------- -// -RESOURCE AVKON_LIST_QUERY r_mus_livesharingview_address_query - { - flags = EGeneralQueryFlags; - softkeys = R_AVKON_SOFTKEYS_OK_CANCEL; - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSinglePopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - array_id = r_mus_livesharingview_address_array; - }; - heading = qtn_msh_inviteview_select_query_hdr_txt; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// Resource for the address selection query array -// ----------------------------------------------------------------------------- -// -RESOURCE ARRAY r_mus_livesharingview_address_array - { - items = - { - LBUF { txt = ""; } - }; - } - - -// ----------------------------------------------------------------------------- -// Resource for the inviting wait note -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_mus_view_inviting_wait_note - { - flags = EAknWaitNoteFlags | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EMusInvitingWaitNoteId; - control = AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// Resource for the camera activation wait note -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_mus_live_sharing_view_activate_camera_wait_note - { - flags = EAknWaitNoteFlags | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EMusActivateCameraWaitNoteId; - control = AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_mus_view_transcoding_wait_note - { - flags = EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EMusTranscodingProgressNoteId; - control = AVKON_NOTE - { - layout = EWaitLayout; - }; - } - }; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_text_enter_address_dialog_prompt - { - buf = qtn_msh_inviteview_enter_sip; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_live_sharing_view_title - { - buf = qtn_msh_shareview_title; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_live_sharing_view_inviting_wait_note_txt - { - buf = qtn_msh_note_inviting; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_live_sharing_view_open_camera_lens_cover_wait_note_txt - { - buf = qtn_msh_note_change_camera_mode; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_registration_pending_wait_note_txt - { - //"Registering to SIP server" - buf = qtn_msh_note_registration_pending; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_change_keypad_mode_txt - { - buf = qtn_msh_note_change_keypad_mode; - } - - -// -------------------------------------------------------- -// Resources related to video receive -// -------------------------------------------------------- - -RESOURCE TBUF r_mus_receive_view_note_incoming_video_request - { - buf = qtn_msh_note_incoming_video_request; // "Accept sharing request from %U[35]?" - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_receive_view_waiting_for_stream - { - buf = qtn_msh_note_waiting_for_stream; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_save_address_query_txt - { - buf = qtn_msh_query_save_contact; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_saved_filename - { - buf = qtn_msh_set_saving_filename; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_save_shared_video_query - { - buf = qtn_msh_query_save_clip; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_note_video_saved - { - buf = qtn_msh_note_video_saved; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_video_save_folder_name - { - buf = qtn_apps_mg_gs; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_progress_note_converting_clip - { - // "Converting clip for sharing" - buf = qtn_msh_note_transcoding_video; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_note_transcoding_complete - { - // "Clip conversion complete" - buf = qtn_msh_note_transcoding_complete; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_view_note_memorycard_problem - { - // "Memory card is not accessible. Phone memory will be used instead." - buf = qtn_msh_note_memorycard_problem; - } - - -// ----------------------------------------------------------------------------- -// Error Note Strings -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_mus_live_sharing_view_note_recipient_not_found - { - // "Unable to find recipient" - buf = qtn_msh_note_recipient_not_found; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_app_n_a - { - // "Recipient does not have 'Video sharing' application" - buf = qtn_msh_note_app_n_a; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_connection_rejected - { - // "Invitation rejected by recipient" - buf = qtn_msh_note_connection_rejected; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_no_response - { - // "No response received to invitation" - buf = qtn_msh_note_no_response; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_invitation_cancelled - { - // "Invitation cancelled" - buf = qtn_msh_note_invitation_cancelled; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_resource_n_a - { - // "Application not available" - buf = qtn_msh_note_resource_n_a; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_error_mediainit - { - // "Media initialisation failed" - buf = qtn_msh_note_error_mediainit; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_error_filelock - { - // "Unable to read file" - buf = qtn_msh_note_error_filelock; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_error_genericfile - { - // "File error" - buf = qtn_msh_note_error_genericfile; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_error_app_general - { - // "Application error" - buf = qtn_msh_note_error_app_general; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_startup_failed - { - // "Start-up failed. Reinstall 'Video sharing' application." - buf = qtn_msh_note_startup_failed; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_bad_startup_settings - { - // "Start-up failed. Check settings." - buf = qtn_msh_note_bad_startup_settings; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_connection_lost - { - // "Disconnected" - buf = qtn_msh_note_connection_lost; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_recipient_busy - { - // "Recipient already sharing video. Unable to establish connection." - buf = qtn_msh_note_recipient_busy; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_network_n_a - { - // "No network coverage" - buf = qtn_msh_note_network_n_a; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_recipient_n_a - { - // "Recipient busy. Try again later." - buf = qtn_msh_note_recipient_n_a; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_wrong_address - { - // "Recipient not found. Check the address." - buf = qtn_msh_note_wrong_address; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_timeout_expired - { - // "Connection time-out" - buf = qtn_msh_note_timeout_expired; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_service_n_a - { - // "Service temporarily unavailable" - buf = qtn_msh_note_service_n_a; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_only_3g - { - // "Video Sharing is supported only in 3G network." - buf = qtn_mshstarter_note_network_incompatible; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_invite_error - { - // "Unable to send invitation" - buf = qtn_msh_note_invite_error; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_no_reg - { - // "Unable to register to network" - buf = qtn_msh_note_no_reg; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_transcoding_not_supported - { - // "Clip is not in correct format. Unable to share." - buf = qtn_msh_note_transcoding_not_supported; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_sharing_ended - { - // "Video sharing ended" - buf = qtn_msh_note_sharing_ended; - } - -RESOURCE TBUF r_mus_live_sharing_view_note_sharing_ended_record - { - // "Video sharing ended. Continue recording?" - buf = qtn_msh_note_sharing_ended_record; - } - -RESOURCE TBUF r_mus_view_drm_info_send_forbid - { - // "Unable to send protected object" - buf = qtn_drm_info_send_forbid_one; - } - -RESOURCE TBUF r_mus_view_note_memory_low - { - // "Memory low. Recording stopped." - buf = qtn_msh_note_memory_low; - } - -RESOURCE TBUF r_mus_view_note_unable_to_convert - { - // "Unable to convert clip" - buf = qtn_msh_note_transcoding_failed; - } - -RESOURCE TBUF r_mus_note_hf_activated - { - // "Handsfree activated" - buf = qtn_hf_conf_activate; - } - -RESOURCE SLIDER r_mus_slider_vertical - { - layout=EAknSliderLayoutVertical; - minvalue=0; - maxvalue=100; - step=1; - valuetype=EAknSliderValueNone; - minlabel="-"; - maxlabel="+"; - } - -RESOURCE SLIDER r_mus_slider_horizontal - { - layout=EAknSliderLayoutHorizontal; - minvalue=0; - maxvalue=100; - step=1; - valuetype=EAknSliderValueNone; - } - -// end of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/data/musui_reg.rss --- a/mmsharing/mmshui/data/musui_reg.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: S60 v3.0-compatible application resource file -* -*/ - - - -#include -#include - -#include - -#include "musuid.hrh" - -UID2 KUidAppRegistrationResourceFile -UID3 KMusUiUid // 0x10282391 - -RESOURCE APP_REGISTRATION_INFO - { - app_file = "musui"; - localisable_resource_file = APP_RESOURCE_DIR"\\musui"; - localisable_resource_id = R_LOCALISABLE_APP_INFO; - hidden = KAppIsHidden; - embeddability = KAppNotEmbeddable; - //group_name = "musui"; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/Thumbs.db Binary file mmsharing/mmshui/graphics/Thumbs.db has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_graf_rop_black.bmp Binary file mmsharing/mmshui/graphics/qgn_graf_rop_black.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_end_rec.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_end_rec.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_end_rec_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_end_rec_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_paused.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_paused.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_paused_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_paused_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_speaker_muted.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_speaker_muted.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_mus_speaker_muted_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_indi_mus_speaker_muted_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_tb_gallery.svg --- a/mmsharing/mmshui/graphics/qgn_indi_tb_gallery.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_tb_microphone_mute.svg --- a/mmsharing/mmshui/graphics/qgn_indi_tb_microphone_mute.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_tb_microphone_unmute.svg --- a/mmsharing/mmshui/graphics/qgn_indi_tb_microphone_unmute.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_tb_zoom.svg --- a/mmsharing/mmshui/graphics/qgn_indi_tb_zoom.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_forw.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_forw.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_pause.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_pause.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_play.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_play.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_record.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_record.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_record_not.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_record_not.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_rew.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_rew.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_stop.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_stop.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait1.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait1.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait2.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait2.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait3.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait3.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait4.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait4.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait5.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait5.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait6.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait6.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait7.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait7.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_indi_video_wait8.svg --- a/mmsharing/mmshui/graphics/qgn_indi_video_wait8.svg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt_mask_soft.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_cxt_mask_soft.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_lst.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_lst.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_lst_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_lst_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_menu_mus_app_lst_mask_soft.bmp Binary file mmsharing/mmshui/graphics/qgn_menu_mus_app_lst_mask_soft.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_clip_rec_sub.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_clip_rec_sub.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_clip_rec_sub_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_clip_rec_sub_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_file_video.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_file_video.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_file_video_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_file_video_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_folder_sub_large.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_folder_sub_large.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_folder_sub_large_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_folder_sub_large_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab2.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab2.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab2_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab2_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_mmc_tab_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab2.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab2.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab2_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab2_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_memc_phone_tab_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_sip_url.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_sip_url.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_sip_url_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_sip_url_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_view_clip_sub.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_view_clip_sub.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_view_clip_sub_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_view_clip_sub_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_view_live_sub.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_view_live_sub.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/qgn_prop_mus_view_live_sub_mask.bmp Binary file mmsharing/mmshui/graphics/qgn_prop_mus_view_live_sub_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/Thumbs.db Binary file mmsharing/mmshui/graphics/temp_icons/Thumbs.db has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_ff.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_ff.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_ff_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_ff_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_norec.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_norec.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_norec_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_norec_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_pause.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_pause.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_pause_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_pause_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_play.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_play.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_play_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_play_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rec.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rec.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rec_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rec_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rew.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rew.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rew_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_rew_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_stop.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_stop.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_stop_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_stop_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_wait.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_wait.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_wait_mask.bmp Binary file mmsharing/mmshui/graphics/temp_icons/qgn_msh_temp_wait_mask.bmp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/group/bld.inf --- a/mmsharing/mmshui/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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: project specification -* -*/ -#include - -PRJ_PLATFORMS -ARMV5 THUMB WINSCW - -PRJ_MMPFILES -musui.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE musuitoolbaricons.mif -OPTION HEADERFILE musuitoolbaricons.mbg -OPTION SOURCEFILE toolbariconslist.txt -END - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE musuiicons.mif -OPTION HEADERFILE musuiicons.mbg -OPTION SOURCEFILE musuiiconlist.txt -END - -START EXTENSION s60/mifconv -OPTION TARGETFILE musui_aif.mif -OPTION HEADERFILE musui_aif.mbg -OPTION SOURCEDIR ../graphics -OPTION SOURCES -c8,8 qgn_menu_mus_app_lst -c8,8 qgn_menu_mus_app_cxt -END - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/group/musui.mmp --- a/mmsharing/mmshui/group/musui.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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: Specifies the project for building musui.exe, the -* application executable. -* -*/ - - -#include -#include - -#include "../../../inc/musuid.hrh" - - -TARGET musui.exe -TARGETTYPE EXE -UID 0x100039CE KMusUiUid //0x10282391 -EPOCSTACKSIZE 0x8000 // 32 kB -EPOCHEAPSIZE 0x4000 0x500000 // Max heapsize ~= 5MB -VENDORID VID_DEFAULT -CAPABILITY CAP_APPLICATION NetworkControl SwEvent Location MultimediaDD - -START RESOURCE ../data/musui.rss -HEADER -LANGUAGE_IDS -TARGETPATH APP_RESOURCE_DIR -END // RESOURCE - -START RESOURCE ../data/musui_reg.rss -DEPENDS musui.rsg -TARGETPATH /private/10003a3f/apps // Do not change the UID in this path. -END - -START BITMAP musui.mbm -HEADER -TARGETPATH APP_BITMAP_DIR -SOURCEPATH ../graphics -SOURCE c16 qgn_menu_mus_app_cxt.bmp -SOURCE 8 qgn_menu_mus_app_cxt_mask.bmp -SOURCE c8 qgn_graf_rop_black.bmp -END // BITMAP - -SOURCEPATH ../src -SOURCE musuiapp.cpp -SOURCE musuidocument.cpp -SOURCE musuiappui.cpp -SOURCE musuigeneralview.cpp -SOURCE musuisendview.cpp -SOURCE musuilivesharingview.cpp -SOURCE musuireceiveview.cpp -SOURCE musuiclipsharingview.cpp -SOURCE musuiviewcontainer.cpp -SOURCE musuisendviewcontainer.cpp -SOURCE musuilivesharingviewcontainer.cpp -SOURCE musuiclipsharingviewcontainer.cpp -SOURCE musuireceivecontainer.cpp -SOURCE musuistatuspanehandler.cpp -SOURCE musuinavimediadecorator.cpp -SOURCE musuinavimediaanimator.cpp -SOURCE musuiinvitationquery.cpp -SOURCE musuiactivequerydialog.cpp -SOURCE musuilevelindicator.cpp -SOURCE musuiactivetimer.cpp -SOURCE musuistartcontroller.cpp -SOURCE musuipropertywatch.cpp -SOURCE musuiresourcehandler.cpp -SOURCE musuieventcontroller.cpp -SOURCE musuisendcontroller.cpp -SOURCE musuilivesharingcontroller.cpp -SOURCE musuireceivecontroller.cpp -SOURCE musuiclipsharingcontroller.cpp -SOURCE musuibitmapdecoder.cpp -SOURCE musuiactivitymanger.cpp -SOURCE musuimmcmonitor.cpp -SOURCE musuicallbackservice.cpp -SOURCE musuidialogutil.cpp -SOURCE musuifileutil.cpp -SOURCE musuicontactutil.cpp -SOURCE musuibackgroundviewcontainer.cpp - - -USERINCLUDE . -USERINCLUDE ../inc - -USERINCLUDE ../data -USERINCLUDE ../../mmshshared/inc -USERINCLUDE ../../mmshengine/inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE . - -// MUS libraries: - -// Symbian libraries: -LIBRARY apgrfx.lib // AppArc server client APIs -LIBRARY apparc.lib // Application framework API -LIBRARY bafl.lib // Resource readers -LIBRARY centralrepository.lib // Central repository -LIBRARY cntmodel.lib // Contact Model -LIBRARY cone.lib // Cone framework API -LIBRARY efsrv.lib // File Server API -LIBRARY eikcoctl.lib // Control framework API -LIBRARY eikcore.lib // Eikon core controls API -LIBRARY eikctl.lib // Eikon controls -LIBRARY eikdlg.lib // Eikon Dialog API -LIBRARY euser.lib // Base library -LIBRARY ws32.lib // Window server client API -LIBRARY fbscli.lib // CFbsBitmap -LIBRARY remconcoreapi.lib -LIBRARY remconinterfacebase.lib -LIBRARY hlplch.lib // HlpLauncher - -// S60 libraries: -LIBRARY aknnotify.lib // CAknGlobalNote -LIBRARY aknskins.lib // Avkon Skins Utils -LIBRARY avkon.lib // Avkon Utils -LIBRARY commonengine.lib // StringLoader -LIBRARY featmgr.lib // S60 Feature manager API -LIBRARY mgfetch.lib // Media Gallery Fetch Dialog -LIBRARY pbkeng.lib // PhoneBook Engine API -LIBRARY pbkview.lib // PhoneBook view API -LIBRARY platformenv.lib // PathInfo -LIBRARY aknicon.lib // AknIconUtils -LIBRARY aknlayout.lib // CdlEngine -LIBRARY gdi.lib // CFont -LIBRARY flogger.lib // RFileLogger -LIBRARY imageconversion.lib // CIImageDecoder -LIBRARY egul.lib // CGulIcon -LIBRARY pbk2commonui.lib // CPbk2ViewState -LIBRARY directorylocalizer.lib // CDirectoryLocalizer - -// MUS libarires: -LIBRARY musengine.lib // Engine - -PAGED - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/group/musuiiconlist.txt --- a/mmsharing/mmshui/group/musuiiconlist.txt Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ --c8,8 qgn_indi_video_forw --c8,8 qgn_indi_video_pause --c8,8 qgn_indi_video_play --c8,8 qgn_indi_video_record --c8,8 qgn_indi_video_record_not --c8,8 qgn_indi_video_rew --c8,8 qgn_indi_video_stop --c8,8 qgn_indi_video_wait1 --c8,8 qgn_indi_video_wait2 --c8,8 qgn_indi_video_wait3 --c8,8 qgn_indi_video_wait4 --c8,8 qgn_indi_video_wait5 --c8,8 qgn_indi_video_wait6 --c8,8 qgn_indi_video_wait7 --c8,8 qgn_indi_video_wait8 --c8,8 qgn_indi_cams_zoom_bg --c8,8 qgn_indi_cams_zoom_bg_max --c8,8 qgn_indi_cams_zoom_bg_min --c8,8 qgn_indi_cams_zoom_elevator --c8,8 qgn_indi_browser_tb_zoom_out --c8,8 qgn_indi_browser_tb_zoom_in - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/group/toolbariconslist.txt --- a/mmsharing/mmshui/group/toolbariconslist.txt Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ --c8,8 qgn_indi_tb_call_volume --c8,8 qgn_indi_tb_fullscreen --c8,8 qgn_indi_cams_tb_rec_pause --c8,8 qgn_indi_tb_pause_send_video --c8,8 qgn_indi_tb_play --c8,8 qgn_indi_tb_video --c8,8 qgn_indi_tb_ffw_frew --c8,8 qgn_indi_tb_zoom --c8,8 qgn_indi_tb_brightness --c8,8 qgn_indi_tb_microphone_mute --c8,8 qgn_indi_tb_microphone_unmute --c8,8 qgn_indi_tb_ihf_off --c8,8 qgn_indi_tb_ihf_on diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/help/data/xhtml.zip Binary file mmsharing/mmshui/help/data/xhtml.zip has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/help/group/bld.inf --- a/mmsharing/mmshui/help/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - Initial contribution -* -* Contributors: -* -* -* Description: -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/help/inc/msh.hlp.hrh --- a/mmsharing/mmshui/help/inc/msh.hlp.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// -// msh.hlp.hrh generated by CSXHelp Utilities. -// - -#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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/help/rom/mmshuihelps_variant.iby --- a/mmsharing/mmshui/help/rom/mmshuihelps_variant.iby Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musui.hrh --- a/mmsharing/mmshui/inc/musui.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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: The MUS application's resource header file. -* -*/ - - -#ifndef MUS_HRH -#define MUS_HRH - -// -// Application menu commands -// -enum TMusUiMenuCommands - { - // General commands start - EMusuiCmdAppTest = 1, - EMusuiCmdViewPause, - EMusuiCmdViewContinue, - EMusuiCmdViewReplay, - EMusuiCmdViewShareVideo, - EMusuiCmdViewShareImage, - EMusuiCmdViewShareLive, - EMusuiCmdViewClipAudio, - EMusuiCmdViewAudioNormal, - EMusuiCmdViewAudioMute, - EMusuiCmdViewFullScreen, - EMusuiCmdViewZoom, - EMusuiCmdViewBrightness, - EMusuiCmdViewMicrophoneMute, - EMusuiCmdViewMicrophoneUnmute, - EMusuiCmdViewIncreaseBrightness, - EMusuiCmdViewDecreaseBrightness, - EMusuiCmdViewZoomIn, - EMusuiCmdViewZoomOut, - EMusuiCmdViewVolumeUp, // Not in menu - EMusuiCmdViewVolumeDown, // Not in menu - EMusuiCmdViewVolumeChanged, // Not in menu - EMusuiCmdViewFastForward, // Not in menu - EMusuiCmdViewFastReverse, // Not in menu - EMusuiCmdViewFastForwardEnd, // Not in menu - EMusuiCmdViewFastReverseEnd, // Not in menu - EMusuiCmdViewLoadspeaker, - EMusuiCmdViewHandset, - EMusuiCmdViewEndActiveCall, - EMusuiCmdViewMiddleSoftkeyOk, - EMusuiCmdRecord, - EMusuiCmdStopRecording, - EMusuiGenCmdExit, - EMusuiGenCmdBack, - // Toolbar commands: - EMusuiCmdToolbarVolume, - EMusuiCmdToolbarFullScreen, - EMusuiCmdToolbarPauseLive, - EMusuiCmdToolbarUnPauseLive, - EMusuiCmdToolbarPause, - EMusuiCmdToolbarUnPause, - EMusuiCmdToolbarZoom, - EMusuiCmdToolbarFFRev, - EMusuiCmdToolbarBrightness, - EMusuiCmdToolbarMute, - EMusuiCmdToolbarUnmute, - EMusuiCmdToolbarSpeakerOff, - EMusuiCmdToolbarSpeakerOn, - EMusuiCmdToolbarGallery, - EMusUiCmdToolbarLastIndex // For loops - }; - -enum TMusUiDlgIds - { - EMusDialogTextQuery = 0x200, - EMusConfirmationQuery - }; - -enum TMusUiControlIds - { - EMusDummyControlId = 1000, - EMusInvitingWaitNoteId, - EMusTranscodingProgressNoteId, - EMusActivateCameraWaitNoteId - }; -// -// MUS clip list view icons -// -enum TMusUiIconID - { - EMusuiMarkingIconId = 0, // Icon for marking - EMusuiFolderIconId, // Folder icon for user created folder - EMusuiFolderSubfolderIconId, // - " - with subfolders - EMusuiVideoIconId, // Icon for video file - EMusuiOtherIconId, // Icon for other file type - // Icon # of this enumeration (MUST be the last entry in this enumeration): - EMusuiIconCount - }; - - -#endif - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiactivequerydialog.h --- a/mmsharing/mmshui/inc/musuiactivequerydialog.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIACTIVEQUERYDIALOG_H -#define MUSUIACTIVEQUERYDIALOG_H - -//#include "musuiactivetimerobserver.h" - -#include - -class CAknGlobalConfirmationQuery; -class MMusUiQueryObserver; - -/** - * - * - * - * @lib musui.exe - */ -class CMusUiActiveQueryDialog : public CActive - { - -public: // constructor - - static CMusUiActiveQueryDialog* NewL( MMusUiQueryObserver& aObserver ); - - ~CMusUiActiveQueryDialog(); - -private: - - CMusUiActiveQueryDialog( MMusUiQueryObserver& aObserver ); - - void ConstructL(); - - -public: // new functions - - void ShowL( const TDesC& aPrompt ); - - -protected: // from CActive - - void RunL(); - - void DoCancel(); - - TInt RunError( TInt aError ); - - -private: // data - - /** A global confirmation query. Own. */ - CAknGlobalConfirmationQuery* iGlobalQuery; - - /** Observer. */ - MMusUiQueryObserver& iObserver; - }; - - -#endif // MUSUIACTIVEQUERYDIALOG_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiactivetimer.h --- a/mmsharing/mmshui/inc/musuiactivetimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 MUSUIACTIVETIMER_H -#define MUSUIACTIVETIMER_H - -#include - -class MMusUiActiveTimerObserver; - -class CMusUiActiveTimer : public CActive - { - -public: // constructors and destructor - - /** - * Destructor. - */ - ~CMusUiActiveTimer(); - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed CMusUiActiveTimer object. - */ - static CMusUiActiveTimer* NewL( MMusUiActiveTimerObserver* aObserver ); - -private: - - /** - * C++ constructor. - */ - CMusUiActiveTimer( MMusUiActiveTimerObserver* aObserver ); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - -public: // new funtions: - - void After( TTimeIntervalMicroSeconds32 anInterval ); - -private: // functions from base class CActive - - void DoCancel(); - - void RunL(); - -private: // Data - - RTimer iTimer; - MMusUiActiveTimerObserver* iObserver; - - }; - -#endif // MUSUIACTIVETIMER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiactivetimerobserver.h --- a/mmsharing/mmshui/inc/musuiactivetimerobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 MUSUIACTIVETIMEROBSERVER_H -#define MUSUIACTIVETIMEROBSERVER_H - -class CMusUiActiveTimer; - -class MMusUiActiveTimerObserver - { - -public: - - virtual void TimerComplete( CMusUiActiveTimer* aTimer ) = 0; - - }; - -#endif // MUSUIACTIVETIMEROBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiactivitymanger.h --- a/mmsharing/mmshui/inc/musuiactivitymanger.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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 MUSUIACTIVITYMANGER_H -#define MUSUIACTIVITYMANGER_H - -#include - - -class CMusUiActivityManager : public CActive - { - -public: - - static CMusUiActivityManager* NewL( TInt aTimeout = 60 ); - - ~CMusUiActivityManager(); - - -protected: - - CMusUiActivityManager( TInt aTimeout ); - - void ConstructL(); - - -public: // new functions: - - void SetTimeout(TInt aTimeout); - - void Start(); - - void Reset(); - - -protected: // from CActive - - void DoCancel(); - - void RunL(); - - -protected: - - RTimer iTimer; - - TInt iTimeout; - -}; - -#endif // MUSUIACTIVITYMANGER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiapp.h --- a/mmsharing/mmshui/inc/musuiapp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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: The application's application class. -* -*/ - - -#ifndef MUSUIAPP_H -#define MUSUIAPP_H - - -#include - - -/** - * Application class of the MUS application. - * - * @lib musui.exe - */ -class CMusUiApp : public CEikApplication - { - -private: - - /** - * From CApaApplication, creates CMusUiDocument document object. - * @return A pointer to the created document object. - */ - CApaDocument* CreateDocumentL(); - - /** - * From CApaApplication, returns application's UID. - * @return The value of KUidMusUi - */ - TUid AppDllUid() const; - - }; - -#endif // MUSUIAPP_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiappui.h --- a/mmsharing/mmshui/inc/musuiappui.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#ifndef MUSUIAPPUI_H -#define MUSUIAPPUI_H - -#include "musuieventobserver.h" -#include "musuiqueryobserver.h" - -#include -#include -#include -#include -#include -#include - -class CMusUiStatusPaneHandler; -class CMusUiActiveQueryDialog; -class CRemConInterfaceSelector; -class CRemConCoreApiTarget; - -/** - * The MUS application's UI class. - * - * @lib musui.exe - */ -class CMusUiAppUi : public CAknViewAppUi, - public MMusUiEventObserver, - public MMusUiQueryObserver, - public MRemConCoreApiTargetObserver - { - -public: // constructors and destructor - - /** - * EPOC default constructor. - */ - void ConstructL( ); - - /** - * Destructor. - */ - ~CMusUiAppUi(); - -public: // New functions - - CMusUiStatusPaneHandler* MusStatusPane(); - - TBool ExitValue(); - - -public: // from base class CEikAppUi - - void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); - - void HandleForegroundEventL( TBool aForeground ); - -public: // from MRemConCoreApiTargetObserver - - void MrccatoCommand( TRemConCoreApiOperationId aOperationId, - TRemConCoreApiButtonAction aButtonAct ); - - -public: // from MMusUiQueryObserver - - virtual void QueryAcceptedL( TBool aAccepted ); - - /** - * Error handler for QueryAcceptedL. - * - * @param aError is error to be handled. - * @return KErrNone means handled value. All other values will lead to - * a panic. - */ - virtual TInt HandleQueryError( TInt aError ); - - -public: // from MMusUiEventObserver - - virtual void ActivateLocalMusViewL( TUid aViewId ); - - virtual void ActivateLocalMusViewL( TUid aViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - virtual void ShowAsyncConfirmationQueryDialogL( const TDesC& aPrompt ); - - virtual void SetToolbarVisibility( TBool aVisible ); - - virtual void ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon ); - - virtual CEikonEnv* EikonEnv( ) const; - - virtual void TerminateCall(); - - virtual CAknAppUiBase::TAppUiOrientation AppOrientation() const; - - /** - * Switch the active view's orientation, if it's in the foreground, - * from landscape to portrait, or vice versa. - */ - virtual void SwitchOrientationL( TAppUiOrientation aAppOrientation ); - - virtual void HandleError( const TInt aReason ); - - virtual void HandleExit(); - - virtual TBool OrientationCanBeChanged() const; - - virtual TInt GetUiVolumeValue(); - -private: // from base class CEikAppUi - - /** - * Takes care of command handling. - * - * @param aCommand The command to be handled. - */ - void HandleCommandL( TInt aCommand ); - - /** - * Handles a change to the application's resources which are shared - * across the environment. - * - * @param aType The type of resources that have changed. - */ - void HandleResourceChangeL( TInt aType ); - - TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - // Help context from CCoeAppUi - CArrayFix* HelpContextL() const; - -private: - - void DoHandleForegroundEventL( TInt aEventType ); - - void FindWindowGroupIdentifiersL(); - - -private: // data - - /** Owns. Handle to status pane handler */ - CMusUiStatusPaneHandler* iStatusPaneHandler; - - CMusUiActiveQueryDialog* iConfirmationQuery; - - CRemConInterfaceSelector* iInterfaceSelector; - - CRemConCoreApiTarget* iCoreTarget; - - TBool iExit; - - TInt iLastKeyCode; - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; - - // Window group id of this application. - TInt iThisApplicationWgId; - - // Window group id of eikon server. - TInt iEikonServerWgId; - - // Window group id for AknCapServer - TInt iAknCapServerWgId; - - // Window group id for Akn Notifier Server - TInt iAknNfyServerWgId; - - TBool iForeground; - - - }; - -#endif // MUSUIAPPUI_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuibackgroundviewcontainer.h --- a/mmsharing/mmshui/inc/musuibackgroundviewcontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIBACKGROUNDVIEWCONTAINER_H -#define MUSUIBACKGROUNDVIEWCONTAINER_H - -#include // Control base class - -class MAknsControlContext; - -/** - * This class handles ordinal position two plain window. - * - * - * @lib musui.exe - */ -class CMusUiBackgroundViewContainer : public CCoeControl, - public MCoeControlObserver - { -public: // Constructors and destructor - - static CMusUiBackgroundViewContainer* NewL( - const TRect& aRect, - TInt aOrdinalPosition ); - - ~CMusUiBackgroundViewContainer(); - - -public: - - /** - * Refreshes the view. Called after the mode has been changed - * from portrait to landscape or vice versa. - */ - void RefreshView(); - - /** - * Sets the windows group ordinal position which is supplied - * at construction phase - */ - void SetOrdinalPosition(); - - /** - * Sets the windows group ordinal position for this container - * @aOrdianlPosition : Ordinal Position - */ - void SetOrdinalPosition( TInt aOrdianlPosition); - - /** - * Increase/decrease the windows group ordinal position which is supplied - * at construction phase based on aUp. - * @aUp : ETrue to increment else EFalse. - */ - void UpdateOrdinalPositionValue( TBool aUp ); - -private: // Construction - - CMusUiBackgroundViewContainer( TInt aOrdinalPosition ); - - void ConstructL( const TRect& aRect ); - -private: // from base class CCoeControl - - /** - * From CoeControl,SizeChanged. - */ - void SizeChanged(); - - /** - * Returns the number of control contained by this class. - * - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * Returns handle to control pointed by aIndex. - * - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * Gets called by the application framework when drawing is - * needed. - * - * @param aRect The rectangle that needs to be drawn. - */ - 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); - - /** - * Handles key events. - * - * @param aEvent The event that occured. - * @param aType Type of key event: EEventKey, EEventKeyUp, or - * EEventKeyDown. - * @return The container's response to event: either - * EKeyWasNotConsumed or EKeyWasConsumed. - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - - /** - * - */ - TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); - - -private: // data - - /** Background skin control context */ - MAknsControlContext* iBackGround; - - /** - * Created window group identifier - */ - TInt iGroupIdentifier; - - /** - * Ordinal Postion for windows group - */ - TInt iOrdinalPosition; - - }; - - -#endif // MUSUILIVESHARINGVIEWCONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuibitmapdecoder.h --- a/mmsharing/mmshui/inc/musuibitmapdecoder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 MUSUIBITMAPDECODER_H -#define MUSUIBITMAPDECODER_H - -#include -#include - -class MMusUiBitmapDecoderObserver; -class CImageDecoder; -class CFbsBitmap; - -class CMusUiBitmapDecoder : public CActive - { - -public: // constructors and destructor - - /** - * Destructor. - */ - ~CMusUiBitmapDecoder(); - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed CMusUiBitmapDecoder instance. - */ - static CMusUiBitmapDecoder* NewL( MMusUiBitmapDecoderObserver& aObserver ); - -private: - - /** - * C++ constructor. - */ - CMusUiBitmapDecoder( MMusUiBitmapDecoderObserver& aObserver ); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - - -public: // new funtions: - - void ConvertL( HBufC8* aData, CFbsBitmap* aBitmap ); - - -private: // functions from base class CActive - - void DoCancel(); - - void RunL(); - -private: // Data - - MMusUiBitmapDecoderObserver& iObserver; - - CImageDecoder* iDecoder; - - CFbsBitmap* iBitmap; - - RFs iFs; - - HBufC8* iData; - }; - -#endif // MUSUIBITMAPDECODER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuibitmapdecoderobserver.h --- a/mmsharing/mmshui/inc/musuibitmapdecoderobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 MUSUIBITMAPDECODEROBSERVER_H -#define MUSUIBITMAPDECODEROBSERVER_H - -class CFbsBitmap; - -class MMusUiBitmapDecoderObserver - { - -public: - - virtual void UpdateBitmap( CFbsBitmap* aBitmap ) = 0; - - }; - -#endif // MUSUIBITMAPDECODEROBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuicallbackobserver.h --- a/mmsharing/mmshui/inc/musuicallbackobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 MUSUICALLBACKOBSERVER_H -#define MUSUICALLBACKOBSERVER_H - - -#include "musuidefinitions.h" - - -/** - * MUS application's note request interface. - */ -class MMusUiCallbackObserver - { - -public: // new functions - - /** - * Process asynchronous event. - * - * @param aEventId Id of the triggered event - */ - virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ) = 0; - - /** - * Error handler for HandleAsyncEventL. - * - * @param aError is error to be handled. - * @return KErrNone means handled value. All other values will lead to - * a panic. - */ - virtual TInt HandleAsyncError( TInt aError ) = 0; - - }; - - -#endif // MUSUICALLBACKOBSERVER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuicallbackservice.h --- a/mmsharing/mmshui/inc/musuicallbackservice.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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 MUSUICALLBACKSERVICE_H -#define MUSUICALLBACKSERVICE_H - -#include "musuidefinitions.h" -#include - -class MMusUiCallbackObserver; - - -/** - * Callback Service used to pass asynchronous events - */ -class CMusUiCallbackService : public CActive - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aCallbackObserver the observer that will receive the callbacks. - * @return new instance of CMusUiCallbackService. - */ - static CMusUiCallbackService* NewL( - MMusUiCallbackObserver& aCallbackObserver ); - - /** - * Destructor. - */ - ~CMusUiCallbackService(); - -private: // Constructors - - /** - * C++ default constructor. - * @param aCallbackObserver the observer that will receive the callbacks. - */ - CMusUiCallbackService( MMusUiCallbackObserver& aCallbackObserver ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - -public: // New functions - - /** - * Buffer a request to trigger an event. - * @param aEventId Id of the event - */ - void AsyncEventL( TMusUiAsyncEvent aEventId ); - - /** - * Called when the notifier has been deactivated so resources can be - * freed and outstanding messages completed. - */ - void Cancel(); - - /** - * Check what event is currently pending - * @return EMusUiAsyncUninitialized is no events are pending - */ - TMusUiAsyncEvent CurrentEvent() const; - - -public: // Functions from CActive base class - - /** - * From CActive. Called when a request completes. - */ - void RunL(); - - /** - * From CActive. Called when a leave occurres in RunL. - * @param aError Symbian OS errorcode. - * @return Error Code. - */ - TInt RunError(TInt aError); - - /** - * From CActive. Called when a request is cancelled. - */ - void DoCancel(); - - -private: // New functions - - /** - * Activate the object. - */ - void Activate(); - - -private: // Data - - /** Handle to callback observer. */ - MMusUiCallbackObserver& iCallbackObserver; - - /** Event ID to pass through. */ - TMusUiAsyncEvent iEventId; - - }; - -#endif // MUSUICALLBACKSERVICE_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiclipsharingcontroller.h --- a/mmsharing/mmshui/inc/musuiclipsharingcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* 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 MUSUICLIPSHARINGCONTROLLER_H -#define MUSUICLIPSHARINGCONTROLLER_H - -#include "musuisendcontroller.h" -#include "musengclipsessionobserver.h" -#include "musunittesting.h" -#include "musuiactivetimerobserver.h" - -#include -#include - -class MMusUiClipSharingObserver; -class CMusEngClipSession; -class CMusUiActiveTimer; - -/** - * - * - * @lib musui.exe - */ -class CMusUiClipSharingController : public CMusUiSendController, - public MMusEngClipSessionObserver, - public MMusUiActiveTimerObserver - { - - MUS_UNITTEST( UT_CMusUiClipSharingController ) - -public: - - static CMusUiClipSharingController* NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiClipSharingObserver& aClipObserver, - const TRect& aRect ); - - virtual ~CMusUiClipSharingController(); - - -private: - - CMusUiClipSharingController( MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiClipSharingObserver& aClipObserver ); - - void ConstructL( const TRect& aRect ); - - -public: // From CMusUiEventController: - - virtual void OfferToolbarEventL( TInt aCommand ); - - virtual void HandleCommandL( TInt aCommand ); - - virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); - - virtual void DeleteEngineSession(); - - -public: // from CMusUiSendController - - virtual CMusEngMceOutSession* EngineOutSession(); - - /** - * Handles status changes specific to sending side sharing types. - * To be overridden in sibling classes for sharing type specific - * status changes. Calls base class version if status change is not - * sending side specific. - */ - virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus ); - - virtual void InviteL( const TDesC& aRecipient ); - - virtual void HandleSliderValueChangeL( TInt aNewLevel ); - - -public: // new functions: - - void SetFileNameL( const TDesC& aFileName ); - - TBool ClipEnded(); - - TBool ClipMutedL(); - - TBool ClipContainsAudioL(); - - void CancelTranscodingL(); - - void StopWindingL(); - - TBool ToolbarFFRevSelected(); - - -private: // new functions: - - void TranscodingProgressedL( TInt aPercentage ); - - void TranscodingCompletedInitL(); - - void TranscodingCompletedFinalizeL(); - - const TDesC& FormattedDurationString( - const TTimeIntervalSeconds& aDurationSeconds, - const TTimeIntervalSeconds& aPositionSeconds ); - - -public: // From MMusEngClipSessionObserver - - virtual void EndOfClip(); - - virtual void TranscodingNeeded(); - - virtual void TranscodingProgressed( TInt aPercentage ); - - virtual void TranscodingCompletedInit(); - - virtual void TranscodingCompletedFinalize(); - - virtual void TranscodingFailed(); - - -public: // from MMusEngOutSessionObserver - - virtual void SessionRecipientNotFound(); // 404 - - -public: // from MMusEngSessionObserver - - virtual void SessionEstablished(); - - virtual void SessionTerminated(); - - virtual void SessionConnectionLost(); - - virtual void SessionFailed(); - - virtual void StreamIdle(); - - virtual void StreamStreaming(); - - virtual void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds ); - - virtual void InactivityTimeout(); - - -public: // from MMusUiActiveTimerObserver - - void TimerComplete( CMusUiActiveTimer* aTimer ); - - -private: // new functions: - - void StreamStreamingL(); - - void SessionTimeChangedL( const TTimeIntervalSeconds& aSeconds ); - - TBool DoFastForwardingL( TBool aUseWinding ); - - TBool DoFastRewindingL( TBool aUseWinding ); - - -private: - - MMusUiClipSharingObserver& iClipObserver; - - CMusEngClipSession* iSession; - - HBufC* iFileName; - - TRect iRect; - - TBool iClipEnded; - - TBool iTranscode; - - TBool iTranscodingGoing; - - TBool iToolbarFFRevSelected; - - TBuf<11> iDurationStringBuffer; - - TBool iFastForward; - - TBool iFastRewind; - - TBool iFileFetchingOngoing; - - // timer initiating session close on expiring - CMusUiActiveTimer* iCloseTimer; - - TBool iWasPlayingBeforeWinding; - - }; - -#endif // MUSUICLIPSHARINGCONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiclipsharingobserver.h --- a/mmsharing/mmshui/inc/musuiclipsharingobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 MUSUICLIPSHARINGOBSERVER_H -#define MUSUICLIPSHARINGOBSERVER_H - -#include "musuidefinitions.h" - -#include -#include - -class MMusUiClipSharingObserver - { - -public: - - virtual void RunFetchDialogL() = 0; - - virtual void ShowTranscodingProgressDialogL() = 0; - - virtual void UpdateClipTranscodingPercentageL( TInt aPercetage ) = 0; - - virtual void CancelTranscodingDialogL() = 0; - - virtual void UpdateClipPositionL( TInt aPositionInSeconds, - const TDesC& aFormattedPosition ) = 0; - - virtual void SetDurationValue( TInt aDurationValue ) = 0; - - virtual void SetPositionValueL( TInt aPositionValue ) = 0; - - virtual void SetDurationVisible() = 0; - - }; - -#endif // MUSUICLIPSHARINGOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiclipsharingview.h --- a/mmsharing/mmshui/inc/musuiclipsharingview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUICLIPSHARINGVIEW_H -#define MUSUICLIPSHARINGVIEW_H - - -#include "musuisendview.h" // Base view class -#include "musuiclipsharingobserver.h" - -#include - -class CMusUiClipSharingViewContainer; -class CMusUiClipSharingController; -class CMusUiActivityManager; -class CMusUiBackgroundViewContainer; -class CAknToolbar; - - -/** - * The MUS application's clip sharing view. - * - * @lib musui.exe - */ -class CMusUiClipSharingView : public CMusUiSendView, - public MMusUiClipSharingObserver - { - -public: // constructors and destructor - - /** - * EPOC 2nd phase constructor. - */ - void ConstructL(); - - /** - * Destructor. - */ - virtual ~CMusUiClipSharingView(); - - -public: // from base class CAknView - - /** - * From CAknView returns Uid of View - * @return TUid uid of the view - */ - virtual TUid Id() const; - - // From MEikMenuObserver, Called by framework before constructing menupane - virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - -public: // from CMusUiGeneralView - - virtual void HandleToolbarCommandL( TInt aCommand ); - - virtual void HandleKeyUpEvent( TInt aKeyCode ); - - virtual void SetInitialFocusedItemL(); - -public: // from base class MAknToolbarObserver - - virtual void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); - - -public: // from MMusUiClipSharingObserver - - virtual void RunFetchDialogL(); - - virtual void ShowTranscodingProgressDialogL(); - - virtual void UpdateClipTranscodingPercentageL( TInt aPercetage ); - - virtual void CancelTranscodingDialogL(); - - virtual void UpdateClipPositionL( TInt aPositionInSeconds, - const TDesC& aFormattedPosition ); - - virtual void SetDurationValue( TInt aDurationValue ); - - virtual void SetPositionValueL( TInt aPositionValue ); - - virtual void SetDurationVisible(); - - virtual void ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ); - - -public: // new functions - - void RefreshView(); - - void CancelTranscodingL(); - - -protected: // from CMusUiSendView - - virtual CMusUiSendController* SendController() const; - - virtual CMusUiSendViewContainer* SendContainer() const; - - -private: - - /** - * Gets called by the framework when it's activating this view. - * - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * Gets called by the framework when it's deactivating this view. - */ - void DoDeactivate(); - - -private: // data - - /** Container for all controls in this view. Owns. */ - CMusUiClipSharingViewContainer* iContainer; - - CMusUiClipSharingController* iController; - - }; - -#endif // MUSUICLIPSHARINGVIEW_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h --- a/mmsharing/mmshui/inc/musuiclipsharingviewcontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUICLIPSHARINGVIEWCONTAINER_H -#define MUSUICLIPSHARINGVIEWCONTAINER_H - -#include "musuisendviewcontainer.h" - -#include // Media Gallery fetcher verifier -#include - -class CAknProgressDialog; -class CEikProgressInfo; - -/** - * - * - * - */ -class CMusUiClipSharingViewContainer : public CMusUiSendViewContainer, - public MMGFetchVerifier, - public MProgressDialogCallback - - { - -public: // constructors and destructor - - /** - * Symbian second-phase constructor. - * - * @param aView Parent view of container. - * @param aRect Frame rectangle for container. - * @param aInputParams Packaged data. - */ - void ConstructL( CMusUiGeneralView* aView, const TRect& aRect ); - - /** - * Destructor. - */ - ~CMusUiClipSharingViewContainer(); - - -public: // new functions - - void ShowTranscodingProgressDialogL(); - - void UpdateClipTranscodingPercentageL( TInt aPercentage ); - - void CancelTranscodingL(); - - void RunFetchDialogL(); - - const TDesC& FetchedFileName(); - - TBool FileSelected(); - - void SetDurationValue( TInt aDurationValue ); - - void SetPositionValueL( TInt aPositionValue ); - - void SetDurationIndicatorVisible( TBool aVisible ); - -public: // from base class MMGFetchVerifier - - /** - * Verifies the current user selection. - * - * @param aSelectedFiles Descriptor array of selected files. - * @return EFalse if selection can't be used. If ok, returns ETrue. - */ - TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); - -public: // from MProgressDialogCallback - - /** - * Callback method - * Get's called when a dialog is dismissed. - */ - void DialogDismissedL( TInt aButtonId ); - - -private: // from base class CCoeControl - - /** - * Returns the number of control contained by this class. - * - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * Returns handle to control pointed by aIndex. - * - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * Handles key events. - * - * @param aEvent The event that occured. - * @param aType Type of key event: EEventKey, EEventKeyUp, or - * EEventKeyDown. - * @return The container's response to event: either - * EKeyWasNotConsumed or EKeyWasConsumed. - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - -protected: // data - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; -private: // data - - /** - * A progress dialog to show the transcoding progress. Own. - */ - CAknProgressDialog* iTranscodingDialog; - - /** - * A progress dialog to show the transcoding progress. Own. - */ - CEikProgressInfo* iTranscodingProgress; - - HBufC* iFileName; - - TBool iFileSelected; - - TBool iTranscodingOngoing; - - }; - - -#endif // MUSUICLIPSHARINGVIEWCONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuicontactutil.h --- a/mmsharing/mmshui/inc/musuicontactutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* 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 MUSUICONTACTUTIL_H -#define MUSUICONTACTUTIL_H - -#include -#include -#include -#include - -class MusUiContactUtil - { - - public: - - /** - */ - static TBool ShareViewFieldExistsL( CCoeEnv& aEnv, TInt aContactId ); - - /** - */ - static TBool CheckPbContactForVSAddressesL( CCoeEnv& aEnv, - const TDesC& aOriginator, - TInt aContactId); - /** - */ - static TBool MatchTextWithPbFieldsL( CCoeEnv& aEnv, - TPbkFieldId aFieldId, - const TDesC& aText, - TInt aContactId); - /** - */ - static void ActivateContactViewL( CCoeEnv& aEnv, - TContactItemId aId, - const TDesC& aTypedAddress, - const TDesC& aMusTelNumberValue ); - - private: - - /** - */ - static void EditContactL( CPbkContactItem& aContact, - TBool aNewOne, - CPbkContactEngine* aPbkContactEngine, - const TDesC& aTypedAddress, - const TDesC& aMusTelNumberValue, - TContactItemId aId ); - - /** - */ - static CContactTextField* EditableContactFieldL( - CPbkContactItem& aContact, - TInt aFieldId, - CPbkContactEngine* aPbkContactEngine ); - }; - - - -#endif // MUSUICONTACTUTIL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuidefinitions.h --- a/mmsharing/mmshui/inc/musuidefinitions.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIDEFINITIONS_H -#define MUSUIDEFINITIONS_H - -#include - - -// View UIDs -const TUid KMusUidNullView = { 0 }; -const TUid KMusUidReceivingView = { 1 }; -const TUid KMusUidLiveSharingView = { 2 }; -const TUid KMusUidClipSharingView = { 3 }; -const TUid KMusUidGeneralView = { 4 }; -const TUid KMusUidSendView = { 5 }; - -// Volume settings -const TInt KMusVolumeMuted = 0; -const TInt KMusVolumeMaximum = 10; -const TInt KMusVolumeDefault = 5; - -// protocol prefixes and address components -const TInt KMusSipAddressesMaxAmount = 8; -const TInt KMusPrefixMaxLength = 4; -const TInt KMusSipAddressMaxLength = 256; -_LIT( KMusPrefixSipUri, "sip:" ); -_LIT( KMusPrefixTelUri, "tel:" ); -_LIT( KMusAtSymbol, "@" ); -_LIT( KMusSpaceSymbol, " " ); -_LIT( KMusEmptyStringSymbol, "" ); -_LIT( KMusCommaSymbol, "," ); -_LIT( KMusVideoFileNameExtension, ".3gp" ); -_LIT( KMusVideoFileNameBegining, "VS" ); -_LIT( KMusVideoFileNameVersion, "V" ); - -const TInt KMusDriveAndColonStringLength = 2; -const TInt KMusPercentUStringLength = 2; -const TInt KMusVideoFileNameNumberStringStartPos = 7; -const TInt KMusVideoFileNameNumberStringLength = 3; - -const TInt KMusDefaultArrayGranularity = 5; -const TInt KMusStringSubstArrayGranularity = 2; - -const TInt KMusOneHundredPercent = 100; - -const TInt KMusErrorMessageMaxLength = 512; -const TInt KMusNameFieldMaxLength = 512; -const TInt KMusFileNameMaxLength = 256; - -// time constants -const TInt KMusOneSecond = 1000000; // one second in microseconds -const TInt KMusInviteExpireTimeout = 60; // seconds -const TInt KMusReceiveTimeout = 10 * KMusOneSecond; // ten seconds -const TInt KMusOneMinuteInSeconds = 60; -const TInt KMusNumberValueTen = 10; -const TInt KMusLocaleHoursAndMinutesSeparator = 1; -const TInt KMusLocaleMinutesAndSecondsSeparator = 2; -const TInt KMusBacklightTimeOut = 4; // seconds - -const TInt KMusNumberValueTwo = 2; - -/** asynchronous UI events */ -enum TMusUiAsyncEvent - { - EMusUiAsyncUninitialized = 0, - EMusUiAsyncInviteCancel, - EMusUiAsyncManualAddressEntry, - EMusUiAsyncInviteAccepted, - EMusUiAsyncStartInvitation, - EMusUiAsyncStartMediaGallery, - EMusUiAsyncStartTranscoding, - EMusUiAsyncHandleExit - }; - -enum TMusUiNaviMediaDecorator - { - EMusUiNaviIconNone = -1, - EMusUiNaviIconForward, - EMusUiNaviIconPause, - EMusUiNaviIconPlay, - EMusUiNaviIconRecord, - EMusUiNaviIconRecordNot, - EMusUiNaviIconRew, - EMusUiNaviIconStop, - EMusUiNaviIconWaitAnim - }; - -enum TMusUiLoudspeakerStatus - { - ELoudspeakerDisabled = 0, - ELoudspeakerEnabled = 1 - }; - -enum TMusUiLoudspeakerDialogStatus - { - ELoudspeakerDialogDisabled = 0, - ELoudspeakerDialogEnabled = 1 - }; - -enum TMusUiVolumeStatus - { - EVolumeDown = 0, - EVolumeUp = 1 - }; - -enum TMusUiIndicatorType - { - EMusUiIndicatorTypeZoom = 0, - EMusUiIndicatorTypeBrightness, - EMusUiIndicatorTypeDuration - }; - - - -#endif // MUSUIDEFINITIONS_H - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuidialogutil.h --- a/mmsharing/mmshui/inc/musuidialogutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 MUSDIALOGUTIL_H -#define MUSDIALOGUTIL_H - -#include -#include - -class MusUiDialogUtil - { - - public: - /** - */ - static TBool ShowGlobalConfirmationQueryDialogL( const TDesC& aPrompt ); - - static void ShowInformationDialogL( const TDesC& aPrompt ); - - static void ShowInformationDialogL( TInt aResourceId ); - - static void ShowGlobalInformationDialogL( TInt aResourceId ); - - static void ShowGlobalInformationDialogL( const TDesC& aMessage ); - - static void ShowGlobalErrorDialogL( const TDesC& aMessage ); - - static void ShowGlobalErrorDialogL( TInt aResourceId ); - - static void ShowGlobalErrorModalDialogL( const TDesC& aMessage ); - - static void ShowGlobalErrorModalDialogL( TInt aResourceId ); - - static TBool SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ); - - static TBool ShowTextQueryDialogL( const TDesC& aPrompt, TDes& aValue ); - - static TBool ShowTextQueryDialogL( TInt aPromptResourceId, - TDes& aValue ); - - }; - - - -#endif // MUSDIALOGUTIL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuidocument.h --- a/mmsharing/mmshui/inc/musuidocument.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* 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: Document class of the application. -* -*/ - - -#ifndef MUSUIDOCUMENT_H -#define MUSUIDOCUMENT_H - -#include // Avkon document base class - -class CEikAppUi; - -/** - * Document class of MUS application. - * - * @lib musui.exe - */ -class CMusUiDocument : public CAknDocument - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aApp Handle to Eikon's application class - * @return a new instance of CMusUiDocument - */ - static CMusUiDocument* NewL( CEikApplication& aApp ); - - /** - * Destructor. - */ - virtual ~CMusUiDocument(); - -private: - - /** - * Default constructor - * @param aApp Handle to Eikon's application class - */ - CMusUiDocument( CEikApplication& aApp ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - -private: // Functions from base classes - - /** - * From CEikDocument, create CMusUiAppUi "App UI" object. - * @return a new instance of Mus Applications AppUi class - */ - CEikAppUi* CreateAppUiL(); - -private: // data - - - }; - -#endif // CMUSUIDOCUMENT_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuieventcontroller.h --- a/mmsharing/mmshui/inc/musuieventcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* 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 MUSUIEVENTCONTROLLER_H -#define MUSUIEVENTCONTROLLER_H - -#include "musuipropertyobserver.h" -#include "musuicallbackobserver.h" -#include "musuibitmapdecoderobserver.h" -#include "musresourceproperties.h" -#include "musuidefinitions.h" -#include "musmanagercommon.h" -#include "musuimmcobserver.h" -#include "musunittesting.h" - -#include "musengsessionobserver.h" -#include "musengaudioroutingobserver.h" - -#include // CAknAppUiBase::TAppUiOrientation - -class CMusUiCallbackService; -class MMusUiEventObserver; -class CMusUiMmcMonitor; -class CMusUiPropertyWatch; -class CMusUiBitmapDecoder; -class CFbsBitmap; -class CMusEngMceSession; -class MMusUiSharingObserver; -class CMusUiActivityManager; -class CMusUiResourceHandler; - -using namespace MultimediaSharing; - - -/** - * - * - * @lib musui.exe - */ -class CMusUiEventController : public CBase, - public MMusUiPropertyObserver, - public MMusUiCallbackObserver, - public MMusUiMmcObserver, - public MMusEngSessionObserver, - public MMusEngAudioRoutingObserver - { - -public: // enumerations - - enum TMusUiShutdownState - { - EMusUiShutdownNotDefined, - EMusUiShutdownStarted, - EMusUiShutdownVideoSaved, - EMusUiShutdownContactSavingQueried, - EMusUiShutdownOver - }; - - -public: - - /** - * - */ - virtual ~CMusUiEventController(); - - -protected: - - /** - * - */ - void ConstructL(); - - /** - * - */ - CMusUiEventController( MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver ); - - -public: // From MMusUiPropertyObserver - - /** - * Sets the property key value common to all sharing types. - * To be overridden for specific key values. - * CMusUiPropertyWatch calls MMusUiPropertyObserver::PropertyChanged, - * when P&S key values change - * - * @param TUint aKey - The Property key - * @param TInt aValue - The value of the Property key - */ - virtual void PropertyChanged( const TUint aKey, const TInt aValue ); - - /** - * - */ - virtual void HandlePropertyError( const TInt aReason ); - - -public: // From MMusUiCallbackObserver - - /** - * Handles async events common to all session types. - * Should be called if child classes are not able to handle the call. - */ - virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); - - /** - * Error handler for HandleAsyncEventL. - */ - virtual TInt HandleAsyncError( TInt aError ); - - -public: // From MMusUiMmcObserver - - /** - * - */ - virtual void MmcRemoved(); - - -public: // From - - /** - * Handles session establishment procedures common to all session types. - */ - virtual void SessionEstablished(); - - -public: // From MMusEngAudioRoutingObserver - - /** - * Indicates that some other application has changed audio routing. - * - */ - virtual void AudioRoutingChanged( TBool aShowNote ); - - /** - * Before doing audio routing, permission is asked - * - */ - virtual TBool AudioRouteChangeAllowed() const; - - -public: // New functions - - /** - * - */ - void SetRect( const TRect& aRect ); - - /** - * - */ - const TDesC& MusContactName(); - - /** - * - */ - const TDesC& MusVideoCodecValue(); - - /** - * - */ - const TDesC& MusTelNumberValue(); - - /** - * - */ - const TDesC& SessionTimeFormatted( const TTimeIntervalSeconds& aSeconds ); - - /** - * - */ - void SaveContactQueryL(); - - /** - * - */ - void HandleError( const TInt aError ); - - /** - * Starts shutdown process - */ - void HandleExitL(); - - /** - * - */ - void AsyncQueryDialogAcceptedL( TBool aAccepted ); - - /** - * - */ - TBool ExitOccured(); - - /** - * - */ - TBool AudioRoutingCanBeChanged(); - - /** - * - */ - TBool IsLoudSpeakerEnabled(); - - /** - * - */ - TBool DeviceHasDedicatedVolumeKeys(); - - /** - * Queries flag for session state - */ - TBool ConnectionEstablished() const; - - /** - * Set session initialization state - */ - void SetConnectionInitialized( TBool aConnectionInitialized ); - - /** - * Queries flag for session state - */ - TBool ConnectionInitialized() const; - - /** - * - */ - void EnableDisplayL( TBool aEnable ); - - /** - * - */ - void ChangeOrientationL( CAknAppUiBase::TAppUiOrientation aOrientation ); - - /** - * - */ - TBool ToolbarVolumeSelected(); - - /** - * - */ - TBool IsMicMutedL(); - - /** - * Function to be overridden in sibling classes - * @return EFalse by default - */ - virtual TBool ManualAddressTyped() const; - - /** - * - */ - virtual void HandleForegroundEventL( TBool aForeground ); - - /** - * - */ - virtual void OfferToolbarEventL( TInt aCommand ); - - /** - * - */ - virtual void HandleCommandL( TInt aCommand ); - - /** - * Returns a pointer to engine side session. - */ - virtual CMusEngMceSession* EngineSession() = 0; - - /** - * - */ - virtual const TDesC& TypedAddress() const = 0; - - /** - * - */ - virtual void DeleteEngineSession() = 0; - - -protected: // New functions - - /** - * General functionality of exit procedure - */ - virtual void ExitProcedureL( TBool aUserAcceptance ); - - /** - * Handles status changes common to all sharing types. - * To be overridden in sibling classes for sharing type specific - * status changes. - */ - virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus ); - - -protected: - - /** - * - */ - MMusUiEventObserver& iEventObserver; - - /** - * - */ - MMusUiSharingObserver& iSharingObserver; - - /** - * - */ - CMusUiCallbackService* iCallbackService; - - /** - * Flag of the connection state - */ - TBool iConnectionEstablished; - - /** - * Flag of the connection state - */ - TBool iConnectionInitialized; - - /** - * - */ - TFileName iVideoFilePath; - - /** - * - */ - TFileName iLocalizedVideoFilePath; - - /** - * - */ - TFileName iVideoFileNamePlain; - - /** - * - */ - TInt iSipProfileId; - - /** - * - */ - TInt iContactId; - - /** - * - */ - HBufC* iContactName; - - /** - * - */ - HBufC* iTelNumber; - - /** - * - */ - HBufC* iDialogPrompt; - - /** - * - */ - HBufC* iVideoCodec; - - /** - * - */ - TBool iForeground; - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; - - /** - * - */ - CMusUiResourceHandler* iResourceHandler; - - /** - * - */ - TMusUiShutdownState iShutdownState; - - -private: - - /** - * - */ - CMusUiMmcMonitor* iMmcMonitor; - - /** - * - */ - CMusUiActivityManager* iActivityManager; - - /** - * - */ - CMusUiPropertyWatch* iStatusPropertyWatch; - - /** - * - */ - TBuf<7> iTimeBuffer; - - /** - * Flag of the Volume item in the Toolbar - */ - TBool iToolbarVolumeSelected; - - /** - * Flag indicating whether call has ended - */ - TBool iActiveCall; - - MUS_UNITTEST( UT_CMusUiEventController ) - MUS_UNITTEST( UT_CMusUiLiveSharingController ) - MUS_UNITTEST( UT_CMusUiClipSharingController ) - MUS_UNITTEST( UT_CMusUiReceiveController ) - }; - -#endif // MUSUIEVENTCONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuieventobserver.h --- a/mmsharing/mmshui/inc/musuieventobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* 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 MUSUIEVENTOBSERVER_H -#define MUSUIEVENTOBSERVER_H - -#include "musuidefinitions.h" - -#include -#include -#include -#include - -class MMusUiEventObserver - { - -public: - - virtual void ActivateLocalMusViewL( TUid aViewId ) = 0; - - virtual void ActivateLocalMusViewL( TUid aViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) = 0; - - virtual void ShowAsyncConfirmationQueryDialogL( const TDesC& aPrompt ) = 0; - - virtual void SetToolbarVisibility( TBool aVisible ) = 0; - - /** - * - */ - virtual void ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon ) = 0; - - virtual CEikonEnv* EikonEnv() const = 0; - - virtual void TerminateCall() = 0; - - /** - * Return current app orientation. - */ - virtual CAknAppUiBase::TAppUiOrientation AppOrientation() const = 0; - - virtual void SwitchOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ) = 0; - - virtual void HandleError( const TInt aReason ) = 0; - - virtual void HandleExit() = 0; - - virtual TBool OrientationCanBeChanged() const = 0; - - virtual TInt GetUiVolumeValue() = 0; - }; - -#endif // MUSUIEVENTOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuifileutil.h --- a/mmsharing/mmshui/inc/musuifileutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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 MUSFILEUTIL_H -#define MUSFILEUTIL_H - -#include - -class MusUiFileUtil - { - - public: - - /** - * return Existence of specified file - */ - static TBool FileExists( const TDesC& aFullFileName ); - - /** - */ - static void VideoFilePathExistsL( const TDesC& aVideoFilePath ); - - /** - */ - static void CreateVideoFileNameL( const TDesC& aVideoFilePath, - TFileName& aFileName ); - - /** - */ - static void DeleteFileL( const TDesC& aFileName ); - - }; - - - -#endif // MUSFILEUTIL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuigeneralview.h --- a/mmsharing/mmshui/inc/musuigeneralview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -/* -* 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 MUSUIGENERALVIEW_H -#define MUSUIGENERALVIEW_H - -#include "musuisharingobserver.h" -#include "musuiactivetimerobserver.h" - -#include // Avkon resource file -#include // Avkon base view class -#include - -class CMusUiAppUi; -class CMusUiEventController; -class CMusUiActivityManager; -class CMusUiViewContainer; -class CAknIncallBubble; -class CMusUiActiveTimer; -class CMusUiBackgroundViewContainer; - -/** - * The base class for the MUS application's view classes. - * Encapsulates common methods for views. - * - * @lib musui.exe - */ -class CMusUiGeneralView : public CAknView, - public MAknToolbarObserver, - public MMusUiSharingObserver, - public MMusUiActiveTimerObserver - { - -public: // constructors and destructor - - enum TMusFgBgEventType - { - EMusFgBgEventNone, - EMusFgEvent, - EMusBgEvent - }; - - /** - * EPOC default constructor. - */ - void ConstructL(); - - /** - * Destructor. - */ - virtual ~CMusUiGeneralView(); - -public: // new functions - - /** - * @return the pointer to the application's AppUi (CMusUiAppUi). - */ - CMusUiAppUi* MusAppUi() const; - - /** - * Refreshes the view. Called after the mode has been changed from portrait - * to landscape or vice versa. This is a virtual function that must be - * implemented by all concrete MUS UI views. - */ - virtual void RefreshView() = 0; - - virtual void HandleToolbarCommandL( TInt aCommand ) = 0; - - virtual void HandleKeyUpEvent( TInt aKeyCode ); - - virtual void SetToolbarVisibility( TBool aVisible ); - - void AsyncQueryDialogAcceptedL( TBool aAccepted ); - - TInt FocusedToolbarItem() const; - - virtual void LevelIndicatorDismissed() {}; - virtual void SetInitialFocusedItemL() = 0; - - TBool OperatorSpecificFunctionality() const; - /** - * Called when UI comes to foregound / goes to background. - * CAknView version of HandleForegroundEventL is not used - * at it generates lots of events. Instead, appui implements - * foreground event callback funtion and forwards events to views - * via this method. - */ - virtual void DoHandleForegroundEventL( TBool aForeground ) = 0; - - -public: // from base class MAknToolbarObserver - - virtual void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); - - virtual void OfferToolbarEventL( TInt aCommand ); - - -public: // from MMusUiSharingObserver - - /* - * Shows sychronous wait dialog with softkey R_AVKON_SOFTKEYS_CANCEL. - * @param aPrompt Prompt text shown in dialog - * @param aTimerInSeconds Timer in seconds when dialog is dismissed - * automatically. Timer value 0 means that no timer is used. - * @param aExpirationMessageResourceId is ID of resource indicating - * the message to be shown if timer expires. Value 0 means that - * no message is shown. - * @return EFalse if dialog is dismissed by user pressing cancel - * or by expiration of timer. ETrue if DismissWaitDialogL - * is called with parameter ETrue; - */ - virtual TBool ShowWaitDialogL( const TDesC& aPrompt, - TInt aTimerInSeconds = 0, - TInt aExpirationMessageResourceId = 0 ); - - /* - * Dismisses sychronous wait dialog shown by calling ShowWaitDialogL. - * @param aReturnValue determines return value of function - * ShowWaitDialogL. - */ - virtual void DismissWaitDialogL( TBool aReturnValue = ETrue ); - - /* - * Set call back service of wait dialog - * @param aCallback A pointer of class MProgressDialogCallback - * which implemented DialogDismissedL - */ - virtual void SetWaitDialogCallbackL( MProgressDialogCallback* aCallback ); - - virtual void ShowStatusPaneTitleL(); - - virtual void EnableMiddleSoftkeyL( TInt aResourceId ); - - virtual void ActivateVolumeControlL( TInt aValue ); - - virtual void HighlightSelectedToolbarItem( TInt aCommand ); - - /** - * General functionality for replacing a toolbar command - * Function should be overridden for specific functionality - */ - virtual void ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ); - - /** - * If toolbar is shown, audio routing button will be refreshed according to - * current state of audio routing. - * In case there is no toolbar, middle softkey will be updated - */ - virtual void RefreshAudioRoutingToolbarButton(); - - virtual void UpdateSessionTime( const TDesC& aSessionTime ); - - -public: // from base class CAknView - - /** - * Takes care of command handling. - * - * @param aCommand The command that was received. - */ - virtual void HandleCommandL( TInt aCommand ); - - /** - * From MEikMenuObserver, called by framework before constructing menupane. - * Initializes menu items common to all sharing types. - */ - virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - -public: // from MMusUiActiveTimerObserver - - /** - * Indicates that a certain amount of time elapsed - */ - virtual void TimerComplete( CMusUiActiveTimer* aTimer ); - - -protected: // New functions - - virtual CMusUiEventController* EventController() const = 0; - - virtual CMusUiViewContainer& SharingContainer() const = 0; - - /** - * Leaves with KErrNotFound if eventcontroller is not available - */ - CMusUiEventController& EventControllerL() const; - - /** - * Called when event occurs of type EEventFocusLost or - * EEventFocusGained. - * - * @param aForeground ETrue if the application is in the foreground, - * otherwise EFalse. - * @param aExit indicates if the application should exit - */ - void HandleForegroundEventL( TBool aForeground, TBool aExit ); - - -protected: - - /** - * Gets called by the framework when it's activating this view. - * - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * Gets called by the framework when it's deactivating this view. - */ - void DoDeactivate(); - -protected: - - - void CompleteForegroundEventL(); - void DoForegroundEventL(); - void DoBackgroundEventL( TBool aExit ); - void SetCurrentFgBgEvent( TMusFgBgEventType aEventType ); - TInt ToolbarPlaceHolderHeight() const; - void UpdateBackgroundOrdinalPosition( TBool aUp ); - -protected: // data - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; - - TBool iToolbarItemSelected; - -private: // data - - CAknIncallBubble* iIncallBubble; - - CMusUiActiveTimer* iSessionEndTimer; - - CMusUiActiveTimer* iFgBgTimer; - - TMusFgBgEventType iCurrentFgBgEvent; - - TBool iCurrentExitSetting; - - CMusUiBackgroundViewContainer* iBackgroundContainer; // skin background drawer - - }; - -// macro for NO_TOOLBAR case -#define MUS_NO_TOOLBAR ( iOperatorSpecificFunctionality && !(AknLayoutUtils::PenEnabled())) - -#endif // MUSUIGENERALVIEW_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiinvitationquery.h --- a/mmsharing/mmshui/inc/musuiinvitationquery.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIINVITATIONQUERY_H -#define MUSUIINVITATIONQUERY_H - -#include "musuiactivetimerobserver.h" - -#include - -class CAknGlobalConfirmationQuery; -class CMusUiActiveTimer; -class MMusUiInvitationQueryObserver; - -/** - * - * - * - * @lib musui.exe - */ -class CMusUiInvitationQuery : public CActive, - public MMusUiActiveTimerObserver - { - -public: // constructor - - static CMusUiInvitationQuery* NewL( MMusUiInvitationQueryObserver& aView ); - - ~CMusUiInvitationQuery(); - -private: - - CMusUiInvitationQuery( MMusUiInvitationQueryObserver& aView ); - - void ConstructL(); - - -public: // new functions - - void ShowL( const TDesC& aContact ); - - -public: // from: MMusUiActiveTimerObserver - - void TimerComplete( CMusUiActiveTimer* aTimer ); - - -protected: // from CActive - - void RunL(); - - void DoCancel(); - - TInt RunError( TInt aError ); - - -private: // data - - /** A global confirmation query. Own. */ - CAknGlobalConfirmationQuery* iGlobalQuery; - - /** A descriptor buffer for prompting. Own. */ - HBufC* iPrompt; - - CMusUiActiveTimer* iActiveTimer; - - /** Observer. */ - MMusUiInvitationQueryObserver& iObserver; - }; - - -#endif // MUSUIINVITATIONQUERY_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiinvitationqueryobserver.h --- a/mmsharing/mmshui/inc/musuiinvitationqueryobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIINVITATIONQUERYOBSERVER_H -#define MUSUIINVITATIONQUERYOBSERVER_H - - -class MMusUiInvitationQueryObserver - { -public: - - /** - * - */ - virtual void InvitationAcceptedL() = 0; - - /** - * - */ - virtual void InvitationRejectedL() = 0; - }; - - -#endif // MUSUIINVITATIONQUERYOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilevelindicator.h --- a/mmsharing/mmshui/inc/musuilevelindicator.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* 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: Class for displaying icons in viewfinder view -* -*/ - - -#ifndef MUSUILEVELINDICATOR_H -#define MUSUILEVELINDICATOR_H - -#include "musuidefinitions.h" -#include "musuiactivetimerobserver.h" - -// SYSTEM -#include -#include -#include - -class MAknsSkinInstance; -class CGulIcon; -class MMusUiLevelIndicatorObserver; -class CAknSlider; - -/** -* Class for displaying icons in viewfinder view -*/ -class CMusUiLevelIndicator : public CCoeControl, - public MCoeControlObserver, - public MMusUiActiveTimerObserver - { - - - public: // Constructors and destructor - - /** - * Symbian OS two-phased constructor. - * @param aController reference to CCcorController - */ - static CMusUiLevelIndicator* NewL( - TAknOrientation aLayout, - TInt aMinLevel, - TInt aMaxLevel, - CCoeControl* aParent, - const TRect& aRect, - MMusUiLevelIndicatorObserver* aObserver ); - - /** - * Symbian OS two-phased constructor. - * @param aController reference to CCcorController - */ - static CMusUiLevelIndicator* NewLC( - TAknOrientation aLayout, - TInt aMinLevel, - TInt aMaxLevel, - CCoeControl* aParent, - const TRect& aRect, - MMusUiLevelIndicatorObserver* aObserver ); - - /** - * Destructor. - */ - ~CMusUiLevelIndicator(); - - - public: // New functions - - /** - * - */ - void SetLevelL( TMusUiIndicatorType aType, - TInt aLevel, - TBool aUseTimer ); - - /** - * - */ - TInt GetLevel(TMusUiIndicatorType aType); - - /** - * - */ - void SetRange( TInt aMinLevel, TInt aMaxLevel, TBool aUseTimer); - - /** - * - */ - void SetIndicatorType( TMusUiIndicatorType aType ); - - - private: // From CCoeControl - - /** - * Handles the size change events. - * - */ - virtual void SizeChanged(); - - virtual void Draw(const TRect& aRect) const; - - virtual TInt CountComponentControls() const; - - virtual CCoeControl* ComponentControl( TInt aIndex ) const; - - virtual void HandleResourceChange( TInt aType ); - - - private: // From CCoeControlObserver - - virtual void HandleControlEventL( CCoeControl* aControl, - TCoeEvent aEventType ); - - - private: // From MMusUiActiveTimerObserver - - virtual void TimerComplete( CMusUiActiveTimer* aTimer ); - - - private: // Constructors and destructor - - /** - * C++ constructor - */ - CMusUiLevelIndicator( TInt aMinLevel, - TInt aMaxLevel, - MMusUiLevelIndicatorObserver* aObserver ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL( TAknOrientation aLayout, - CCoeControl* aParent, - const TRect& aRect ); - - - private: // HELPERS - - void ConstructImageL( CEikImage* aImage, - MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId, - TParse aParse ); - - /** - * Callback for disable level indicator. - * @since 2.8 - * @return KErrNone - */ - //static TInt DisableLevelIndicator( TAny* aThis ); - //void DisableTimer(); - //void EnableTimer(); - - - private: //data - - - TRect iParentRect; - - TRect iViewfinderRect; - - TInt iMinLevel; - - TInt iMaxLevel; - - TInt iZoomLevel; - - TInt iBrightnessLevel; - - TInt iDurationLevel; - - CMusUiActiveTimer* iDisableLevelTimer; - - TInt iIndicatorType; - - CAknSlider* iSlider; - - CMusUiActiveTimer* iSliderEventTimer; - - /** - * NOT OWN!!! - */ - MMusUiLevelIndicatorObserver* iObserver; - - }; - - -#endif - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilevelindicatorobserver.h --- a/mmsharing/mmshui/inc/musuilevelindicatorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 level indicator Event Observer Interface -* -*/ - - - -#ifndef MUSUILEVELINDICATOROBSERVER_H -#define MUSUILEVELINDICATOROBSERVER_H - - -class MMusUiLevelIndicatorObserver - { - public: - - virtual void SetLevelIndicatorVisibility(TBool aVisible) = 0; - - virtual void IndicatorLevelChanged( TInt aNewLevel ) = 0; - - }; - -#endif // MUSUILEVELINDICATOROBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilivesharingcontroller.h --- a/mmsharing/mmshui/inc/musuilivesharingcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* 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 MUSUILIVESHARINGCONTROLLER_H -#define MUSUILIVESHARINGCONTROLLER_H - -#include "musuisendcontroller.h" -#include "musenglivesessionobserver.h" -#include "musunittesting.h" - -#include -#include - -class MMusUiLiveSharingObserver; -class CMusEngLiveSession; - -/** - * - * - * @lib musui.exe - */ -class CMusUiLiveSharingController : public CMusUiSendController, - public MMusEngLiveSessionObserver - { - - MUS_UNITTEST( UT_CMusUiLiveSharingController; ) - MUS_UNITTEST( UT_CMusUiEventController; ) - -public: - - static CMusUiLiveSharingController* NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiLiveSharingObserver& aLiveObserver, - const TRect& aRect ); - - virtual ~CMusUiLiveSharingController(); - - -private: - - CMusUiLiveSharingController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiLiveSharingObserver& aLiveObserver ); - - void ConstructL( const TRect& aRect ); - - -public: // From CMusUiEventController: - - virtual void PlayL(); - - virtual void PauseL(); - - virtual void OfferToolbarEventL( TInt aCommand ); - - virtual void HandleCommandL( TInt aCommand ); - - virtual void DeleteEngineSession(); - - -public: // from CMusUiSendController - - virtual CMusEngMceOutSession* EngineOutSession(); - - virtual void InviteL( const TDesC& aRecipient ); - - virtual void HandleSliderValueChangeL( TInt aNewLevel ); - - -public: // new functions - - TMusUiNaviMediaDecorator RecordIcon(); - - TBool IsBrightnessSupported(); - - TBool IsDiskFull(); - - /** - * Determines whether zoom adjustment is selected either from toolbar - * or menu - */ - TBool ZoomSelected(); - - /** - * Determines whether brightness adjustment is selected either from toolbar - * or menu - */ - TBool BrightnessSelected(); - - void LevelIndicatorDismissed(); - TBool ToolbarZoomSelected(); - - TBool ToolbarBrightnessSelected(); - - void ResetToolbarSelected(); - - -private: // new functions: - - void ZoomInL(); - - void ZoomOutL(); - - void IncreaseBrightnessL(); - - void DecreaseBrightnessL(); - - void ZoomL(); - - void BrightnessL(); - - void HandleMiddleSoftkeyOkL(); -public: // From MMusEngLiveSessionObserver - - void DiskFull(); - - -public: // from MMusEngSessionObserver - - void SessionEstablished(); - - void SessionTerminated(); - - void SessionConnectionLost(); - - void SessionFailed(); - - void StreamIdle(); - - void StreamStreaming(); - - void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds ); - - void InactivityTimeout(); - - -private: - - MMusUiLiveSharingObserver& iLiveObserver; - - CMusEngLiveSession* iSession; - - TBool iToolbarZoomSelected; - - TBool iToolbarBrightnessSelected; - - TBool iZoomSelected; - - TBool iBrightnessSelected; - - TBool iDiskFull; - - }; - -#endif // MUSUILIVESHARINGCONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilivesharingobserver.h --- a/mmsharing/mmshui/inc/musuilivesharingobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 MUSUILIVESHARINGOBSERVER_H -#define MUSUILIVESHARINGOBSERVER_H - -#include "musuidefinitions.h" - -#include -#include - -class MMusUiLiveSharingObserver - { - -public: - - virtual void SetZoomValues( TInt aMinZoom, TInt aMaxZoom ) = 0; - - virtual void SetBrightnessValues( TInt aMinBrightness, TInt aMaxBrightness ) = 0; - - virtual void SetZoomL( TInt aZoomLevel ) = 0; - - virtual void SetBrightnessL( TInt aBrightnessLevel ) = 0; - - virtual void SetZoomVisible( TBool aVisible ) = 0; - - virtual void SetBrightnessVisible( TBool aVisible ) = 0; - - - }; - -#endif // MUSUILIVESHARINGOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilivesharingview.h --- a/mmsharing/mmshui/inc/musuilivesharingview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUILIVESHARINGVIEW_H -#define MUSUILIVESHARINGVIEW_H - - -#include "musuisendview.h" // Base view class -#include "musuilivesharingobserver.h" - -#include - -class CMusUiLiveSharingViewContainer; -class CMusUiLiveSharingController; -class CMusUiActivityManager; -class CMusUiBackgroundViewContainer; -class CAknToolbar; - - -/** - * The MUS application's live sharing view. - * - * @lib musui.exe - */ -class CMusUiLiveSharingView : public CMusUiSendView, - public MMusUiLiveSharingObserver - { - -public: // constructors and destructor - - /** - * EPOC 2nd phase constructor. - */ - void ConstructL(); - - /** - * Destructor. - */ - virtual ~CMusUiLiveSharingView(); - - -public: // from base class CAknView - - /** - * From CAknView returns Uid of View - * @return TUid uid of the view - */ - TUid Id() const; - - // From MEikMenuObserver, Called by framework before constructing menupane - void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - -public: // from CMusUiGeneralView - - void HandleToolbarCommandL( TInt aCommand ); - - virtual void SetInitialFocusedItemL(); - - void RefreshAudioRoutingButton(); -public: // from base class MAknToolbarObserver - - void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); - - -public: // from MMusUiLiveSharingObserver - - void SetZoomValues( TInt aMinZoom, TInt aMaxZoom ); - - void SetBrightnessValues( TInt aMinBrightness, TInt aMaxBrightness ); - - void SetZoomL( TInt aZoomLevel ); - - void SetBrightnessL( TInt aBrightnessLevel ); - - void SetZoomVisible( TBool aVisible ); - - void SetBrightnessVisible( TBool aVisible ); - - void ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ); - - -public: // new functions - - void RefreshView(); - - void LevelIndicatorDismissed(); - - void HandleKeyUpArrowL(); - - void HandleKeyDownArrowL(); - - /* In order to receive right oriented frames from camera when - * orientation changed, it has to be recreated.Only way to do - * from UI is to pause and play. - * - * aNewRect : New rectangle co-ordinates. - * This will be compared to old rectangle co-ordinates - * to find out whether orientation changed. - */ - void RefreshCameraOrientationL(TRect& aNewRect); - - /* ----------------------------------------------------------------------------- - * When Live sharing paused , camera source will be unavilable, hence - * it is inappropriate to show the zoom and brightness - * so hide those item. And unhide it again when unpaused. - * - * @aIsPaused : ETrue if paused else EFalse - */ - void HideToolbarCommandForPause( TBool aIsPaused ); - - void ResetToolBarSelected(); - -protected: // from CMusUiSendView - - virtual CMusUiSendController* SendController() const; - - virtual CMusUiSendViewContainer* SendContainer() const; - - -private: - - /** - * Gets called by the framework when it's activating this view. - * - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * Gets called by the framework when it's deactivating this view. - */ - void DoDeactivate(); - - -private: // data - - /** Container for all controls in this view. Owns. */ - CMusUiLiveSharingViewContainer* iContainer; - - CMusUiLiveSharingController* iController; - - TBool iPauseSelected; - - }; - - -#endif // MUSUILIVESHARINGVIEW_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuilivesharingviewcontainer.h --- a/mmsharing/mmshui/inc/musuilivesharingviewcontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUILIVESHARINGVIEWCONTAINER_H -#define MUSUILIVESHARINGVIEWCONTAINER_H - -#include "musuisendviewcontainer.h" -#include "musuilevelindicatorobserver.h" - - -/** - * - * - * - * @lib musui.exe - */ -class CMusUiLiveSharingViewContainer : public CMusUiSendViewContainer - { - -public: // constructors and destructor - - /** - * Symbian second-phase constructor. - * - * @param aView Parent view of container. - * @param aRect Frame rectangle for container. - * @param aInputParams Packaged data. - */ - void ConstructL( CMusUiGeneralView* aView, - const TRect& aRect ); - - /** - * Destructor. - */ - ~CMusUiLiveSharingViewContainer(); - - -public: // new functions - - void SetZoomValues( TInt aMinZoom, TInt aMaxZoom ); - - void SetBrightnessValues( TInt aMinBrightness, TInt aMaxBrightness ); - - void SetZoomL( TInt aZoomLevel ); - - void SetBrightnessL( TInt aBrightnessLevel ); - - void SetZoomVisible( TBool aVisible ); - - void SetBrightnessVisible( TBool aVisible ); - - -private: // from base class CCoeControl - - /** - * Returns the number of control contained by this class. - * - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * Returns handle to control pointed by aIndex. - * - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * Handles key events. - * - * @param aEvent The event that occured. - * @param aType Type of key event: EEventKey, EEventKeyUp, or - * EEventKeyDown. - * @return The container's response to event: either - * EKeyWasNotConsumed or EKeyWasConsumed. - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - - /** - * Handles pointer events. - * - * @param aEvent The event that occured. - */ - virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - -protected: // data - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; - -private: // data - - }; - - -#endif // MUSUILIVESHARINGVIEWCONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuimmcmonitor.h --- a/mmsharing/mmshui/inc/musuimmcmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 MUSUIMMCMONITOR_H -#define MUSUIMMCMONITOR_H - -// INCLUDES -#include "musuimmcobserver.h" - -#include -#include - - -// CLASS DECLARATION - -/** -* Listen changes on the filesystem and notifies observers if -* MMC card has been removed. -* Notifies clients only once about MMC removal and only -* in that case that user wanted to listen MMC drive -*/ -class CMusUiMmcMonitor : public CActive - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver MMC observer pointer. - */ - static CMusUiMmcMonitor* NewL( MMusUiMmcObserver& aObserver ); - - /** - * Destructor. - */ - ~CMusUiMmcMonitor(); - - private: // from CActive - - void RunL(); - void DoCancel(); - - private: // New functions. - - void ConstructL(); - CMusUiMmcMonitor( MMusUiMmcObserver& aObserver ); - - void MonitorMmc(); - TBool DriveRemoved(); - TBool IsRemovableDrive( TDriveNumber aDriveNumber ); - - private: // Data - - RFs iFs; - TDriveNumber iDriveNumber; - TBool iRemovableDrive; - TBool iDriveRemoved; - MMusUiMmcObserver& iObserver; - }; - -#endif // MUSUIMMCMONITOR_H - -// End of File - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuimmcobserver.h --- a/mmsharing/mmshui/inc/musuimmcobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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 MUSUIMMCOBSERVER_H -#define MUSUIMMCOBSERVER_H - - -/** -* Interface for listening MMC removal indication. -*/ -class MMusUiMmcObserver - { - public: - - /** - * Called when MMC was removed. - */ - virtual void MmcRemoved() = 0; - }; - -#endif // MUSUIMMCOBSERVER_H - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuinavimediaanimator.h --- a/mmsharing/mmshui/inc/musuinavimediaanimator.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* 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 MUSUINAVIMEDIAANIMATOR_H -#define MUSUINAVIMEDIAANIMATOR_H - -#include "musuidefinitions.h" -#include "musuinavimediaanimatorobserver.h" - -#include -#include - -class CAknIconArray; -class MAknsSkinInstance; -class CPeriodic; - -/** - * CMusUiNaviMediaDecorator - * - * @lib musui.exe - */ -class CMusUiNaviMediaAnimator : public CBase - { - - public: // constructors and destructor - - /** - * Two-phased constructor. - * - */ - static CMusUiNaviMediaAnimator* NewL( - MMusUiNaviMediaAnimatorObserver& aObserver, TSize aImageSize ); - - /** - * - * - */ - virtual ~CMusUiNaviMediaAnimator(); - - - private: // constructors - - /** - * C++ default constructor. - * - */ - CMusUiNaviMediaAnimator( - MMusUiNaviMediaAnimatorObserver& aObserver, TSize aImageSize ); - - /** - * By default Symbian second-phase constructor is private. - * - */ - void ConstructL(); - - - public: // API - - /** - * Sets animation timer interval eq. speed of animation - * - * @param aAnimationInterval Milliseconds between image transitions - */ - void SetInterval( const TInt aAnimationInterval ); - - - private: // Perioidic timer CallBack - - static TInt AnimationInterval( TAny* aThis ); - - - private: // HELPERS - - /** - * Layouts all images. And also set size. - * - */ - void LoadImagesL(); - - - /** - * Construct image from resourse file - * - */ - void ConstructImageL( MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId, - TParse parse ); - - - - private: // DATA - - /** - * - */ - CAknIconArray* iBitmapArray; - - /** - * - */ - //CAknIconArray* iMaskArray; - - /** - * resource file location ( eq. Z or C ) - */ - TBool iResourceRam; - - /** - * Animation image index - */ - TInt iIndex; - - /** - * - */ - MMusUiNaviMediaAnimatorObserver& iObserver; - - /** - * - */ - TInt iInterval; - - /** - * Image size - */ - TSize iSize; - - /** - * - */ - CPeriodic* iAnimationTimer; // owned - - - }; - -#endif // MUSUINAVIMEDIADECORATOR_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuinavimediaanimatorobserver.h --- a/mmsharing/mmshui/inc/musuinavimediaanimatorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 MUSUINAVIMEDIAANIMATOROBSERVER_H -#define MUSUINAVIMEDIAANIMATOROBSERVER_H - -#include -#include -#include - -class MMusUiNaviMediaAnimatorObserver - { - - public: - - /** - * Sets new image for drawing. Ownership is not transferred. - * - */ - virtual void SetIcon( CGulIcon* aIcon ) = 0; - - }; - -#endif // MUSUIEVENTOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuinavimediadecorator.h --- a/mmsharing/mmshui/inc/musuinavimediadecorator.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,215 +0,0 @@ -/* -* 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 MUSUINAVIMEDIADECORATOR_H -#define MUSUINAVIMEDIADECORATOR_H - -#include "musuidefinitions.h" -#include "musuinavimediaanimatorobserver.h" - -#include -#include - -class CAknIconArray; -class CMusUiNaviMediaAnimator; -class MAknsSkinInstance; - -/** - * CMusUiNaviMediaDecorator - * - * @lib musui.exe - */ -class CMusUiNaviMediaDecorator : public CCoeControl, - public MMusUiNaviMediaAnimatorObserver - { - - public: // constructors and destructor - - /** - * Two-phased constructor. - * - */ - static CMusUiNaviMediaDecorator* NewL(); - - /** - * - * - */ - virtual ~CMusUiNaviMediaDecorator(); - - - private: // constructors - - /** - * C++ default constructor. - * - */ - CMusUiNaviMediaDecorator(); - - /** - * By default Symbian second-phase constructor is private. - * - */ - void ConstructL(); - - - public: // API - - /** - * Updates left label (usually time string) in navi pane. - * - * @param aLabel New label - */ - void SetLeftLabelL( const TDesC& aLabel ); - - /** - * Updates right label (usually time string) in navi pane. - * - * @param aLabel New label - */ - void SetRightLabelL( const TDesC& aLabel ); - - /** - * Selects icon show - * - */ - void ShowIcon( TMusUiNaviMediaDecorator aIcon ); - - - protected: // from MMusUiNaviMediaAnimatorObserver - - void SetIcon( CGulIcon* aIcon ); - - - protected: // from CCoeControl - - /** - * Handles the size change events. - * - */ - void SizeChanged(); - - /** - * Draws the control. - * - * @param aRect The region of the control to be redrawn. - */ - void Draw( const TRect& aRect ) const; - - - private: // HELPERS - - /** - * Layouts the text depending on current situation. - * - */ - void DoLayoutText(); - - - void LoadImagesL(); - - void ConstructImageL( MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId, - TParse parse ); - - - private: // DATA - - /** - * - * - */ - HBufC* iLeftLabel; - - /** - * - * - */ - HBufC* iRightLabel; - - - CAknLayoutFont *iFont; - - /** - * - * - */ - TAknLayoutText iLeftTextLayout; - - /** - * - * - */ - TAknLayoutText iRightTextLayout; - - /** - * - * - */ - TAknLayoutRect iIconLayout; - - /** - * - * - */ - CAknIconArray* iIconArray; - - /** - * - * - */ - TInt iMiddle; - - TInt iIconLeft; - - /** - * - * - */ - TSize iLeftTextSize; - - /** - * - * - */ - TSize iRightTextSize; - - /** - * - * - */ - CGulIcon* iIcon; - - /** - * resource file location ( eq. Z or C ) - */ - TBool iResourceRam; - - - CMusUiNaviMediaAnimator* iAnimation; - - TSize iImageSize; - - }; - -#endif // MUSUINAVIMEDIADECORATOR_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuipropertyobserver.h --- a/mmsharing/mmshui/inc/musuipropertyobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 MUSUIPROPERTYOBSERVER_H -#define MUSUIPROPERTYOBSERVER_H - -#include - -class MMusUiPropertyObserver - { - -public: - - //virtual void ResourcePropertyChanged( const TUint aKey, const TInt aValue ) = 0; - - //virtual void SessionPropertyChanged( const TUint aKey, const TInt aValue ) = 0; - - virtual void PropertyChanged( const TUint aKey, const TInt aValue ) = 0; - - virtual void HandlePropertyError( const TInt aReason ) = 0; - - }; - -#endif // MUSUIPROPERTYOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuipropertywatch.h --- a/mmsharing/mmshui/inc/musuipropertywatch.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* 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 MUSUIPROPERTYWATCH_H -#define MUSUIPROPERTYWATCH_H - -#include "musunittesting.h" - -#include -#include - -class MMusUiPropertyObserver; - -class CMusUiPropertyWatch : public CActive - { - - MUS_UNITTEST( UT_CMusUiPropertyWatch; ) - -public: // constructors and destructor - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed CMusUiPropertyWatch object. - */ - static CMusUiPropertyWatch* NewL( MMusUiPropertyObserver& aObserver, - TUid aCategory, - const TInt aPropertyName ); - - /** - * Destructor. - */ - ~CMusUiPropertyWatch(); - -private: - - /** - * C++ constructor. - */ - CMusUiPropertyWatch( MMusUiPropertyObserver& 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; - - MMusUiPropertyObserver& iObserver; - - }; - -#endif // MUSUIPROPERTYWATCH_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiqueryobserver.h --- a/mmsharing/mmshui/inc/musuiqueryobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIQUERYOBSERVER_H -#define MUSUIQUERYOBSERVER_H - - -class MMusUiQueryObserver - { -public: - - /** - * - */ - virtual void QueryAcceptedL( TBool aAccepted ) = 0; - - /** - * Error handler for QueryAcceptedL. - * - * @param aError is error to be handled. - * @return KErrNone means handled value. All other values will lead to - * a panic. - */ - virtual TInt HandleQueryError( TInt aError ) = 0; - - }; - - -#endif // MUSUIQUERYOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuireceivecontainer.h --- a/mmsharing/mmshui/inc/musuireceivecontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIRECEIVECONTAINER_H -#define MUSUIRECEIVECONTAINER_H - -#include "musuiviewcontainer.h" - -class MAknsControlContext; -class CMusUiGeneralView; -class CMusUiInvitationQuery; -class MMusUiInvitationQueryObserver; -class CMusUiReceiveView; - -/** - * - * - */ -class CMusUiReceiveContainer : public CMusUiViewContainer - { - -public: // constructors and destructor - - /** - * Public constructor. - */ - static CMusUiReceiveContainer* NewL( CMusUiReceiveView& aView, - TRect aRect ); - - /** - * Destructor. - */ - ~CMusUiReceiveContainer(); - - -private: // hidden constructors - - /** - * C++ Constructor - */ - CMusUiReceiveContainer( CMusUiReceiveView& aView ); - - /** - * Symbian second-phase constructor. - * - * @param aView Parent view of container. - * @param aRect Frame rectangle for container. - * @param aInputParams Packaged data. - */ - void ConstructL( const TRect& aRect ); - -protected: // data - - /** - * ETrue if operator specific functionality is needed - */ - TBool iOperatorSpecificFunctionality; - -public: // new functions - - /** - * Shows an invitation query. - */ - void ShowInvitationQueryL( const TDesC& aContact, - MMusUiInvitationQueryObserver& aObserver ); - - /** - * - */ - void DismissInvitationQuery( TBool aDelete ); - - /** - * Return pointer to view class. User needs to type cast to - * appropriate concrete view class. - * - * @return handle to view - */ - CMusUiGeneralView* MusUiView() const; - - - void SetFullScreen( TBool aFullScreen, TRect aRect ); - - -private: // from base class CCoeControl - - /** - * - */ - virtual void SizeChanged(); - - /** - * Returns the number of control contained by this class. - * - * @return Number of controls contained - */ - virtual TInt CountComponentControls() const; - - /** - * Returns handle to control pointed by aIndex. - * - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - virtual CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * Gets called by the application framework when drawing is - * needed. - * - * @param aRect The rectangle that needs to be drawn. - */ - virtual void Draw( const TRect& aRect ) const; - - /** - * Handles key events. - * - * @param aEvent The event that occured. - * @param aType Type of key event: EEventKey, EEventKeyUp, or - * EEventKeyDown. - * @return The container's response to event: either - * EKeyWasNotConsumed or EKeyWasConsumed. - */ - virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, - TEventCode aType ); - - /** - * Handles pointer events. Will return from full screen mode as a response - * to whatever pointer event. - * - * @param aEvent The event that occured. - */ - virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - - -private: // data - - /** A dialog for invitation query (accept/reject). Own.*/ - CMusUiInvitationQuery* iInvitationQuery; - - /** Background skin control context. */ - MAknsControlContext* iBackGround; - - /** Handle to the view that owns of this container. Not own. */ - CMusUiGeneralView& iView; - - TBool iFullScreen; - - }; - - -#endif // MUSUIRECEIVECONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuireceivecontroller.h --- a/mmsharing/mmshui/inc/musuireceivecontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,322 +0,0 @@ -/* -* 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 MUSUIRECEIVECONTROLLER_H -#define MUSUIRECEIVECONTROLLER_H - -#include "musuieventcontroller.h" -#include "musengreceivesessionobserver.h" -#include "musengmcesession.h" -#include "musuiinvitationqueryobserver.h" -#include "musunittesting.h" -#include "musuiactivetimerobserver.h" - -#include - -class MMusUiReceiveObserver; -class CMusEngReceiveSession; -class MMusUiReceiveObserver; -class CMusUiActiveTimer; - -/** - * - * - * @lib musui.exe - */ -class CMusUiReceiveController : public CMusUiEventController, - public MMusEngReceiveSessionObserver, - public MMusUiInvitationQueryObserver, - public MMusUiActiveTimerObserver - { - -public: - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed CMusUiReceiveController object. - */ - static CMusUiReceiveController* NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiReceiveObserver& aReceiveObserver, - const TRect& aRect ); - - /** - * Destructor. - */ - virtual ~CMusUiReceiveController(); - -private: - - /** - * C++ constructor. - */ - CMusUiReceiveController( MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiReceiveObserver& aReceiveObserver ); - - /** - * Symbian 2nd-phase constructor. - * @leave One of the system wide error codes - * @param aRect Original view's rectangle, which is centered and passed - * for the Engine. - */ - void ConstructL( const TRect& aRect ); - - -public: // new functions: - - /** - * Gets called by MMusEngReceiveSessionObserver's Incoming Session. - * Function cancels the timer and displays the invitation query dialog. - * MO Address is saved into memeber variable iOriginator. - * @leave One of the system wide error codes - * @param aOriginator The Address of MO. - * @param aOriginatorIdentity The identity of MO. - */ - void HandleIncomingSessionL( const TDesC& aOriginator, - const TDesC& iOriginatorIdentity ); - - TBool ClipMutedL(); - - TBool ClipContainsAudioL(); - - /** - * Determines whether video is being played in full screen mode. - */ - TBool FullScreenSelected(); - - -public: // from CMusUiEventController - - /** - * Returns a pointer to engine side session. - */ - virtual CMusEngMceSession* EngineSession(); - - /** - * Implementation of the pure virtual function in MMusUiCallbackObserver. - * Handled async. event in the MT is EMusUiAsyncInviteAccepted. - * @param aEventId Async. event - */ - virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); - - /** - * Implementation of the pure virtual function from CMusUiEventController - * @return iOriginator, the address of MO - */ - virtual const TDesC& TypedAddress() const; - - /** - * Updates softkeys specific to receiving. Delegates other requests to - * a base class. - */ - // virtual void UpdateSoftkeyL( TInt aToolbarItem ); - - /** - * Handles commands generated by UI's Toolbar in the Receive View. - * @pre iSession != NULL - * @leave One of the system wide error codes - * @param aCommand Identiefier of the event's command. - */ - virtual void OfferToolbarEventL( TInt aCommand ); - - virtual void HandleCommandL( TInt aCommand ); - - /** - * Implementation of the pure virtual function from CMusUiEventController - * Deletes the Engine instance. - */ - virtual void DeleteEngineSession(); - - -public: // from MMusEngReceiveSessionObserver - - /** - * Called by engine when timer can be cancelled. - */ - virtual void IncomingSessionPreNotification(); - - /** - * Called by the engine, when session is incoming. - * @param aOriginator The address of MO. - * @param aOriginatorIdentity The identity of MO. - */ - virtual void IncomingSession( const TDesC& aOriginator, - const TDesC& iOriginatorIdentity ); - - /** - * Called by the engine, when current receiving session is buffering - * received RTP. - */ - virtual void StreamBuffering(); - - -public: // from MMusEngSessionObserver - - /** - * Called by the engine, when incoming session is established. - * Dismisses the wait dialog and sets up the status pane - */ - void SessionEstablished(); - - /** - * Called by the engine, when session has been terminated. - * If connection is not established, dismisses the invitation query dialog, - * shows an error dialog and exits. - * Otherwise dismisses wait dialog and exits. - */ - void SessionTerminated(); - - /** - * Called by the engine, when current session has lost network connection. - * Displays an error dialog. - */ - void SessionConnectionLost(); - - /** - * Called by the engine, when an undefined exception has occurred. - * Dismisses the wait dialog. - */ - void SessionFailed(); - - /** - * Called by the engine, when we are not sending or receiving RTP. - * Updates the icon to be Pause icon. - */ - void StreamIdle(); - - /** - * Called by the engine, when current session state is changed to streaming - * Dismisses the wait dialog, and updates the icon to Play icon. - */ - void StreamStreaming(); - - /** - * Called by the engine, when time information of the session - * should be updated. - * Calls Observer's UpdateSessionTime() function. - * @param aSeconds Session time in secods to be formatted. - */ - void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds ); - - /** - * Called by the engine, when RTCP inactivity timeout has occurred. - * Exits the application. - */ - void InactivityTimeout(); - - -public: // from MMusUiInvitationQueryObserver - - /** - * Called if the user accepts the incoming invitation. - * Calls Engine's AcceptInvitationL() function with ETrue and starts - * to show the wait dialog async. - * @pre iSession != NULL - * @leave One of the system wide error codes - */ - void InvitationAcceptedL(); - - /* - * Called if the user rejects the incoming invitation. - * Calls Engine's AcceptInvitationL() with EFalse and exits the application. - * @pre iSession != NULL - * @leave One of the system wide error codes - */ - void InvitationRejectedL(); - -public: // from MMusUiActiveTimerObserver - - /* - * Called if the timer completes. - * Calls ShutdownL() function. - */ - void TimerComplete( CMusUiActiveTimer* aTimer ); - - -protected: // from CMusUiEventController - - /** - * Receive specific functionality of exit procedure - */ - virtual void ExitProcedureL( TBool aUserAcceptance ); - - -private: // new functions: - /** - * Changes video playing mode to the opposite. - * Value of iFullScreenSelected will be changed to opposite as well. - */ - void ChangeFullScreenModeL(); - - - /** - * Displays the wait dialog calling Observer's ShowWaitDialogL with a string - * loaded from resources. - * @leave One of the system wide error codes - */ - void ShowWaitDialogL(); - - /** - * - */ - void SessionEstablishedL(); - - -private: - - /** - * Observer interface for receiving specific callbacks - */ - MMusUiReceiveObserver& iReceiveObserver; - - /** - * The engine object for MT - */ - CMusEngReceiveSession* iSession; - - /** - * Address of the MO - */ - HBufC* iOriginator; - - /** - * Flag indicating that video is being played in Full Screen mode - */ - TBool iFullScreenSelected; - /** - * Active object timer instance - */ - CMusUiActiveTimer* iTimer; - - CMusEngMceSession::TDisplayOrientation iOriginalMceOrientation; - - /** - * Flag indicating that the stream is paused - */ - TBool iStreamPaused; - - - MUS_UNITTEST( UT_CMusUiReceiveController; ) - - }; - -#endif // MUSUIRECEIVECONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuireceiveobserver.h --- a/mmsharing/mmshui/inc/musuireceiveobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 MUSUIRECEIVEOBSERVER_H -#define MUSUIRECEIVEOBSERVER_H - -#include "musuidefinitions.h" - -#include - -class MMusUiReceiveObserver - { - -public: - - virtual void ShowInvitationQueryL( const TDesC& aQuery ) = 0; - - virtual void DismissInvitationQuery( TBool aDelete ) = 0; - - virtual void SetFullScreenL( TBool aFullScreen ) = 0; - - }; - -#endif // MUSUILIVESHARINGOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuireceiveview.h --- a/mmsharing/mmshui/inc/musuireceiveview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUIRECEIVEVIEW_H -#define MUSUIRECEIVEVIEW_H - - -#include "musuigeneralview.h" // Base view class -#include "musuinavimediadecorator.h" -#include "musuireceiveobserver.h" -#include "musuidefinitions.h" - -#include - - -class CMusUiReceiveContainer; -class CMusUiReceiveController; -class CMusUiActivityManager; -class CMusUiBackgroundViewContainer; - - -/** - * The MUS application's live sharing view. - * - */ -class CMusUiReceiveView : public CMusUiGeneralView, - public MMusUiReceiveObserver - { - -public: // constructors and destructor - - /** - * EPOC 2nd phase constructor. - */ - void ConstructL(); - - /** - * Destructor. - */ - virtual ~CMusUiReceiveView(); - - -public: // from base class CAknView - - /** - * From CAknView returns Uid of View - * @return TUid uid of the view - */ - virtual TUid Id() const; - - // From MEikMenuObserver, Called by framework before constructing menupane - virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - -public: // from CMusUiGeneralView - - virtual void HandleToolbarCommandL( TInt aCommand ); - - virtual void SetInitialFocusedItemL(); - - virtual void SetToolbarVisibility( TBool aVisible ); - - virtual void DoHandleForegroundEventL( TBool aForeground ); - -public: // from base class MAknToolbarObserver - - virtual void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); - - -public: // from MMusUiReceiveObserver - - virtual void ShowInvitationQueryL( const TDesC& aQuery ); - - virtual void DismissInvitationQuery( TBool aDelete ); - - virtual void SetFullScreenL( TBool aFullScreen ); - - -public: // new functions - - void RefreshView(); - - -protected: // from MusUiGeneralView - - virtual CMusUiEventController* EventController() const; - - virtual CMusUiViewContainer& SharingContainer() const; - - -private: - - /** - * Gets called by the framework when it's activating this view. - * - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * Gets called by the framework when it's deactivating this view. - */ - void DoDeactivate(); - - -private: // data - - /** Container for all controls in this view. Owns. */ - CMusUiReceiveContainer* iContainer; - - CMusUiReceiveController* iController; - - HBufC* iAddress; - - TRect iOriginalRect; - - }; - -#endif // MUSUIRECEIVEVIEW_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiresourcehandler.h --- a/mmsharing/mmshui/inc/musuiresourcehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* 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: Handler for camera, keypad and video player resources -* -*/ - - - -#include "musuipropertyobserver.h" -#include "musresourceproperties.h" -#include "mussettingskeys.h" - -#include - -class CMusUiPropertyWatch; -class MMusUiEventObserver; -class CAknWaitDialog; - -/** - * Encapsulates handling and observing of camera, keypad and video player - * hardware and software resources. - */ -class CMusUiResourceHandler : public CBase, - public MMusUiPropertyObserver - { - - public: - - virtual ~CMusUiResourceHandler(); - - static CMusUiResourceHandler* NewL( MMusUiEventObserver& aObserver ); - - public: // API - - TBool RequestKeypadL( TBool aMandatory = EFalse ); - - TBool RequestCameraL( TBool aMandatory = EFalse ); - - TBool RequestVideoPlayerL( TBool aMandatory = EFalse ); - - - public: // From MMusUiPropertyObserver - - /** - * @param TUint aKey - The Property key - * @param TInt aValue - The value of the Property key - */ - virtual void PropertyChanged( const TUint aKey, const TInt aValue ); - - virtual void HandlePropertyError( const TInt aReason ); - - - private: - - CMusUiResourceHandler( MMusUiEventObserver& aObserver ); - - void ConstructL(); - - - private: // Helpers - - TBool ShowChangeProductModeDialogL( const TDesC& aPrompt ); - - TBool IsCurrentlyAvailable( NMusResourceApi::TAvailability aResourceAvailability, - MusSettingsKeys::TUsability aResourceUsability ); - - - private: // data - - /** - * - */ - MMusUiEventObserver& iObserver; - - /** - * - */ - CMusUiPropertyWatch* iCameraResourceWatch; - - /** - * - */ - CMusUiPropertyWatch* iKeypadResourceWatch; - - /** - * It holds the value for CameraAvailability. - * If it is static available ( Bit set to 0 in Cenrep) - * then it will be available always , if the bit set - * to 1 ( dynamic ) then it should be monitored by property - * listner and set the value accordingly. - */ - NMusResourceApi::TAvailability iCameraAvailability; - - /** - * It holds the value for KeypadAvailability. - * If it is static available ( Bit set to 0 in Cenrep) - * then it will be available always , if the bit set - * to 1 ( dynamic ) then it should be monitored by property - * listner and set the value accordingly. - */ - NMusResourceApi::TAvailability iKeypadAvailability; - - /** - * It holds the value for CameraUsability. - * Intially read from cenrep and assigned - * Refer mussettingskeys.h to know the bit value. - */ - MusSettingsKeys::TUsability iCameraUsability; - - /** - * It holds the value for KeypadUsability. - * Intially read from cenrep and assigned - * Refer mussettingskeys.h to know the bit value. - */ - MusSettingsKeys::TUsability iKeypadUsability; - - /** - * It holds the value for VideoplayerUsability. - * Intially read from cenrep and assigned - * Refer mussettingskeys.h to know the bit value. - */ - MusSettingsKeys::TUsability iVideoplayerUsability; - - /** - * - */ - TBool iCameraAvailibilityInProgress; - - /** - * - */ - TBool iKeypadAvailibilityInProgress; - - /** - * - */ - CAknWaitDialog* iChangeProductModeDialog; - - /** - * - */ - HBufC* iDialogPrompt; - - }; - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuisendcontroller.h --- a/mmsharing/mmshui/inc/musuisendcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* 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 MUSUISENDCONTROLLER_H -#define MUSUISENDCONTROLLER_H - -#include "musuieventcontroller.h" -#include "musengoutsessionobserver.h" -#include "musunittesting.h" - -#include "musengoutsessionobserver.h" -#include - -class MMusUiSendObserver; -class CMusEngMceOutSession; -class CDirectoryLocalizer; - -/** - * - * - * @lib musui.exe - */ -class CMusUiSendController : public CMusUiEventController, - public MMusEngOutSessionObserver - { - -public: - - virtual ~CMusUiSendController(); - - -public: // From CMusUiEventController: - - /** - * Returns a pointer to engine side session. - */ - virtual CMusEngMceSession* EngineSession(); - - /** - * - */ - virtual const TDesC& TypedAddress() const; - - /** - * - */ - virtual TBool ManualAddressTyped() const; - - /** - * Makes out session specific preparations for engine session deletion. - */ - virtual void DeleteEngineSession(); - - -public: // From MMusUiPropertyObserver - - virtual void HandlePropertyError( const TInt aReason ); - - -public: // From MMusUiCallbackObserver - - /** - * Handles async events common to outgoing session types. - * Should be called if child classes are not able to handle the call. - */ - virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); - - -public: // new functions: - - /** - * Returns a pointer to engine side session. - */ - virtual CMusEngMceOutSession* EngineOutSession() = 0; - - virtual void InviteL( const TDesC& aRecipient ) = 0; - - virtual void HandleSliderValueChangeL( TInt aNewLevel ) = 0; - - void StartInvitationL(); - - void InviteL(); - - void CancelInvitationL(); - - virtual void HandleForegroundEventL( TBool aForeground ); - - virtual void PlayL(); - - virtual void PauseL(); - - TBool IsPlayingL(); - - -public: // from MMusEngSessionObserver - - virtual void SessionEstablished(); - - -public: // from MMusEngOutSessionObserver - - virtual void SessionRejected(); // e.g. 603 DECLINE - - virtual void SessionBadRequest(); // 400 - - virtual void SessionUnauthorized(); // 401 - - virtual void SessionPaymentRequired(); // 402 - - virtual void SessionRecipientNotFound(); // 404 - - virtual void SessionProxyAuthenticationRequired(); // 407 - - virtual void SessionRequestTimeOut(); // 408 - - virtual void SessionUnsupportedMediaType(); // 415 - - virtual void SessionBusyHere(); // 486 - - virtual void SessionRequestCancelled(); // 487 - - virtual void SessionTemporarilyNotAvailable(); // 480 - - -protected: // Contructors - - void ConstructL(); - - CMusUiSendController( MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver ); - - -protected: // from MusUiEventController - - /** - * Send specific functionality of exit procedure - */ - virtual void ExitProcedureL( TBool aUserAcceptance ); - - /** - * Handles status changes specific to sending side sharing types. - * To be overridden in sibling classes for sharing type specific - * status changes. Calls base class version if status change is not - * sending side specific. - */ - virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus ); - - -protected: - - /** - * - */ - const TDesC& VideoFileNameL(); - - void ShowInvitingWaitDialogL(); - - void DismissWaitDialog(); - - -private: // Helpers - - void SplitL( const TDesC& aDes, const TDesC& aChar, CDesCArray* aArray ); - - void SetVideoPathValueL(); - - void ShowVideoSavedDialogL(); - - void DeleteVideoL(); - - -protected: // Data - - /* - * Interface for outgoing session specific callbacks - */ - MMusUiSendObserver& iSendObserver; - - HBufC* iAddress; - - TBool iVideoToBeSaved; - - TBool iManualAddressTyped; - - TInt iTriedInvitations; - - /** - * - */ - TBool iSipRegistrationPending; - - /** - * - */ - HBufC* iRemoteSipAddress; - - /** - * - */ - HBufC* iRemoteSipAddressProposal; - - -private: // Data - - /** - * If this variable is ETrue, playback should be continued - * when gaining focus. ETrue by default. - */ - TBool iContinuePlayingWhenForeground; - - /** - * - */ - HBufC* iVideoFileName; - - CDirectoryLocalizer* iLocalizer; - -protected: - /** - * The class is used as a call back service of the wait dialog - */ - class TWaitDialogCallback : public MProgressDialogCallback - { - public: - TWaitDialogCallback( CMusUiSendController& aController ); - void DialogDismissedL( TInt /*aButtonId*/ ); - - private: - CMusUiSendController& iController; - - }iWaitDialogCallback; - - /** - * If this variable is ETrue, playback should be continued - * when gaining focus. ETrue by default. - */ - }; - -#endif // MUSUISENDCONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuisendobserver.h --- a/mmsharing/mmshui/inc/musuisendobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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: Mus Application's Send Observer Interface -* -*/ - - - -#ifndef MUSUISENDOBSERVER_H -#define MUSUISENDOBSERVER_H - -class MMusUiSendObserver - { - - public: - - virtual void ManualAddressEntryL( const TDesC& aAddress ) = 0; - - - }; - -#endif // MUSUISENDOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuisendview.h --- a/mmsharing/mmshui/inc/musuisendview.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUISENDVIEW_H -#define MUSUISENDVIEW_H - - -#include "musuigeneralview.h" // Base view class -#include "musuisendobserver.h" -#include - -class CMusUiSendViewContainer; -class CMusUiSendController; - -/** - * The MUS application's share view. - * - * @lib musui.exe - */ -class CMusUiSendView : public CMusUiGeneralView, - public MMusUiSendObserver - { - -public: // constructors and destructor - - /** - * EPOC default constructor. - */ - void ConstructL(); - - /** - * Destructor. - */ - virtual ~CMusUiSendView(); - - -public: // from MMusUiSendObserver - - virtual void ManualAddressEntryL( const TDesC& aAddress ); - -public: // from CMusUiGeneralView - - virtual void DoHandleForegroundEventL( TBool aForeground ); - -protected: // New functions - - virtual CMusUiSendController* SendController() const = 0; - - virtual CMusUiSendViewContainer* SendContainer() const = 0; - - -protected: // from CMusUiGeneralView - - virtual CMusUiEventController* EventController() const; - - virtual CMusUiViewContainer& SharingContainer() const; - - -protected: // from base class CAknView - - /** - * Gets called by the framework when it's activating this view. - * - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * Gets called by the framework when it's deactivating this view. - */ - void DoDeactivate(); - - - - -protected: // data - - CAknAppUiBase::TAppUiOrientation iSavedOrientation; - TBool iPauseSelected; - - }; - -#endif // MUSUISENDVIEW_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuisendviewcontainer.h --- a/mmsharing/mmshui/inc/musuisendviewcontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#ifndef MUSUISENDVIEWCONTAINER_H -#define MUSUISENDVIEWCONTAINER_H - - -#include "musuiviewcontainer.h" -#include "musuilevelindicatorobserver.h" - -#include - -class MAknsControlContext; -class CMusUiGeneralView; -class CAknWaitDialog; -class CMusUiLevelIndicator; -class CMusUiSendController; - -/** - * - * - */ -class CMusUiSendViewContainer : public CMusUiViewContainer, - public MMusUiLevelIndicatorObserver - { - -public: // constructors and destructor - - /** - * Destructor. - */ - ~CMusUiSendViewContainer(); - -public: // new functions - - /** - * Return pointer to view class. User needs to type cast to - * appropriate concrete view class. - * - * @return handle to view - */ - CMusUiGeneralView* MusUiView() const; - - /** - * @param Pointer to instance of controller who is notified about changes in - * indicator. NULL if notifications are to be suppressed. - */ - void SetController( CMusUiSendController* aController ); - - -protected: // constructors - - /** - * Meant to be a base class, no instantiation - */ - CMusUiSendViewContainer(); - - /** - * Symbian second-phase constructor. - * - * @param aView Parent view of container. - * @param aRect Frame rectangle for container. - * @param aInputParams Packaged data. - */ - void ConstructL( CMusUiGeneralView* aView, - const TRect& aRect, - TAknOrientation aIndicatorLayout ); - - -private: // from base class CCoeControl - - /** - * Gets called by the application framework when drawing is - * needed. - * - * @param aRect The rectangle that needs to be drawn. - */ - virtual void Draw( const TRect& aRect ) const; - - virtual void SizeChanged(); - - virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); - - -private: // MMusUiLevelIndicatorObserver - - virtual void SetLevelIndicatorVisibility( TBool aVisible ); - - virtual void IndicatorLevelChanged( TInt aNewLevel ); - - -protected: // data - - CMusUiLevelIndicator* iIndicator; - - -private: // data - - /** Background skin control context. */ - MAknsControlContext* iBackGround; - - /** Handle to the view that owns of this container. Not own. */ - CMusUiGeneralView* iView; - - /** - * Engine DSA area - */ - TRect iVideoRect; - - // Can be NULL - CMusUiSendController* iSendController; - - }; - - -#endif // MUSUISENDVIEWCONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuisharingobserver.h --- a/mmsharing/mmshui/inc/musuisharingobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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: Mus Application's Sharing Observer Interface -* -*/ - - - -#ifndef MUSUISHARINGOBSERVER_H -#define MUSUISHARINGOBSERVER_H - - -#include -#include - -class MMusUiSharingObserver - { - - public: - - /* - * Shows sychronous wait dialog with softkey R_AVKON_SOFTKEYS_CANCEL. - * @param aPrompt Prompt text shown in dialog - * @param aTimerInSeconds Timer in seconds when dialog is dismissed - * automatically. Timer value 0 means that no timer is used. - * @param aExpirationMessageResourceId is ID of resource indicating - * the message to be shown if timer expires. Value 0 means that - * no message is shown. - * @return EFalse if dialog is dismissed by user pressing cancel - * or by expiration of timer. ETrue if DismissWaitDialogL - * is called with parameter ETrue; - */ - virtual TBool ShowWaitDialogL( - const TDesC& aPrompt, - TInt aTimerInSeconds = 0, - TInt aExpirationMessageResourceId = 0 ) = 0; - - /* - * Dismisses sychronous wait dialog shown by calling ShowWaitDialogL. - * @param aReturnValue determines return value of function - * ShowWaitDialogL. - */ - virtual void DismissWaitDialogL( TBool aReturnValue = ETrue ) = 0; - - /** - * Set call back service of wait dialog - * @param aCallback A pointer of class MProgressDialogCallback - * which implemented DialogDismissedL - */ - virtual void SetWaitDialogCallbackL( MProgressDialogCallback* aCallback ) = 0; - - virtual void ShowStatusPaneTitleL() = 0; - - /** - * - */ - virtual void EnableMiddleSoftkeyL( TInt aResourceId ) = 0; - - virtual void ActivateVolumeControlL( TInt aValue ) = 0; - - virtual void HighlightSelectedToolbarItem( TInt aCommand ) = 0; - - virtual void ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ) = 0; - - virtual void RefreshAudioRoutingToolbarButton() = 0; - - virtual void UpdateSessionTime( const TDesC& aSessionTime ) = 0; - - }; - -#endif // MUSUISHARINGOBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuistartcontroller.h --- a/mmsharing/mmshui/inc/musuistartcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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 MUSUISTARTCONTROLLER_H -#define MUSUISTARTCONTROLLER_H - -#include "musmanagercommon.h" -#include "musunittesting.h" - - -/** - * Class to read startup parameter from publish & subscribe - */ -class MusUiStartController - { - -private: // second phase constructors - - /** - * Disable instantiation by declaring C++ constructor private. - */ - MusUiStartController(); - - -public: // static new functions - - /** - * Reads a P&S integer value from the category KCategoryUid - * @pre P&S property KUseCase has to be defined. - * @leave One of the system wide error codes, if RProperty::Get() - * returns an error value. - * @return Defined use case (TMusUseCase) for launching MUS. - */ - static MultimediaSharing::TMusUseCase ReadUseCaseL(); - - - MUS_UNITTEST( UT_CMusUiStartController; ) - - }; - -#endif // MUSUISTARTCONTROLLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuistatuspanehandler.h --- a/mmsharing/mmshui/inc/musuistatuspanehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* 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 MUSUISTATUSPANEHANDLER_H -#define MUSUISTATUSPANEHANDLER_H - - -#include "musuinavimediadecorator.h" - -#include // Tab group -#include // Title pane -#include // Context pane -#include // Indicator container -#include -#include // CAknNavigationDecorator - - -class CAknNavigationControlContainer; -class CAknVolumePopup; - -/** - * Handles status, title and contextpane operations. - * - * @lib musui.exe - */ -class CMusUiStatusPaneHandler : public CBase - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CMusUiStatusPaneHandler* NewL( CEikonEnv& aEikonEnv ); - - /** - * Destructor. - */ - virtual ~CMusUiStatusPaneHandler(); - -private: - - /** - * C++ default constructor. - */ - CMusUiStatusPaneHandler( CEikonEnv& aEikonEnv ); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - - -public: // New functions - - /** - * Sets statuspane icons. - * - * @param aIconId ID of icon from .mbg file. - * @param aIconMaskId ID of icon mask from .mbg file. - */ - void SetStatusPaneIconsL( TInt32 aIconId, TInt32 aIconMaskId ); - - /** - * Sets statuspane icons. - * - */ - void SetStatusPaneIconsL( CFbsBitmap* aBitmap ); - - /** - * Hides navi-pane decorators and clears text - */ - void ClearNaviPaneL(); - - /** - * Sets title-pane text - * - * @param aTitle Title text - */ - void SetTitleL( const TDesC& aTitle ); - - /** - * Sets title-pane text - * - */ - void SetTitleFromResourceL( TInt aResourceId ); - - /** - * Get the current volume setting. - * - * @return Current volume. - */ - TInt GetVolumeControlValue() const; - - /** - * Activates volume control. - * - * @return Volume controller. - */ - void ActivateVolumeControlL( TInt aVolume ); - - /** - * Activate media navi pane. - */ - void ActivateNaviPaneMediaL(); - - /** - * - */ - void ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon ); - - /** - * Set text in media navi pane. - * - * @param aLabel New label of media navi pane control - */ - void SetLeftLabelL( const TDesC& aLabel ); - - /** - * Set text in media navi pane. - * - * @param aLabel New label of media navi pane control - */ - void SetRightLabelL( const TDesC& aLabel ); - - /** - * Create media navi pane. - */ - CAknNavigationDecorator* CreateMediaNaviL(); - - /** - * Get Volume popup control pointer - * @return pointer of VolumePopup control - */ - CAknVolumePopup* GetVolumePopup() const; - - -private: // data - - CEikonEnv& iEikonEnvironment; - - // UI controls - CAknNavigationControlContainer* iNaviPane; - CAknTitlePane* iTitlePane; - CAknContextPane* iContextPane; - CAknNavigationDecorator* iNaviPaneText; - CAknVolumePopup* iVolumePopup; - // Navi pane media control - CAknNavigationDecorator* iMediaControl; - - // Volume level of the volume control - TInt iVolume; - - }; - -#endif // MUSUISTATUSPANEHANDLER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuiviewcontainer.h --- a/mmsharing/mmshui/inc/musuiviewcontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* 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 MUS application's UI class. -* -*/ - - - -#ifndef MUSUIVIEWCONTAINER_H -#define MUSUIVIEWCONTAINER_H - - -#include // Control base class -#include - -class CAknWaitDialog; -class CMusUiGeneralView; - -/** - * - * - */ -class CMusUiViewContainer : public CCoeControl - { - -public: // constructors and destructor - - /** - * Destructor. - */ - ~CMusUiViewContainer(); - -public: // new functions - - void CancelWaitTimer(); - - /** - * Dismisses the current active wait note, if any. - */ - void DismissWaitDialogL( TBool aReturnValue = ETrue ); - - /** - * Shows sychronous wait dialog with softkey R_AVKON_SOFTKEYS_CANCEL. - * @param aPrompt Prompt text shown in dialog - * @param aTimerInSeconds Timer in seconds when dialog is dismissed - * automatically. Timer value 0 means that no timer is used. - * @param aExpirationMessageResourceId Message to be loaded and shown if - * timer expires. Value 0 means that no message is shown. - * @return ETrue if wait note is dismissed by calling DismissWaitDialogL - * with param ETrue. EFalse if user pressed cancel, timer expires - * or if DismissWaitDialogL is called with param EFalse. - */ - TBool RunWaitDialogL( const TDesC& aPrompt, - TInt aTimerInSeconds = 0, - TInt aExpirationMessageResourceId = 0 ); - - /** - * Set call back service of wait dialog - * @param aCallback A pointer of class MProgressDialogCallback - * which implemented DialogDismissedL - */ - void SetWaitDialogCallbackL( MProgressDialogCallback* aCallback ); - - /** - * Checks whether wait dialog is shown currently. - * @return ETrue if wait dialog is show. - */ - TBool WaitDialogShown() const; - - /** - * Request that toolbar visibility is set once currently shown dialog - * is dismissed. - * @param aToolbarHandler if NULL is passed, previous request is canceled. - * Ownership not transferred. - */ - void RequestToolbarVisibilityOnceDialogDismissed( - CMusUiGeneralView* aToolbarHandler ); - -protected: // constructors - - /** - * Meant to be a base class, no instantiation - */ - CMusUiViewContainer(); - -private: // new static functions - - /** - * Tick handler, callback function directly called by periodic timer - * - * @param aObject Pointer passed to TCallback. - * @return Value to indicate if callback function should be called again. - */ - static TInt DoWaitNoteTimeout( TAny* aObject ); - - -private: // data - - /** Wait dialog to show the invite is sent. Not own. */ - CAknWaitDialog* iWaitDialog; - - /** Periodic timer active object. Owns. */ - CPeriodic* iWaitDialogTimer; - - /** - * Indicates if wait note is dismissed using DismissWaitDialogL - */ - TBool iInvitationWaitDialogDismissed; - - /** - * If iInvitationWaitDialogDismissed is ETrue, this value should be returned - * from RunWaitDialogL - */ - TBool iWaitDialogReturnValueWhenDismissed; - - /** - * Resource ID of message to be shown if timer expires - */ - TInt iExpirationMessageResourceId; - - /** - * Flag indicating whether wait dialog is currently shown. - */ - TBool iShowingWaitDialog; - - /** - * Not owned. - */ - CMusUiGeneralView* iToolbarHandler; - - }; - - -#endif // MUSUISENDVIEWCONTAINER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuizoomindicator.h --- a/mmsharing/mmshui/inc/musuizoomindicator.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* -* 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: Class for displaying icons in viewfinder view -* -*/ - - -#ifndef CMUSUIZOOMINDICATORS_H -#define CMUSUIZOOMINDICATORS_H - -// SYSTEM -#include -#include -#include - -class MAknsSkinInstance; -class CGulIcon; -class MMusUiZoomIndicatorObserver; - -/** -* Class for displaying icons in viewfinder view -* @since 2.8 -*/ -class CMusUiZoomIndicator : public CCoeControl - { - - - public: // Constructors and destructor - - /** - * Symbian OS two-phased constructor. - * @since 2.8 - * @param aController reference to CCcorController - */ - static CMusUiZoomIndicator* NewLC( - TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ); - - /** - * Symbian OS two-phased constructor. - * @since 2.8 - * @param aController reference to CCcorController - */ - static CMusUiZoomIndicator* NewL( - TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ); - - /** - * Destructor. - */ - ~CMusUiZoomIndicator(); - - public: // New functions - - /** - * - * @since 3.2 - */ - void SetZoomLevel( TInt aZoomLevel ); - - /** - * - * @since 3.2 - */ - TInt GetZoomLevel(); - - /** - * - * @since 3.2 - */ - void SetZoomMin( TInt aZoomMin ); - - /** - * - * @since 3.2 - */ - void SetZoomMax( TInt aZoomMax ); - - /** - * - * @since 3.2 - */ - void SetFullRect( const TRect aRect ); - - - - private: // From CCoeConrol - - /** - * Handles the size change events. - * - */ - void SizeChanged(); - - /** - * Draws the control. - * - * @param aRect The region of the control to be redrawn. - */ - void Draw(const TRect& aRect) const; - - TInt CountComponentControls() const; - - CCoeControl* ComponentControl( TInt aIndex ) const; - - - - private: // Constructors and destructor - - /** - * C++ constructor - * @since 2.8 - * @param aController reference to CCcorController - */ - CMusUiZoomIndicator( TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ); - - /** - * Symbian 2nd phase constructor. - * @since 2.8 - */ - void ConstructL(); - - - private: // HELPERS - - /** - * - */ - void DrawIcons( const TRect& aRect ); - - /** - * - */ - void UpdateZoomLayout(); - - void ConstructImageL( CEikImage* aImage, - MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId ); - - /** - * Callback for disable zoom indicator. - * @since 2.8 - * @return KErrNone - */ - static TInt DisableZoomIndicator( TAny* aThis ); - - /** - * - */ - void DisableTimer(); - - /** - * - */ - void EnableTimer(); - - - private: //data - - /** - * - */ - TRect iParentRect; - - /** - * - */ - TRect iViewfinderRect; - - /** - * - */ - TInt iZoomMin; - - /** - * - */ - TInt iZoomMax; - - /** - * - */ - TInt iZoomLevel; - - /** - * - */ - CPeriodic* iDisableZoomTimer; // owned - - /** - * - */ - TRgb iIconColor; - - /** - * - */ - CEikImage* iIconElevator; - - /** - * - */ - CEikImage* iIconMin; - - /** - * - */ - CEikImage* iIconMax; - - /** - * - */ - CEikImage* iIconBg; - - /** - * - */ - TInt iTopMargin; - - /** - * - */ - TInt iBottomMargin; - - /** - * - */ - TInt iScaleStep; - - /** - * - */ - TInt iScaleY; - - /** - * - */ - TInt iMiddle; - - /** - * NOT OWN!!! - */ - MMusUiZoomIndicatorObserver* iObserver; - - TInt iElevatorWidth; - - TInt iElevatorHeight; - - TRect iFullRect; - - - }; - - -#endif - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/inc/musuizoomindicatorobserver.h --- a/mmsharing/mmshui/inc/musuizoomindicatorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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 zoom indicator Event Observer Interface -* -*/ - - - -#ifndef MUSUIZOOMINDICATOROBSERVER_H -#define MUSUIZOOMINDICATOROBSERVER_H - - -class MMusUiZoomIndicatorObserver - { - public: - - virtual void DisableZoomIndicator() = 0; - }; - -#endif // MUSUIZOOMINDICATOROBSERVER_H - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiactivequerydialog.cpp --- a/mmsharing/mmshui/src/musuiactivequerydialog.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuiactivequerydialog.h" -#include "musuiqueryobserver.h" -#include "muslogger.h" -#include "musunittesting.h" - -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiActiveQueryDialog* CMusUiActiveQueryDialog::NewL( - MMusUiQueryObserver& aObserver ) - { - CMusUiActiveQueryDialog* self - = new( ELeave ) CMusUiActiveQueryDialog( aObserver ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog" ); - - Cancel(); - delete iGlobalQuery; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiActiveQueryDialog::CMusUiActiveQueryDialog( MMusUiQueryObserver& aObserver ) - : CActive( EPriorityNormal ), iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveQueryDialog::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::ConstructL" ); - - iGlobalQuery = CAknGlobalConfirmationQuery::NewL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveQueryDialog::ShowL( const TDesC& aPrompt ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::ShowL" ); - - iGlobalQuery->ShowConfirmationQueryL( - iStatus, - aPrompt, - R_AVKON_SOFTKEYS_YES_NO ); - SetActive(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::ShowL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveQueryDialog::RunL() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::RunL [%d]", iStatus.Int() ); - if ( iStatus == EAknSoftkeyYes ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiActiveQueryDialog::RunL: if" ); - iObserver.QueryAcceptedL( ETrue ); - } - else // EAknSoftkeyNo - { - MUS_LOG( "mus: [MUSUI ] CMusUiActiveQueryDialog::RunL: else" ); - iObserver.QueryAcceptedL( EFalse ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::RunL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveQueryDialog::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::DoCancel" ); - iGlobalQuery->CancelConfirmationQuery(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiActiveQueryDialog::RunError( TInt aError ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::RunError [%d]", - aError ); - - return iObserver.HandleQueryError( aError ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiactivetimer.cpp --- a/mmsharing/mmshui/src/musuiactivetimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 "musuiactivetimer.h" -#include "musuiactivetimerobserver.h" - -#include "muslogger.h" // debug logging - - -// ----------------------------------------------------------------------------- -// Symbian two-phase constructor. -// ----------------------------------------------------------------------------- -// -CMusUiActiveTimer* CMusUiActiveTimer::NewL( MMusUiActiveTimerObserver* aObserver ) - { - CMusUiActiveTimer* self = new (ELeave) CMusUiActiveTimer( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// Symbian second-phase constructor. -// ----------------------------------------------------------------------------- -// -void CMusUiActiveTimer::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveTimer::ConstructL" ); - - User::LeaveIfError( iTimer.CreateLocal() ); - CActiveScheduler::Add( this ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveTimer::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// . -// ----------------------------------------------------------------------------- -// -void CMusUiActiveTimer::After( TTimeIntervalMicroSeconds32 anInterval ) - { - // No logging due to huge amount of calls in some use cases - - Cancel(); - iTimer.After( iStatus, anInterval ); - SetActive(); - - // No logging due to huge amount of calls in some use cases - } - - -// ----------------------------------------------------------------------------- -// C++ constructor. -// ----------------------------------------------------------------------------- -// -CMusUiActiveTimer::CMusUiActiveTimer( MMusUiActiveTimerObserver* aObserver ) : - CActive( EPriorityNormal ), - iObserver( aObserver ) - { - // nothing - } - - -// ----------------------------------------------------------------------------- -// C++ destructor. -// ----------------------------------------------------------------------------- -// -CMusUiActiveTimer::~CMusUiActiveTimer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveTimer::~CMusUiActiveTimer" ); - - Cancel(); - iTimer.Close(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveTimer::~CMusUiActiveTimer" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveTimer::DoCancel() - { - // No logging due to huge amount of calls in some use cases - - iTimer.Cancel(); - - // No logging due to huge amount of calls in some use cases - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActiveTimer::RunL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveTimer::RunL" ); - if (iStatus == KErrNone) - { - iObserver->TimerComplete( this ); - } - else - { - User::Leave(iStatus.Int()); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveTimer::RunL" ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiactivitymanger.cpp --- a/mmsharing/mmshui/src/musuiactivitymanger.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/* -* 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 "musuiactivitymanger.h" -#include "muslogger.h" // debug logging - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiActivityManager* CMusUiActivityManager::NewL( TInt aTimeout ) - - { - CMusUiActivityManager* self = - new (ELeave) CMusUiActivityManager( aTimeout ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiActivityManager::~CMusUiActivityManager() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::~CMusUiActivityManager" ); - Cancel(); - iTimer.Close(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::~CMusUiActivityManager" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiActivityManager::CMusUiActivityManager( TInt aTimeout ) - : CActive( CActive::EPriorityHigh ), - iTimeout( aTimeout ) - - { - CActiveScheduler::Add(this); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::ConstructL" ); - iTimer.CreateLocal(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::SetTimeout( TInt aTimeout ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiActivityManager::SetTimeout [%d]", aTimeout ); - iTimeout = aTimeout; - Reset(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::SetTimeout" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::Start() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::Start" ); - if (!IsActive()) - { - iTimer.Inactivity( iStatus, iTimeout ); - SetActive(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::Start" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::Reset() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::Reset" ); - Cancel(); - Start(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::Reset" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::DoCancel" ); - iTimer.Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiActivityManager::RunL() - { - - MUS_LOG( "mus: [MUSUI ] -> CMusUiActivityManager::RunL" ); - - if ( iStatus == KErrNone ) - { - - TInt inactivity = User::InactivityTime().Int(); - - if ( inactivity >= iTimeout ) - { - User::ResetInactivityTime(); - Reset(); - } - else - { - iTimer.Inactivity( iStatus, iTimeout ); - } - - if ( !IsActive() ) - { - SetActive(); - } - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiActivityManager::RunL" ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiapp.cpp --- a/mmsharing/mmshui/src/musuiapp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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: Application class for MUS App. -* -*/ - - - -#include "musuiapp.h" // Header file for this class -#include "musuidocument.h" // Mus UI Document -#include "musuid.hrh" -#include "muslogger.h" // debug logging - -#include - - -// ============================ MEMBER FUNCTIONS =========================== - -// Returns application UID -TUid CMusUiApp::AppDllUid() const - { - const TUid KUidRetVal = { KMusUiUid }; - return KUidRetVal; - } - -// Creates CMusUiDocument object -CApaDocument* CMusUiApp::CreateDocumentL() - { - return CMusUiDocument::NewL( *this ); - } - - -// ==================== OTHER EXPORTED FUNCTIONS =========================== - -// Constructs and returns an application object -EXPORT_C CApaApplication* NewApplication() - { - MUS_LOG( "mus: [MUSUI ] -------------------------------------------------" ); - return new CMusUiApp; - } - -// Main function of the application executable -GLDEF_C TInt E32Main() - { - return EikStart::RunApplication( NewApplication ); - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiappui.cpp --- a/mmsharing/mmshui/src/musuiappui.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,747 +0,0 @@ -/* -* 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: Application's UI class. -* -*/ - - - -#include "musuiappui.h" -#include "musuilivesharingview.h" -#include "musuiclipsharingview.h" -#include "musuireceiveview.h" -#include "musuistatuspanehandler.h" -#include "musuistartcontroller.h" -#include "musuiactivequerydialog.h" -#include "musuidefinitions.h" -#include "mussettings.h" -#include "mussettingskeys.h" -#include "musmanagercommon.h" -#include "musui.hrh" -#include "musuid.hrh" -#include "muslogger.h" // debug logging -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -using namespace MusSettingsKeys; - -// ----------------------------------------------------------------------------- -// Symbian second-phase constructor. -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::ConstructL" ); - BaseConstructL( EAknEnableSkin | EAppOrientationAutomatic | EAknEnableMSK ); - - iForeground = ETrue; - - // View for Live Sharing: - CMusUiLiveSharingView* liveSharingView = - new ( ELeave ) CMusUiLiveSharingView; - CleanupStack::PushL( liveSharingView ); - liveSharingView->ConstructL(); - AddViewL( liveSharingView ); // transfer ownership to CAknViewAppUi - CleanupStack::Pop( liveSharingView ); - - // View for Clip Sharing: - CMusUiClipSharingView* clipSharingView = - new ( ELeave ) CMusUiClipSharingView; - CleanupStack::PushL( clipSharingView ); - clipSharingView->ConstructL(); - AddViewL( clipSharingView ); // transfer ownership to CAknViewAppUi - CleanupStack::Pop( clipSharingView ); - - // View for Receiving: - CMusUiReceiveView* receiveView = new ( ELeave ) CMusUiReceiveView; - CleanupStack::PushL( receiveView ); - receiveView->ConstructL(); - AddViewL( receiveView ); // transfer ownership to CAknViewAppUi - CleanupStack::Pop( receiveView ); - - FindWindowGroupIdentifiersL(); - - iStatusPaneHandler = CMusUiStatusPaneHandler::NewL( *iEikonEnv ); - // The application icon: - iStatusPaneHandler->SetStatusPaneIconsL( - EMbmMusuiQgn_menu_mus_app_cxt, - EMbmMusuiQgn_menu_mus_app_cxt_mask ); - - AknsUtils::InitSkinSupportL(); - AknsUtils::SetAvkonSkinEnabledL( ETrue ); - - // Check use case and set default view - switch ( MusUiStartController::ReadUseCaseL() ) - { - case MultimediaSharing::EMusLiveVideo: - ActivateLocalViewL( liveSharingView->Id() ); - break; - case MultimediaSharing::EMusClipVideo: - ActivateLocalViewL( clipSharingView->Id() ); - break; - case MultimediaSharing::EMusReceive: - ActivateLocalViewL( receiveView->Id() ); - break; - default: - User::Leave( KErrNotSupported ); - break; - } - - iInterfaceSelector = CRemConInterfaceSelector::NewL(); - iCoreTarget = CRemConCoreApiTarget::NewL(*iInterfaceSelector, *this); - iInterfaceSelector->OpenTargetL(); - - // check if operator specific functionality is needed - iOperatorSpecificFunctionality = - ( MultimediaSharingSettings::OperatorVariantSettingL() == - EOperatorSpecific ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor. -// ----------------------------------------------------------------------------- -// -CMusUiAppUi::~CMusUiAppUi() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::~CMusUiAppUi" ); - delete iConfirmationQuery; - delete iStatusPaneHandler; - delete iInterfaceSelector; - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::~CMusUiAppUi" ); - } - - -// ----------------------------------------------------------------------------- -// Fetches a handle to status pane handler -// ----------------------------------------------------------------------------- -// -CMusUiStatusPaneHandler* CMusUiAppUi::MusStatusPane() - { - return iStatusPaneHandler; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiAppUi::ExitValue() - { - return iExit; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HandleWsEventL" ); - - const TInt type = aEvent.Type(); - - // Avoiding unknown failures - if( !iView ) - { - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleWsEventL, view is NULL" ); - return; - } - - if ( type == EEventPointer && - iStatusPaneHandler->GetVolumePopup()->IsVisible() ) - { - MUS_LOG( "mus: [MUSUI ] EMusuiCmdViewVolumeChanged" ); - CMusUiGeneralView* activatedView = - static_cast( iView ); - activatedView->HandleCommandL( EMusuiCmdViewVolumeChanged ); - } - - if( type == EEventKeyUp ) - { - static_cast - ( iView )->HandleKeyUpEvent( iLastKeyCode ); - } - - if ( ( type == EEventKey ) && iView->Toolbar()->IsShown() && !MUS_NO_TOOLBAR ) - { - const TKeyEvent* keyEvent = aEvent.Key(); - - iLastKeyCode = keyEvent->iCode; - - MUS_LOG1( "mus: [MUSUI ] CMusUiAppUi::HandleWsEventL iCode: %d", - keyEvent->iCode ); - CMusUiGeneralView* activatedView = - static_cast( iView ); - activatedView->HandleToolbarCommandL( keyEvent->iCode ); - } - - if ( type == KAknFullOrPartialForegroundLost || - type == EEventFocusLost || - type == KAknFullOrPartialForegroundGained || - type == EEventFocusGained ) - { - DoHandleForegroundEventL( type ); - } - - // All events are sent to base class. - CAknAppUi::HandleWsEventL( aEvent, aDestination ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleWsEventL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleForegroundEventL( TBool aForeground ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HandleForegroundEventL" ); - - CAknViewAppUi::HandleForegroundEventL( aForeground ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleForegroundEventL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::MrccatoCommand( TRemConCoreApiOperationId aOperationId, - TRemConCoreApiButtonAction aButtonAct ) - { - MUS_LOG2( "mus: [MUSUI ] -> CMusUiAppUi::MrccatoCommand: %d, %d", - aOperationId, - aButtonAct ); - - switch ( aOperationId ) - { - case ERemConCoreApiVolumeUp: // Volume Up - { - switch ( aButtonAct ) - { - case ERemConCoreApiButtonClick: - { - // volume up clicked - CMusUiGeneralView* activatedView = - static_cast( iView ); - if( MUS_NO_TOOLBAR ) - { - TRAP_IGNORE( activatedView->HandleCommandL( - EMusuiCmdViewVolumeUp ) ) - } - else - { - TRAP_IGNORE( activatedView->HandleToolbarCommandL( - EMusuiCmdViewVolumeUp ) ) - } - break; - } - default: - // Never hits this - break; - } - break; - } - case ERemConCoreApiVolumeDown: // Volume Down - { - switch ( aButtonAct ) - { - case ERemConCoreApiButtonClick: - { - // volume down clicked - CMusUiGeneralView* activatedView = - static_cast( iView ); - if( MUS_NO_TOOLBAR ) - { - TRAP_IGNORE( activatedView->HandleCommandL( - EMusuiCmdViewVolumeDown ) ) - } - else - { - TRAP_IGNORE( activatedView->HandleToolbarCommandL( - EMusuiCmdViewVolumeDown ) ) - } - break; - } - default: - // Never hits this - break; - } - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::MrccatoCommand" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::QueryAcceptedL( TBool aAccepted ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::QueryAccepted" ); - CMusUiGeneralView* activatedView = static_cast( iView ); - // TODO: If next call leaves, it causes error handling to be done with - // previously deleted query object. This leads to crash. - activatedView->AsyncQueryDialogAcceptedL( aAccepted ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::QueryAccepted" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiAppUi::HandleQueryError( TInt aError ) - { - HandleError( aError ); // Forward to general error handler - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::ActivateLocalMusViewL( TUid aViewId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::ActivateLocalMusViewL" ); - ActivateLocalViewL( aViewId ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::ActivateLocalMusViewL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::ActivateLocalMusViewL( TUid aViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::ActivateLocalMusViewL" ); - ActivateLocalViewL( aViewId, aCustomMessageId, aCustomMessage ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::ActivateLocalMusViewL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::ShowAsyncConfirmationQueryDialogL( const TDesC& aPrompt ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::ShowAsyncConfirmationQueryDialogL" ); - if ( !iConfirmationQuery ) - { - iConfirmationQuery = CMusUiActiveQueryDialog::NewL( *this ); - } - iConfirmationQuery->ShowL( aPrompt ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::ShowAsyncConfirmationQueryDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::SetToolbarVisibility( TBool aVisible ) - { - CMusUiGeneralView* activatedView = static_cast( iView ); - if ( activatedView ) - { - activatedView->SetToolbarVisibility( aVisible ); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon ) - { - MusStatusPane()->ShowNaviPaneIconL( aIcon ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CEikonEnv* CMusUiAppUi::EikonEnv( ) const - { - return iEikonEnv; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::TerminateCall() - { - // TODO: Remove hard-coded values! - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::TerminateCall" ); - RWsSession sess = iEikonEnv->WsSession(); - - TApaTaskList taskList(sess); - - TApaTask phoneTask = taskList.FindApp(TUid::Uid(0x100058B3)); - MUS_LOG( "mus: [MUSUI ] phoneTask" ); - TInt id = 0; - if (phoneTask.Exists()) - id = phoneTask.WgId(); - MUS_LOG1( "PhoneTask ID: %d",id ); - TWsEvent event; - - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::TerminateCall: 1" ); - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::EEventKeyDown" ); - event.SetType( EEventKeyDown ); - event.SetTimeNow(); - event.Key()->iCode = 0; - event.Key()->iModifiers = EModifierNumLock; - event.Key()->iRepeats = 0; - event.Key()->iScanCode = EStdKeyNo; - sess.SendEventToWindowGroup( id, event ); - - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::TerminateCall: 2" ); - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::EEventKey" ); - event.SetType( EEventKey ); - event.SetTimeNow(); - event.Key()->iCode = EKeyNo; - event.Key()->iModifiers = 32769; - event.Key()->iRepeats = 0; - event.Key()->iScanCode = EStdKeyNo; - sess.SendEventToWindowGroup( id, event ); - - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::TerminateCall: 3" ); - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::EEventKeyUp" ); - event.SetType( EEventKeyUp ); - event.SetTimeNow(); - event.Key()->iCode = 0; - event.Key()->iModifiers = 32769; - event.Key()->iRepeats = 0; - event.Key()->iScanCode = EStdKeyNo; - sess.SendEventToWindowGroup( id, event ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::TerminateCall" ); - } - - -// ----------------------------------------------------------------------------- -// Return current app orientation. -// ----------------------------------------------------------------------------- -// -CAknAppUiBase::TAppUiOrientation CMusUiAppUi::AppOrientation() const - { - return ( ApplicationRect().Width() > ApplicationRect().Height() ) ? - CAknAppUiBase::EAppUiOrientationLandscape : - CAknAppUiBase::EAppUiOrientationPortrait; - } - - -// ----------------------------------------------------------------------------- -// Switch the active view's orientation, if it's in the foreground. -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::SwitchOrientationL( TAppUiOrientation aAppOrientation ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::SwitchOrientationL" ); - SetOrientationL( aAppOrientation ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::SwitchOrientationL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleError( const TInt aReason ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HandleError" ); - if ( aReason != KErrNone ) - { - HandleExit(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleError" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleExit() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HandleExit" ); - if ( !iExit ) - { - iExit = ETrue; - PrepareToExit(); - - RemoveView( KMusUidLiveSharingView ); - RemoveView( KMusUidClipSharingView ); - RemoveView( KMusUidReceivingView ); - - User::Exit( KErrNone ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleExit" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiAppUi::OrientationCanBeChanged() const - { - return CAknAppUiBase::OrientationCanBeChanged(); - } - - -// ----------------------------------------------------------------------------- -// From base class CEikAppUi. Handles a change to the application's -// resources which are shared across the environment. -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleResourceChangeL( TInt aResourceChangeType ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HandleResourceChangeL" ); - CAknAppUi::HandleResourceChangeL( aResourceChangeType ); - - if ( aResourceChangeType == KEikDynamicLayoutVariantSwitch ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiAppUi::HandleResourceChangeL:\ - aResourceChangeType == KEikDynamicLayoutVariantSwitch" ); - - CMusUiGeneralView* activatedView = - static_cast( iView ); - if ( !IsForeground() ) - { - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleResourceChangeL" ); - return; - } - - if ( activatedView ) - { - activatedView->RefreshView(); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleResourceChangeL" ); - } - - -// ----------------------------------------------------------------------------- -// takes care of key event handling -// ----------------------------------------------------------------------------- -// -TKeyResponse CMusUiAppUi::HandleKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode /*aType*/ ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiAppUi::HandleKeyEventL: %d", - aKeyEvent.iScanCode ); - MUS_LOG1( "mus: [MUSUI ] -> CMusUiAppUi::HandleKeyEventL: %d", - aKeyEvent.iCode ); - - if ( aKeyEvent.iScanCode == EStdKeyDevice1 /*165*/ ) // Cancel in Options - { - SetToolbarVisibility( ETrue ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HandleKeyEventL" ); - return EKeyWasNotConsumed; - } - - -// ----------------------------------------------------------------------------- -// takes care of command handling -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::HandleCommandL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiAppUi::HandleCommandL [%d]", - aCommand ); - switch ( aCommand ) - { - case EMusuiGenCmdExit: - case EAknSoftkeyExit: - case EEikCmdExit: - { - SetToolbarVisibility( EFalse ); - HandleExit(); - break; - } - default: - break; - } - MUS_LOG( "mus: [MUSUI ] <-> CMusUiAppUi::HandleCommandL" ); - } - -// ----------------------------------------------------------------------------- -// CMusUiAppUi::GetVolumeFromUi() -// ----------------------------------------------------------------------------- -// -TInt CMusUiAppUi::GetUiVolumeValue() - { - return iStatusPaneHandler->GetVolumeControlValue(); - } - - -// ----------------------------------------------------------------------------- -// CMusUiAppUi::AppHelpContextL() -// ----------------------------------------------------------------------------- -// -CArrayFix* CMusUiAppUi::HelpContextL() const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::HelpContextL" ); - CArrayFix* contexts = - new (ELeave) CArrayFixFlat(1); - CleanupStack::PushL(contexts); - - TCoeHelpContext help; - help.iMajor.iUid = KMusUiUid; - - if ( iView->Id() == KMusUidLiveSharingView ) - { - help.iContext = KMSH_HLP_LIVE; - } - else if ( iView->Id() == KMusUidClipSharingView ) - { - help.iContext = KMSH_HLP_CLIP; - } - else if ( iView->Id() == KMusUidReceivingView ) - { - help.iContext = KMSH_HLP_RECEIVE; - } - - contexts->AppendL(help); - CleanupStack::Pop(); // contexts - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::HelpContextL" ); - return contexts; - } - - -// ----------------------------------------------------------------------------- -// We might get PartialFocusLost also for some notes and -// overally items that are somehow overlapping screen instead of -// FocusLost. In those cases we should not put app to background. -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::DoHandleForegroundEventL( TInt aEventType ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiAppUi::DoHandleForegroundEventL, event:%d", - aEventType ); - - __ASSERT_ALWAYS( aEventType == KAknFullOrPartialForegroundGained || - aEventType == KAknFullOrPartialForegroundLost || - aEventType == EEventFocusLost || - aEventType == EEventFocusGained, User::Leave( KErrArgument ) ); - - TBool handleEvent( EFalse ); - TBool foreground( - aEventType == KAknFullOrPartialForegroundGained || - aEventType == EEventFocusGained ); - - const TInt windowGroupId = - iCoeEnv->WsSession().GetFocusWindowGroup(); - - MUS_LOG1( "mus: [MUSUI ] focus wgid:%d", windowGroupId ); - - if ( foreground ) - { - iCoeEnv->RootWin().EnableFocusChangeEvents(); - handleEvent = ETrue; - } - else if ( ( windowGroupId != iThisApplicationWgId ) && - ( windowGroupId != iEikonServerWgId ) && - ( windowGroupId != iAknCapServerWgId ) && - ( windowGroupId != iAknNfyServerWgId ) ) - { - iCoeEnv->RootWin().DisableFocusChangeEvents(); - handleEvent = ETrue; - } - else - { - // NOP - } - - if ( handleEvent && iView && foreground != iForeground ) - { - iForeground = foreground; - - CMusUiGeneralView* activatedView = - static_cast( iView ); - - activatedView->DoHandleForegroundEventL( foreground ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::DoHandlerForegroundEventL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiAppUi::FindWindowGroupIdentifiersL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiAppUi::FindWindowGroupIdentifiersL" ); - - // Name of the EIKON server window group. - _LIT( KMusUiEikonServer, "EikonServer" ); - - // Name of the AknCapServer window group. - _LIT( KMusUiAknCapServer, "*akncapserver*" ); - - // Name of the AknNotifierServer window group. - _LIT( KMusUiAknNotifierServer, "*aknnfysrv*" ); - - CEikonEnv& eikEnv = *( iEikonEnv ); - eikEnv.SetSystem( ETrue ); - eikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); - - iThisApplicationWgId = eikEnv.RootWin().Identifier(); - MUS_LOG1( "mus: [MUSUI ] own wgid:%d", iThisApplicationWgId ); - iEikonServerWgId = - eikEnv.WsSession().FindWindowGroupIdentifier( 0, KMusUiEikonServer ); - MUS_LOG1( "mus: [MUSUI ] eikonserv wgid:%d", iEikonServerWgId ); - iAknCapServerWgId = - eikEnv.WsSession().FindWindowGroupIdentifier( 0, KMusUiAknCapServer ); - MUS_LOG1( "mus: [MUSUI ] akncapserv wgid:%d", iAknCapServerWgId ); - iAknNfyServerWgId = - eikEnv.WsSession().FindWindowGroupIdentifier( 0, - KMusUiAknNotifierServer ); - MUS_LOG1( "mus: [MUSUI ] aknnotifserv wgid:%d", iAknNfyServerWgId ); - - eikEnv.RootWin().EnableFocusChangeEvents(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiAppUi::FindWindowGroupIdentifiersL" ); - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp --- a/mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - -#include "musuibackgroundviewcontainer.h" -#include "musuiappui.h" -#include "muslogger.h" // debug logging - -#include -#include -#include -#include // StringLoader -#include -#include -#include -#include - - -// Hidden window group. magic number 32 hiddens window -_LIT( KMusUiBackgroundWindowGroupName,"32MusUiBackground" ); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiBackgroundViewContainer* CMusUiBackgroundViewContainer::NewL( - const TRect& aRect, - TInt aOrdinalPosition ) - { - CMusUiBackgroundViewContainer* self = - new( ELeave )CMusUiBackgroundViewContainer( aOrdinalPosition ); - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( - TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition ) - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::ConstructL( const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::ConstructL()" ); - - RWindowGroup iMyWindowGroup = RWindowGroup( iCoeEnv->WsSession() ); - User::LeaveIfError( iMyWindowGroup.Construct( ( TUint32 )&iMyWindowGroup) ); - - iMyWindowGroup.SetName( KMusUiBackgroundWindowGroupName ); - iMyWindowGroup.SetOrdinalPosition( iOrdinalPosition, ECoeWinPriorityNormal ); - iMyWindowGroup.EnableReceiptOfFocus( EFalse ); - - CreateWindowL(&iMyWindowGroup); - - iGroupIdentifier = iMyWindowGroup.Identifier(); - - iBackGround = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, - aRect, - EFalse ); - - SetRect( aRect ); - - ActivateL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::ConstructL()" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiBackgroundViewContainer::~CMusUiBackgroundViewContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::~CMusUiBackgroundViewContainer()" ); - delete iBackGround; - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::~CMusUiBackgroundViewContainer()" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::RefreshView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::RefreshView()" ); - - DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::RefreshView()" ); - } - - -// ----------------------------------------------------------------------------- -// Set's this group right ordinal position -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::SetOrdinalPosition() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::SetOrdinalPosition(): %d", - iOrdinalPosition ); - MakeVisible( ETrue ); - - iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( iGroupIdentifier, - iOrdinalPosition ); - - DrawNow(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::SetOrdinalPosition()" ); - } - -// ----------------------------------------------------------------------------- -// Set's this group right ordinal position -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::SetOrdinalPosition( TInt aOrdianlPosition) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::SetOrdinalPosition(): %d", - aOrdianlPosition ); - MakeVisible( ETrue ); - - iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( iGroupIdentifier, - aOrdianlPosition ); - - DrawNow(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::SetOrdinalPosition()" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue( TBool aUp ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue(): %d", - aUp ); - if ( aUp ) - { - ++iOrdinalPosition; - } - else - { - --iOrdinalPosition; - } - SetOrdinalPosition(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue()" ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when the view size is changed -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::SizeChanged() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::SizeChanged()" ); - TRect parentRect(Rect()); - if (iBackGround) - { - (static_cast(iBackGround))->SetRect(parentRect); - } - - SetOrdinalPosition(); - //MakeVisible( EFalse ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::SizeChanged()" ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when to retrieve the no. of controls. -// ----------------------------------------------------------------------------- -// -TInt CMusUiBackgroundViewContainer::CountComponentControls() const - { - return 0; // return nbr of controls inside this container - } - - -// ----------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// ----------------------------------------------------------------------------- -// -CCoeControl* CMusUiBackgroundViewContainer::ComponentControl( TInt /*aIndex*/ ) const - { - return NULL; - } - - -// ----------------------------------------------------------------------------- -// Called by framework to redraw the screen area. -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::Draw( const TRect& aRect ) const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBackgroundViewContainer::Draw()" ); - - CWindowGc& gc = SystemGc(); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - if(!AknsDrawUtils::Background( skin, cc,this,gc,aRect,KAknsDrawParamDefault )) - { - MUS_LOG( "mus: [MUSUI ] Skin not valid or not found" ); - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiBackgroundViewContainer::Draw()" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBackgroundViewContainer::HandleControlEventL( - CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) - { - // TODO: Add your control event handler code here - } - - -// ----------------------------------------------------------------------------- -// Called by framework to act on key events if required. -// ----------------------------------------------------------------------------- -// -TKeyResponse CMusUiBackgroundViewContainer::OfferKeyEventL( - const TKeyEvent& /*aKeyEvent*/, - TEventCode /*aType*/ ) - { - return EKeyWasNotConsumed; - } - - -// ----------------------------------------------------------------------------- -// Supply the Mob Object for background skin drawing -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CMusUiBackgroundViewContainer::MopSupplyObject( TTypeUid aId ) - { - if (aId.iUid == MAknsControlContext::ETypeId && iBackGround ) - { - return MAknsControlContext::SupplyMopObject( aId, iBackGround ); - } - return CCoeControl::MopSupplyObject( aId ); - } - - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuibitmapdecoder.cpp --- a/mmsharing/mmshui/src/musuibitmapdecoder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* 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 "musuibitmapdecoder.h" -#include "musuibitmapdecoderobserver.h" -#include "muslogger.h" // debug logging - -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiBitmapDecoder::~CMusUiBitmapDecoder() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBitmapDecoder::~CMusUiBitmapDecoder" ); - Cancel(); - iFs.Close(); - delete iData; - delete iDecoder; - MUS_LOG( "mus: [MUSUI ] <- CMusUiBitmapDecoder::~CMusUiBitmapDecoder" ); - } - - -// ----------------------------------------------------------------------------- -// Symbian two-phase constructor. -// ----------------------------------------------------------------------------- -// -CMusUiBitmapDecoder* CMusUiBitmapDecoder::NewL( - MMusUiBitmapDecoderObserver& aObserver ) - { - CMusUiBitmapDecoder* self = new (ELeave) CMusUiBitmapDecoder( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiBitmapDecoder::CMusUiBitmapDecoder( - MMusUiBitmapDecoderObserver& aObserver ) : - CActive( EPriorityNormal ), - iObserver( aObserver ) - { - // nothing - } - - -// ----------------------------------------------------------------------------- -// Symbian second-phase constructor. -// ----------------------------------------------------------------------------- -// -void CMusUiBitmapDecoder::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBitmapDecoder::ConstructL" ); - User::LeaveIfError( iFs.Connect() ); - //delete iData; - iData = NULL; - //delete iDecoder; - iDecoder = NULL; - CActiveScheduler::Add( this ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBitmapDecoder::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBitmapDecoder::ConvertL( HBufC8* aData, CFbsBitmap* aBitmap ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBitmapDecoder::ConvertL" ); - - if ( IsActive() ) - { - Cancel(); - } - - iData = aData->AllocL(); - iBitmap = aBitmap; - - delete iDecoder; - iDecoder = NULL; - iDecoder = CImageDecoder::DataNewL( iFs, *iData ); - - iBitmap->Create( iDecoder->FrameInfo().iFrameCoordsInPixels.Size(), - iDecoder->FrameInfo().iFrameDisplayMode ); - - iDecoder->Convert( &iStatus, *iBitmap, 0 ); - SetActive(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiBitmapDecoder::ConvertL" ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBitmapDecoder::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBitmapDecoder::DoCancel" ); - iDecoder->Cancel(); - Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiBitmapDecoder::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiBitmapDecoder::RunL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiBitmapDecoder::RunL" ); - if (iStatus == KErrNone) - { - iObserver.UpdateBitmap( iBitmap ); - } - else - { - MUS_LOG1( "mus: [MUSUI ] CMusUiBitmapDecoder::RunL: iStatus: [%d]", - iStatus.Int() ); - User::Leave( iStatus.Int() ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiBitmapDecoder::RunL" ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuicallbackservice.cpp --- a/mmsharing/mmshui/src/musuicallbackservice.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* 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: Asynchronous callback service provider. -* -*/ - - - -#include "musuicallbackservice.h" -#include "musuicallbackobserver.h" // callback observer interface -#include "muslogger.h" - - -// ----------------------------------------------------------------------------- -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CMusUiCallbackService* CMusUiCallbackService::NewL( - MMusUiCallbackObserver& aCallbackObserver ) - { - CMusUiCallbackService* self = - new ( ELeave ) CMusUiCallbackService( - aCallbackObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// Destructor. -// ----------------------------------------------------------------------------- -// -CMusUiCallbackService::~CMusUiCallbackService() - { - // Cancel active object - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::~CMusUiCallbackService" ); - Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::~CMusUiCallbackService" ); - } - - -// ----------------------------------------------------------------------------- -// C++ default constructor. -// ----------------------------------------------------------------------------- -// -CMusUiCallbackService::CMusUiCallbackService( - MMusUiCallbackObserver& aCallbackObserver ) - : CActive( EPriorityStandard ), - iCallbackObserver( aCallbackObserver ), - iEventId( EMusUiAsyncUninitialized ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::ConstructL() - { - } - - -// ----------------------------------------------------------------------------- -// Buffer a request to trigger an event. -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::AsyncEventL( TMusUiAsyncEvent aEventId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::AsyncEventL" ); - iEventId = aEventId; - Activate(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::AsyncEventL" ); - } - - -// ----------------------------------------------------------------------------- -// Cancels the active request. -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::Cancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::Cancel" ); - CActive::Cancel(); - iStatus = NULL; - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::Cancel" ); - } - -// ----------------------------------------------------------------------------- -// Check what event is currently pending. -// ----------------------------------------------------------------------------- -// -TMusUiAsyncEvent CMusUiCallbackService::CurrentEvent() const - { - if ( IsActive() ) - { - return iEventId; - } - return EMusUiAsyncUninitialized; - } - -// ----------------------------------------------------------------------------- -// From CActive. Called when a request completes. -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::RunL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::RunL" ); - if ( iEventId ) - { - // Copy the id from member to local so the member can be cleared. - TMusUiAsyncEvent eventId = iEventId; - iEventId = EMusUiAsyncUninitialized; - // Issue the call to the observer interface. - iCallbackObserver.HandleAsyncEventL( eventId ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::RunL returns" ); - return; - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::RunL" ); - } - - -// ----------------------------------------------------------------------------- -// From CActive. Called when a leave occurres in RunL. -// ----------------------------------------------------------------------------- -// -TInt CMusUiCallbackService::RunError( TInt aError ) - { - MUS_LOG1( "mus: [MUSUI ] CMusUiCallbackService::RunError [%d]", - aError ); - - return iCallbackObserver.HandleAsyncError( aError ); - } - - -// ----------------------------------------------------------------------------- -// From CActive. Called when a request is cancelled. -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::DoCancel" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// Activate the object. -// ----------------------------------------------------------------------------- -// -void CMusUiCallbackService::Activate() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiCallbackService::Activate" ); - // Call SetActive() so RunL() will be called by the active scheduler - if ( IsActive() ) - { - Cancel(); - } - SetPriority( EPriorityHigh ); - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiCallbackService::Activate" ); - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiclipsharingcontroller.cpp --- a/mmsharing/mmshui/src/musuiclipsharingcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1166 +0,0 @@ -/* -* 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: Application's UI class. -* -*/ - - - -#include "musuiclipsharingcontroller.h" -#include "musuicallbackservice.h" -#include "musuieventobserver.h" -#include "musuisharingobserver.h" -#include "musuisendobserver.h" -#include "musuiclipsharingobserver.h" -#include "musuidialogutil.h" -#include "musengclipsession.h" -#include "mussettings.h" -#include "mussettingskeys.h" -#include "musuiresourcehandler.h" -#include "musui.hrh" -#include "muslogger.h" // debug logging -#include "musuiactivetimer.h" -#include "musuigeneralview.h" - -#include -#include -#include - -#include -#include - -// CONSTANTS -const TInt KMusTimeToCloseAfterClipEndedStandard = 60 * 1000000; // 60 seconds -const TInt KMusTimeToCloseAfterClipEndedOpVariant = 1 * 1000000; // 1 second - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiClipSharingController* CMusUiClipSharingController::NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiClipSharingObserver& aClipObserver, - const TRect& aRect ) - { - CMusUiClipSharingController* self = - new( ELeave ) CMusUiClipSharingController( aEventObserver, - aSharingObserver, - aSendObserver, - aClipObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiClipSharingController::~CMusUiClipSharingController() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::~CMusUiClipSharingController" ); - delete iCloseTimer; - DeleteEngineSession(); - delete iFileName; - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::~CMusUiClipSharingController" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiClipSharingController::CMusUiClipSharingController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiClipSharingObserver& aClipObserver ) - :CMusUiSendController( aEventObserver, aSharingObserver, aSendObserver ), - iClipObserver( aClipObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::ConstructL( const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::ConstructL" ); - - CMusUiSendController::ConstructL(); // Base class construction - - iRect = aRect; - iSession = CMusEngClipSession::NewL( iRect, - *this, - *this, - *this, - iSipProfileId ); - iSession->SetAudioRoutingObserver( this ); - - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - } - - if ( iVideoCodec && iVideoCodec->Length() > 0 ) - { - iSession->SetSupportedVideoCodecListL( *iVideoCodec ); - } - - iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery ); - - iCloseTimer = CMusUiActiveTimer::NewL( this ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::HandleAsyncEventL" ); - switch ( aEventId ) - { - case EMusUiAsyncStartMediaGallery: - { - iTranscode = EFalse; - iTranscodingGoing = EFalse; - - if ( !iSession ) - { - iSession = CMusEngClipSession::NewL( iRect, - *this, - *this, - *this, - iSipProfileId ); - iSession->SetAudioRoutingObserver( this ); - } - - // Do fetching guarded. If registration completes during fetching, - // there is no need to do anything. - iFileFetchingOngoing = ETrue; - iClipObserver.RunFetchDialogL(); - iFileFetchingOngoing = EFalse; - - TRAPD( error, - iSession->SetClipL( *iFileName ) ) - MUS_LOG_TDESC( "mus: [MUSUI ] File name: ", - iFileName->Des() ) - if ( error == KErrNone) - { - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - } - iClipEnded = EFalse; - StartInvitationL(); - } - else if ( error == KErrPermissionDenied ) - { - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_VIEW_DRM_INFO_SEND_FORBID ); - DeleteEngineSession(); - delete iFileName; - iFileName = NULL; - iSession = CMusEngClipSession::NewL( iRect, - *this, - *this, - *this, - iSipProfileId ); - iSession->SetAudioRoutingObserver( this ); - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - } - iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery ); - } - else - { - HandleExitL(); - } - - break; - } - case EMusUiAsyncStartTranscoding: - { - // Parse Target Filename for the transcoding result - // and start transcoding: - //iSession->TranscodeL( VideoFileNameL() ); - // Show progress dialog: - //iObserver->ShowTranscodingProgressDialogL(); - iTranscodingGoing = ETrue; - break; - } - - default: - { - // Not clip specific, let the base class handle - CMusUiSendController::HandleAsyncEventL( aEventId ); - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::HandleAsyncEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::DeleteEngineSession() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::DeleteEngineSession" ); - - CMusUiSendController::DeleteEngineSession(); - - // Cancel transcoding - if ( iSession && iTranscodingGoing ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::DeleteEngineSession:\ - Canceling transcoding..." ); - DismissWaitDialog(); - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ); - iSession->CancelTranscodeL() ); - } - - delete iSession; - iSession = NULL; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::DeleteEngineSession" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession* CMusUiClipSharingController::EngineOutSession() - { - return iSession; // Clip session is CMusEngMceOutSession - } - - -// ----------------------------------------------------------------------------- -// Handles status changes specific to sending sharing types. -// Calls base class version for status changes that are not sending specific. -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::HandleChangedStatusL( - TMusAvailabilityStatus aStatus ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::HandleChangedStatusL" ) - - switch( aStatus ) - { - case EMultimediaSharingAvailable: - { - MUS_LOG( "mus: [MUSUI ] EMultimediaSharingAvailable" ) - - if ( iSipRegistrationPending ) - { - iSipRegistrationPending = EFalse; - - // If fecth dialog is still open, there is no need to do anything - if ( !iFileFetchingOngoing ) - { - iSipRegistrationPending = EFalse; - // Set callback service, Call StartInvitationL when wait dialog dismissed - TRAPD( err, iSharingObserver.SetWaitDialogCallbackL( - &iWaitDialogCallback ) ); - // Dismiss pending wait note - iSharingObserver.DismissWaitDialogL(); - if ( err == KErrNotReady ) - { - StartInvitationL(); - } - } - } - break; - } - default: - { - // Not clip specific, let the base class handle - CMusUiSendController::HandleChangedStatusL( aStatus ); - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::HandleChangedStatusL" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::InviteL( const TDesC& aRecipient ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiClipSharingController::InviteL:", - aRecipient ); - - // Registration must not be pending in this phase - __ASSERT_ALWAYS( !iSipRegistrationPending, - iEventObserver.HandleError( KErrNotReady ) ); - - delete iAddress; - iAddress = NULL; - iAddress = aRecipient.AllocL(); - - - TRAPD( err, iSession->InviteL( aRecipient ) ); - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::InviteL: After TRAPD" ); - - // If address is in wrong format, Manual Address Entry Dialog - // is displayed - if ( err != KErrNone ) - { - DismissWaitDialog(); - MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_INVITE_ERROR ); - if ( ( ++iTriedInvitations < 2 ) && ( err == KErrArgument ) ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: iTriedInvitations < 2" ); - iManualAddressTyped = ETrue; - iResourceHandler->RequestKeypadL( ETrue ); - - // If the address has to be queried again...: - iTranscode = EFalse; - - MUS_LOG_TDESC( "mus: [MUSUI ] CMusUiClipSharingController::InviteL: ", - iFileName->Des() ) - - iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); - return; - } - else - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: ++iTriedInvitations > 1" ); - DeleteEngineSession(); - HandleExitL(); - return; - } - } - - - if( iTranscode ) - { - MUS_LOG( "mus: [MUSUI ] Starting transcode..." ); - iTranscode = EFalse; - // Show progress dialog: - iClipObserver.ShowTranscodingProgressDialogL(); - // Start transcoding - iTranscodingGoing = ETrue; - - SetFileNameL( VideoFileNameL() ); - TRAPD( err, iSession->TranscodeL( *iFileName ) ); - - if ( err != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] Transcoding failed: %d", err ); - iTranscodingGoing = EFalse; - if ( err == KErrNotFound ) // No Video Editor Engine - { - DismissWaitDialog(); - MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_TRANSCODING_NOT_SUPPORTED ); - DeleteEngineSession(); - iVideoToBeSaved = EFalse; - HandleExitL(); - } - else - { - // Unable to convert clip, if transc. leaves. - // After note return back to the media gallery. - TranscodingFailed(); - } - return; - } - } - else - { - SetConnectionInitialized( ETrue ); - ShowInvitingWaitDialogL(); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::InviteL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::HandleSliderValueChangeL( TInt aNewLevel ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingController::HandleSliderValueChangeL(%d)", - aNewLevel ) - - __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); - __ASSERT_ALWAYS( iConnectionEstablished, User::Leave( KErrNotReady ) ); - - iSession->SetPositionL( TTimeIntervalSeconds( aNewLevel ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::HandleSliderValueChangeL" ) - } - - - -void CMusUiClipSharingController::OfferToolbarEventL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingController::OfferToolbarEventL [%d]", - aCommand ); - - switch ( aCommand ) - { - case EMusuiCmdToolbarPause: - { - HandleCommandL( EMusuiCmdViewPause ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPause, - EMusuiCmdToolbarUnPause, - ETrue ); - break; - } - case EMusuiCmdToolbarUnPause: - { - HandleCommandL( EMusuiCmdViewContinue ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnPause, - EMusuiCmdToolbarPause, - ETrue ); - break; - } - case EMusuiCmdToolbarFFRev: - { - iToolbarFFRevSelected = !iToolbarFFRevSelected; - iClipObserver.SetDurationValue( iSession->DurationL().Int() ); - if ( iToolbarFFRevSelected ) - { - iWasPlayingBeforeWinding = iSession->IsPlayingL(); - PauseL(); - } - else - { - StopWindingL(); - if ( iWasPlayingBeforeWinding ) - { - PlayL(); - } - } -// iClipObserver.SetDurationVisible(); - iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarFFRev ); - break; - } - default: // Not clip specific, let the base class handle - { - CMusUiEventController::OfferToolbarEventL( aCommand ); - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::OfferToolbarEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::HandleCommandL(TInt aCommand) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::HandleCommandL" ); - - __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); - - switch ( aCommand ) - { - case EMusuiCmdViewPause: - { - PauseL(); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - break; - } - case EMusuiCmdViewContinue: - { - PlayL(); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPlay ); - break; - } - - case EMusuiCmdViewReplay: - { - if( !MUS_NO_TOOLBAR ) - { - if (!AknLayoutUtils::PenEnabled()) - { - iEventObserver.SetToolbarVisibility( ETrue ); - } - - if ( ClipEnded() ) - { - iEventObserver.SetToolbarVisibility( ETrue ); - // Simulate press of play in toolbar - OfferToolbarEventL( EMusuiCmdToolbarUnPause ); - } - } - break; - } - - case EMusuiCmdViewShareVideo: - { - PauseL(); - // TODO: Change to video sharing - break; - } - case EMusuiCmdViewShareImage: - { - PauseL(); - // TODO: Change to image sharing - break; - } - case EMusuiCmdViewShareLive: - { - // TODO: Change to live sharing - break; - } - - case EMusuiCmdViewAudioNormal: - { - if( !MUS_NO_TOOLBAR ) - { - if (!AknLayoutUtils::PenEnabled()) - { - iEventObserver.SetToolbarVisibility( ETrue ); - } - } - iSession->UnmuteL(); - break; - } - case EMusuiCmdViewAudioMute: - { - if (!AknLayoutUtils::PenEnabled()) - { - iEventObserver.SetToolbarVisibility( ETrue ); - } - - iSession->MuteL(); - break; - } - case EMusuiCmdViewFastForward: - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastForward" ); - if ( DoFastForwardingL( ETrue ) ) - { - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconForward ); - iClipObserver.SetPositionValueL( iSession->PositionL().Int() ); - //iClipObserver.SetDurationVisible(); - } - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastForward END" ); - break; - } - case EMusuiCmdViewFastReverse: - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastReverse" ); - if ( DoFastRewindingL( ETrue ) ) - { - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRew ); - iClipObserver.SetPositionValueL( iSession->PositionL().Int() ); - //iClipObserver.SetDurationVisible(); - } - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastReverse END" ); - break; - } - case EMusuiCmdViewFastForwardEnd: - { - if ( DoFastForwardingL( EFalse ) ) - { - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - PauseL(); - } - break; - } - case EMusuiCmdViewFastReverseEnd: - { - if ( DoFastRewindingL( EFalse ) ) - { - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - PauseL(); - } - break; - } - default: - { - // Try more general handling - CMusUiEventController::HandleCommandL( aCommand ); - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::HandleCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SetFileNameL( const TDesC& aFileName ) - { - iFileName = aFileName.AllocL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::ClipEnded() - { - return iClipEnded; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::ClipMutedL() - { - return iSession->IsMutedL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::ClipContainsAudioL() - { - if ( !iConnectionInitialized || !iSession ) - { - return EFalse; // We cannot be sure yet - } - - return iSession->ContainsAudioL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::CancelTranscodingL() - { - if ( iSession && iTranscodingGoing ) - { - iTranscodingGoing = EFalse; - iSession->CancelTranscodeL(); - } - iVideoToBeSaved = EFalse; - HandleExitL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::StopWindingL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::StopWindingL" ); - - if ( DoFastForwardingL( EFalse ) || DoFastRewindingL( EFalse ) ) - { - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::StopWindingL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::ToolbarFFRevSelected() - { - return iToolbarFFRevSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingProgressedL( TInt aPercentage ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingProgressedL ( %d )", aPercentage ); - if ( aPercentage < KMusOneHundredPercent ) - { - iTranscodingGoing = ETrue; - iClipObserver.UpdateClipTranscodingPercentageL( aPercentage ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingProgressedL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingCompletedInitL() - { - MUS_LOG( - "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingCompletedInitL" ); - if ( iTranscodingGoing ) - { - iVideoToBeSaved = ETrue; - iTranscodingGoing = EFalse; - iClipObserver.CancelTranscodingDialogL(); - MusUiDialogUtil::ShowInformationDialogL( R_MUS_VIEW_NOTE_TRANSCODING_COMPLETE ); - } - MUS_LOG( - "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingCompletedInitL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingCompletedFinalizeL() - { - MUS_LOG( - "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingCompletedFinalizeL" ); - SetConnectionInitialized( ETrue ); - if ( !iTranscodingGoing ) - { - ShowInvitingWaitDialogL(); - } - MUS_LOG( - "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingCompletedFinalizeL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiClipSharingController::FormattedDurationString( - const TTimeIntervalSeconds& aDurationSeconds, - const TTimeIntervalSeconds& aPositionSeconds ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::FormattedDurationString" ); - _LIT( KDurationAndPositionSeparator, "/" ); - - iDurationStringBuffer.SetLength( 0 ); - TLocale locale; - _LIT( KZeroSymbol, "0" ); - - TInt durationMinutes( 0 ); - TInt durationSeconds( aDurationSeconds.Int() ); - if ( aDurationSeconds.Int() > ( KMusOneMinuteInSeconds - 1 ) ) - { - durationMinutes = (int)( aDurationSeconds.Int() / KMusOneMinuteInSeconds ); - durationSeconds = durationSeconds - ( durationMinutes * KMusOneMinuteInSeconds ); - } - - iDurationStringBuffer.AppendNum( durationMinutes ); - iDurationStringBuffer.Append( locale.TimeSeparator( KMusLocaleMinutesAndSecondsSeparator ) ); - if ( durationSeconds < KMusNumberValueTen ) - { - iDurationStringBuffer.Append( KZeroSymbol ); - } - iDurationStringBuffer.AppendNum( durationSeconds ); - iDurationStringBuffer.Append( KDurationAndPositionSeparator ); - - TInt positionMinutes( 0 ); - TInt positionSeconds( aPositionSeconds.Int() ); - if ( aPositionSeconds.Int() > ( KMusOneMinuteInSeconds - 1 ) ) - { - positionMinutes = (int)( aPositionSeconds.Int() / KMusOneMinuteInSeconds ); - positionSeconds = positionSeconds - ( positionMinutes * KMusOneMinuteInSeconds ); - } - - iDurationStringBuffer.AppendNum( positionMinutes ); - iDurationStringBuffer.Append( locale.TimeSeparator( KMusLocaleMinutesAndSecondsSeparator ) ); - if ( positionSeconds < KMusNumberValueTen ) - { - iDurationStringBuffer.Append( KZeroSymbol ); - } - iDurationStringBuffer.AppendNum( positionSeconds ); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::FormattedDurationString" ); - return iDurationStringBuffer; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::EndOfClip() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::EndOfClip" ); - iClipEnded = ETrue; - - TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconStop ) ); - if(!MUS_NO_TOOLBAR) - { - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPause, - EMusuiCmdToolbarUnPause, - ETrue ); - } - iCloseTimer->Cancel(); - iCloseTimer->After( iOperatorSpecificFunctionality ? - KMusTimeToCloseAfterClipEndedOpVariant : - KMusTimeToCloseAfterClipEndedStandard ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::EndOfClip" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingNeeded() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingNeeded" ); - iTranscode = ETrue; - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingNeeded" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingProgressed( TInt aPercentage ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingProgressed %d", - aPercentage ); - TRAP_IGNORE( TranscodingProgressedL( aPercentage ) ) - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingProgressed" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingCompletedInit() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingCompleted" ); - TRAPD( error, TranscodingCompletedInitL() ); - if ( error != KErrNone ) - { - HandleError( error ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingCompleted" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingCompletedFinalize() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingCompleted" ); - TRAPD( error, TranscodingCompletedFinalizeL() ); - if ( error != KErrNone ) - { - HandleError( error ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingCompleted" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TranscodingFailed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::TranscodingFailed" ); - iTranscodingGoing = EFalse; - DismissWaitDialog(); - TRAP_IGNORE( iClipObserver.CancelTranscodingDialogL(); - MusUiDialogUtil::ShowGlobalErrorModalDialogL( - R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) ); - DeleteEngineSession(); - delete iFileName; - iFileName = NULL; - TRAPD( error, - iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery ) ); - if ( error != KErrNone ) - { - HandleError( error ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::TranscodingFailed" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionRecipientNotFound() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionRecipientNotFound [%d]", iTriedInvitations ); - - // If the address has to be queried again...: - iTranscode = EFalse; - - CMusUiSendController::SessionRecipientNotFound(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionRecipientNotFound" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionTerminated() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionTerminated" ); - DismissWaitDialog(); - if ( iTranscodingGoing ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionTerminated" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionConnectionLost() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionConnectionLost" ); - DismissWaitDialog(); - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_LOST ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionConnectionLost" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionFailed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionFailed" ); - DismissWaitDialog(); - if ( iTranscodingGoing ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionFailed" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::StreamIdle() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::StreamIdle" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::StreamIdle" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::StreamStreaming() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::StreamStreaming" ); - TRAPD( error, StreamStreamingL() ); - if ( error != KErrNone ) - { - iEventObserver.HandleError( error ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::StreamStreaming" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionTimeChanged( - const TTimeIntervalSeconds& aSeconds ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionTimeChanged" ); - TRAP_IGNORE( SessionTimeChangedL( aSeconds ) ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionTimeChanged" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::InactivityTimeout() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::InactivityTimeout" ); - DismissWaitDialog(); - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::InactivityTimeout" ); - } - - -// ----------------------------------------------------------------------------- -// Called when predefined time elapsed -// after the clip had reached the end -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::TimerComplete( CMusUiActiveTimer* /*aTimer*/ ) - { - MUS_LOG( "mus: [MUSUI ] Close time elapsed from clip ending => \ - closing session" ); - TRAP_IGNORE( HandleExitL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::StreamStreamingL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::StreamStreamingL" ); - - if ( ConnectionEstablished() ) - { - iClipEnded = EFalse; - iCloseTimer->Cancel(); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPlay ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::StreamStreamingL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionTimeChangedL( const TTimeIntervalSeconds& aSeconds ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionTimeChangedL" ); - if ( aSeconds.Int() > -1 ) - { - TTimeIntervalSeconds clipDuration = iSession->DurationL(); - TTimeIntervalSeconds clipPosition = iSession->PositionL(); - - iSharingObserver.UpdateSessionTime( SessionTimeFormatted( aSeconds ) ); - iClipObserver.UpdateClipPositionL( clipPosition.Int(), - FormattedDurationString( - clipPosition, - clipDuration ) ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionTimeChangedL" ); - } - - -// ----------------------------------------------------------------------------- -// CMusUiClipSharingController::SessionEstablished() -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingController::SessionEstablished() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::SessionEstablished" ); - - TRAPD( error, iResourceHandler->RequestVideoPlayerL( ETrue ) ); - if ( error != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] RequestVideoPlayerL leave code: %d", error ) - } - - // Duration setting visible - TRAP( error, iClipObserver.SetDurationValue( iSession->DurationL().Int() ) ) - if ( error != KErrNone ) - { - HandleError( error ); - } - iClipObserver.SetDurationVisible(); - - // General handling - CMusUiSendController::SessionEstablished(); // Base class handling - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::SessionEstablished" ); - } - - -// ----------------------------------------------------------------------------- -// CMusUiClipSharingController::DoFastForwardingL() -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::DoFastForwardingL( TBool aUseWinding ) - { - if( iFastForward ^ aUseWinding ) - { - iSession->FastForwardL( aUseWinding ); - iFastForward = aUseWinding; - return ETrue; - } - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// CMusUiClipSharingController::DoFastRewindingL() -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingController::DoFastRewindingL( TBool aUseWinding ) - { - if( iFastRewind ^ aUseWinding ) - { - iSession->FastRewindL( aUseWinding ); - iFastRewind = aUseWinding; - return ETrue; - } - return EFalse; - } - - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiclipsharingview.cpp --- a/mmsharing/mmshui/src/musuiclipsharingview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,653 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#include "musuiclipsharingview.h" -#include "musuiclipsharingviewcontainer.h" -#include "musuibackgroundviewcontainer.h" -#include "musuiclipsharingcontroller.h" -#include "musuiactivitymanger.h" -#include "musuiappui.h" -#include "musuistatuspanehandler.h" -#include "musui.hrh" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include -#include - -#include -#include -#include -#include -#include - - -const TInt KMusUiContainerHeight = 50; -const TInt KDefaultResolutionHeight = 640; - -// ----------------------------------------------------------------------------- -// EPOC two-phased constructor -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::ConstructL" ); - - CMusUiSendView::ConstructL(); - - Toolbar()->SetToolbarObserver( this ); - Toolbar()->UpdateBackground(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiClipSharingView::~CMusUiClipSharingView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::~CMusUiClipSharingView" ); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - } - delete iContainer; - - delete iController; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::~CMusUiClipSharingView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TUid CMusUiClipSharingView::Id() const - { - return KMusUidClipSharingView; - } - -// ----------------------------------------------------------------------------- -// From MEikMenuObserver, Called by framework before constructing menupane -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DynInitMenuPaneL" ); - - - // Base class initiated initialization first - CMusUiGeneralView::DynInitMenuPaneL( aResourceId, aMenuPane ); - - if(! MUS_NO_TOOLBAR ) - { - SetInitialFocusedItemL(); - } - - if ( aResourceId == R_MUSUI_VIEW_MENU ) - { - - // Delete items not related to clip sharing: - aMenuPane->DeleteMenuItem( EMusuiCmdRecord ); - aMenuPane->DeleteMenuItem( EMusuiCmdStopRecording ); - - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarZoom ); - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewZoom ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewFullScreen ); - - // Delete EMusuiCmdViewAudioNormal or EMusuiCmdViewAudioMute - // depending on the audio state of the clip: - if ( iController->ClipContainsAudioL() ) - { - aMenuPane->DeleteMenuItem( iController->ClipMutedL() ? - EMusuiCmdViewAudioMute : - EMusuiCmdViewAudioNormal ); - } - else - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioMute ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioNormal ); - } - - // Delete "Replay" item, if the end of the clip not reached: - if ( !iController->ClipEnded() ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewReplay ); - } - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DynInitMenuPaneL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::HandleToolbarCommandL( TInt aCommand ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::HandleToolbarCommandL" ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - switch ( aCommand ) - { - case EKeyLeftArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastReverse : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyRightArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastForward : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyUpArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastForward : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyDownArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - iController->ToolbarFFRevSelected() ? EMusuiCmdViewFastReverse : - EMusUiCmdToolbarLastIndex ); - break; - } - case EMusuiCmdViewVolumeDown: - { - HandleCommandL( EMusuiCmdViewVolumeDown ); - break; - } - case EMusuiCmdViewVolumeUp: - { - HandleCommandL( EMusuiCmdViewVolumeUp ); - break; - } - default: - { - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::HandleToolbarCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::HandleKeyUpEvent( TInt /*aKeyCode*/ ) - { - TRAP_IGNORE( iController->StopWindingL() ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::SetInitialFocusedItemL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::SetInitialFocusedItemL" ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - if ( iOperatorSpecificFunctionality && !AknLayoutUtils::PenEnabled() ) - { - MUS_LOG( "Focus changed in OPERATOR mode !!!!!!!!!!!!!" ); - - if ( !( iController->DeviceHasDedicatedVolumeKeys() ) ) - { - Toolbar()->SetFocusedItemL( EMusuiCmdToolbarVolume ); - } - else - { - - Toolbar()->SetFocusedItemL( EventControllerL().IsMicMutedL() ? - EMusuiCmdToolbarUnmute : - EMusuiCmdToolbarMute ); - } - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::SetInitialFocusedItemL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::DynInitToolbarL( TInt aResourceId, - CAknToolbar* aToolbar ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DynInitToolbarL" ); - - // Items to be removed in Clip Sharing View: - - - if (!AknLayoutUtils::PenEnabled())//(aResourceId == R_MUS_TOOLBAR_NONTOUCH)// - { - if ( iController->DeviceHasDedicatedVolumeKeys() ) - { - aToolbar->RemoveItem( EMusuiCmdToolbarVolume ); - } - else - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarVolume ); - } - - aToolbar->RemoveItem( EMusuiCmdToolbarZoom ); - aToolbar->RemoveItem( EMusuiCmdToolbarBrightness ); - } - - Toolbar()->RemoveItem( EMusuiCmdToolbarPauseLive ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPauseLive ); - Toolbar()->RemoveItem( EMusuiCmdToolbarFullScreen ); - - - if ( iOperatorSpecificFunctionality ) - { - // Remove pause/unpause functionality in operator variant case - Toolbar()->RemoveItem( EMusuiCmdToolbarPause ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPause ); - - if ( aToolbar->FocusedItem() == KErrNotFound && - !AknLayoutUtils::PenEnabled() ) - { - aToolbar->SetFocusedItemL( EventControllerL().IsMicMutedL() ? - EMusuiCmdToolbarUnmute : - EMusuiCmdToolbarMute ); - } - - } - else - { - // Toggled items to be hidden: - Toolbar()->HideItem( iPauseSelected ? - EMusuiCmdToolbarPause : - EMusuiCmdToolbarUnPause, - ETrue, - ETrue ); - if ( aToolbar->FocusedItem() == KErrNotFound && - !AknLayoutUtils::PenEnabled() ) - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarPause ); - } - } - - // Last generic base class functionality - CMusUiGeneralView::DynInitToolbarL( aResourceId, aToolbar ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DynInitToolbarL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::RunFetchDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::RunFetchDialogL" ); - iContainer->RunFetchDialogL(); - if ( iContainer->FileSelected() ) - { - iController->SetFileNameL( iContainer->FetchedFileName() ); - RefreshView(); - } - else - { - MusAppUi()->HandleExit(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::RunFetchDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::ShowTranscodingProgressDialogL() - { - iContainer->ShowTranscodingProgressDialogL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::UpdateClipTranscodingPercentageL( TInt aPercetage ) - { - iContainer->UpdateClipTranscodingPercentageL( aPercetage ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::CancelTranscodingDialogL() - { - iContainer->CancelTranscodingL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::UpdateClipPositionL( - TInt aPositionInSeconds, - const TDesC& aFormattedPosition ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiClipSharingView::UpdateClipPositionL: ", - aFormattedPosition ); - - MusAppUi()->MusStatusPane()->SetRightLabelL( aFormattedPosition ); - iContainer->SetPositionValueL( aPositionInSeconds ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::UpdateClipPositionL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::SetDurationValue( TInt aDurationValue ) - { - iContainer->SetDurationValue( aDurationValue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::SetPositionValueL( TInt aDurationValue ) - { - iContainer->SetPositionValueL( aDurationValue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::SetDurationVisible() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetDurationVisible: %d", - iToolbarItemSelected ); - if ( !iToolbarItemSelected ) - { - iContainer->SetDurationIndicatorVisible( ETrue ); - } - else - { - iContainer->SetDurationIndicatorVisible( EFalse ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetDurationVisible" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingView::ReplaceToolbarCommand: %d", - aOldCommand ); - switch ( aOldCommand ) - { - case EMusuiCmdToolbarPause: - { - iPauseSelected = ETrue; - break; - } - case EMusuiCmdToolbarUnPause: - { - iPauseSelected = EFalse; - break; - } - default: - { - break; - } - - } - - // Call base class version for generic part - - CMusUiGeneralView::ReplaceToolbarCommand( aOldCommand, - aNewCommand, - aSetNewCommandFocused ); - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiClipSharingView::ReplaceToolbarCommand: %d", - aOldCommand ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::RefreshView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::RefreshView" ); - - - if ( iContainer ) - { - TInt height = MusAppUi()->ApplicationRect().Height(); - MUS_LOG1( "mus: [MUSUI ] -> application rect height: %d", height ); - TInt containerHeight = (KMusUiContainerHeight * height) / KDefaultResolutionHeight; - - MUS_LOG1( "mus: [MUSUI ] -> container rect height: %d", containerHeight ); - TRect containerRect( - ClientRect().iTl.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() - - containerHeight,//KMusUiContainerHeight, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if (!AknLayoutUtils::PenEnabled()) - { - containerRect = TRect( - ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iTl.iY + containerHeight ); - } - iContainer->SetRect( containerRect ); - - if ( iController ) - { - - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() - - iContainer->Size().iHeight ); - - if (!AknLayoutUtils::PenEnabled()) - { - TInt dy = iContainer->Size().iHeight; - videoRect.Move(0, dy); - } - iController->SetRect( videoRect ); - - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::RefreshView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::CancelTranscodingL() - { - if ( iController ) - { - iController->CancelTranscodingL(); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendController* CMusUiClipSharingView::SendController() const - { - return iController; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendViewContainer* CMusUiClipSharingView::SendContainer() const - { - return iContainer; - } - - -// ----------------------------------------------------------------------------- -// From CAknView, Gets called from framework when activating this view -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DoActivateL" ); - - // Base class activation first - CMusUiSendView::DoActivateL( aPrevViewId, - aCustomMessageId, - aCustomMessage ); - - TInt height = MusAppUi()->ApplicationRect().Height(); - MUS_LOG1( "mus: [MUSUI ] -> application rect height: %d", height ); - TInt containerHeight = (KMusUiContainerHeight * height) / KDefaultResolutionHeight; - - MUS_LOG1( "mus: [MUSUI ] -> container rect height: %d", containerHeight ); - TRect containerRect( - ClientRect().iTl.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() - - containerHeight,//KMusUiContainerHeight, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if (!AknLayoutUtils::PenEnabled()) - { - containerRect = TRect( - ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iTl.iY + containerHeight ); - } - - if ( !iContainer ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingView::DoActivateL: !iContainer" ); - iContainer = new ( ELeave ) CMusUiClipSharingViewContainer(); - iContainer->SetMopParent( this ); - iContainer->ConstructL( this, containerRect ); - AppUi()->AddToViewStackL( *this, iContainer ); - } - - /* Increase the ordinal position of background container - * So that other control will be drawn first. - */ - UpdateBackgroundOrdinalPosition( ETrue ); - - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() - - iContainer->Size().iHeight ); - - if (!AknLayoutUtils::PenEnabled()) - { - TInt dy = iContainer->Size().iHeight; - videoRect.Move(0, dy); - } - if ( !iController ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingView::DoActivateL: !iController" ); - iController = CMusUiClipSharingController::NewL( *MusAppUi(), - *this, - *this, - *this, - videoRect ); - } - - iContainer->SetController( iController ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DoActivateL" ); - } - - -// ----------------------------------------------------------------------------- -// From AknView, Gets called from framework when deactivating this view -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingView::DoDeactivate() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingView::DoDeactivate" ); - - CMusUiSendView::DoDeactivate(); // Base class deactivation first - - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingView::DoDeactivate" ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp --- a/mmsharing/mmshui/src/musuiclipsharingviewcontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,408 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuidefinitions.h" -#include "musuiclipsharingviewcontainer.h" -#include "musuieventcontroller.h" -#include "musuilevelindicator.h" -#include "musuiclipsharingview.h" -#include "musuiappui.h" -#include "musuidialogutil.h" -#include "musui.hrh" -#include "muslogger.h" // debug logging -#include "mussettings.h" -#include - - -#include -#include -#include // CEikProgressInfo -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::ConstructL( CMusUiGeneralView* aView, - const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::ConstructL" ); - - CMusUiSendViewContainer::ConstructL( aView, - aRect, - EAknOrientationHorizontal ); - // check if operator specific functionality is needed - iOperatorSpecificFunctionality = - ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EOperatorSpecific ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiClipSharingViewContainer::~CMusUiClipSharingViewContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::~CMusUiClipSharingViewContainer" ); - - delete iFileName; - - TRAP_IGNORE( CancelTranscodingL() ); - - if ( iTranscodingDialog ) - { - TRAP_IGNORE( iTranscodingDialog->ProcessFinishedL() ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::~CMusUiClipSharingViewContainer" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::ShowTranscodingProgressDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::ShowTranscodingProgressDialogL" ); - iTranscodingOngoing = ETrue; - HBufC* transcodText; - iTranscodingDialog = - new ( ELeave ) CAknProgressDialog( - ( reinterpret_cast( &iTranscodingDialog ) ) ); - - iTranscodingDialog->SetCallback( this ); - transcodText = iEikonEnv->AllocReadResourceLC( - R_MUS_PROGRESS_NOTE_CONVERTING_CLIP ); - iTranscodingDialog->SetCurrentLabelL( EAknCtNote, *transcodText ); - CleanupStack::PopAndDestroy( transcodText ); - iTranscodingDialog->ExecuteLD( R_MUS_VIEW_TRANSCODING_WAIT_NOTE ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::ShowTranscodingProgressDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::UpdateClipTranscodingPercentageL( - TInt aPercentage ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::UpdateClipTranscodingPercentageL" ); - if ( iTranscodingDialog ) - { - if ( aPercentage < KMusOneHundredPercent ) - { - iTranscodingProgress = iTranscodingDialog->GetProgressInfoL(); - iTranscodingProgress->SetFinalValue( KMusOneHundredPercent ); - if ( iTranscodingProgress ) - { - iTranscodingProgress->IncrementAndDraw( - aPercentage - iTranscodingProgress->CurrentValue() ); - } - } - else - { - iTranscodingOngoing = EFalse; - iTranscodingDialog->ProcessFinishedL(); - iTranscodingDialog = NULL; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::UpdateClipTranscodingPercentageL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::CancelTranscodingL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::CancelTranscodingL" ); - if ( iTranscodingOngoing ) - { - iTranscodingOngoing = EFalse; - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::CancelTranscodingL: iTranscodingOngoing" ); - if ( iTranscodingDialog ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::CancelTranscodingL: iTranscodingDialog" ); - iTranscodingDialog->ProcessFinishedL(); - iTranscodingDialog = NULL; - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::CancelTranscodingL: ProcessFinishedL()" ); - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::CancelTranscodingL" ); - } - - -// ----------------------------------------------------------------------------- -// Runs the Media Gallery Fetch dialog. -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::RunFetchDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::RunFetchDialogL" ); - - // Create array of descriptors for the selected files - CDesCArrayFlat* fileArray = new ( ELeave ) CDesCArrayFlat( KMusDefaultArrayGranularity ); - CleanupStack::PushL( fileArray ); - - // Open the dialog. - TBool ret = MGFetch::RunL( - *fileArray, // When dialog is closed, fileArray contains selected files - EVideoFile, // Displays only media files of type aMediaType - EFalse, // Not used in S60 2.0 ( single or multiple file selection ) - this // Pointer to class implementing MMGFetchVerifier; - // when user has selected file( s ), - // MMGFetchVerifier::VerifySelectionL is called. - ); - - if ( ret ) - { - iFileSelected = ETrue; - iFileName = fileArray->MdcaPoint( 0 ).AllocL(); - } - else - { - // The user has not selected any file - iFileSelected = EFalse; - } - - CleanupStack::PopAndDestroy( fileArray ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::RunFetchDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiClipSharingViewContainer::FetchedFileName() - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::FetchedFileName" ); - return *iFileName; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingViewContainer::FileSelected() - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::FileSelected" ); - return iFileSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::SetDurationValue( TInt aDurationValue ) - { - const TInt KMinLevel = 0; - iIndicator->SetRange( KMinLevel, aDurationValue, EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::SetPositionValueL( TInt aPositionValue ) - { - iIndicator->SetLevelL( EMusUiIndicatorTypeDuration, - aPositionValue, - EFalse /*never use timer*/ ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::SetDurationIndicatorVisible( TBool aVisible ) - { - iIndicator->SetIndicatorType(EMusUiIndicatorTypeDuration); - MakeVisible( aVisible ); - } - - -// ----------------------------------------------------------------------------- -// Verifies the current user selection. -// ----------------------------------------------------------------------------- -// -TBool CMusUiClipSharingViewContainer::VerifySelectionL( const MDesCArray* - aSelectedFiles ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiClipSharingViewContainer::\ - VerifySelectionL" ); - return ( aSelectedFiles->MdcaCount() > 0 ) ? ETrue : EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiClipSharingViewContainer::DialogDismissedL( TInt /*aButtonId*/ ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::DialogDismissedL" ); - if ( iTranscodingOngoing ) - { - (static_cast (MusUiView()))->CancelTranscodingL(); - iTranscodingOngoing = EFalse; - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingViewContainer::DialogDismissedL" ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when to retrieve the no. of controls. -// ----------------------------------------------------------------------------- -// -TInt CMusUiClipSharingViewContainer::CountComponentControls() const - { - return 1; // return nbr of controls inside this container - } - - -// ----------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// ----------------------------------------------------------------------------- -// -CCoeControl* CMusUiClipSharingViewContainer::ComponentControl( TInt aIndex ) const - { - CCoeControl* control = NULL; - - switch ( aIndex ) - { - case 0: - control = iIndicator; - break; - default: - break; - } - return control; - } - - -// ----------------------------------------------------------------------------- -// Called by framework to act on key events if required. -// ----------------------------------------------------------------------------- -// -TKeyResponse CMusUiClipSharingViewContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::OfferKeyEventL: %d", - aKeyEvent.iCode ); - MUS_LOG1( "mus: [MUSUI ] -> CMusUiClipSharingViewContainer::OfferKeyEventL: %d", - aKeyEvent.iScanCode ); - - TKeyResponse ret( EKeyWasNotConsumed ); - - /** - * special keys have scancode - */ - switch( aKeyEvent.iScanCode ) - { - // Fast Forward: - case EStdKeyUpArrow: // EKeyUpArrow: - { - if ( !MUS_NO_TOOLBAR ) - { - if( aType == EEventKeyDown ) - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewFastForward ); - } - - if( aType == EEventKeyUp ) - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewFastForwardEnd ); - } - } - return EKeyWasConsumed; - } - - // Fast Reverse: - case EStdKeyDownArrow: // EKeyDownArrow: - { - if ( !MUS_NO_TOOLBAR ) - { - if( aType == EEventKeyDown ) - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewFastReverse ); - } - if( aType == EEventKeyUp ) - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewFastReverseEnd ); - } - } - return EKeyWasConsumed; - } - default: - { - ret = EKeyWasNotConsumed; - break; - } - } - - - switch ( aKeyEvent.iCode ) - { - // Volume Control - case EKeyLeftArrow: - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewVolumeDown ); - ret = EKeyWasConsumed; - break; - } - case EKeyRightArrow: - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewVolumeUp ); - ret = EKeyWasConsumed; - break; - } - - default: - { - ret = EKeyWasNotConsumed; - break; - } - } - - return ret; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuicontactutil.cpp --- a/mmsharing/mmshui/src/musuicontactutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,388 +0,0 @@ -/* -* 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 "musuicontactutil.h" -#include "musuidefinitions.h" -#include "muslogger.h" -#include "musenguriparser.h" -#include "musuid.hrh" - -#include // Phonebook view resource -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiContactUtil::ShareViewFieldExistsL( CCoeEnv& aEnv, TInt aContactId ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::ShareViewFieldExistsL" ); - - TBool ret( EFalse ); - - RPbkViewResourceFile pbkResourceFile( aEnv ); - CleanupClosePushL( pbkResourceFile ); - pbkResourceFile.OpenL(); - CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( pbkContactEngine ); - CPbkContactItem* contactItem = NULL; - CleanupStack::PushL( contactItem ); - if ( aContactId > 0 ) - { - contactItem = pbkContactEngine->OpenContactL( aContactId ); - if ( contactItem->FindField( EPbkFieldIdShareView ) ) - { - MUS_LOG( "mus: [MUSUI ] EPbkFieldIdShareView found!!" ); - ret = ETrue; - } - else if ( contactItem->FindField( EPbkFieldIdSIPID ) ) - { - MUS_LOG( "mus: [MUSUI ] EPbkFieldIdSIPID found, NOT EPbkFieldIdShareView defined!!!" ); - ret = ETrue; - } - else - { - ret = EFalse; - } - } - else - { - ret = EFalse; - } - CleanupStack::PopAndDestroy( 3 ); // contactItem, pbkContactEngine, &pbkResourceFile - MUS_LOG( "mus: [MUSUI ] <- MusUiContactUtil::ShareViewFieldExistsL" ); - return ret; - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiContactUtil::CheckPbContactForVSAddressesL( CCoeEnv& aEnv, - const TDesC& aOriginator, - TInt aContactId) -{ - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::CheckPbContactForVSAddressesL" ); - - TBool sipAddrMatches(EFalse); - TBool shareViewAddrMatches(EFalse); - TBool ret(EFalse); - - if(MatchTextWithPbFieldsL(aEnv, EPbkFieldIdSIPID, aOriginator, aContactId)) - { - sipAddrMatches=ETrue; - } - if(MatchTextWithPbFieldsL(aEnv, EPbkFieldIdShareView, aOriginator, aContactId)) - { - shareViewAddrMatches=ETrue; - } - - if(aOriginator.Find(KMusPrefixSipUri) != KErrNotFound) - { - //pb field without sip:-prefix are checked. - HBufC * withoutPrefix; - withoutPrefix = HBufC::NewLC(aOriginator.Length()); - *withoutPrefix = aOriginator; - TPtr ptr = withoutPrefix->Des(); - ptr.Delete(0,KMusPrefixMaxLength); - - if(MatchTextWithPbFieldsL(aEnv, EPbkFieldIdSIPID, *withoutPrefix, aContactId)) - { - sipAddrMatches=ETrue; - } - if(MatchTextWithPbFieldsL(aEnv, EPbkFieldIdShareView, *withoutPrefix, aContactId)) - { - shareViewAddrMatches=ETrue; - } - - CleanupStack::PopAndDestroy(withoutPrefix); - } - - if(sipAddrMatches||shareViewAddrMatches) - { - ret=ETrue; - } - else - { - ret=EFalse; - } - - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::CheckPbContactForVSAddressesL" ); - return ret; -} -// ----------------------------------------------------------------------------- -// @function MatchTextWithPbFieldsL -// searches all contactId´s fieldIds of same type for a text -// returns ETrue if text is found from at least one of them. -// ----------------------------------------------------------------------------- -// -TBool MusUiContactUtil::MatchTextWithPbFieldsL( CCoeEnv& aEnv, - TPbkFieldId aFieldId, - const TDesC& aText, - TInt aContactId ) -{ - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::MatchTextWithPbFieldsL" ); - - TBool textMatch(EFalse); - - RPbkViewResourceFile pbkResourceFile(aEnv); - CleanupClosePushL( pbkResourceFile ); - pbkResourceFile.OpenL(); - CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( pbkContactEngine ); - CPbkContactItem* contactItem = NULL; - CleanupStack::PushL( contactItem ); - - if ( aContactId > 0 ) - { - contactItem = pbkContactEngine->OpenContactL( aContactId ); - - TInt index(0); - - while(index!=KErrNotFound) - { - TPbkContactItemField* contactItemField = - contactItem->FindField( aFieldId, index ); - - if( contactItemField ) - { - if( contactItemField->Text() == aText && !textMatch ) - { - textMatch=ETrue; - } - } - - if( index != KErrNotFound ) - { - index++; - } - } - - } - - CleanupStack::PopAndDestroy( 3 ); // contactItem, pbkContactEngine, &pbkResourceFile - - MUS_LOG( "mus: [MUSUI ] <- MusUiContactUtil::MatchTextWithPbFieldsL" ); - return textMatch; - -} -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiContactUtil::ActivateContactViewL( CCoeEnv& aEnv, - TContactItemId aId, - const TDesC& aTypedAddress, - const TDesC& aMusTelNumberValue ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::ActivateContactViewL" ); - RPbkViewResourceFile pbkResourceFile( aEnv ); - CleanupClosePushL( pbkResourceFile ); - pbkResourceFile.OpenL(); - CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); - CleanupStack::PushL( pbkContactEngine ); - - CPbkContactItem* contactItem = NULL; - CleanupStack::PushL( contactItem ); - - if ( aId > 0 ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::ActivateContactViewL\ - TContactItemId > 0 => Opening Existing Contact..." ); - contactItem = pbkContactEngine->OpenContactL( aId ); - EditContactL( *contactItem, - EFalse, - pbkContactEngine, - aTypedAddress, - aMusTelNumberValue, - aId ); - } - else - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::ActivateContactViewL\ - TContactItemId < 1 => Creating new Contact..." ); - contactItem = pbkContactEngine->CreateEmptyContactL(); - EditContactL( *contactItem, - ETrue, - pbkContactEngine, - aTypedAddress, - aMusTelNumberValue, - aId ); - } - - CleanupStack::PopAndDestroy( 3 ); // contactItem, pbkContactEngine, &pbkResourceFile - MUS_LOG( "mus: [MUSUI ] <- MusUiContactUtil::ActivateContactViewL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiContactUtil::EditContactL( CPbkContactItem& aContact, - TBool aNewOne, - CPbkContactEngine* aPbkContactEngine, - const TDesC& aTypedAddress, - const TDesC& aMusTelNumberValue, - TContactItemId aContactId ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::EditContactL" ); - - TMusEngUriParser parser( aTypedAddress ); - parser.ParseUriL(); - HBufC* uri = NULL; - CleanupStack::PushL( uri ); - - CContactTextField* addressField = NULL; - CleanupStack::PushL( addressField ); - - if ( parser.UriType() == TMusEngUriParser::ESip ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL\ - parser.UriType() == TMusEngUriParser::ESip" ); - addressField = EditableContactFieldL( - aContact, - EPbkFieldIdShareView, - aPbkContactEngine ); - uri = parser.GetUri16L( ETrue ); - } - else if ( parser.UriType() == TMusEngUriParser::ETel ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL\ - parser.UriType() == TMusEngUriParser::ETel" ); - addressField = EditableContactFieldL( - aContact, - EPbkFieldIdPhoneNumberMobile, - aPbkContactEngine ); - uri = parser.GetUri16L( EFalse ); - } - - if ( addressField ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL\ - addressField OK" ); - addressField->SetTextL( *uri ); - } - - if ( ( aMusTelNumberValue.Length() > 0 ) && aContactId == KErrNotFound ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL\ - !iPhoneNumberFieldFound" ); - CContactTextField* phoneNumberField = EditableContactFieldL( - aContact, - EPbkFieldIdPhoneNumberMobile, - aPbkContactEngine ); - if ( phoneNumberField ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL\ - phoneNumberField OK" ); - phoneNumberField->SetTextL( aMusTelNumberValue ); - } - } - - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditContactL: Creating dialog..." ); - - // Bring MuSh UI foreground - RWsSession wsSession; - User::LeaveIfError( wsSession.Connect() ); - CleanupClosePushL( wsSession ); - TApaTaskList taskList( wsSession ); - TUid appUid; - appUid.iUid = KMusUiUid; - TApaTask task = taskList.FindApp( appUid ); - task.BringToForeground(); - CleanupStack::PopAndDestroy( &wsSession ); - - // Launch pbk new entry editor dlg - CPbkContactEditorDlg* editorDlg = CPbkContactEditorDlg::NewL( - *aPbkContactEngine, - aContact, - aNewOne, - -1, // Move focus to the topmost field - ETrue ); - editorDlg->ResetWhenDestroyed( &editorDlg ); - editorDlg->HideExitCommand(); - editorDlg->ExecuteLD(); - - CleanupStack::Pop( 2 ); // uri, addressField - - MUS_LOG( "mus: [MUSUI ] <- MusUiContactUtil::EditContactL" ); - } - - -// ----------------------------------------------------------------------------- -// Get editable contact field. -// ----------------------------------------------------------------------------- -// -CContactTextField* MusUiContactUtil::EditableContactFieldL( - CPbkContactItem& aContact, - TInt aFieldId, - CPbkContactEngine* aPbkContactEngine ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiContactUtil::EditableContactFieldL" ); - - // Get fields info from pbk engine - const CPbkFieldsInfo& fieldsInfo = aPbkContactEngine->FieldsInfo(); - - // Try to get the SIP URI storage field for this contact - TPbkContactItemField* itemField = aContact.FindField( aFieldId ); - - if ( !itemField ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditableContactFieldL: !itemField" ); - CPbkFieldInfo* fieldInfo = fieldsInfo.Find( aFieldId ); - // Add field to this contact - if ( fieldInfo ) - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditableContactFieldL\ - fieldInfo OK" ); - // Contact takes ownership of the field. - aContact.AddFieldL( *fieldInfo ); - itemField = aContact.FindField( aFieldId ); - return ( itemField ) ? itemField->TextStorage() : NULL; - } - else - { - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditableContactFieldL\ - fieldInfo == NULL" ); - return NULL; - } - } - else - { - // Does not pass ownership. - MUS_LOG( "mus: [MUSUI ] MusUiContactUtil::EditableContactFieldL\ - itemField OK" ); - return itemField->TextStorage(); - } - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuidialogutil.cpp --- a/mmsharing/mmshui/src/musuidialogutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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 "musuidialogutil.h" -#include - -#include -#include -#include -#include -#include - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiDialogUtil::ShowGlobalConfirmationQueryDialogL( const TDesC& aPrompt ) - { - CAknGlobalConfirmationQuery* dlg = CAknGlobalConfirmationQuery::NewLC(); - TRequestStatus status; - dlg->ShowConfirmationQueryL( status, aPrompt, R_AVKON_SOFTKEYS_YES_NO ); - User::WaitForRequest( status ); - CleanupStack::PopAndDestroy( dlg ); - return ( status == EAknSoftkeyYes ) ? ETrue : EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowInformationDialogL( const TDesC& aPrompt ) - { - CAknInformationNote* dlg = new ( ELeave ) CAknInformationNote( ETrue ); - dlg->ExecuteLD( aPrompt ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowInformationDialogL( TInt aResourceId ) - { - HBufC* dlgPrompt = StringLoader::LoadLC( aResourceId ); - ShowInformationDialogL( *dlgPrompt ); - CleanupStack::PopAndDestroy( dlgPrompt ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalInformationDialogL( const TDesC& aMessage ) - { - TRequestStatus status; - CAknGlobalNote* dlg= CAknGlobalNote::NewLC(); - dlg->ShowNoteL( status, EAknGlobalInformationNote, aMessage ); - User::WaitForRequest( status ); - CleanupStack::PopAndDestroy( dlg ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalInformationDialogL( TInt aResourceId ) - { - HBufC* dlgPrompt = StringLoader::LoadLC( aResourceId ); - ShowGlobalInformationDialogL( *dlgPrompt ); - CleanupStack::PopAndDestroy( dlgPrompt ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalErrorDialogL( const TDesC& aMessage ) - { - CAknGlobalNote* dlg = CAknGlobalNote::NewLC(); - dlg->ShowNoteL( EAknGlobalErrorNote, aMessage ); - CleanupStack::PopAndDestroy( dlg ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalErrorDialogL( TInt aResourceId ) - { - HBufC* dlgPrompt = StringLoader::LoadLC( aResourceId ); - ShowGlobalErrorDialogL( *dlgPrompt ); - CleanupStack::PopAndDestroy( dlgPrompt ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalErrorModalDialogL( const TDesC& aMessage ) - { - CAknGlobalNote* dlg = CAknGlobalNote::NewLC(); - TRequestStatus status; - dlg->ShowNoteL( status , EAknGlobalErrorNote, aMessage ); - User::WaitForRequest( status ); - CleanupStack::PopAndDestroy( dlg ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiDialogUtil::ShowGlobalErrorModalDialogL( TInt aResourceId ) - { - HBufC* dlgPrompt = StringLoader::LoadLC( aResourceId ); - ShowGlobalErrorModalDialogL( *dlgPrompt ); - CleanupStack::PopAndDestroy( dlgPrompt ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiDialogUtil::SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ) - { - __ASSERT_ALWAYS( aAddressArray, User::Leave( KErrArgument ) ); - __ASSERT_ALWAYS( aAddressArray->Count() > 0, User::Leave( KErrArgument ) ); - - TInt selectedIndex( 0 ); - CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( &selectedIndex ); - dlg->PrepareLC( R_MUS_LIVESHARINGVIEW_ADDRESS_QUERY ); - dlg->SetItemTextArray( aAddressArray ); - dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); - TInt dlgResponse( dlg->RunLD() ); - aSelectedAddress = (*aAddressArray)[ selectedIndex ]; - delete aAddressArray; - aAddressArray = NULL; - return dlgResponse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiDialogUtil::ShowTextQueryDialogL( const TDesC& aPrompt, TDes& aValue ) - { - CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( aValue ); - CleanupStack::PushL( dlg ); - dlg->SetPromptL( aPrompt ); - CleanupStack::Pop( dlg ); - return dlg->ExecuteLD( R_MUS_TEXT_QUERY_DIALOG ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiDialogUtil::ShowTextQueryDialogL( TInt aPromptResourceId, TDes& aValue ) - { - TBool retval( EFalse ); - HBufC* dlgPrompt = StringLoader::LoadLC( aPromptResourceId ); - retval = ShowTextQueryDialogL( *dlgPrompt, aValue ); - CleanupStack::PopAndDestroy( dlgPrompt ); - return retval; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuidocument.cpp --- a/mmsharing/mmshui/src/musuidocument.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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: Document class of MUS App. -* -*/ - - - -#include "musuidocument.h" // Header for this class -#include "musuiappui.h" // Application UI class - -#include -#include - - -// ----------------------------------------------------------------------------- -// CMusUiDocument::CMusUiDocument -// C++ default constructor. -// ----------------------------------------------------------------------------- -CMusUiDocument::CMusUiDocument( CEikApplication& aApp ) : CAknDocument( aApp ) - { - } - - -// ----------------------------------------------------------------------------- -// CMusUiDocument::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -CMusUiDocument* CMusUiDocument::NewL( CEikApplication& aApp ) - { - CMusUiDocument* self = new( ELeave ) CMusUiDocument( aApp ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CMusUiDocument::ConstructL -// Symbian 2nd phase constructor. -// ----------------------------------------------------------------------------- -void CMusUiDocument::ConstructL() - { - } - - -// ----------------------------------------------------------------------------- -// CMusUiDocument::~CMusUiDocument -// Destructor. -// ----------------------------------------------------------------------------- -CMusUiDocument::~CMusUiDocument() - { - } - - -// ----------------------------------------------------------------------------- -// CMusUiDocument::CreateAppUiL() -// Constructs CMusUiAppUi. -// ----------------------------------------------------------------------------- -CEikAppUi* CMusUiDocument::CreateAppUiL() - { - return new ( ELeave ) CMusUiAppUi( ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuieventcontroller.cpp --- a/mmsharing/mmshui/src/musuieventcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1037 +0,0 @@ -/* -* 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: Application's UI class. -* -*/ - - - -#include "musuieventcontroller.h" -#include "musuieventobserver.h" -#include "musuisharingobserver.h" -#include "musuipropertywatch.h" -#include "musuicallbackservice.h" -#include "musuiactivitymanger.h" -#include "musuifileutil.h" -#include "musuidialogutil.h" -#include "musuicontactutil.h" -#include "mussessionproperties.h" -#include "musuibitmapdecoder.h" -#include "muscommon.h" -#include "mussettings.h" -#include "musenguriparser.h" -#include "musuimmcmonitor.h" -#include "musresourceproperties.h" -#include "musuiresourcehandler.h" -#include "musui.hrh" -#include "muslogger.h" // debug logging -#include "musuigeneralview.h" - -#include "musengmcesession.h" - -#include - -#include -#include - -#include -#include -#include -#include // for feature definitions -#include - -#include // HlpLauncher -#include - -using namespace MusSettingsKeys; -using namespace NMusSessionApi; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventController::~CMusUiEventController() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::~CMusUiEventController" ); - delete iResourceHandler; - delete iStatusPropertyWatch; - delete iContactName; - delete iTelNumber; - delete iVideoCodec; - delete iDialogPrompt; - delete iCallbackService; - delete iMmcMonitor; - delete iActivityManager; - FeatureManager::UnInitializeLib(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::~CMusUiEventController" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::ConstructL" ); - - TInt error( KErrNotFound ); - - FeatureManager::InitializeLibL(); - - iCallbackService = CMusUiCallbackService::NewL( *this ); - - // read ps properties (no need to read again later) - - TRAP( error, iVideoCodec = CMusUiPropertyWatch::ReadDescPropertyL( - KVideoCodecs ) ); - if ( error != KErrNone ) - { - iVideoCodec = KNullDesC().AllocL(); - } - - TRAP( error, iTelNumber = CMusUiPropertyWatch::ReadDescPropertyL( - KTelNumber ) ); - if ( error != KErrNone ) - { - iTelNumber = KNullDesC().AllocL(); - } - - TRAP( error, iSipProfileId = CMusUiPropertyWatch::ReadIntPropertyL( - NMusSessionApi::KSipProfileId ) ); - if ( error != KErrNone ) - { - iSipProfileId = KErrNotFound; - } - - TRAP( error, - iContactId = CMusUiPropertyWatch::ReadIntPropertyL( KContactId ) ); - if ( error != KErrNone ) - { - iContactId = KErrNotFound; - } - - TRAP( error, iContactName = CMusUiPropertyWatch::ReadDescPropertyL( - KContactName ) ); - - if ( error != KErrNone ) - { - iContactName = KNullDesC().AllocL(); - } - - // follow session status property - iStatusPropertyWatch = CMusUiPropertyWatch::NewL( - *this, - NMusSessionApi::KCategoryUid, - KStatus ); - - iMmcMonitor = CMusUiMmcMonitor::NewL( *this ); - - iResourceHandler = CMusUiResourceHandler::NewL( iEventObserver ); - - // start monitoring activity - iActivityManager = CMusUiActivityManager::NewL( KMusBacklightTimeOut ); - iActivityManager->Reset(); - - // check if operator specific functionality is needed - iOperatorSpecificFunctionality = - ( MultimediaSharingSettings::OperatorVariantSettingL() == - EOperatorSpecific ); - - iShutdownState = EMusUiShutdownNotDefined; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventController::CMusUiEventController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver ) - : iEventObserver( aEventObserver ), - iSharingObserver( aSharingObserver ), - iForeground( ETrue ), - iActiveCall( ETrue ) - { - } - - -// ----------------------------------------------------------------------------- -// Called by CMusUiPropertyWatch, when resource key values change in P&S -// Sets the member values common to all sharing types. -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::PropertyChanged( const TUint aKey, - const TInt aValue ) - { - MUS_LOG2( "mus: [MUSUI ] -> CMusUiEventController::ResourcePropertyChanged:\ - aKey: [%u] aValue: [%d]", aKey, aValue ); - switch( aKey ) - { - case KStatus: - { - TRAP_IGNORE( - HandleChangedStatusL( ( TMusAvailabilityStatus ) aValue ) ); - break; - } - default: - { - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::ResourcePropertyChanged" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandlePropertyError( const TInt aReason ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::HandleError [%d]", - aReason ); - - HandleError( aReason ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleError" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::HandleAsyncEventL [%d]", - aEventId ); - - switch ( aEventId ) - { - case EMusUiAsyncHandleExit: - { - MUS_LOG( "mus: [MUSUI ] CMusUiEventController::\ - HandleAsyncEventL: EMusUiAsyncHandleExit" ); - HandleExitL(); - break; - } - default: - { - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleAsyncEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiEventController::HandleAsyncError( TInt aError ) - { - iEventObserver.HandleError( aError ); // Stop the execution - - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::MmcRemoved() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::MmcRemoved" ); - TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ) ) - - iEventObserver.HandleExit(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::MmcRemoved" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::SessionEstablished() - { - TRAPD( error, iSharingObserver.ShowStatusPaneTitleL() ) - - if ( error != KErrNone ) - { - iEventObserver.HandleError( error ); - } - - if ( MUS_NO_TOOLBAR ) - { - TRAPD( error, iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? - R_MUSUI_VIEW_OPS_MSK_IHF_OFF : - R_MUSUI_VIEW_OPS_MSK_IHF_ON )); - if ( error != KErrNone ) - { - iEventObserver.HandleError( error ); - } - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::AudioRoutingChanged( TBool aShowNote ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::AudioRoutingChanged" ); - - if ( aShowNote ) - { - if ( IsLoudSpeakerEnabled() ) - { - MUS_LOG( "mus: [MUSUI ] show activated note" ); - TRAP_IGNORE( - MusUiDialogUtil::ShowGlobalInformationDialogL( R_MUS_NOTE_HF_ACTIVATED ) ) - } - } - - iSharingObserver.RefreshAudioRoutingToolbarButton(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::AudioRoutingChanged" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::AudioRouteChangeAllowed() const - { - // Do not allow audio routing if call has ended - return iActiveCall; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::SetRect(const TRect& aRect) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::SetRect" ); - - if ( EngineSession() ) - { - TRAPD( err, EngineSession()->SetRectL( aRect ) ); - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::SetRect" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiEventController::MusContactName() - { - return *iContactName; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiEventController::MusVideoCodecValue() - { - return *iVideoCodec; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiEventController::MusTelNumberValue() - { - MUS_LOG_TDESC("mus: [MUSUI ] <> CMusUiEventController::MusTelNumberValue()", - iTelNumber->Des() ) - return *iTelNumber; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiEventController::SessionTimeFormatted( - const TTimeIntervalSeconds& aSeconds ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::SessionTimeFormatted" ); - iTimeBuffer.SetLength( 0 ); - TLocale locale; - _LIT( KZeroSymbol, "0" ); - TInt sessionHours( 0 ); - TInt sessionMinutes( 0 ); - TInt sessionSeconds( aSeconds.Int() ); - if ( aSeconds.Int() > ( KMusOneMinuteInSeconds - 1 ) ) - { - sessionMinutes = (int)(aSeconds.Int() / KMusOneMinuteInSeconds ); - sessionSeconds = sessionSeconds - ( sessionMinutes * KMusOneMinuteInSeconds ); - } - if ( sessionMinutes > ( KMusOneMinuteInSeconds - 1 ) ) - { - sessionHours = (int)( sessionMinutes / KMusOneMinuteInSeconds ); - sessionMinutes = sessionMinutes - ( sessionHours * KMusOneMinuteInSeconds ); - } - if ( sessionHours != 0 ) - { - iTimeBuffer.AppendNum( sessionHours ); - iTimeBuffer.Append( locale.TimeSeparator( KMusLocaleHoursAndMinutesSeparator ) ); - if ( sessionMinutes < KMusNumberValueTen ) - { - iTimeBuffer.Append( KZeroSymbol ); - } - } - - iTimeBuffer.AppendNum( sessionMinutes ); - iTimeBuffer.Append( locale.TimeSeparator( KMusLocaleMinutesAndSecondsSeparator ) ); - if ( sessionSeconds < KMusNumberValueTen ) - { - iTimeBuffer.Append( KZeroSymbol ); - } - iTimeBuffer.AppendNum( sessionSeconds ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::SessionTimeFormatted" ); - return iTimeBuffer; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::SaveContactQueryL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::SaveContactQueryL" ); - if ( !MusUiContactUtil::ShareViewFieldExistsL( *iEventObserver.EikonEnv(), - iContactId ) ) - { - delete iDialogPrompt; - iDialogPrompt = NULL; - iDialogPrompt = StringLoader::LoadL( R_MUS_VIEW_SAVE_ADDRESS_QUERY_TXT ); - iEventObserver.ShowAsyncConfirmationQueryDialogL( *iDialogPrompt ); - } - else - { - AsyncQueryDialogAcceptedL( EFalse ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::SaveContactQueryL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleError( const TInt aError ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::HandleError %d", - aError ); - - iEventObserver.HandleError( aError ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleError" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::ExitOccured() - { - return ( iShutdownState != EMusUiShutdownNotDefined ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::AudioRoutingCanBeChanged() - { - return ( EngineSession() && EngineSession()->AudioRoutingCanBeChanged() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::IsLoudSpeakerEnabled() - { - return ( EngineSession() && EngineSession()->IsLoudSpeakerEnabled() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::DeviceHasDedicatedVolumeKeys() - { - return FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleExitL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::HandleExitL" ); - - if ( iShutdownState == EMusUiShutdownNotDefined ) - { - iShutdownState = EMusUiShutdownStarted; - - if ( iStatusPropertyWatch ) - { - iStatusPropertyWatch->Cancel(); - } - - if ( iMmcMonitor ) - { - iMmcMonitor->Cancel(); - } - - if ( iActivityManager ) - { - iActivityManager->Cancel(); - } - - if ( iCallbackService ) - { - iCallbackService->Cancel(); - } - - iEventObserver.SetToolbarVisibility( EFalse ); - - // This must be done before showing the end note, because showing of - // note may cause the session to continue for extra few seconds. - DeleteEngineSession(); - - // Sharing Ended note - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ); - - // TODO: Continue Recording query, if sharing live video and receiving end - // terminates the sharing session - - ExitProcedureL( EFalse ); - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleExitL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::ExitProcedureL( TBool aUserAcceptance ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::ExitProcedureL" ); - - switch ( iShutdownState ) - { - case EMusUiShutdownStarted: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusUiShutdownStarted" ); - // No general functionality, skip the state - iShutdownState = EMusUiShutdownVideoSaved; - ExitProcedureL( EFalse ); - break; - } - case EMusUiShutdownVideoSaved: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownVideoSaved" ); - iEventObserver.HandleExit(); - break; - } - - case EMusUiShutdownContactSavingQueried: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusUiShutdownContactSavingQueried" ); - // Stop app execution - if ( aUserAcceptance ) - { - if ( iResourceHandler->RequestKeypadL( EFalse ) ) - { - MusUiContactUtil::ActivateContactViewL( - *iEventObserver.EikonEnv(), - iContactId, - TypedAddress(), - MusTelNumberValue() ); - } - } - iEventObserver.HandleExit(); - break; - } - case EMusUiShutdownOver: - { - iEventObserver.HandleExit(); - break; - } - case EMusUiShutdownNotDefined: - default: - { - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::ExitProcedureL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::AsyncQueryDialogAcceptedL( TBool aAccepted ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::AsyncQueryDialogAcceptedL" ); - - if ( ExitOccured() ) - { - ExitProcedureL( aAccepted ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::AsyncQueryDialogAcceptedL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::ConnectionEstablished() const - { - return iConnectionEstablished; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::SetConnectionInitialized( - TBool aConnectionInitialized ) - { - MUS_LOG1( - "mus: [MUSUI ] -> CMusUiEventController::SetConnectionInitialized ( %d )", - aConnectionInitialized ); - - iConnectionInitialized = aConnectionInitialized; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::ConnectionInitialized() const - { - return iConnectionInitialized; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::EnableDisplayL( TBool aEnable ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::EnableDisplayL" ); - if ( EngineSession() ) - { - EngineSession()->EnableDisplayL( aEnable ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::EnableDisplayL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::ChangeOrientationL" ); - iEventObserver.SwitchOrientationL( aOrientation ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::ChangeOrientationL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::ToolbarVolumeSelected() - { - return iToolbarVolumeSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::IsMicMutedL() - { - __ASSERT_ALWAYS( EngineSession(), User::Leave( KErrNotReady ) ); - - return EngineSession()->IsMicMutedL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiEventController::ManualAddressTyped() const - { - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleForegroundEventL( TBool aForeground ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::HandleForegroundEventL" ); - - iForeground = aForeground; - - if ( ConnectionInitialized() && !ExitOccured() ) - { - EnableDisplayL( aForeground ); - - // Change toolbar according to a real state. Other items than speaker - // and mic states cannot be changed from phone app and thus there is - // no need to check them - if ( aForeground ) - { - if ( MUS_NO_TOOLBAR ) - { - iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? - R_MUSUI_VIEW_OPS_MSK_IHF_OFF : - R_MUSUI_VIEW_OPS_MSK_IHF_ON ); - } - else - { - if ( IsMicMutedL() ) - { - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarMute, - EMusuiCmdToolbarUnmute, - EFalse ); - } - else - { - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnmute, - EMusuiCmdToolbarMute, - EFalse ); - } - - if ( IsLoudSpeakerEnabled() ) - { - iSharingObserver.ReplaceToolbarCommand( - EMusuiCmdToolbarSpeakerOn, - EMusuiCmdToolbarSpeakerOff, - EFalse ); - } - else - { - iSharingObserver.ReplaceToolbarCommand( - EMusuiCmdToolbarSpeakerOff, - EMusuiCmdToolbarSpeakerOn, - EFalse ); - } - if ( ConnectionEstablished() ) - { - iEventObserver.SetToolbarVisibility( aForeground ); - } - - } - } - - } - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleForegroundEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::OfferToolbarEventL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::OfferToolbarEventL [%d]", - aCommand ); - - __ASSERT_ALWAYS( EngineSession(), User::Leave( KErrNotReady ) ); - - switch ( aCommand ) - { - case EMusuiCmdToolbarVolume: - { - iToolbarVolumeSelected = !iToolbarVolumeSelected; - iSharingObserver.HighlightSelectedToolbarItem( - EMusuiCmdToolbarVolume ); - iSharingObserver.ActivateVolumeControlL( - EngineSession()->VolumeL() ); - break; - } - case EMusuiCmdToolbarMute: - { - EngineSession()->MuteMicL( ETrue ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarMute, - EMusuiCmdToolbarUnmute, - ETrue ); - break; - } - case EMusuiCmdToolbarUnmute: - { - EngineSession()->MuteMicL( EFalse ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnmute, - EMusuiCmdToolbarMute, - ETrue ); - break; - } - case EMusuiCmdToolbarSpeakerOff: - { - EngineSession()->EnableLoudspeakerL( ELoudspeakerDisabled, EFalse ); - // Toolbar will be changed when asynchronous request is completed - break; - } - case EMusuiCmdToolbarSpeakerOn: - { - EngineSession()->EnableLoudspeakerL( ELoudspeakerEnabled, EFalse ); - // Toolbar will be changed when asynchronous request is completed - break; - } - default: // Never should be the case - { - HandleExitL(); - break; - } - - } - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiEventController::OfferToolbarEventL [%d]", - aCommand ); - - } - - -// ----------------------------------------------------------------------------- -// Handles commands common to all sharing types. -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleCommandL( TInt aCommand ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::HandleCommandL" ); - - switch ( aCommand ) - { - case EMusuiCmdViewVolumeUp: - { - // Set Volume: - __ASSERT_ALWAYS( EngineSession(), User::Leave( KErrNotReady ) ); - EngineSession()->VolumeUpL(); - // Update the status pane: - iSharingObserver.ActivateVolumeControlL( - EngineSession()->VolumeL() ); - break; - } - case EMusuiCmdViewVolumeDown: - { - // Set Volume: - __ASSERT_ALWAYS( EngineSession(), User::Leave( KErrNotReady ) ); - EngineSession()->VolumeDownL(); - // Update the status pane: - iSharingObserver.ActivateVolumeControlL( - EngineSession()->VolumeL() ); - break; - } - case EMusuiCmdViewVolumeChanged: - { - __ASSERT_ALWAYS( EngineSession(), User::Leave( KErrNotReady ) ); - TInt volumeFromEngine = EngineSession()->VolumeL(); - TInt volumeFromUi = iEventObserver.GetUiVolumeValue(); - if ( volumeFromUi != volumeFromEngine ) - { - EngineSession()->SetVolumeL( volumeFromUi ); - } - break; - } - - case EMusuiCmdViewLoadspeaker: - { - EngineSession()->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - break; - } - - case EMusuiCmdViewHandset: - { - EngineSession()->EnableLoudspeakerL( ELoudspeakerDisabled, ETrue ); - break; - } - - case EMusuiCmdViewMicrophoneMute: - { - EngineSession()->MuteMicL( ETrue ); - break; - } - - case EMusuiCmdViewMicrophoneUnmute: - { - EngineSession()->MuteMicL( EFalse ); - break; - } - - case EMusuiCmdViewEndActiveCall: - { - MUS_LOG( "mus: [MUSUI ] CMusUiReceiveController::ConstructL:\ - EMusuiCmdViewEndActiveCall" ); - iEventObserver.TerminateCall(); - HandleExitL(); - break; - } - case EMusuiGenCmdExit: - case EAknSoftkeyExit: - { - HandleExitL(); - break; - } - - case EAknCmdHelp: - { - if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) - { - HlpLauncher::LaunchHelpApplicationL( - iEventObserver.EikonEnv()->WsSession(), - iEventObserver.EikonEnv()->AppUi()->AppHelpContextL() ); - } - break; - } - - default: - { - //NOP - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// Handles status changes common to all sharing types. -// ----------------------------------------------------------------------------- -// -void CMusUiEventController::HandleChangedStatusL( - TMusAvailabilityStatus aStatus ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiEventController::HandleChangedStatusL" ); - switch( aStatus ) - { - case EErrNoActiveCall: - { - MUS_LOG( "mus: [MUSUI ] EErrNoActiveCall" ); - iActiveCall = EFalse; - HandleExitL(); - break; - } - case EErrCallOnHold: - case EErrConferenceCall: - case EMultimediaSharingNotAvailable: - { - MUS_LOG( "mus: [MUSUI ]\ - EErrCallOnHold, EErrConferenceCall, EMultimediaSharingNotAvailable" ); - HandleExitL(); - break; - } - case EErrSipRegistration: - { - MUS_LOG( "mus: [MUSUI ] EErrSipRegistration" ); - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ); - HandleExitL(); - break; - } - case EErrRoaming: - { - MUS_LOG( "mus: [MUSUI ] EErrRoaming" ); - HandleExitL(); - break; - } - case EErrNetwork: - { - MUS_LOG( "mus: [MUSUI ] EErrNetwork" ); - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ); - HandleExitL(); - break; - } - case EErrConnection: - { - MUS_LOG( "mus: [MUSUI ] EErrConnection" ); - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_ONLY_3G ); - HandleExitL(); - break; - } - - case EErrServerShutDown: - { - MUS_LOG( "mus: [MUSUI ] EErrServerShutDown" ); - HandleExitL(); - break; - } - - default: - { - MUS_LOG( "mus: [MUSUI ] Default" ); - // TODO - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleChangedStatusL" ); - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuifileutil.cpp --- a/mmsharing/mmshui/src/musuifileutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* 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 "musuifileutil.h" -#include "muslogger.h" // debug logging -#include "musuidefinitions.h" -#include "musuidialogutil.h" -#include "mussettings.h" -#include - -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool MusUiFileUtil::FileExists( const TDesC& aFullFileName ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiFileUtil::FileExists" ); - - TBool fileExists( EFalse ); - RFs fs; - - if ( fs.Connect() == KErrNone ) - { - TUint att; - fileExists = ( fs.Att( aFullFileName, att ) != KErrNotFound ); - fs.Close(); - } - - MUS_LOG( "mus: [MUSUI ] <- MusUiFileUtil::FileExists" ); - - return fileExists; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiFileUtil::VideoFilePathExistsL( const TDesC& aVideoFilePath) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiFileUtil::VideoFilePathExistsL" ); - - RFs fs; - - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - TInt error = fs.MkDirAll( aVideoFilePath ); - CleanupStack::PopAndDestroy( &fs ); - - MUS_LOG1( "mus: [MUSUI ] <- MusUiFileUtil::VideoFilePathExistsL,%d",error ); - User::Leave(error); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiFileUtil::CreateVideoFileNameL( const TDesC& aVideoFilePath, - TFileName& aFileName ) - { - MUS_LOG( "mus: [MUSUI ] -> MusUiFileUtil::CreateVideoFileNameL" ); - - RFs fs; - TParse parse; - TFileName fullFileName; - TUint att; - - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - - if ( fs.Att( aVideoFilePath, att ) == KErrNone ) - { - if ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EStandard ) - { - HBufC* temp = StringLoader::LoadLC( R_MUS_VIEW_SAVED_FILENAME ); - User::LeaveIfError( parse.Set( aVideoFilePath, temp, NULL ) ); - CleanupStack::PopAndDestroy( temp ); - fullFileName = parse.FullName(); - fullFileName.Append( KMusVideoFileNameExtension ); - User::LeaveIfError( - CApaApplication::GenerateFileName( fs, fullFileName ) ); - User::LeaveIfError( parse.Set( fullFileName, NULL, NULL ) ); - } - else // operator specific case - { - RBuf newName; - newName.CreateL( KMaxFileName ); - CleanupClosePushL( newName ); - - TEntry entry; - TInt i = 1; - // path + 'VS' + date + 'V' + counter + extension - _LIT( KFormatStringOne, "%S%S%S%S%02d%S" ); - _LIT( KFormatStringTwo, "%S%S%S%S%d%S" ); - TBuf<16> format; - format = KFormatStringOne; - - // get current date - _LIT( KDateFormat, "%F%M%D%*Y" ); - TTime time; - time.UniversalTime(); - TBuf<6> dateString; - time.FormatL( dateString, KDateFormat ); - - // generate a valid filename that doesn't already exist... - do - { - TPtrC driveAndPath = aVideoFilePath; - TPtrC date = dateString; - newName.Format( format, - &driveAndPath, &KMusVideoFileNameBegining, - &date, &KMusVideoFileNameVersion, - i++, &KMusVideoFileNameExtension ); - - if ( newName.Length() > KMaxFileName ) - { - User::Leave( KErrOverflow ); - } - - if ( i >= 100 ) - { - format = KFormatStringTwo; - } - } // Continue until DoesNotExist - while ( fs.Entry( newName, entry ) == KErrNone ); - - fullFileName.Copy( newName ); - User::LeaveIfError( parse.Set( newName, NULL, NULL ) ); - - CleanupStack::PopAndDestroy( &newName ); - } - - RFile file; - CleanupClosePushL( file ); - User::LeaveIfError( - file.Create( fs, fullFileName, EFileWrite | EFileShareExclusive ) ); - CleanupStack::PopAndDestroy( &file ); - } - - CleanupStack::PopAndDestroy( &fs ); - - aFileName = parse.Name(); - - MUS_LOG( "mus: [MUSUI ] < - MusUiFileUtil::CreateVideoFileNameL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void MusUiFileUtil::DeleteFileL( const TDesC& aFileName ) - { - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - TInt error = fs.Delete( aFileName ); - if ( ( error != KErrNone ) && ( error != KErrNotFound ) ) - { - User::Leave( error ); - } - CleanupStack::PopAndDestroy( &fs ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuigeneralview.cpp --- a/mmsharing/mmshui/src/musuigeneralview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,887 +0,0 @@ -/* -* 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 -* -*/ - - - -#include "musuigeneralview.h" -#include "musui.hrh" -#include "musuiappui.h" // Application UI class -#include "musuistatuspanehandler.h" -#include "musuieventcontroller.h" -#include "musuiviewcontainer.h" -#include "musuidefinitions.h" -#include "mussettings.h" -#include "mussettingskeys.h" -#include "muslogger.h" // debug logging -#include "musuiactivetimer.h" -#include "musuibackgroundviewcontainer.h" -#include -#include - -#include // Eikon enviroment -#include -#include -#include -#include -#include -#include -#include - -const TInt KBackgroundIntervalForClose = 10 * 1000 * 1000; // 10s -const TInt KMusFgBgEventFiltering = 200 * 1000; // 200 ms - -// ----------------------------------------------------------------------------- -// EPOC two-phased constructor -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::ConstructL" ); - - BaseConstructL( R_MUSUI_VIEW ); - TInt toolbarId = R_MUS_TOOLBAR; - if (!AknLayoutUtils::PenEnabled()) - { - toolbarId = R_MUS_TOOLBAR_NONTOUCH; - } - CreateAndSetToolbarL(toolbarId); - - // check if operator specific functionality is needed - iOperatorSpecificFunctionality = - ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EOperatorSpecific ); - - iIncallBubble = CAknIncallBubble::NewL(); - iSessionEndTimer = CMusUiActiveTimer::NewL( this ); - - iFgBgTimer = CMusUiActiveTimer::NewL( this ); - - if( MUS_NO_TOOLBAR ) - { - MUS_LOG( "mus: [MUSUI ] Operator variant hides toolbar!" ); - Toolbar()->SetToolbarVisibility( EFalse ); - Toolbar()->MakeVisible(EFalse); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiGeneralView::~CMusUiGeneralView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::~CMusUiGeneralView" ); - - delete iSessionEndTimer; - - delete iFgBgTimer; - - if ( iIncallBubble ) - { - TRAP_IGNORE( iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue ) ) - } - delete iIncallBubble; - - /* Remove and delete background container */ - if ( iBackgroundContainer ) - { - AppUi()->RemoveFromViewStack( *this, iBackgroundContainer ); - } - delete iBackgroundContainer; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::~CMusUiGeneralView" ); - } - - -// ----------------------------------------------------------------------------- -// Fetches a pointer to the application's AppUi class ( CMusUiAppUi ) -// ----------------------------------------------------------------------------- -// -CMusUiAppUi* CMusUiGeneralView::MusAppUi() const - { - MUS_LOG( "mus: [MUSUI ] CMusUiGeneralView::MusAppUi()" ); - return static_cast( iEikonEnv->AppUi() ); - } - - - -// ----------------------------------------------------------------------------- -// To be overridden in subclasses -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::HandleKeyUpEvent( TInt /*aKeyCode*/ ) - { - // NOP - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::SetToolbarVisibility( TBool aVisible ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::SetToolbarVisibility: %d", - aVisible ); - - if( MUS_NO_TOOLBAR ) - { - MUS_LOG( "mus: [MUSUI ] Operator variant hides toolbar!" ); - Toolbar()->SetToolbarVisibility( EFalse ); - Toolbar()->MakeVisible(EFalse); - return; - } - - // Show toolbar only after established session and before of exit procedure - if ( aVisible && - EventController() && - !EventController()->ExitOccured() && - EventController()->ConnectionEstablished() ) - { - MUS_LOG( "mus: [MUSUI ] setting toolbar visible" ); - - if ( SharingContainer().WaitDialogShown() ) - { - // Cannot show toolbar at the moment as it would go over the dialog. - // Instead, request container to set visibility once dialog - // is dismissed. - SharingContainer().RequestToolbarVisibilityOnceDialogDismissed( this ); - } - else - { - Toolbar()->SetToolbarVisibility( ETrue ); - Toolbar()->MakeVisible(ETrue); - } - } - else if ( !aVisible && EventController()->ExitOccured() ) - { - Toolbar()->SetToolbarVisibility( EFalse ); - Toolbar()->MakeVisible(EFalse); - } - else - { - MUS_LOG( "mus: [MUSUI ] We do not set fixed toolbar invisible" ); - if (!AknLayoutUtils::PenEnabled()) - { - Toolbar()->SetToolbarVisibility( EFalse ); - Toolbar()->MakeVisible(EFalse); - } - - SharingContainer().RequestToolbarVisibilityOnceDialogDismissed( NULL ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::SetToolbarVisibility" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::AsyncQueryDialogAcceptedL( TBool aAccepted ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::AsyncQueryDialogAcceptedL" ); - - EventControllerL().AsyncQueryDialogAcceptedL( aAccepted ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::AsyncQueryDialogAcceptedL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiGeneralView::FocusedToolbarItem() const - { - MUS_LOG( "mus: [MUSUI ] <-> CMusUiGeneralView::FocusedToolbarItem" ); - return Toolbar()->FocusedItem(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::DynInitToolbarL( TInt /*aResourceId*/, - CAknToolbar* /*aToolbar*/ ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DynInitToolbarL" ); - - Toolbar()->SetWithSliding( EFalse ); - - // Hide items according to states of speaker and microphone: - - Toolbar()->HideItem( EventControllerL().IsMicMutedL() ? - EMusuiCmdToolbarMute : - EMusuiCmdToolbarUnmute, - ETrue, - ETrue ); - - TBool loudSpeakerEnabled( EventControllerL().IsLoudSpeakerEnabled() ); - - Toolbar()->HideItem( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOn : - EMusuiCmdToolbarSpeakerOff, - ETrue, - ETrue ); - - // Dim audio routing button if audio routing cannot be changed - // or when some button is selected - TBool dimAudioRouting( iToolbarItemSelected || - !EventControllerL().AudioRoutingCanBeChanged() ); - - Toolbar()->SetItemDimmed( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOff : - EMusuiCmdToolbarSpeakerOn, - dimAudioRouting, - ETrue ); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DynInitToolbarL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::OfferToolbarEventL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::OfferToolbarEventL: %d", - aCommand ); - EventControllerL().OfferToolbarEventL( aCommand ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::OfferToolbarEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiGeneralView::ShowWaitDialogL( const TDesC& aPrompt, - TInt aTimerInSeconds, - TInt aExpirationMessageResourceId ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiGeneralView::ShowWaitDialogL: ", - aPrompt ); - - TBool retVal = SharingContainer().RunWaitDialogL( - aPrompt, - aTimerInSeconds, - aExpirationMessageResourceId ); - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiGeneralView::ShowWaitDialogL: retVal = %d", - retVal ) - - return retVal; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::DismissWaitDialogL( TBool aReturnValue ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DismissWaitDialogL" ); - - SharingContainer().DismissWaitDialogL( aReturnValue ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DismissWaitDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::SetWaitDialogCallbackL( MProgressDialogCallback* aCallback ) - { - SharingContainer().SetWaitDialogCallbackL( aCallback ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::ShowStatusPaneTitleL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::ShowStatusPaneTitleL" ); - - MusAppUi()->MusStatusPane()->ActivateNaviPaneMediaL(); - - // Status Pane Title: - if ( EventControllerL().MusContactName().Length() > 0 ) - { - MusAppUi()->MusStatusPane()->SetTitleL( - EventControllerL().MusContactName() ); - } - else if ( EventControllerL().MusTelNumberValue().Length() > 0 ) - { - MusAppUi()->MusStatusPane()->SetTitleL( - EventControllerL().MusTelNumberValue() ); - } - else - { - MusAppUi()->MusStatusPane()->SetTitleFromResourceL( - R_MUS_LIVE_SHARING_VIEW_TITLE ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::ShowStatusPaneTitleL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::EnableMiddleSoftkeyL( TInt aResourceId ) - { - // Update Middle softkey - CEikButtonGroupContainer* cba = Cba(); - if ( cba ) - { - cba->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition, - aResourceId ); - cba->DrawDeferred(); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::ActivateVolumeControlL( TInt aValue ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::ActivateVolumeControlL" ); - - MusAppUi()->MusStatusPane()->ActivateVolumeControlL( aValue ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::ActivateVolumeControlL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::HighlightSelectedToolbarItem( TInt aCommand ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::HightlightSelectedToolbarItem" ); - iToolbarItemSelected = !iToolbarItemSelected; - CAknButton* button = static_cast( Toolbar()->ControlOrNull( - aCommand ) ); - button->SetCurrentState( iToolbarItemSelected ? 1 : 0, ETrue ); - - TBool dimAudioRouting( iToolbarItemSelected || - !( EventController() && - EventController()->AudioRoutingCanBeChanged() ) ); - - for ( TInt i = EMusuiCmdToolbarVolume; i < EMusUiCmdToolbarLastIndex; i++ ) - { - // Undim audio routing buttons only if changing the routing is allowed - if ( i == EMusuiCmdToolbarSpeakerOn ) - { - Toolbar()->SetItemDimmed( - EMusuiCmdToolbarSpeakerOn, - dimAudioRouting, - ETrue ); - } - else if ( i == EMusuiCmdToolbarSpeakerOff ) - { - Toolbar()->SetItemDimmed( - EMusuiCmdToolbarSpeakerOff, - dimAudioRouting, - ETrue ); - } - else if ( i != aCommand ) - { - Toolbar()->SetItemDimmed( i, iToolbarItemSelected, ETrue ); - } - else - { - // NOP - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::HightlightSelectedToolbarItem" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::ReplaceToolbarCommand: %d", - aNewCommand ); - - // Hide the old item: - Toolbar()->HideItem( aOldCommand, ETrue, EFalse ); - // Show new item: - Toolbar()->HideItem( aNewCommand, EFalse, ETrue ); - - TBool dimAudioRouting( iToolbarItemSelected || - !( EventController() && - EventController()->AudioRoutingCanBeChanged() ) ); - - if ( aNewCommand == EMusuiCmdToolbarSpeakerOn || - aNewCommand == EMusuiCmdToolbarSpeakerOff ) - { - // Dim audio routing button if audio routing cannot be changed - Toolbar()->SetItemDimmed( aNewCommand, - dimAudioRouting, - ETrue ); - } - - if ( aSetNewCommandFocused && - !AknLayoutUtils::PenEnabled() ) - { - TRAP_IGNORE( Toolbar()->SetFocusedItemL( aNewCommand ) ); - } - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiGeneralView::ReplaceToolbarCommand: %d", - aNewCommand ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::RefreshAudioRoutingToolbarButton() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::RefreshAudioRoutingToolbarButton" ) - TBool loudSpeakerEnabled( EventController() && - EventController()->IsLoudSpeakerEnabled() ); - if ( MUS_NO_TOOLBAR ) - { - TRAP_IGNORE( EnableMiddleSoftkeyL( loudSpeakerEnabled ? - R_MUSUI_VIEW_OPS_MSK_IHF_OFF : - R_MUSUI_VIEW_OPS_MSK_IHF_ON ) ); - } - else if ( Toolbar()->IsShown() ) - { - // If toolbar is not shown, it will be refreshed automatically when shown. - TInt focusedItem( Toolbar()->FocusedItem() ); - TBool focusInAudioRouting( focusedItem == EMusuiCmdToolbarSpeakerOff || - focusedItem == EMusuiCmdToolbarSpeakerOn ); - - TBool loudSpeakerEnabled( EventController() && - EventController()->IsLoudSpeakerEnabled() ); - - // Hide old audio routing buttton - Toolbar()->HideItem( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOn : - EMusuiCmdToolbarSpeakerOff, - ETrue, - EFalse ); - - // Show new audio routing button - Toolbar()->HideItem( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOff : - EMusuiCmdToolbarSpeakerOn, - EFalse, - ETrue ); - - // Dim new audio routing button if audio routing cannot be changed - // or when some button is selected - TBool dimAudioRouting( iToolbarItemSelected || - !( EventController() && - EventController()->AudioRoutingCanBeChanged() ) ); - - Toolbar()->SetItemDimmed( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOff : - EMusuiCmdToolbarSpeakerOn, - dimAudioRouting, - ETrue ); - - // If audio routing button has been focused, focus also the new button - // if it is not dimmed - if ( focusInAudioRouting && - !dimAudioRouting && - !AknLayoutUtils::PenEnabled() ) - { - TRAP_IGNORE( Toolbar()->SetFocusedItemL( loudSpeakerEnabled ? - EMusuiCmdToolbarSpeakerOff : - EMusuiCmdToolbarSpeakerOn ) ) - } - - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::RefreshAudioRoutingToolbarButton" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::UpdateSessionTime( const TDesC& aSessionTime ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiGeneralView::UpdateSessionTime: ", - aSessionTime ); - - TRAPD( err, MusAppUi()->MusStatusPane()->SetLeftLabelL( aSessionTime ) ); - if ( err != KErrNone ) - { - EventController()->HandleError( err ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::UpdateSessionTime" ); - } - - -// ----------------------------------------------------------------------------- -// takes care of view command handling -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::HandleCommandL( TInt aCommand ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::HandleCommandL" ); - - EventControllerL().HandleCommandL( aCommand ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::HandleCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventController& CMusUiGeneralView::EventControllerL() const - { - __ASSERT_ALWAYS( EventController(), User::Leave( KErrNotFound ) ); - - return *EventController(); - } - - -// ----------------------------------------------------------------------------- -// Called when focus event occurs. Timer is started once coming to foreground -// as often in such case we receive burst of foreground/background events. -// Timer is used to filter that burst and to determine the final condition. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::HandleForegroundEventL( TBool aForeground, TBool aExit ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::HandleForegroundEventL: %d", - aForeground ); - - SetCurrentFgBgEvent( ( aForeground ? EMusFgEvent : EMusBgEvent ) ); - iCurrentExitSetting = aExit; - - if ( !iFgBgTimer->IsActive() ) - { - if ( aForeground ) - { - MUS_LOG( "mus: [MUSUI ] immediately to fg" ); - RefreshView(); - DoForegroundEventL(); - } - else - { - DoBackgroundEventL( iCurrentExitSetting ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::HandleForegroundEventL,\ -immediately to bg" ); - return; - } - } - - iFgBgTimer->After( KMusFgBgEventFiltering ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::HandleForegroundEventL" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusUiActiveTimerObserver -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::TimerComplete( CMusUiActiveTimer* aTimer ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::TimerComplete" ); - - if ( aTimer == iSessionEndTimer ) - { - MUS_LOG( "mus: [MUSUI ] Close application because of going \ -in background" ); - - TRAP_IGNORE( EventControllerL().HandleExitL() ) - } - else - { - TRAP_IGNORE( CompleteForegroundEventL() ) - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::TimerComplete" ); - } - - -// ----------------------------------------------------------------------------- -// From MEikMenuObserver, Called by framework before constructing menupane. -// Initializes menu items common to all sharing types. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::DynInitMenuPaneL [%d]", - aResourceId ); - - if ( aResourceId == R_MUSUI_VIEW_MENU ) - { - - // Delete Single session items: - aMenuPane->DeleteMenuItem( EMusuiCmdViewShareVideo ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewShareImage ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewShareLive ); - if ( MUS_NO_TOOLBAR ) - { - aMenuPane->DeleteMenuItem( EventControllerL().IsMicMutedL() ? - EMusuiCmdViewMicrophoneMute : - EMusuiCmdViewMicrophoneUnmute ); - } - else - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewMicrophoneMute ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewMicrophoneUnmute ); - } - - if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) ) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DynInitMenuPaneL" ); - } - - -// ----------------------------------------------------------------------------- -// CMusUiGeneralView::DoActivateL -// From CAknView, Gets called from framework when activating this view -// ----------------------------------------------------------------------------- -void CMusUiGeneralView::DoActivateL( const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DoActivateL()" ) - - - MusAppUi()->MusStatusPane()->ClearNaviPaneL(); - MusAppUi()->MusStatusPane()->SetTitleFromResourceL( - R_MUS_LIVE_SHARING_VIEW_TITLE ); - - iIncallBubble->SetIncallBubbleAllowedInUsualL( EFalse ); - - /* Draw the skin background in the client rectangle area.*/ - if ( !iBackgroundContainer ) - { - /* Construct background container with clientrect area and - * Ordinal position of 0 ie highest so that it draws the initial - * skin background first. - */ - iBackgroundContainer = - CMusUiBackgroundViewContainer::NewL( ClientRect(), 0 ); - /* Add container to view stack so that it get view events */ - AppUi()->AddToViewStackL( *this, iBackgroundContainer ); - } - else - { - /* Set the windows ordinal position to highest ie 0, - * so that background gets priority and drawn first. - */ - iBackgroundContainer->SetOrdinalPosition( 0 ); - } - /* Draw the skin background now */ - iBackgroundContainer->DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DoActivateL()" ) - } - - -// ----------------------------------------------------------------------------- -// CMusUiGeneralView::DoDeactivate -// From AknView, Gets called from framework when deactivating this view -// ----------------------------------------------------------------------------- -void CMusUiGeneralView::DoDeactivate() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DoDeactivate()" ) - if ( iBackgroundContainer ) - { - AppUi()->RemoveFromViewStack( *this, iBackgroundContainer ); - delete iBackgroundContainer; - iBackgroundContainer = NULL; - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DoDeactivate()" ) - } - - -// ----------------------------------------------------------------------------- -// Asynchronous completion of last fg/bg condition. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::CompleteForegroundEventL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::CompleteForegroundEventL()" ) - - switch ( iCurrentFgBgEvent ) - { - case EMusFgEvent: - { - DoForegroundEventL(); - break; - } - case EMusBgEvent: - { - DoBackgroundEventL( iCurrentExitSetting ); - break; - } - default: - { - break; - } - } - - SetCurrentFgBgEvent( EMusFgBgEventNone ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::CompleteForegroundEventL()" ) - } - - -// ----------------------------------------------------------------------------- -// Complete foreground event. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::DoForegroundEventL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DoForegroundEventL()" ) - - /* if background container exist then draw now. but do not change - * the ordinal so that other control preceed in drawing. - */ - if( iBackgroundContainer ) - { - iBackgroundContainer->RefreshView(); - } - iSessionEndTimer->Cancel(); - - EventControllerL().HandleForegroundEventL( ETrue ); - iIncallBubble->SetIncallBubbleAllowedInUsualL( EFalse ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DoForegroundEventL()" ) - } - - -// ----------------------------------------------------------------------------- -// Complete background event. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::DoBackgroundEventL( TBool aExit ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiGeneralView::DoBackgroundEventL()" ) - - if ( aExit ) - { - MUS_LOG( "mus: [MUSUI ] Go to background, \ - wait some seconds before closing..." ); - iSessionEndTimer->After( KBackgroundIntervalForClose ); - } - if ( !MusAppUi()->ExitValue() ) - { - MUS_LOG( "mus: [MUSUI ] Calling EventControllerL()" ); - EventControllerL().HandleForegroundEventL( EFalse ); - // If exiting, next will be called by destructor - iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue ); - } - - SetCurrentFgBgEvent( EMusFgBgEventNone ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::DoBackgroundEventL()" ) - } - -// ----------------------------------------------------------------------------- -// Set current fg/bg condition. -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::SetCurrentFgBgEvent( TMusFgBgEventType aEventType ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiGeneralView::SetCurrentFgBgEvent() event:%d", - aEventType ) - - iCurrentFgBgEvent = aEventType; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiGeneralView::OperatorSpecificFunctionality() const - { - return iOperatorSpecificFunctionality; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiGeneralView::ToolbarPlaceHolderHeight() const - { - TInt toolbarPlaceHolderHeight( 0 ); - CAknAppUiBase::TAppUiOrientation orientation = MusAppUi()->AppOrientation(); - if ( !Toolbar()->IsShown() && - orientation == CAknAppUiBase::EAppUiOrientationPortrait && - AknLayoutUtils::PenEnabled() ) - { - // In touch UI in portrait mode the toolbar - // fills the whole lower part of the screen - toolbarPlaceHolderHeight = Toolbar()->Size().iHeight; - } - return toolbarPlaceHolderHeight; - } - -// ----------------------------------------------------------------------------- -// Increase/Decrease background container ordinal so that other controls -// can preceed background -// ----------------------------------------------------------------------------- -// -void CMusUiGeneralView::UpdateBackgroundOrdinalPosition( TBool aUp ) - { - // If there is no background container then do not care - if ( iBackgroundContainer ) - { - iBackgroundContainer->UpdateOrdinalPositionValue( aUp ); - } - } -// end of file - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiinvitationquery.cpp --- a/mmsharing/mmshui/src/musuiinvitationquery.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuiinvitationquery.h" -#include "musuiinvitationqueryobserver.h" -#include "musuidefinitions.h" -#include "musuiactivetimer.h" -#include "muslogger.h" -#include "musunittesting.h" - -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// Two phase constructor -// ----------------------------------------------------------------------------- -// -CMusUiInvitationQuery* CMusUiInvitationQuery::NewL( - MMusUiInvitationQueryObserver& aView ) - { - CMusUiInvitationQuery* self - = new( ELeave ) CMusUiInvitationQuery( aView ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiInvitationQuery::~CMusUiInvitationQuery() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiInvitationQuery::~CMusUiInvitationQuery" ); - - delete iGlobalQuery; - delete iPrompt; - - delete iActiveTimer; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiInvitationQuery::~CMusUiInvitationQuery" ); - } - - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -// -CMusUiInvitationQuery::CMusUiInvitationQuery( MMusUiInvitationQueryObserver& aView ) - : CActive( EPriorityNormal ), iObserver( aView ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// Second phase constructor -// ----------------------------------------------------------------------------- -// -void CMusUiInvitationQuery::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiInvitationQuery::ConstructL" ); - - iGlobalQuery = CAknGlobalConfirmationQuery::NewL(); - iPrompt = NULL; - - iActiveTimer = CMusUiActiveTimer::NewL( this ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiInvitationQuery::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Shows the confirmation query dialog -// ----------------------------------------------------------------------------- -// -void CMusUiInvitationQuery::ShowL( const TDesC& aContact ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiInvitationQuery::ShowL" ); - if ( iPrompt ) - { - delete iPrompt; - iPrompt = NULL; - } - - iPrompt = StringLoader::LoadL( - R_MUS_RECEIVE_VIEW_NOTE_INCOMING_VIDEO_REQUEST, - aContact ); - if ( iActiveTimer->IsActive() ) - { - // If Timer is active already , dont know what to do - // It might mean a invitation ongoing. - } - else - { - iActiveTimer->After( KMusInviteExpireTimeout * KMusOneSecond ); - iGlobalQuery->ShowConfirmationQueryL( - iStatus, - *iPrompt, - R_AVKON_SOFTKEYS_YES_NO ); - SetActive(); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiInvitationQuery::ShowL" ); - } - - -// ----------------------------------------------------------------------------- -// Timer Expiry event. -// ----------------------------------------------------------------------------- -// -void CMusUiInvitationQuery::TimerComplete( CMusUiActiveTimer* /*aTimer*/ ) - { - Cancel(); - TRAP_IGNORE( iObserver.InvitationRejectedL() ); - } - - -// ----------------------------------------------------------------------------- -// CActive RunL implementation. -// ----------------------------------------------------------------------------- -// -void CMusUiInvitationQuery::RunL() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiInvitationQuery::RunL [%d]", iStatus.Int() ); - iActiveTimer->Cancel(); - if ( iStatus == EAknSoftkeyYes ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiInvitationQuery::RunL: if" ); - iObserver.InvitationAcceptedL(); - } - else // EAknSoftkeyNo - { - MUS_LOG( "mus: [MUSUI ] CMusUiInvitationQuery::RunL: else" ); - iObserver.InvitationRejectedL(); - } - Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiInvitationQuery::RunL" ); - } - - -// ----------------------------------------------------------------------------- -// Cancel() will call this -// ----------------------------------------------------------------------------- -// -void CMusUiInvitationQuery::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiInvitationQuery::DoCancel" ); - iGlobalQuery->CancelConfirmationQuery(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiInvitationQuery::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// If RunL() leaves should be handled here. -// ----------------------------------------------------------------------------- -// -TInt CMusUiInvitationQuery::RunError( TInt aError ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiInvitationQuery::RunError [%d]", aError ); - - // Handle the error fully here. No cleanup needed in this case. - // default active scheduler will panic by calling Error() if - // it not handled here. so return KErrNone. - aError = KErrNone; - - return aError; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuilevelindicator.cpp --- a/mmsharing/mmshui/src/musuilevelindicator.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,480 +0,0 @@ -/* -* Copyright (c) 2003, 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 for displaying level indicator icons -* -*/ - - -// USER -#include "musuilevelindicator.h" -#include "musuilevelindicatorobserver.h" -#include "muslogger.h" -#include "musresourcefinderutil.h" -#include "musuiactivetimer.h" -#include -#include - -// SYSTEM -#include -#include -#include -#include -#include -#include -#include -#include - - -// CONSTANTS -const TInt KMusUiLevelDisableTime = 4000000; -const TInt KMusUiSliderEventDelay = 300000; - - -_LIT( KMyBitmapRomFile, "Z:\\resource\\apps\\musuiicons.mif" ); -//_LIT( KMyBitmapRamFile, "C:\\resource\\apps\\musuiicons.mif" ); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLevelIndicator::CMusUiLevelIndicator( - TInt aMinLevel, - TInt aMaxLevel, - MMusUiLevelIndicatorObserver* aObserver ) - : iMinLevel( aMinLevel ), - iMaxLevel( aMaxLevel ), - iObserver( aObserver ) - { - MUS_LOG( "mus: mus: [MUSUI ] -> CMusUiLevelIndicator::CMusUiLevelIndicator()" ); - // pass - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::CMusUiLevelIndicator()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLevelIndicator* CMusUiLevelIndicator::NewL( - TAknOrientation aLayout, - TInt aMinLevel, - TInt aMaxLevel, - CCoeControl* aParent, - const TRect& aRect, - MMusUiLevelIndicatorObserver* aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::NewL()" ); - - CMusUiLevelIndicator* self = NewLC( aLayout, - aMinLevel, - aMaxLevel, - aParent, - aRect, - aObserver ); - CleanupStack::Pop( self ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::NewL()" ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLevelIndicator* CMusUiLevelIndicator::NewLC( - TAknOrientation aLayout, - TInt aMinLevel, - TInt aMaxLevel, - CCoeControl* aParent, - const TRect& aRect, - MMusUiLevelIndicatorObserver* aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::NewLC()" ); - - CMusUiLevelIndicator* self = new ( ELeave ) CMusUiLevelIndicator( - aMinLevel, - aMaxLevel, - aObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aLayout, aParent, aRect ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::NewLC()" ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLevelIndicator::~CMusUiLevelIndicator() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::~CMusUiLevelIndicator()" ); - - delete iSlider; - delete iSliderEventTimer; - delete iDisableLevelTimer; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::~CMusUiLevelIndicator()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::ConstructL( TAknOrientation aLayout, - CCoeControl* aParent, - const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::ConstructL()" ); - - SetRect(aRect); - - if( iMinLevel > iMaxLevel ) - { - User::Leave( KErrArgument ); - } - - iDisableLevelTimer = CMusUiActiveTimer::NewL( this ); - iSliderEventTimer = CMusUiActiveTimer::NewL( this ); - - iSlider = new CAknSlider(); - - TResourceReader reader; - - if( aLayout == EAknOrientationHorizontal ) - { - iEikonEnv->CreateResourceReaderLC( reader, R_MUS_SLIDER_HORIZONTAL ); - MUS_LOG( "mus: [MUSUI ] -> ConstructFromResourceL" ); - iSlider->ConstructFromResourceL( aParent, 0, reader); - CleanupStack::PopAndDestroy(); // reader - iSlider->SetRange( iMinLevel, iMaxLevel ); - iSlider->SetRect( aRect ); - } - else - { - iEikonEnv->CreateResourceReaderLC( reader, R_MUS_SLIDER_VERTICAL ); - iSlider->ConstructFromResourceL( aParent, 0 ,reader); - CleanupStack::PopAndDestroy(); // reader - TRect rect = TRect( TPoint( (aRect.iBr.iX - iSlider->Size().iWidth),(aRect.iTl.iY) ),TSize( iSlider->Size() ) ); - iSlider->SetRect(rect); - - /* Draw the Min and Max Zoom */ - TParse parse; - parse.Set( KMyBitmapRomFile, &KDC_APP_RESOURCE_DIR, NULL ); - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - AknsUtils::CreateIconL(AknsUtils::SkinInstance(), - KAknsIIDQsnBgScreen, - bitmap, - mask, - parse.FullName(), - EMbmMusuiiconsQgn_indi_browser_tb_zoom_in, - EMbmMusuiiconsQgn_indi_browser_tb_zoom_in_mask); - iSlider->SetGraphics(CAknSlider::EElemEmptyLeftCap,bitmap,mask); - AknsUtils::CreateIconL(AknsUtils::SkinInstance(), - KAknsIIDQsnBgScreen, - bitmap, - mask, - parse.FullName(), - EMbmMusuiiconsQgn_indi_browser_tb_zoom_out, - EMbmMusuiiconsQgn_indi_browser_tb_zoom_out_mask); - iSlider->SetGraphics(CAknSlider::EElemEmptyRightCap,bitmap,mask); - } - - iSlider->HandleResourceChange( - KEikMessageCaptionedControlEditableStateChange ); - iSlider->SetObserver( this ); - iSlider->SetPositionIndicators( CAknSlider::EPosMarker ); - iSlider->SetTicksEnabled( EFalse ); - iSlider->EnableDrag(); - iSlider->SetStepSize( 1 ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::ConstructL()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::SetLevelL( TMusUiIndicatorType aType, - TInt aLevel, - TBool aUseTimer ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLevelIndicator::SetLevelL( %d ) ", - aLevel ); - if ( aLevel >= iMinLevel && aLevel <= iMaxLevel ) - { - switch(aType) - { - case EMusUiIndicatorTypeZoom: - { - iZoomLevel=aLevel; - break; - } - case EMusUiIndicatorTypeBrightness: - { - iBrightnessLevel=aLevel; - break; - } - case EMusUiIndicatorTypeDuration: - { - iDurationLevel=aLevel; - break; - } - } - } - - // Set it to the slider - if ( !iSliderEventTimer->IsActive() ) - { - iSlider->SetValueL( aLevel ); - } - - DrawNow(); - - if ( aUseTimer ) - { - iDisableLevelTimer->After( KMusUiLevelDisableTime ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::SetLevelL()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiLevelIndicator::GetLevel( TMusUiIndicatorType aType ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::GetLevel()" ); - - TInt ret=KErrNotFound; - - switch(aType) - { - case EMusUiIndicatorTypeZoom: - { - ret=iZoomLevel; - break; - } - case EMusUiIndicatorTypeBrightness: - { - ret=iBrightnessLevel; - break; - } - - case EMusUiIndicatorTypeDuration: - { - ret = iSlider->Value(); - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::GetLevel()" ); - return ret; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::SetRange( TInt aMinLevel, - TInt aMaxLevel, - TBool aUseTimer) - { - MUS_LOG2( "mus: [MUSUI ] -> CMusUiLevelIndicator::SetRange( %d - %d ) ", - aMinLevel, aMaxLevel ); - - if( aMinLevel < aMaxLevel ) - { - iMinLevel = aMinLevel; - iMaxLevel = aMaxLevel; - iSlider->SetRange( iMinLevel, iMaxLevel ); - } - - if ( aUseTimer ) - { - iDisableLevelTimer->After( KMusUiLevelDisableTime ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::SetRange()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::SetIndicatorType( TMusUiIndicatorType aType ) - { - iIndicatorType = aType; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::SizeChanged() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::SizeChanged()" ); - - if ( iSlider ) - { - iSlider->SetRect( Rect() ); - } - - DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::SizeChanged()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -void CMusUiLevelIndicator::Draw( const TRect& aRect ) const - { - CWindowGc& gc = SystemGc(); - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiLevelIndicator::CountComponentControls() const - { - return 1; // return nbr of controls inside this container - } - - -// ----------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// ----------------------------------------------------------------------------- -// -CCoeControl* CMusUiLevelIndicator::ComponentControl( TInt aIndex ) const - { - switch ( aIndex ) - { - case 0: - { - return iSlider; - } - default: - { - return NULL; - } - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::HandleResourceChange( TInt aType ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLevelIndicator::HandleResourceChange()" ); - - if( aType==KEikDynamicLayoutVariantSwitch ) - { - if ( iSlider ) // Force a re-layout - { - iSlider->SetRect( Rect() ); - } - } - - DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLevelIndicator::HandleResourceChange()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::HandleControlEventL( CCoeControl* aControl, - TCoeEvent aEventType) - { - // No logging due to huge amount of events - - if ( aControl == iSlider && - aEventType == MCoeControlObserver::EEventStateChanged ) - { - // Restart the disable timer if running - if ( iDisableLevelTimer->IsActive() ) - { - iDisableLevelTimer->After( KMusUiLevelDisableTime ); - } - - if ( iObserver ) - { - iSliderEventTimer->After( KMusUiSliderEventDelay ); - } - } - - // No logging due to huge amount of events - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLevelIndicator::TimerComplete( CMusUiActiveTimer* aTimer ) - { - if ( aTimer == iSliderEventTimer ) - { - MUS_LOG( "mus: [MUSUI ] Slider event timer complete" ); - - if ( iObserver ) - { - iObserver->IndicatorLevelChanged( iSlider->Value() ); - } - } - else if ( aTimer == iDisableLevelTimer ) - { - MUS_LOG( "mus: [MUSUI ] Slider visibility timer complete" ); - - if ( iObserver ) - { - iObserver->SetLevelIndicatorVisibility( EFalse ); - } - } - else - { - // NOP - } - } - - - -// End of File - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuilivesharingcontroller.cpp --- a/mmsharing/mmshui/src/musuilivesharingcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,907 +0,0 @@ -/* -* 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: Application's UI class. -* -*/ - - - -#include "musuilivesharingcontroller.h" -#include "musuicallbackservice.h" -#include "musuieventobserver.h" -#include "musuisharingobserver.h" -#include "musuisendobserver.h" -#include "musuilivesharingobserver.h" -#include "musuidialogutil.h" -#include "musenglivesession.h" -#include "musuiresourcehandler.h" -#include "musui.hrh" -#include "mussettings.h" -#include "mussettingskeys.h" -#include "muslogger.h" // debug logging -#include "musuigeneralview.h" - -#include -#include -#include - -#include - -using namespace NMusResourceApi; -using namespace MusSettingsKeys; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLiveSharingController* CMusUiLiveSharingController::NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiLiveSharingObserver& aLiveObserver, - const TRect& aRect ) - { - CMusUiLiveSharingController* self = - new( ELeave ) CMusUiLiveSharingController( aEventObserver, - aSharingObserver, - aSendObserver, - aLiveObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLiveSharingController::~CMusUiLiveSharingController() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::~CMusUiLiveSharingController" ); - delete iSession; - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::~CMusUiLiveSharingController" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLiveSharingController::CMusUiLiveSharingController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver, - MMusUiLiveSharingObserver& aLiveObserver ) - : CMusUiSendController( aEventObserver, aSharingObserver, aSendObserver ), - iLiveObserver( aLiveObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::ConstructL( const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ConstructL" ); - - CMusUiSendController::ConstructL(); // Base class construction - - iSession = CMusEngLiveSession::NewL( VideoFileNameL(), - aRect, - *this, - *this, - *this, - iSipProfileId ); - - iSession->SetAudioRoutingObserver( this ); - - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - } - - if ( iVideoCodec && iVideoCodec->Length() > 0 ) - { - iSession->SetSupportedVideoCodecListL( *iVideoCodec ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::PlayL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::PlayL" ); - - CMusUiSendController::PlayL(); - iEventObserver.ShowNaviPaneIconL( - (!iDiskFull) ? RecordIcon() : EMusUiNaviIconRecordNot ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PlayL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::PauseL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::PauseL" ); - - CMusUiSendController::PauseL(); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PauseL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::DeleteEngineSession() - { - CMusUiSendController::DeleteEngineSession(); - - delete iSession; - iSession = NULL; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession* CMusUiLiveSharingController::EngineOutSession() - { - return iSession; // Live session is CMusEngMceOutSession - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::InviteL( const TDesC& aRecipient ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiLiveSharingController::InviteL:", - aRecipient ); - - // Registration must not be pending in this phase - __ASSERT_ALWAYS( !iSipRegistrationPending, - iEventObserver.HandleError( KErrNotReady ) ); - - delete iAddress; - iAddress = NULL; - iAddress = aRecipient.AllocL(); - - - TRAPD( err, iSession->InviteL( aRecipient ) ); - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: After TRAPD" ); - - // If address is in wrong format, Manual Address Entry Dialog - // is displayed - if ( err != KErrNone ) - { - // Display the error message - DismissWaitDialog(); - if ( !ExitOccured() ) - { - MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_INVITE_ERROR ); - } - if ( ( ++iTriedInvitations < 2 ) && ( err == KErrArgument ) ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: iTriedInvitations < 2" ); - iManualAddressTyped = ETrue; - iResourceHandler->RequestKeypadL( ETrue ); - iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); - return; - } - else - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: ++iTriedInvitations > 1" ); - HandleExitL(); - return; - } - } - - SetConnectionInitialized( ETrue ); - - ShowInvitingWaitDialogL(); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::InviteL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::HandleSliderValueChangeL( TInt aNewLevel ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleSliderValueChangeL(%d)", - aNewLevel ) - - __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); - __ASSERT_ALWAYS( iConnectionEstablished, User::Leave( KErrNotReady ) ); - - if ( iToolbarZoomSelected ) - { - iSession->SetZoomL( aNewLevel ); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - } - else - { - iSession->SetBrightnessL( aNewLevel ); - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleSliderValueChangeL" ) - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::OfferToolbarEventL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::OfferToolbarEventL [%d]", - aCommand ); - - iLiveObserver.SetZoomVisible( EFalse ); - iLiveObserver.SetBrightnessVisible( EFalse ); - - switch ( aCommand ) - { - case EMusuiCmdToolbarPauseLive: - { - HandleCommandL( EMusuiCmdViewPause ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPauseLive, - EMusuiCmdToolbarUnPauseLive, - ETrue ); - break; - } - - case EMusuiCmdToolbarUnPauseLive: - { - HandleCommandL( EMusuiCmdViewContinue ); - iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnPauseLive, - EMusuiCmdToolbarPauseLive, - ETrue ); - break; - } - case EMusuiCmdToolbarZoom: - { - iToolbarZoomSelected = !iToolbarZoomSelected; - - if ( iToolbarZoomSelected ) - { - iLiveObserver.SetZoomValues( iSession->MinZoomL(), - iSession->MaxZoomL() ); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - } - - iLiveObserver.SetZoomVisible( iToolbarZoomSelected ); - iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarZoom ); - - break; - } - case EMusuiCmdToolbarBrightness: - { - iToolbarBrightnessSelected = !iToolbarBrightnessSelected; - - if ( iToolbarBrightnessSelected ) - { - MUS_LOG1( "mus: [MUSUI ] CMusUiLiveSharingController::OfferToolbarEventL: Brightness %d", - iSession->CurrentBrightnessL() ); - - iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), - iSession->MaxBrightnessL() ); - - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - } - - iLiveObserver.SetBrightnessVisible( iToolbarBrightnessSelected ); - iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarBrightness ); - - break; - } - default: // Not live specific, let the base class handle - { - CMusUiEventController::OfferToolbarEventL( aCommand ); - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::OfferToolbarEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::HandleCommandL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleCommandL [%d]", - aCommand ); - - __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); - - switch ( aCommand ) - { - case EMusuiCmdViewPause: - { - PauseL(); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); - break; - } - case EMusuiCmdViewContinue: - { - PlayL(); - break; - } - - case EMusuiCmdViewShareVideo: - { - PauseL(); - // TODO: Change to video sharing - break; - } - case EMusuiCmdViewShareImage: - { - PauseL(); - // TODO: Change to image sharing - break; - } - - case EMusuiCmdToolbarZoom: - { - iToolbarZoomSelected = ETrue; - iToolbarBrightnessSelected = EFalse; - iLiveObserver.SetZoomVisible( iToolbarZoomSelected ); - iLiveObserver.SetZoomValues( iSession->MinZoomL(), - iSession->MaxZoomL() ); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - break; - } - case EMusuiCmdViewMiddleSoftkeyOk: - { - HandleMiddleSoftkeyOkL(); - break; - } - - case EMusuiCmdViewZoom: - { - ZoomL(); - break; - } - - case EMusuiCmdViewZoomIn: - { - iLiveObserver.SetZoomVisible( MUS_NO_TOOLBAR ? iZoomSelected : iToolbarZoomSelected ); - iSession->ZoomInL(); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - break; - } - case EMusuiCmdViewZoomOut: - { - iLiveObserver.SetZoomVisible( MUS_NO_TOOLBAR ? iZoomSelected : iToolbarZoomSelected ); - iSession->ZoomOutL(); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - break; - } - - case EMusuiCmdToolbarBrightness: - { - iToolbarZoomSelected = EFalse; - iToolbarBrightnessSelected = ETrue; - iLiveObserver.SetBrightnessVisible( iToolbarBrightnessSelected ); - iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), - iSession->MaxBrightnessL() ); - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - break; - } - case EMusuiCmdViewBrightness: - { - BrightnessL(); - break; - } - - case EMusuiCmdViewIncreaseBrightness: - { - iLiveObserver.SetBrightnessVisible( MUS_NO_TOOLBAR ? iBrightnessSelected : iToolbarBrightnessSelected ); - iSession->IncreaseBrightnessL(); - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - break; - } - case EMusuiCmdViewDecreaseBrightness: - { - iLiveObserver.SetBrightnessVisible( MUS_NO_TOOLBAR ? iBrightnessSelected : iToolbarBrightnessSelected ); - iSession->DecreaseBrightnessL(); - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - break; - } - - case EMusuiCmdRecord: - { - // Show toolbar hidden while showing options menu - iEventObserver.SetToolbarVisibility( ETrue ); - - if ( iDiskFull ) - { - DiskFull(); - } - else - { - iSession->RecordL( ETrue ); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecord ); - } - break; - } - case EMusuiCmdStopRecording: - { - // Show toolbar hidden while showing options menu - iEventObserver.SetToolbarVisibility( ETrue ); - - iSession->RecordL( EFalse ); - iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecordNot ); - break; - } - - default: - { - // Try more general handling - CMusUiEventController::HandleCommandL( aCommand ); - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::LevelIndicatorDismissed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::LevelIndicatorDismissed" ); - if ( MUS_NO_TOOLBAR ) - { - iZoomSelected = EFalse; - iBrightnessSelected = EFalse; - TRAP_IGNORE( iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? - R_MUSUI_VIEW_OPS_MSK_IHF_OFF : - R_MUSUI_VIEW_OPS_MSK_IHF_ON ) ); - } - else - { - if ( iToolbarZoomSelected ) - { - iToolbarZoomSelected = EFalse; - if ( !AknLayoutUtils::PenEnabled() ) - { - TRAP_IGNORE( iSharingObserver.HighlightSelectedToolbarItem(EMusuiCmdToolbarZoom) ); - } - } - else if( iToolbarBrightnessSelected ) - { - iToolbarBrightnessSelected = EFalse; - if ( !AknLayoutUtils::PenEnabled() ) - { - TRAP_IGNORE( iSharingObserver.HighlightSelectedToolbarItem(EMusuiCmdToolbarBrightness) ); - } - } - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::LevelIndicatorDismissed" ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TMusUiNaviMediaDecorator CMusUiLiveSharingController::RecordIcon() - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::RecordIcon" ); - - return (iSession->IsRecording() == EFalse) ? - EMusUiNaviIconRecordNot : - EMusUiNaviIconRecord; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::IsBrightnessSupported() - { - if ( !iSession ) - { - return EFalse; - } - TRAPD( error, iSession->SetBrightnessL( iSession->CurrentBrightnessL() ) ) - return ( error == KErrNotSupported ) ? EFalse : ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::IsDiskFull() - { - return iDiskFull; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::ToolbarZoomSelected() - { - return iToolbarZoomSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::ToolbarBrightnessSelected() - { - return iToolbarBrightnessSelected; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::ZoomSelected() - { - return iZoomSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiLiveSharingController::BrightnessSelected() - { - return iBrightnessSelected; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::ZoomL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomL" ); - iZoomSelected = ETrue; - iLiveObserver.SetZoomValues( iSession->MinZoomL(), iSession->MaxZoomL() ); - iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); - iLiveObserver.SetZoomVisible( ETrue ); - - if ( MUS_NO_TOOLBAR ) - { - iSharingObserver.EnableMiddleSoftkeyL( R_MUSUI_VIEW_MSK_OK ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::ResetToolbarSelected() - { - iToolbarZoomSelected = EFalse; - iToolbarBrightnessSelected = EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::BrightnessL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::BrightnessL" ); - iBrightnessSelected = ETrue; - iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), - iSession->MaxBrightnessL() ); - iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); - iLiveObserver.SetBrightnessVisible( ETrue ); - - if ( MUS_NO_TOOLBAR ) - { - iSharingObserver.EnableMiddleSoftkeyL( R_MUSUI_VIEW_MSK_OK ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::BrightnessL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::HandleMiddleSoftkeyOkL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleMiddleSoftkeyOkL" ); - - if ( iZoomSelected ) - { - iZoomSelected = EFalse; - iLiveObserver.SetZoomVisible( EFalse ); - } - else if ( iBrightnessSelected ) - { - iZoomSelected = EFalse; - iLiveObserver.SetBrightnessVisible( EFalse ); - } - - iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? - R_MUSUI_VIEW_OPS_MSK_IHF_OFF : - R_MUSUI_VIEW_OPS_MSK_IHF_ON ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleMiddleSoftkeyOkL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::ZoomInL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomInL" ); - iSession->ZoomInL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomInL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::ZoomOutL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomOutL" ); - iSession->ZoomOutL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomOutL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::IncreaseBrightnessL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::IncreaseBrightnessL" ); - iSession->IncreaseBrightnessL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::IncreaseBrightnessL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::DecreaseBrightnessL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::DecreaseBrightnessL" ); - iSession->DecreaseBrightnessL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::DecreaseBrightnessL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::DiskFull() - { - // Update the icon: - TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecordNot ); - DismissWaitDialog(); - // Saving ends when disk is full but streaming continues (user is notified) - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( R_MUS_VIEW_NOTE_MEMORY_LOW ) ) ); - iDiskFull = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::SessionEstablished() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionEstablished" ); - - TRAPD( error, iResourceHandler->RequestCameraL( ETrue ) ); - if ( error != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] RequestCameraL leave code: %d", error ) - } - - CMusUiSendController::SessionEstablished(); // Base class handling - - iVideoToBeSaved = ETrue; - - MusSettingsKeys::TAutoRecord autoRecordValue = EAutoRecordOff; - TRAPD ( errAutoRecord, autoRecordValue = - MultimediaSharingSettings::AutoRecordSettingL() ); - if ( errAutoRecord != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] AutoRecordSettingL leave code: %d", errAutoRecord ) - HandleError( errAutoRecord ); - } - - if ( autoRecordValue != EAutoRecordOff ) - { - TRAPD ( errRecordL, iSession->RecordL( ETrue ) ); - if ( errRecordL != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] RecordL leave code: %d", errRecordL ) - HandleError( errRecordL ); - } - } - - TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( RecordIcon() ) ) - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionEstablished" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::SessionTerminated() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionTerminated" ); - if ( !ExitOccured() ) - { - DismissWaitDialog(); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionTerminated" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::SessionConnectionLost() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionConnectionLost" ); - DismissWaitDialog(); - if ( !ExitOccured() ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_LOST ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionConnectionLost" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::SessionFailed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionFailed" ); - if ( !ExitOccured() ) - { - DismissWaitDialog(); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionFailed" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::StreamIdle() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::StreamIdle" ); - DismissWaitDialog(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::StreamIdle" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::StreamStreaming() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::StreamStreaming" ); - //DismissWaitDialog(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::StreamStreaming" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::SessionTimeChanged( - const TTimeIntervalSeconds& aSeconds ) - { - if ( aSeconds.Int() > -1 ) - { - iSharingObserver.UpdateSessionTime( SessionTimeFormatted( aSeconds ) ); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingController::InactivityTimeout() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::InactivityTimeout" ); - DismissWaitDialog(); - if ( !ExitOccured() ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::InactivityTimeout" ); - } - - - - - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuilivesharingview.cpp --- a/mmsharing/mmshui/src/musuilivesharingview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,771 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#include "musenglivesession.h" -#include "musuilivesharingview.h" -#include "musuilivesharingviewcontainer.h" -#include "musuibackgroundviewcontainer.h" -#include "musuilivesharingcontroller.h" -#include "musuiactivitymanger.h" -#include "musuiappui.h" -#include "musuistatuspanehandler.h" -#include "musui.hrh" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include -#include -#include "musengmcesession.h" - -#include -#include -#include -#include - - -const TInt KMusUiContainerWidth = 30; - - -// ----------------------------------------------------------------------------- -// EPOC two-phased constructor -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::ConstructL" ); - - CMusUiSendView::ConstructL(); - - Toolbar()->SetToolbarObserver( this ); - Toolbar()->UpdateBackground(); -/* - if( MUS_NO_TOOLBAR ) - { - MUS_LOG( "mus: [MUSUI ] Operator variant hides toolbar!" ); - Toolbar()->SetToolbarVisibility( EFalse ); - Toolbar()->MakeVisible(EFalse); - } -*/ - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiLiveSharingView::~CMusUiLiveSharingView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::~CMusUiLiveSharingView" ); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - } - delete iContainer; - delete iController; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::~CMusUiLiveSharingView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TUid CMusUiLiveSharingView::Id() const - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingView::Id()" ); - return KMusUidLiveSharingView; - } - - -// ----------------------------------------------------------------------------- -// Handle EKeyUpArrow key presses -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::HandleKeyUpArrowL() - { - HandleCommandL( - iController->ZoomSelected() ? EMusuiCmdViewZoomIn : - iController->BrightnessSelected() ? EMusuiCmdViewIncreaseBrightness : - EMusUiCmdToolbarLastIndex ); - } - - -// ----------------------------------------------------------------------------- -// Handle EKeyDownArrow key presses -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::HandleKeyDownArrowL() - { - HandleCommandL( - iController->ZoomSelected() ? EMusuiCmdViewZoomOut : - iController->BrightnessSelected() ? EMusuiCmdViewDecreaseBrightness : - EMusUiCmdToolbarLastIndex ); - } - - - - -// ----------------------------------------------------------------------------- -// From MEikMenuObserver, Called by framework before constructing menupane -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::DynInitMenuPaneL [%d]" ); - SetZoomVisible(EFalse); - SetBrightnessVisible(EFalse); - // Base class initiated initialization first - CMusUiGeneralView::DynInitMenuPaneL( aResourceId, aMenuPane ); - if( !MUS_NO_TOOLBAR ) - { - SetInitialFocusedItemL(); - } - - if ( aResourceId == R_MUSUI_VIEW_MENU ) - { - // Delete items not related to live sharing: - aMenuPane->DeleteMenuItem( EMusuiCmdViewReplay ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioMute ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioNormal ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewFullScreen ); - - if ( iController->ConnectionEstablished() - && !iController->IsDiskFull() ) - { - CMusEngLiveSession *session = dynamic_cast - ( iController->EngineOutSession() ); - - if ( session->IsPlayingL() ) - { - aMenuPane->DeleteMenuItem( session->IsRecording() ? - EMusuiCmdRecord : - EMusuiCmdStopRecording ); - } - else - { - // when camera source was paused, hide the command - aMenuPane->DeleteMenuItem( EMusuiCmdRecord ); - aMenuPane->DeleteMenuItem( EMusuiCmdStopRecording ); - } - } - else - { - // Hide recording commands if the session is not established - // TODO: check autorecord on/off - aMenuPane->DeleteMenuItem( EMusuiCmdRecord ); - aMenuPane->DeleteMenuItem( EMusuiCmdStopRecording ); - } - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - if( MUS_NO_TOOLBAR ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarZoom ); - if ( !iController->IsBrightnessSupported() || - !SendController()->IsPlayingL() ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewBrightness ); - } - - if ( !SendController()->IsPlayingL() ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewZoom ); - } - } - else - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewZoom ); - if ( !iController->IsBrightnessSupported() || - !SendController()->IsPlayingL() || - !AknLayoutUtils::PenEnabled() ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarBrightness ); - } - - if ( !SendController()->IsPlayingL() || - !AknLayoutUtils::PenEnabled() ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarZoom ); - } - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::DynInitMenuPaneL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::HandleToolbarCommandL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingView::HandleToolbarCommandL: %d", - aCommand ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - switch ( aCommand ) - { - case EKeyLeftArrow: - { - if( MUS_NO_TOOLBAR ) - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - iController->BrightnessSelected() ? EMusuiCmdViewDecreaseBrightness : - iController->ZoomSelected() ? EMusuiCmdViewZoomOut : - EMusUiCmdToolbarLastIndex ); - } - else - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - iController->ToolbarBrightnessSelected() ? EMusuiCmdViewDecreaseBrightness : - iController->ToolbarZoomSelected() ? EMusuiCmdViewZoomOut : - EMusUiCmdToolbarLastIndex ); - } - break; - } - case EKeyRightArrow: - { - if( MUS_NO_TOOLBAR ) - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - iController->BrightnessSelected() ? EMusuiCmdViewIncreaseBrightness : - iController->ZoomSelected() ? EMusuiCmdViewZoomIn : - EMusUiCmdToolbarLastIndex ); - } - else - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - iController->ToolbarBrightnessSelected() ? EMusuiCmdViewIncreaseBrightness : - iController->ToolbarZoomSelected() ? EMusuiCmdViewZoomIn : - EMusUiCmdToolbarLastIndex ); - } - break; - } - case EKeyUpArrow: - { - if( MUS_NO_TOOLBAR ) - { - HandleCommandL( - iController->ZoomSelected() ? EMusuiCmdViewZoomIn : - iController->BrightnessSelected() ? EMusuiCmdViewIncreaseBrightness : - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - EMusUiCmdToolbarLastIndex ); - } - else - { - HandleCommandL( - iController->ToolbarZoomSelected() ? EMusuiCmdViewZoomIn : - iController->ToolbarBrightnessSelected() ? EMusuiCmdViewIncreaseBrightness : - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - EMusUiCmdToolbarLastIndex ); - } - break; - } - case EKeyDownArrow: - { - if( MUS_NO_TOOLBAR ) - { - HandleCommandL( - iController->ZoomSelected() ? EMusuiCmdViewZoomOut : - iController->BrightnessSelected() ? EMusuiCmdViewDecreaseBrightness : - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - EMusUiCmdToolbarLastIndex ); - } - else - { - HandleCommandL( - iController->ToolbarZoomSelected() ? EMusuiCmdViewZoomOut : - iController->ToolbarBrightnessSelected() ? EMusuiCmdViewDecreaseBrightness : - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - EMusUiCmdToolbarLastIndex ); - } - break; - } - case EMusuiCmdViewVolumeDown: - { - HandleCommandL( EMusuiCmdViewVolumeDown ); - break; - } - case EMusuiCmdViewVolumeUp: - { - HandleCommandL( EMusuiCmdViewVolumeUp ); - break; - } - default: - { - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::HandleToolbarCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetInitialFocusedItemL() - { - MUS_LOG( "mus: [MUSUI ] -> MusUiLiveSharingView::SetInitialFocusedItemL" ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - if ( iOperatorSpecificFunctionality && !AknLayoutUtils::PenEnabled() ) - { - MUS_LOG( "Focus changed in OPERATOR mode !!!!!!!!!!!!!" ); - Toolbar()->SetFocusedItemL( EMusuiCmdToolbarZoom ); - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetInitialFocusedItemL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::DynInitToolbarL( TInt aResourceId, - CAknToolbar* aToolbar ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::DynInitToolbarL" ); - - // Items to be removed in Live Sharing View: - if (!AknLayoutUtils::PenEnabled())//(aResourceId == R_MUS_TOOLBAR_NONTOUCH)// - { - Toolbar()->RemoveItem( EMusuiCmdToolbarFFRev ); - - // Items to be removed in Live Sharing View: - if ( iController->DeviceHasDedicatedVolumeKeys() ) - { - Toolbar()->RemoveItem( EMusuiCmdToolbarVolume ); - } - else - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarVolume ); - } - - - if ( !iController->IsBrightnessSupported() ) - { - Toolbar()->HideItem( EMusuiCmdToolbarBrightness, ETrue, ETrue ); - } - else - { - if ( aToolbar->FocusedItem() == KErrNotFound ) - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarBrightness ); - } - } - } - Toolbar()->RemoveItem( EMusuiCmdToolbarPause ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPause ); - Toolbar()->RemoveItem( EMusuiCmdToolbarFullScreen ); - - if ( iOperatorSpecificFunctionality ) - { - // Remove pause/unpause functionality in operator variant case - Toolbar()->RemoveItem( EMusuiCmdToolbarPauseLive ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPauseLive ); - if ( (aToolbar->FocusedItem() == KErrNotFound ) && - !AknLayoutUtils::PenEnabled() ) - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarZoom ); - } - } - else - { - // Toggled items to be hidden: - Toolbar()->HideItem( iPauseSelected ? - EMusuiCmdToolbarPauseLive : - EMusuiCmdToolbarUnPauseLive, - ETrue, - ETrue ); - if ( aToolbar->FocusedItem() == KErrNotFound && - !AknLayoutUtils::PenEnabled() ) - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarPauseLive ); - } - } - - // Last generic base class functionality - CMusUiGeneralView::DynInitToolbarL( aResourceId, aToolbar ); - - MUS_LOG1( "aToolbar Focused Item: %d", aToolbar->FocusedItem() ); - MUS_LOG1( "toolbar() Focused Item: %d", Toolbar()->FocusedItem() ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::DynInitToolbarL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetZoomValues( TInt aMinZoom, TInt aMaxZoom ) - { - iContainer->SetZoomValues( aMinZoom, aMaxZoom ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetBrightnessValues( TInt aMinBrightness, - TInt aMaxBrightness ) - { - iContainer->SetBrightnessValues( aMinBrightness, aMaxBrightness ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetZoomL( TInt aZoomLevel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetZoomL" ); - iContainer->SetZoomL( aZoomLevel ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetZoomL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetBrightnessL( TInt aBrightnessLevel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetBrightnessL" ); - iContainer->SetBrightnessL( aBrightnessLevel ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetBrightnessL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetZoomVisible( TBool aVisible ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetZoomVisible" ); - - iContainer->SetZoomVisible( aVisible ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetZoomVisible" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::SetBrightnessVisible( TBool aVisible ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::SetBrightnessVisible" ); - - iContainer->SetBrightnessVisible( aVisible ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::SetBrightnessVisible" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::LevelIndicatorDismissed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::LevelIndicatorDismissed" ); - iController->LevelIndicatorDismissed(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::LevelIndicatorDismissed" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::RefreshAudioRoutingButton() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::RefreshAudioRoutingButton" ); - //We ignore audio routing change event in case there is Zoom/Brightness - //adjustment ongoing in operator variant. Middle softkey will be - //updated once adjustment is done - if ( !MUS_NO_TOOLBAR || - ( !iController->ZoomSelected() && - !iController->BrightnessSelected() ) ) - { - CMusUiGeneralView::RefreshAudioRoutingToolbarButton(); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::RefreshAudioRoutingButton" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::ReplaceToolbarCommand( TInt aOldCommand, - TInt aNewCommand, - TBool aSetNewCommandFocused ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingView::ReplaceToolbarCommand: %d", - aOldCommand ); - switch ( aOldCommand ) - { - case EMusuiCmdToolbarPauseLive: - { - iPauseSelected = ETrue; - /* Hide pause related toolbar items */ - HideToolbarCommandForPause(ETrue); - break; - } - case EMusuiCmdToolbarUnPauseLive: - { - iPauseSelected = EFalse; - /* Unhide pause related toolbar items */ - HideToolbarCommandForPause(EFalse); - break; - } - default: - { - break; - } - } - - // Call base class version for generic part - - CMusUiGeneralView::ReplaceToolbarCommand( aOldCommand, - aNewCommand, - aSetNewCommandFocused ); - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiLiveSharingView::ReplaceToolbarCommand: %d", - aNewCommand ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::RefreshView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::RefreshView" ); - if ( iContainer ) - { - TRect containerRect( ClientRect().iBr.iX - KMusUiContainerWidth, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - iContainer->SetRect( containerRect ); - } - - if ( iController ) - { - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - // if this function leaves we can nothing to do for camera orientation. - // Alteast we can try further to set right rectangle for display - TRAPD(err,RefreshCameraOrientationL(videoRect)); - if( err ) - { - MUS_LOG1( "mus: [MUSUI ] -> Orientation can not be changed =%d",err ); - } - iController->SetRect( videoRect ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::RefreshView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendController* CMusUiLiveSharingView::SendController() const - { - return iController; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendViewContainer* CMusUiLiveSharingView::SendContainer() const - { - return iContainer; - } - - -// ----------------------------------------------------------------------------- -// From CAknView, Gets called from framework when activating this view -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::DoActivateL" ); - - // Base class activation first - CMusUiSendView::DoActivateL( aPrevViewId, - aCustomMessageId, - aCustomMessage ); - - TRect containerRect( ClientRect().iBr.iX - KMusUiContainerWidth, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if ( !iContainer ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingView::DoActivateL: !iContainer" ); - iContainer = new ( ELeave ) CMusUiLiveSharingViewContainer(); - iContainer->SetMopParent( this ); - iContainer->ConstructL( this, - containerRect ); - AppUi()->AddToViewStackL( *this, iContainer ); - } - - /* Increase the ordinal position of background container - * So that other control will be drawn first. - */ - UpdateBackgroundOrdinalPosition( ETrue ); - - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if ( !iController ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingView::DoActivateL: !iController" ); - iController = CMusUiLiveSharingController::NewL( *MusAppUi(), - *this, - *this, - *this, - videoRect ); - iController->StartInvitationL(); - } - - iContainer->SetController( iController ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::DoActivateL" ); - } - - -// ----------------------------------------------------------------------------- -// From AknView, Gets called from framework when deactivating this view -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::DoDeactivate() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::DoDeactivate" ); - - CMusUiSendView::DoDeactivate(); // Base class deactivation first - - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::DoDeactivate" ); - } - -// ----------------------------------------------------------------------------- -// When orientation changed , Camera instances has to be recreated inorder -// to receive proper orientated frames. -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::RefreshCameraOrientationL(TRect& aNewRect) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::RefreshCameraOrientation" ); - if( iController && iController->IsPlayingL() ) - { - TRect oldRect = iController->EngineSession()->Rect(); - MUS_LOG2( "mus: [MUSUI ] -> Old Rect (width = %d,height=%d)",oldRect.Width(),oldRect.Height() ); - MUS_LOG2( "mus: [MUSUI ] -> New Rect (width = %d,height=%d)",aNewRect.Width(),aNewRect.Height() ); - if ( !( ( ( oldRect.Width() > oldRect.Height() ) && //check lanscape - ( aNewRect.Width() > aNewRect.Height() ) - ) - || - ( - ( oldRect.Width() < oldRect.Height() ) && // check portrait - ( aNewRect.Width() < aNewRect.Height() ) - ) - ) - ) - { - MUS_LOG( "mus: [MUSUI ] -> Orientation Changed.Restart Camera" ); - iController->PauseL(); - iController->PlayL(); - } - else - { - MUS_LOG( "mus: [MUSUI ] -> Orientation Not changed. dont restart camera"); - } - } - else - { - MUS_LOG( "mus: [MUSUI ] -> Not Playing"); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::RefreshCameraOrientation" ); - } - -// ----------------------------------------------------------------------------- -// When Live sharing paused , camera source will be unavilable, hence -// it is inappropriate to show the zoom and brightness -// so hide those item. And unhide it again when unpaused. -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::HideToolbarCommandForPause( TBool aIsPaused ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingView::HideToolbarCommandForPause() %d",aIsPaused); - /* Hide brightness toolbar item if paused else unhide. Draw immediately.*/ - Toolbar()->HideItem( EMusuiCmdToolbarBrightness, aIsPaused, ETrue ); - /* Hide zoom toolbar item if paused else unhide. Draw immediately.*/ - Toolbar()->HideItem( EMusuiCmdToolbarZoom, aIsPaused, ETrue ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::HideToolbarCommandForPause"); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingView::ResetToolBarSelected() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingView::ResetToolBarSelected" ); - iController->ResetToolbarSelected(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingView::ResetToolBarSelected" ); - } -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuilivesharingviewcontainer.cpp --- a/mmsharing/mmshui/src/musuilivesharingviewcontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuidefinitions.h" -#include "musuilivesharingviewcontainer.h" -#include "musuieventcontroller.h" -#include "musuigeneralview.h" -#include "musuilivesharingview.h" -#include "musuiappui.h" -#include "musuilevelindicator.h" -#include "musuidialogutil.h" -#include "musui.hrh" -#include "muslogger.h" // debug logging -#include "mussettings.h" -#include - -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::ConstructL( CMusUiGeneralView* aView, - const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::ConstructL" ); - - CMusUiSendViewContainer::ConstructL( aView, - aRect, - EAknOrientationVertical ); - // check if operator specific functionality is needed - iOperatorSpecificFunctionality = - ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EOperatorSpecific ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer" ); - // NOP - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetZoomValues( TInt aMinZoom, TInt aMaxZoom ) - { - iIndicator->SetRange( aMinZoom, aMaxZoom, ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetBrightnessValues( TInt aMinBrightness, - TInt aMaxBrightness ) - { - iIndicator->SetRange( aMinBrightness, aMaxBrightness, ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetZoomL( TInt aZoomLevel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::SetZoomL" ) - - iIndicator->SetLevelL( EMusUiIndicatorTypeZoom, - aZoomLevel, - ETrue /* use timer */ ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::SetZoomL" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetBrightnessL( TInt aBrightnessLevel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::SetBrightnessL" ) - - iIndicator->SetLevelL( EMusUiIndicatorTypeBrightness, - aBrightnessLevel, - ETrue /* use timer */ ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::SetBrightnessL" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetZoomVisible( TBool aVisible ) - { - iIndicator->SetIndicatorType( EMusUiIndicatorTypeZoom ); - MakeVisible( aVisible ); - SetGloballyCapturing( aVisible ); - SetPointerCapture( aVisible ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::SetBrightnessVisible( TBool aVisible) - { - iIndicator->SetIndicatorType(EMusUiIndicatorTypeBrightness); - MakeVisible( aVisible ); - SetGloballyCapturing( aVisible ); - SetPointerCapture( aVisible ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when to retrieve the no. of controls. -// ----------------------------------------------------------------------------- -// -TInt CMusUiLiveSharingViewContainer::CountComponentControls() const - { - return 1; // return nbr of controls inside this container - } - - -// ----------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// ----------------------------------------------------------------------------- -// -CCoeControl* CMusUiLiveSharingViewContainer::ComponentControl( TInt aIndex ) const - { - CCoeControl* control = NULL; - switch ( aIndex ) - { - case 0: - control = iIndicator; - break; - default: - break; - } - return control; - } - - -// ----------------------------------------------------------------------------- -// Called by framework to act on key events if required. -// ----------------------------------------------------------------------------- -// -TKeyResponse CMusUiLiveSharingViewContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode /*aType*/ ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::OfferKeyEventL: %d", - aKeyEvent.iCode ); - MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::OfferKeyEventL: %d", - aKeyEvent.iScanCode ); - - TKeyResponse ret( EKeyWasNotConsumed ); - - if ( MUS_NO_TOOLBAR ) - { - CMusUiLiveSharingView* view = - static_cast< CMusUiLiveSharingView* >( MusUiView() ); - switch ( aKeyEvent.iCode ) - { - case EKeyLeftArrow: - { - view->HandleCommandL( EMusuiCmdViewVolumeDown ); - ret = EKeyWasConsumed; - break; - } - case EKeyRightArrow: - { - view->HandleCommandL( EMusuiCmdViewVolumeUp ); - ret = EKeyWasConsumed; - break; - } - case EKeyUpArrow: - { - view->HandleKeyUpArrowL(); - ret = EKeyWasConsumed; - break; - } - case EKeyDownArrow: - { - view->HandleKeyDownArrowL(); - ret = EKeyWasConsumed; - break; - } - default: - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::OfferKeyEventL" ); - return ret; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiLiveSharingViewContainer::HandlePointerEventL( - const TPointerEvent& aPointerEvent) - { - if ( Rect().Contains( aPointerEvent.iPosition ) ) - { - // Forward to base class in order to use slider - CCoeControl::HandlePointerEventL( aPointerEvent ); - } - else - { - // Tapping outside slider area means ending of zoom or brightness - // adjustment - SetZoomVisible( EFalse ); // This hides also the brightness slider - CMusUiLiveSharingView* liveView = - (CMusUiLiveSharingView*)this->MusUiView(); - liveView->ResetToolBarSelected(); - } - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuimmcmonitor.cpp --- a/mmsharing/mmshui/src/musuimmcmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* 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 "musuimmcmonitor.h" -#include "muslogger.h" // debug logging - -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiMmcMonitor* CMusUiMmcMonitor::NewL( MMusUiMmcObserver& aObserver ) - { - CMusUiMmcMonitor* self = new ( ELeave ) CMusUiMmcMonitor( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiMmcMonitor::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::ConstructL" ); - User::LeaveIfError( iFs.Connect() ); - const TDesC& memoryCardPath = PathInfo::MemoryCardRootPath(); - TInt driveNumber = 0; - if ( memoryCardPath.Length() > 0 ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiMmcMonitor::ConstructL: \ - ( memoryCardPath.Length() > 0 )" ); - TChar driveChar( memoryCardPath[0] ); - iFs.CharToDrive( driveChar, driveNumber ); - iDriveNumber = static_cast(driveNumber); - } - else - { - MUS_LOG( "mus: [MUSUI ] CMusUiMmcMonitor::ConstructL: else" ); - TParsePtrC parser( RProcess().FileName() ); - TChar driveChar( parser.Drive()[0] ); - iFs.CharToDrive( driveChar, driveNumber ); - iDriveNumber = static_cast(driveNumber); - } - - iRemovableDrive = IsRemovableDrive( iDriveNumber ); - iDriveRemoved = DriveRemoved(); - MonitorMmc(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiMmcMonitor::CMusUiMmcMonitor( MMusUiMmcObserver& aObserver ) - : CActive( CActive::EPriorityStandard ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiMmcMonitor::~CMusUiMmcMonitor() - { - Cancel(); - iFs.Close(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiMmcMonitor::RunL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::RunL" ); - if( DriveRemoved() ) - { - iObserver.MmcRemoved(); - } - else // continue monitoring - { - MonitorMmc(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::RunL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiMmcMonitor::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::DoCancel" ); - iFs.NotifyChangeCancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiMmcMonitor::MonitorMmc() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::MonitorMmc" ); - if( !IsActive() && iRemovableDrive && !iDriveRemoved ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiMmcMonitor::MonitorMmc: calling iFs.NotifyChange" ); - iFs.NotifyChange( ENotifyDisk, iStatus ); - SetActive(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::MonitorMmc" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiMmcMonitor::DriveRemoved() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::DriveRemoved" ); - if ( iDriveRemoved ) - { - return iDriveRemoved; - } - - TDriveInfo driveInfo; - iFs.Drive( driveInfo, iDriveNumber ); - - if ( driveInfo.iType == EMediaNotPresent ) - { - iDriveRemoved = ETrue; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::DriveRemoved" ); - return iDriveRemoved; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiMmcMonitor::IsRemovableDrive( TDriveNumber aDriveNumber ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiMmcMonitor::IsRemovableDrive" ); - TDriveInfo driveInfo; - iFs.Drive( driveInfo, aDriveNumber ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiMmcMonitor::IsRemovableDrive" ); - return ( driveInfo.iDriveAtt & KDriveAttRemovable ); - } - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuinavimediaanimator.cpp --- a/mmsharing/mmshui/src/musuinavimediaanimator.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,333 +0,0 @@ -/* -* 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 "musuinavimediaanimator.h" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include -//#include -//#include -#include -#include "musresourcefinderutil.h" - -#include // KDC_APP_BITMAP_DIR -#include -#include // CAknNavigationControlContainer -#include // CEikStatusPaneBase -#include -#include // scalable UI -#include // SetSize for the icons -#include -#include -#include -#include -#include - -using namespace AppLayout; - - -// CONSTANTS -const TInt KMusUiAnimatorTimer = 50000; // Default 50 ms, 20 fps - -const TInt KIconArraySize = 15; - -_LIT( KMyBitmapRomFile, "Z:\\resource\\apps\\musuiicons.mif" ); -_LIT( KMyBitmapRamFile, "C:\\resource\\apps\\musuiicons.mif" ); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaAnimator* CMusUiNaviMediaAnimator::NewL( - MMusUiNaviMediaAnimatorObserver& aObserver, TSize aImageSize ) - { - CMusUiNaviMediaAnimator* self = - new( ELeave ) CMusUiNaviMediaAnimator( aObserver, aImageSize ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaAnimator::~CMusUiNaviMediaAnimator() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::~CMusUiNaviMediaAnimator" ); - - if ( iAnimationTimer->IsActive() ) - { - iAnimationTimer->Cancel(); - } - delete iAnimationTimer; - delete iBitmapArray; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaAnimator::~CMusUiNaviMediaAnimator" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaAnimator::CMusUiNaviMediaAnimator( - MMusUiNaviMediaAnimatorObserver& aObserver, TSize aImageSize ) - : iObserver( aObserver ) - { - iSize = aImageSize; - MUS_LOG1( "mus: [MUSUI ] -> \ - CMusUiNaviMediaAnimator::CMusUiNaviMediaAnimator(): iSize.iWidth %d", - iSize.iWidth ) - MUS_LOG1( "mus: [MUSUI ] -> \ - CMusUiNaviMediaAnimator::CMusUiNaviMediaAnimator(): iSize.iHeight %d", - iSize.iHeight ) - iBitmapArray = NULL; - iInterval = KMusUiAnimatorTimer; - iIndex = 0; - - - - -/* iAnimationTimer->Start( iInterval, - iInterval, - TCallBack( AnimationInterval, this ) ); - */ - } - - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaAnimator::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::ConstructL" ); - - if( MusResourceFinderUtil::IsExistL( KMyBitmapRomFile ) ) - { - iResourceRam = EFalse; - } - else if( MusResourceFinderUtil::IsExistL( KMyBitmapRamFile ) ) - { - iResourceRam = ETrue; - } - else - { - MUS_LOG( "mus: [MUSUI ] Icon File Not Found " ); - User::Leave(KErrNotFound); - } - - - LoadImagesL(); - - iAnimationTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - - iAnimationTimer->Start( iInterval, - iInterval, - TCallBack( AnimationInterval, this ) ); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaAnimator::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaAnimator::SetInterval( const TInt aAnimationInterval ) - { - iInterval = aAnimationInterval; - - - if ( iAnimationTimer->IsActive() ) - { - iAnimationTimer->Cancel(); - } - - iAnimationTimer->Start( iInterval, - iInterval, - TCallBack( AnimationInterval, this ) ); - } - - -// ----------------------------------------------------------------------------- -// Callback for disable level indicator. -// ----------------------------------------------------------------------------- -// -TInt CMusUiNaviMediaAnimator::AnimationInterval( TAny* aThis ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::AnimationInterval()" ); - CMusUiNaviMediaAnimator* animator = - static_cast< CMusUiNaviMediaAnimator* > ( aThis ); - - - if ( animator->iBitmapArray ) - { - animator->iObserver.SetIcon( animator->iBitmapArray->At( animator->iIndex ) ); - if( animator->iIndex < ( animator->iBitmapArray->Count() - 1 ) ) - { - animator->iIndex++; - } - else - { - animator->iIndex = 0; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaAnimator::AnimationInterval()" ); - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// Layouts the text depending on current icon situation. -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaAnimator::LoadImagesL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::DoLayoutText" ); - - delete iBitmapArray; - iBitmapArray = NULL; - iBitmapArray = new ( ELeave ) CAknIconArray( KIconArraySize ); - - TParse parse; - if( iResourceRam ) - { - parse.Set( KMyBitmapRamFile, &KDC_APP_RESOURCE_DIR, NULL ); - } - else - { - parse.Set( KMyBitmapRomFile, &KDC_APP_RESOURCE_DIR, NULL ); - } - - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TAknsItemID item; - item.Set( 0xFFCC, 0xC ); // It's a kind a magic - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait1, - EMbmMusuiiconsQgn_indi_video_wait1_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait2, - EMbmMusuiiconsQgn_indi_video_wait2_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait3, - EMbmMusuiiconsQgn_indi_video_wait3_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait4, - EMbmMusuiiconsQgn_indi_video_wait4_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait5, - EMbmMusuiiconsQgn_indi_video_wait5_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait6, - EMbmMusuiiconsQgn_indi_video_wait6_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait7, - EMbmMusuiiconsQgn_indi_video_wait7_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_wait8, - EMbmMusuiiconsQgn_indi_video_wait8_mask, - parse ); - - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaAnimator::DoLayoutText" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaAnimator::ConstructImageL( MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId, - TParse parse ) - - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::ConstructImageL()" ); - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - - AknsUtils::CreateIconL(aSkin, - aId, - bitmap, - mask, - parse.FullName(), - aBitmapId, - aMaskId); - - AknIconUtils::SetSize( bitmap, iSize ); - AknIconUtils::SetSize( mask, iSize ); - - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::ConstructImageL(): iSize.iWidth %d", - iSize.iWidth ) - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaAnimator::ConstructImageL(): iSize.iHeight %d", - iSize.iHeight ) - - CGulIcon* icon = CGulIcon::NewL(); - icon->SetBitmap( bitmap ); - icon->SetMask( mask ); - - CleanupStack::PushL( icon ); - iBitmapArray->AppendL( icon ); - CleanupStack::Pop( icon ); - - //aImage->SetPicture(bitmap, mask); // Owership transferred to CEikImage - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaAnimator::ConstructImageL()" ); - - } - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuinavimediadecorator.cpp --- a/mmsharing/mmshui/src/musuinavimediadecorator.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,522 +0,0 @@ -/* -* 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 "musuinavimediadecorator.h" -#include "musuinavimediaanimator.h" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include -//#include -//#include -#include -#include "musresourcefinderutil.h" - -#include // KDC_APP_BITMAP_DIR -#include -#include // CAknNavigationControlContainer -#include // CEikStatusPaneBase -#include -#include // scalable UI -#include // SetSize for the icons -#include -#include -#include -#include -#include - -using namespace AppLayout; - - -const TInt KMusDecoratorStability = 0; -const TInt KIconArraySize = 15; - -_LIT( KMyBitmapRomFile, "Z:\\resource\\apps\\musuiicons.mif" ); -_LIT( KMyBitmapRamFile, "C:\\resource\\apps\\musuiicons.mif" ); - - -#ifndef __MIN -#define __MIN(A, B) ((A) < (B) ? (A): (B)) -#endif -//macro -//_LIT( KMyMbmFileName, "z:Camcorder.mbm"); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaDecorator* CMusUiNaviMediaDecorator::NewL() - { - CMusUiNaviMediaDecorator* self = new( ELeave ) CMusUiNaviMediaDecorator(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaDecorator::~CMusUiNaviMediaDecorator() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::~CMusUiNaviMediaDecorator" ); - delete iLeftLabel; - delete iRightLabel; - delete iIconArray; - delete iAnimation; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::~CMusUiNaviMediaDecorator" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiNaviMediaDecorator::CMusUiNaviMediaDecorator() - { - iMiddle = 0; - iLeftTextSize = TSize( 0, 0 ); - iRightTextSize = TSize( 0, 0 ); - iIcon = NULL; - iIconLeft = 50; // Only defaylt valut, it's overrided right away - iImageSize = TSize( 18, 18 ); // Only default value, it's overrided right avay - } - - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructL" ); - iLeftLabel = HBufC16::NewL(0); - iRightLabel = HBufC16::NewL(0); - - - iIconLayout.LayoutRect( Rect(), R_MUS_NAVI_MEDIA_ICON_LAYOUT_SIZE ); - iImageSize.iWidth = iIconLayout.Rect().Width(); - iImageSize.iHeight = iIconLayout.Rect().Height(); - - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructL(): iImageSize.iWidth %d", - iImageSize.iWidth ) - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructL(): iImageSize.iHeight %d", - iImageSize.iHeight ) - iLeftTextLayout.LayoutText( Rect(), - R_MUS_NAVI_MEDIA_TEXT_LEFT_LAYOUT ); - iRightTextLayout.LayoutText( Rect(), - R_MUS_NAVI_MEDIA_TEXT_RIGHT_LAYOUT ); - - - if( MusResourceFinderUtil::IsExistL( KMyBitmapRomFile ) ) - { - iResourceRam = EFalse; - } - else if( MusResourceFinderUtil::IsExistL( KMyBitmapRamFile ) ) - { - iResourceRam = ETrue; - } - else - { - MUS_LOG( "mus: [MUSUI ] Icon File Not Found " ); - User::Leave(KErrNotFound); - } - - LoadImagesL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::SetLeftLabelL( const TDesC& aLabel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::SetLabelL" ); - HBufC* newLabel = aLabel.AllocL(); - delete iLeftLabel; // after the AllocL succeeds - iLeftLabel = NULL; - iLeftLabel = newLabel; - TPtr ptr( iLeftLabel->Des() ); - AknTextUtils::LanguageSpecificNumberConversion( ptr ); - DoLayoutText(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::SetLabelL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::SetRightLabelL( const TDesC& aLabel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::SetLabelL" ); - HBufC* newLabel = aLabel.AllocL(); - delete iRightLabel; // after the AllocL succeeds - iRightLabel = NULL; - iRightLabel = newLabel; - TPtr ptr( iRightLabel->Des() ); - AknTextUtils::LanguageSpecificNumberConversion( ptr ); - DoLayoutText(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::SetLabelL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::ShowIcon( TMusUiNaviMediaDecorator aIcon ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ShowIcon( \ - TMusMediaNaviIcons aIcon ) #%d", aIcon ); - - delete iAnimation; - iAnimation = NULL; - - if( aIcon == EMusUiNaviIconNone ) - { - iIcon = NULL; - return; - } - else if( aIcon == EMusUiNaviIconWaitAnim ) - { - iIcon = NULL; - iIconLayout.LayoutRect( Rect(), R_MUS_NAVI_MEDIA_ICON_LAYOUT_SIZE ); - iImageSize.iWidth = iIconLayout.Rect().Width(); - iImageSize.iHeight = iIconLayout.Rect().Height(); - TRAPD( err, iAnimation = CMusUiNaviMediaAnimator::NewL( *this, iImageSize ); ) - if( err == KErrNone ) - { - //iAnimation->SetInterval( 50000 ); - } - } - else if( iIconArray->Count() > aIcon ) - { - iIcon = static_cast< CGulIcon* > ( iIconArray->At( aIcon) ); - } - else - { - iIcon = NULL; - } - if( !iAnimation ) - { - DrawNow(); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::ShowIcon( \ - TMusMediaNaviIcons aIcon )" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::SetIcon( CGulIcon* aIcon ) - { - iIcon = aIcon; - DrawNow(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::SizeChanged() - { - AknsUtils::RegisterControlPosition( this ); - DoLayoutText(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::Draw( const TRect& aRect ) const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::Draw" ); - - CWindowGc& gc = SystemGc(); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - // Get skinned bitmap - CFbsBitmap* skinBitmap = - AknsUtils::GetCachedBitmap( skin, KAknsIIDQsnIconColors ); - if( iIcon ) - { - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - AknsDrawUtils::Background( skin, cc,this, gc , aRect , KAknsDrawParamDefault ); - gc.BitBltMasked( TPoint( iIconLeft,1), - iIcon->Bitmap(), - iIconLayout.Rect(), - iIcon->Mask(), - EFalse ); - } - // draw time indicator - - //TRgb color = iLeftTextLayout.Color(); - - TRgb color; - - AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG2 ); - - gc.SetPenColor( color ); - gc.UseFont( iLeftTextLayout.Font() ); - - - TInt flTop = ( ( aRect.Height() >> 1 ) - - ( iLeftTextLayout.Font()->AscentInPixels() >> 1 ) ) - + aRect.iTl.iY - 1; // -1 because some rounding things - - gc.DrawText( *iLeftLabel, - TRect( aRect.iTl.iX+1, flTop, aRect.iBr.iX, aRect.iBr.iY ), - iLeftTextLayout.Font()->AscentInPixels() + 1, - iLeftTextLayout.Align() ); - - TInt frTop = ( ( aRect.Height() >> 1 ) - - ( iRightTextLayout.Font()->AscentInPixels() >> 1 ) ) - + aRect.iTl.iY - 1; // -1 because some rounding things - - TInt frLeft; - TInt frRight; - - if ( AknLayoutUtils::LayoutMirrored() ) - { - frLeft = aRect.iTl.iX; - frRight = iRightTextSize.iWidth + 1; - } - else - { - frLeft = aRect.iBr.iX - iRightTextSize.iWidth - 1; - frRight = aRect.iBr.iX; - } - - gc.DrawText( *iRightLabel, - TRect( frLeft, frTop, frRight, aRect.iBr.iY ), - iRightTextLayout.Font()->AscentInPixels() + 1, - iRightTextLayout.Align() ); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::Draw " ); - } - - -// ----------------------------------------------------------------------------- -// Layouts the text depending on current icon situation. -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::DoLayoutText() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::DoLayoutText" ); - TRect parent( Rect() ); - if ( parent.IsEmpty() ) - { - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::DoLayoutText: return" ); - return; - } - - TInt minsize = __MIN( parent.Width(), parent.Height() ); - iImageSize = TSize( minsize-2, minsize-2 ); - - - // Reassign text sizes - TAknTextLineLayout txtLayout = AppLayout::Navipanetexts_Line_2(); - const TInt spaceBetweenIconsAndText = 1; - txtLayout.il = spaceBetweenIconsAndText; - - iLeftTextLayout.LayoutText( parent, txtLayout ); - iRightTextLayout.LayoutText( parent, txtLayout ); - - TSize parentSize = TSize( parent.iBr.iX - parent.iTl.iX, - parent.iBr.iY - parent.iTl.iY ); - - //TInt clientWidth = parent.iBr.iX - parent.iTl.iX; - - iLeftTextSize.iWidth = - iLeftTextLayout.Font()->TextWidthInPixels( iLeftLabel->Des() ); - iRightTextSize.iWidth = - iRightTextLayout.Font()->TextWidthInPixels( iRightLabel->Des() ); - - // First testing elements total width - if( iLeftTextSize.iWidth + iRightTextSize.iWidth + iIconLayout.Rect().iBr.iX - > parentSize.iWidth ) - { - // Whole stuff is too large - _LIT( KMusStringThreeDots, "..."); - TRAP_IGNORE( SetRightLabelL( KMusStringThreeDots ) ); - } - - // Middle point of Icon box in current text parameters - TInt middle = parent.iTl.iX + ( parentSize.iWidth >> 1 ); - - // If there collision, calculates middle of the text fields - iIconLeft = middle - parent.iTl.iX - ( iIconLayout.Rect().iBr.iX >> 1 ); - TInt iconRight = - middle - parent.iTl.iX + ( iIconLayout.Rect().iBr.iX >> 1 ); - - if( iLeftTextSize.iWidth > iIconLeft || - ( parentSize.iWidth - iRightTextSize.iWidth ) < iconRight ) - { - middle = (( parentSize.iWidth - - ( iLeftTextSize.iWidth + iRightTextSize.iWidth )) >> 1 ) - + parent.iTl.iX + iLeftTextSize.iWidth; - } - - - // Move only if middle place moves enough eq. ignoring jumping - if( middle < ( iMiddle - KMusDecoratorStability ) - || middle > ( iMiddle + KMusDecoratorStability ) ) - { - iMiddle = middle; - } - - iLeftTextSize.iHeight = iLeftTextLayout.Font()->HeightInPixels(); - iRightTextSize.iHeight = iRightTextLayout.Font()->HeightInPixels(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::DoLayoutText" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::LoadImagesL() - { - - delete iIconArray; - iIconArray = NULL; - iIconArray = new ( ELeave ) CAknIconArray( KIconArraySize ); - - TParse parse; - if( iResourceRam ) - { - parse.Set( KMyBitmapRamFile, &KDC_APP_RESOURCE_DIR, NULL ); - } - else - { - parse.Set( KMyBitmapRomFile, &KDC_APP_RESOURCE_DIR, NULL ); - } - - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TAknsItemID item; - item.Set( 0xFFCC, 0xC ); // It's a kind a magic - - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_forw, - EMbmMusuiiconsQgn_indi_video_forw_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_pause, - EMbmMusuiiconsQgn_indi_video_pause_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_play, - EMbmMusuiiconsQgn_indi_video_play_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_record, - EMbmMusuiiconsQgn_indi_video_record_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_record_not, - EMbmMusuiiconsQgn_indi_video_record_not_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_rew, - EMbmMusuiiconsQgn_indi_video_rew_mask, - parse ); - - ConstructImageL( skin, - item, - EMbmMusuiiconsQgn_indi_video_stop, - EMbmMusuiiconsQgn_indi_video_stop_mask, - parse ); - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiNaviMediaDecorator::ConstructImageL( MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId, - TParse parse ) - - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructImageL()" ); - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - - AknsUtils::CreateIconL(aSkin, - aId, - bitmap, - mask, - parse.FullName(), - aBitmapId, - aMaskId); - - AknIconUtils::SetSize( bitmap, iImageSize ); - AknIconUtils::SetSize( mask, iImageSize ); - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructIconL(): iImageSize.iWidth %d", - iImageSize.iWidth ) - MUS_LOG1( "mus: [MUSUI ] -> CMusUiNaviMediaDecorator::ConstructIconL(): iImageSize.iHeight %d", - iImageSize.iHeight ) - - - CGulIcon* icon = CGulIcon::NewL(); - icon->SetBitmap( bitmap ); - icon->SetMask( mask ); - - CleanupStack::PushL( icon ); - iIconArray->AppendL( icon ); - CleanupStack::Pop( icon ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiNaviMediaDecorator::ConstructIconL()" ); - - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuipropertywatch.cpp --- a/mmsharing/mmshui/src/musuipropertywatch.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* 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 "musuipropertywatch.h" -#include "musuipropertyobserver.h" -#include "mussessionproperties.h" -#include "musresourceproperties.h" -#include "muslogger.h" // debug logging - -using namespace NMusSessionApi; - -// ----------------------------------------------------------------------------- -// Symbian two-phase constructor. -// ----------------------------------------------------------------------------- -// -CMusUiPropertyWatch* CMusUiPropertyWatch::NewL( - MMusUiPropertyObserver& aObserver, - TUid aCategory, - const TInt aPropertyName ) - { - CMusUiPropertyWatch* self = new (ELeave) CMusUiPropertyWatch( - aObserver, - aCategory, - aPropertyName ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// C++ destructor. -// ----------------------------------------------------------------------------- -// -CMusUiPropertyWatch::~CMusUiPropertyWatch() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiPropertyWatch::~CMusUiPropertyWatch" ); - if ( IsActive() ) - { - Cancel(); - } - iProperty.Close(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiPropertyWatch::~CMusUiPropertyWatch" ); - } - - -// ----------------------------------------------------------------------------- -// C++ constructor. -// ----------------------------------------------------------------------------- -// -CMusUiPropertyWatch::CMusUiPropertyWatch( MMusUiPropertyObserver& aObserver, - TUid aCategory, - const TInt aPropertyName ) : - CActive( EPriorityNormal ), - iObserver( aObserver ) - { - iPropertyCategory = aCategory; - iPropertyKey = aPropertyName; - } - - -// ----------------------------------------------------------------------------- -// Symbian second-phase constructor. -// ----------------------------------------------------------------------------- -// -void CMusUiPropertyWatch::ConstructL( ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiPropertyWatch::ConstructL" ); - User::LeaveIfError( iProperty.Attach( iPropertyCategory, - iPropertyKey) ); - CActiveScheduler::Add( this ); - RunL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiPropertyWatch::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiPropertyWatch::ReadIntPropertyL( TUint aKey ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiPropertyWatch::ReadIntPropertyL: aKey: [%d]", - aKey ); - TInt val; - User::LeaveIfError( RProperty::Get( KCategoryUid, - aKey, - val ) ); - MUS_LOG1( "mus: [MUSUI ] <- CMusUiPropertyWatch::ReadIntPropertyL: val: [%d]", - val ); - return val; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -HBufC* CMusUiPropertyWatch::ReadDescPropertyL( TUint aKey ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiPropertyWatch::ReadDescPropertyL: aKey: [%d]", - aKey ); - TBuf buffer; - - User::LeaveIfError( RProperty::Get( KCategoryUid, - aKey, - buffer ) ); - HBufC* desc = buffer.AllocL(); - MUS_LOG_TDESC( "mus: [MUSUI ] <- CMusUiPropertyWatch::ReadDescPropertyL: val: ", - (*desc) ); - return desc; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiPropertyWatch::DoCancel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiPropertyWatch::DoCancel" ); - iProperty.Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiPropertyWatch::DoCancel" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiPropertyWatch::RunL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiPropertyWatch::RunL" ); - TInt val; - - User::LeaveIfError( RProperty::Get( iPropertyCategory, - iPropertyKey, - val ) ); - iProperty.Subscribe( iStatus ); - SetActive(); - - iObserver.PropertyChanged( iPropertyKey, val ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiPropertyWatch::RunL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiPropertyWatch::RunError( TInt aError ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiPropertyWatch::RunError [%d]", aError ); - iObserver.HandlePropertyError( aError ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiPropertyWatch::RunError" ); - return KErrNone; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuireceivecontainer.cpp --- a/mmsharing/mmshui/src/musuireceivecontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,320 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuireceivecontainer.h" -#include "musuieventcontroller.h" -#include "musuigeneralview.h" -#include "musuireceiveview.h" -#include "musuiinvitationquery.h" -#include "musuiinvitationqueryobserver.h" -#include "musuiappui.h" -#include "musuidialogutil.h" -#include "musuidefinitions.h" -#include "musui.hrh" -#include "muslogger.h" // debug logging -#include - -#include -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveContainer* CMusUiReceiveContainer::NewL( - CMusUiReceiveView& aView, - const TRect aRect ) - { - CMusUiReceiveContainer* self - = new( ELeave ) CMusUiReceiveContainer( aView ); - - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - CleanupStack::Pop( self ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveContainer::~CMusUiReceiveContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveContainer::~CMusUiReceiveContainer" ); - - if ( iInvitationQuery ) - { - iInvitationQuery->Cancel(); - delete iInvitationQuery; - iInvitationQuery = NULL; - } - - delete iBackGround; - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::~CMusUiReceiveContainer" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveContainer::CMusUiReceiveContainer( CMusUiReceiveView& aView ) - : iView( aView ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::ConstructL( const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveContainer::ConstructL" ); - CreateWindowL(); - iBackGround = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, - aRect, - EFalse ); - iFullScreen = EFalse; - SetRect( aRect ); - ActivateL(); - - iOperatorSpecificFunctionality = iView.OperatorSpecificFunctionality(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::ShowInvitationQueryL( - const TDesC& aContact, - MMusUiInvitationQueryObserver& aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveContainer::ShowInvitationQueryL" ); - if ( !iInvitationQuery ) - { - iInvitationQuery = CMusUiInvitationQuery::NewL( aObserver ); - } - iInvitationQuery->ShowL( aContact ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::ShowInvitationQueryL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::DismissInvitationQuery( TBool aDelete ) - { - if ( iInvitationQuery ) - { - iInvitationQuery->Cancel(); - if ( aDelete ) - { - delete iInvitationQuery; - iInvitationQuery = NULL; - } - } - } - - -// ----------------------------------------------------------------------------- -// Fetches a pointer to the view that owns this container. -// ----------------------------------------------------------------------------- -// -CMusUiGeneralView* CMusUiReceiveContainer::MusUiView() const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveContainer::MusUiView" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::MusUiView" ); - return &iView; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::SetFullScreen( TBool aFullScreen, TRect aRect ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiReceiveContainer::SetFullScreen: %d", - aFullScreen ); - iFullScreen = aFullScreen; - - if ( aFullScreen ) - { - // In order to capture pointer events this container must be visible. - // Thus we make it as small as possible. - SetRect( TRect( 0, 0, 0, 0) ); - MakeVisible( ETrue ); - SetGloballyCapturing( ETrue ); - SetPointerCapture( ETrue ); - } - else - { - SetRect( aRect ); - SetPointerCapture( EFalse ); - MakeVisible( EFalse ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::SetFullScreen" ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when the view size is changed -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::SizeChanged() - { - TRect parentRect(Rect()); - if (iBackGround) - { - (static_cast(iBackGround))->SetRect(parentRect); - } - MakeVisible( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when to retrieve the no. of controls. -// ----------------------------------------------------------------------------- -// -TInt CMusUiReceiveContainer::CountComponentControls() const - { - return 0; // return nbr of controls inside this container - } - - -// ----------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// ----------------------------------------------------------------------------- -// -CCoeControl* CMusUiReceiveContainer::ComponentControl( TInt aIndex ) const - { - switch ( aIndex ) - { - default: - return NULL; - } - } - - -// ----------------------------------------------------------------------------- -// Called by framework to redraw the screen area. -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::Draw( const TRect& aRect ) const - { - CWindowGc& gc = SystemGc(); - - gc.Clear( aRect ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - if(!AknsDrawUtils::Background( skin, cc,this,gc,aRect,KAknsDrawParamDefault )) - { - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - } - - -// ----------------------------------------------------------------------------- -// Called by framework -// ----------------------------------------------------------------------------- -// -TKeyResponse CMusUiReceiveContainer::OfferKeyEventL( const TKeyEvent& aEvent, - TEventCode aType ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveContainer::OfferKeyEventL" ); - - if ( iFullScreen && aType == EEventKey ) - { - // We respond to whatever key by returning from fullscreen - if( MUS_NO_TOOLBAR ) - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewFullScreen ); - } - else - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdToolbarFullScreen ); - } - return EKeyWasConsumed; - } - - switch ( aEvent.iCode ) - { - // Volume Control - case EKeyLeftArrow: - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewVolumeDown ); - return EKeyWasConsumed; - } - case EKeyRightArrow: - { - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdViewVolumeUp ); - return EKeyWasConsumed; - } - - // TODO: - case EKeyUpArrow: - { - break; - } - case EKeyDownArrow: - { - break; - } - default: - return EKeyWasNotConsumed; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveContainer::OfferKeyEventL" ); - return EKeyWasNotConsumed; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveContainer::HandlePointerEventL( const TPointerEvent& ) - { - if ( iFullScreen ) - { - // We respond to whatever pointer event by returning from fullscreen - (static_cast - (MusUiView()))->HandleCommandL( EMusuiCmdToolbarFullScreen ); - } - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuireceivecontroller.cpp --- a/mmsharing/mmshui/src/musuireceivecontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,867 +0,0 @@ -/* -* 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: Application's UI class. -* Version : %version: 75.1.10 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#include "musuireceivecontroller.h" -#include "musuieventobserver.h" -#include "musuisharingobserver.h" -#include "musuireceiveobserver.h" -#include "musuicallbackservice.h" -#include "musuiactivetimer.h" -#include "musuidialogutil.h" -#include "musuicontactutil.h" -#include "mussettings.h" -#include "mussettingskeys.h" -#include "musuiresourcehandler.h" -#include "musengreceivesession.h" -#include "musenguriparser.h" -#include "mussessionproperties.h" -#include "muslogger.h" // debug logging -#include "musuiappui.h" -#include "musuireceiveview.h" -#include "musuipropertywatch.h" -#include "mussesseioninformationapi.h" -#include "musui.hrh" -#include - -#include -#include -#include - -using namespace MusSettingsKeys; -using namespace NMusSessionApi; - -const TInt KMusMinDigitCountInValidTelNumber = 7; - -/* - * Private number. -*/ -_LIT( KPrivateNumber, "" ); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveController* CMusUiReceiveController::NewL( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiReceiveObserver& aReceiveObserver, - const TRect& aRect ) - { - CMusUiReceiveController* self = new( ELeave ) CMusUiReceiveController( - aEventObserver, - aSharingObserver, - aReceiveObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveController::~CMusUiReceiveController() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::~CMusUiReceiveController" ); - delete iSession; - delete iOriginator; - delete iTimer; - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::~CMusUiReceiveController" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiReceiveController::CMusUiReceiveController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiReceiveObserver& aReceiveObserver ) - : CMusUiEventController( aEventObserver, aSharingObserver ), - iReceiveObserver( aReceiveObserver ) - { - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::ConstructL( const TRect& aRect ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::ConstructL" ); - - // construct event listener - CMusUiEventController::ConstructL(); - - // construct an engine session - iSession = CMusEngReceiveSession::NewL( aRect, *this, *this ); - iSession->SetAudioRoutingObserver( this ); - - iTimer = CMusUiActiveTimer::NewL( this ); - iTimer->After( KMusReceiveTimeout ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::ConstructL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::ChangeFullScreenModeL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::ChangeFullScreenModeL" ); - - iFullScreenSelected = !iFullScreenSelected; - - if ( !MUS_NO_TOOLBAR ) - { - iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarFullScreen ); - } - - iReceiveObserver.SetFullScreenL( iFullScreenSelected ); - - if ( ( iEventObserver.AppOrientation()!= CAknAppUiBase::EAppUiOrientationLandscape ) - && iFullScreenSelected ) - { - if( !iEventObserver.OrientationCanBeChanged() ) - { - MUS_LOG( "mus: [MUSUI ] !OrientationCanBeChanged()" ); - iSession->SetOrientationL( CMusEngMceSession::ELandscape ); - } - } - else if ( ( iSession->OrientationL() != iOriginalMceOrientation ) - && !iFullScreenSelected ) - { - if( !iEventObserver.OrientationCanBeChanged() ) - { - MUS_LOG( "mus: [MUSUI ] !OrientationCanBeChanged()" ); - iSession->SetOrientationL( iOriginalMceOrientation ); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::ChangeFullScreenModeL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::OfferToolbarEventL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiReceiveController::OfferToolbarEventL [%d]", - aCommand ); - - switch ( aCommand ) - { - case EMusuiCmdToolbarFullScreen: - { - ChangeFullScreenModeL(); - break; - } - default: // Not receive specific, let the base class handle - { - CMusUiEventController::OfferToolbarEventL( aCommand ); - break; - } - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::OfferToolbarEventL" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::HandleCommandL( TInt aCommand ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiReceiveController::HandleCommandL: %d", - aCommand ); - - switch ( aCommand ) - { - // Menu commands from view's HandleCommandL: - case EMusuiCmdViewAudioNormal: - { - MUS_LOG( "mus: [MUSUI ] CMusUiReceiveController::ConstructL:\ - EMusuiCmdViewAudioNormal" ); - if ( iSession->ContainsAudioL() ) - { - iSession->UnmuteL(); - } - break; - } - case EMusuiCmdViewAudioMute: - { - MUS_LOG( "mus: [MUSUI ] CMusUiReceiveController::ConstructL:\ - EMusuiCmdViewAudioMute" ); - if ( iSession->ContainsAudioL() ) - { - iSession->MuteL(); - } - break; - } - case EMusuiCmdToolbarFullScreen: - { - OfferToolbarEventL( EMusuiCmdToolbarFullScreen ); - break; - } - case EMusuiCmdViewFullScreen: - { - ChangeFullScreenModeL(); - break; - } - default: - { - // Try more general handling - CMusUiEventController::HandleCommandL( aCommand ); - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::HandleCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::HandleIncomingSessionL( - const TDesC& aOriginator, - const TDesC& aOriginatorIdentity ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::HandleIncomingSessionL" ) - - delete iOriginator; - iOriginator = NULL; - TInt privacyStatus(0); - - - MUS_LOG( "mus: [MUSUI ] Check private number" ) - TRAPD( errorPrivacyStatus, privacyStatus = - CMusUiPropertyWatch::ReadIntPropertyL( NMusSessionApi::KPrivacyStatus ) ); - if ( errorPrivacyStatus != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] ReadIntPropertyL leave code: %d", errorPrivacyStatus ) - HandleError( errorPrivacyStatus ); - } - - if ( privacyStatus == 1 ) - { - MUS_LOG( "mus: [MUSUI ] Call is from private number" ) - iOriginator = KPrivateNumber().AllocL(); - } - else if( iOperatorSpecificFunctionality ) - { - iOriginator = aOriginatorIdentity.AllocL(); - } - else - { - iOriginator = aOriginator.AllocL(); - } - - // Cancel the 10 seconds timer: - iTimer->Cancel(); - - // Display the query dialog: - - if ( privacyStatus == 1 ) - { - iReceiveObserver.ShowInvitationQueryL( *iOriginator ); - } - else if ( iOperatorSpecificFunctionality && aOriginatorIdentity.Length() != 0 ) - { - // We compare last seven digits, since that is the minimum amount - // that can make up a valid telephone number. - MUS_LOG_TDESC( "mus: [MUSUI ] Right7 of MusTelNumberValue(): ", - MusTelNumberValue().Right( KMusMinDigitCountInValidTelNumber ) ) - MUS_LOG_TDESC( "mus: [MUSUI ] Right7 of aOriginatorIdentity: ", - aOriginatorIdentity.Right( KMusMinDigitCountInValidTelNumber ) ) - MUS_LOG_TDESC( "mus: [MUSUI ] MusContactName: ", MusContactName() ) - - if ( !( MusTelNumberValue().Length() >= - KMusMinDigitCountInValidTelNumber && - aOriginatorIdentity.Length() >= - KMusMinDigitCountInValidTelNumber && - MusTelNumberValue().Right( KMusMinDigitCountInValidTelNumber ) == - aOriginatorIdentity.Right( KMusMinDigitCountInValidTelNumber ) && - MusContactName().Length() > 0 ) ) - { - // In some very rare scenario a valid session may come from MSISDN - // that is not the same as the one received from manager. To avoid - // showing of wrong MSISDN, we replace phone number with one - // received from P-Asserted-Identity header. Since in this scenario - // we cannot be sure about contact name either, we replace it with - // phone number. Replacing of contact name must happen also when we - // have no name for contact. - delete iTelNumber; - iTelNumber = NULL; - iTelNumber = aOriginatorIdentity.AllocL(); - - delete iContactName; - iContactName = NULL; - iContactName = aOriginatorIdentity.AllocL(); - } - - iReceiveObserver.ShowInvitationQueryL( MusContactName() ); - - } - else - { - if( MusUiContactUtil::CheckPbContactForVSAddressesL( - *( iEventObserver.EikonEnv() ), *iOriginator, iContactId ) ) - { - if ( MusContactName().Length() < 1 ) - { // originator is defined in Contacts but the name is empty - iReceiveObserver.ShowInvitationQueryL( *iOriginator ); - } - else - { - iReceiveObserver.ShowInvitationQueryL( MusContactName() ); - } - } - else - { - iReceiveObserver.ShowInvitationQueryL( *iOriginator ); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::HandleIncomingSessionL" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiReceiveController::ClipMutedL() - { - return iSession->IsMutedL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiReceiveController::ClipContainsAudioL() - { - if ( !ConnectionInitialized() ) - { - return EFalse; // We cannot be sure yet - } - - return iSession->ContainsAudioL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession* CMusUiReceiveController::EngineSession() - { - return iSession; // CMusEngReceiveSession is CMusEngMceSession - } - - -// ----------------------------------------------------------------------------- -// Virtual function from CMusUiEventController -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::HandleAsyncEventL" ); - switch ( aEventId ) - { - case EMusUiAsyncInviteAccepted: - { - ShowWaitDialogL(); - break; - } - default: - { - // Not receive specific, let the base class handle - CMusUiEventController::HandleAsyncEventL( aEventId ); - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::HandleAsyncEventL" ); - } - - -// ----------------------------------------------------------------------------- -// Virtual function from CMusUiEventController -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiReceiveController::TypedAddress() const - { - return *iOriginator; - } - - -// ----------------------------------------------------------------------------- -// Virtual function from CMusUiEventController -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::DeleteEngineSession() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::DeleteEngineSession" ); - delete iSession; - iSession = NULL; - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::DeleteEngineSession" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiReceiveController::FullScreenSelected() - { - return iFullScreenSelected; - } - - -// ----------------------------------------------------------------------------- -// From MMusEngReceiveSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::IncomingSessionPreNotification() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::IncomingSessionPreNotification" ); - iTimer->Cancel(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::IncomingSessionPreNotification" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngReceiveSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::IncomingSession( const TDesC& aOriginator, - const TDesC& aOriginatorIdentity ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::IncomingSession" ); - TRAPD( err, HandleIncomingSessionL( aOriginator, aOriginatorIdentity ) ); - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - else - { - SetConnectionInitialized( ETrue ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::IncomingSession" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngReceiveSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::StreamBuffering() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::StreamBuffering" ); - if ( iStreamPaused ) - { - MUS_LOG( "mus: [MUSUI ] Stream was paused, not show buffering state" ); - } - else - { - TRAPD( err, iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconWaitAnim ) ); - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - } - - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::StreamBuffering" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionEstablished() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::SessionEstablished" ); - - // Common handling first - CMusUiEventController::SessionEstablished(); - - TRAPD( error, SessionEstablishedL() ) - - if ( error != KErrNone ) - { - iEventObserver.HandleError( error ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::SessionEstablished" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionTerminated() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::SessionTerminated" ); - if ( !ConnectionEstablished() ) - { - iReceiveObserver.DismissInvitationQuery( ETrue ); - TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_INVITATION_CANCELLED ) ) - iEventObserver.HandleExit(); - } - else - { - TRAP_IGNORE( iSharingObserver.DismissWaitDialogL() ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::SessionTerminated" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionConnectionLost() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::SessionConnectionLost" ); - TRAPD( err, - iSharingObserver.DismissWaitDialogL(); - MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_LOST ) ); - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::SessionConnectionLost" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionFailed() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::SessionFailed" ); - TRAPD( error, iSharingObserver.DismissWaitDialogL() ); - if ( error != KErrNone ) - { - iEventObserver.HandleError( error ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::SessionFailed" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::StreamIdle() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::StreamIdle" ); - iStreamPaused = ETrue; - TRAPD( err, iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ) ); - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::StreamIdle" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::StreamStreaming() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::StreamStreaming" ); - - if ( ConnectionEstablished() ) - { - TRAP_IGNORE( iSharingObserver.DismissWaitDialogL() ) - TRAPD( err, iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPlay ) ) - - if ( err != KErrNone ) - { - iEventObserver.HandleError( err ); - } - iStreamPaused = EFalse; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::StreamStreaming" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionTimeChanged( - const TTimeIntervalSeconds& aSeconds ) - { - if ( aSeconds.Int() > -1 ) - { - iSharingObserver.UpdateSessionTime( SessionTimeFormatted( aSeconds ) ); - } - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::InactivityTimeout() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::InactivityTimeout" ); - TRAP_IGNORE( iSharingObserver.DismissWaitDialogL(); - MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::InactivityTimeout" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusUiInvitationQueryObserver: Invitation accepted by the user -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::InvitationAcceptedL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::InvitationAcceptedL" ); - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - - // Enable loud speaker already before answering but disable it immediately - // if accepting fails for some reason - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); - } - - TRAPD( err, iSession->AcceptInvitationL( ETrue ) ); - if ( err ) - { - if ( iSession->AudioRoutingCanBeChanged() ) - { - iSession->EnableLoudspeakerL( ELoudspeakerDisabled, ETrue ); - } - User::Leave( err ); - } - - iCallbackService->AsyncEventL( EMusUiAsyncInviteAccepted ); - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::InvitationAcceptedL" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusUiInvitationQueryObserver: Invitation rejected by the user -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::InvitationRejectedL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::InvitationRejectedL" ); - __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); - iSession->AcceptInvitationL( EFalse ); - HandleExitL(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::InvitationRejectedL" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusUiActiveTimerObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::TimerComplete( CMusUiActiveTimer* /*aTimer*/ ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::TimerComplete" ); - iEventObserver.HandleExit(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::TimerComplete" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::ExitProcedureL( TBool aUserAcceptance ) - { - - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::ExitProcedureL" ); - - switch ( iShutdownState ) - { - case EMusUiShutdownVideoSaved: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownVideoSaved" ); - - // Check if our address is valid sip or tel uri. If not, there is no - // reason to query user about permission to save it to contacts. - - TInt error = KErrNotFound; - if ( iOriginator ) - { - TMusEngUriParser parser( *iOriginator ); - TRAP( error, parser.ParseUriL() ) - } - - // Save Address to Contacts query if contact found and - // there is no address in contacts - // and if is the standard variant. - if ( !iOperatorSpecificFunctionality && iContactId > 0 && - !MusUiContactUtil::ShareViewFieldExistsL( - *( iEventObserver.EikonEnv() ), iContactId ) && - error == KErrNone ) - { - iShutdownState = EMusUiShutdownContactSavingQueried; - iEventObserver.SetToolbarVisibility( EFalse ); - SaveContactQueryL(); - } - else - { - // Nothing receive specific, let the base class handle - CMusUiEventController::ExitProcedureL( aUserAcceptance ); - } - break; - } - - default: - { - // Nothing receive specific, let the base class handle - CMusUiEventController::ExitProcedureL( aUserAcceptance ); - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::ExitProcedureL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::ShowWaitDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::ShowWaitDialogL" ); - - delete iDialogPrompt; - iDialogPrompt = NULL; - - iDialogPrompt = StringLoader::LoadL( - R_MUS_RECEIVE_VIEW_WAITING_FOR_STREAM, - ( MusContactName().Length() > 0 ) ? - MusContactName() : - *iOriginator ); - - if ( !iSharingObserver.ShowWaitDialogL( - *iDialogPrompt, - KMusInviteExpireTimeout, - R_MUS_LIVE_SHARING_VIEW_NOTE_TIMEOUT_EXPIRED ) ) - { - HandleExitL(); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::ShowWaitDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// From MMusEngSessionObserver -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveController::SessionEstablishedL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveController::SessionEstablishedL" ); - - iConnectionEstablished = ETrue; - iSharingObserver.DismissWaitDialogL(); - - if ( iCallbackService->CurrentEvent() == EMusUiAsyncInviteAccepted ) - { - iCallbackService->Cancel(); - } - - // Orientation for video player - iResourceHandler->RequestVideoPlayerL( ETrue ); - - iOriginalMceOrientation = iSession->OrientationL(); - - // set the mce orientation if different than videoplayer orientation - CAknAppUiBase::TAppUiOrientation currentOrientation = - STATIC_CAST(CMusUiReceiveView&,iReceiveObserver).MusAppUi()->Orientation(); - - if( (iOriginalMceOrientation == CMusEngMceSession::EPortrait && - currentOrientation== CAknAppUiBase::EAppUiOrientationPortrait ) || - (iOriginalMceOrientation == CMusEngMceSession::ELandscape && - currentOrientation== CAknAppUiBase::EAppUiOrientationLandscape )) - { - MUS_LOG( "mus: [MUSUI ] -> MCE & Videoplayer orientation is same" ); - // Both MCE and Videoplayer has same orientation. - } - else - { - if(currentOrientation == CAknAppUiBase::EAppUiOrientationPortrait) - { - MUS_LOG( "mus: [MUSUI ] -> Setting MCE Orientation to Portrait" ); - iSession->SetOrientationL(CMusEngMceSession::EPortrait); - } - else if(currentOrientation == CAknAppUiBase::EAppUiOrientationLandscape) - { - MUS_LOG( "mus: [MUSUI ] -> Setting MCE Orientation to Landscape" ); - iSession->SetOrientationL(CMusEngMceSession::ELandscape); - } - else - { - MUS_LOG( "mus: [MUSUI ] -> Undefined Orientation. " ); - } - } - - if ( iForeground ) - { - EnableDisplayL( ETrue ); - iEventObserver.SetToolbarVisibility( ETrue ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveController::SessionEstablishedL" ); - } - - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuireceiveview.cpp --- a/mmsharing/mmshui/src/musuireceiveview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,498 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - - -#include "musuireceiveview.h" -#include "musuireceivecontainer.h" -#include "musuibackgroundviewcontainer.h" -#include "musuireceivecontroller.h" -#include "musuiactivitymanger.h" -#include "musuiappui.h" -#include "musuistatuspanehandler.h" -#include "musui.hrh" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include -#include - -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// EPOC two-phased constructor -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::ConstructL" ); - - CMusUiGeneralView::ConstructL(); - - Toolbar()->SetToolbarObserver( this ); - Toolbar()->UpdateBackground(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiReceiveView::~CMusUiReceiveView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::~CMusUiReceiveView" ); - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - } - delete iContainer; - - delete iController; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::~CMusUiReceiveView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TUid CMusUiReceiveView::Id() const - { - return KMusUidReceivingView; - } - -// ----------------------------------------------------------------------------- -// From MEikMenuObserver, Called by framework before constructing menupane -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::DynInitMenuPaneL" ); - - // Base class initiated initialization first - CMusUiGeneralView::DynInitMenuPaneL( aResourceId, aMenuPane ); - if(!MUS_NO_TOOLBAR) - { - SetInitialFocusedItemL(); - } - - if ( aResourceId == R_MUSUI_VIEW_MENU ) - { - // Delete item which is present on toolbar - if ( !MUS_NO_TOOLBAR ) - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewFullScreen ); - } - - // Delete items not related to receiving side: - aMenuPane->DeleteMenuItem( EMusuiCmdViewReplay ); - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarZoom ); - aMenuPane->DeleteMenuItem( EMusuiCmdToolbarBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewZoom ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewBrightness ); - aMenuPane->DeleteMenuItem( EMusuiCmdRecord ); - aMenuPane->DeleteMenuItem( EMusuiCmdStopRecording ); - - // Delete EMusuiCmdViewAudioNormal or EMusuiCmdViewAudioMute - // depending on the audio state of the clip: - if ( iController->ClipContainsAudioL() ) - { - aMenuPane->DeleteMenuItem( iController->ClipMutedL() ? - EMusuiCmdViewAudioMute : - EMusuiCmdViewAudioNormal ); - } - else - { - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioMute ); - aMenuPane->DeleteMenuItem( EMusuiCmdViewAudioNormal ); - } - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::DynInitMenuPaneL" ); - } - - -// ----------------------------------------------------------------------------- -// Called when focus event occurs. -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DoHandleForegroundEventL( TBool aForeground ) - { - CMusUiGeneralView::HandleForegroundEventL( aForeground, EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::HandleToolbarCommandL( TInt aCommand ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::HandleToolbarCommandL" ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - switch ( aCommand ) - { - case EKeyLeftArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyRightArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyUpArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeUp : - EMusUiCmdToolbarLastIndex ); - break; - } - case EKeyDownArrow: - { - HandleCommandL( - iController->ToolbarVolumeSelected() ? EMusuiCmdViewVolumeDown : - EMusUiCmdToolbarLastIndex ); - break; - } - case EMusuiCmdViewVolumeDown: - { - HandleCommandL( EMusuiCmdViewVolumeDown ); - break; - } - case EMusuiCmdViewVolumeUp: - { - HandleCommandL( EMusuiCmdViewVolumeUp ); - break; - } - default: - { - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::HandleToolbarCommandL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::SetInitialFocusedItemL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::SetInitialFocusedItemL" ); - - __ASSERT_ALWAYS( iController, User::Leave( KErrNotReady ) ); - - if ( iOperatorSpecificFunctionality && !AknLayoutUtils::PenEnabled() ) - { - MUS_LOG( "Focus changed in OPERATOR mode !!!!!!!!!!!!!" ); - if ( !( iController->DeviceHasDedicatedVolumeKeys() ) ) - { - Toolbar()->SetFocusedItemL( EMusuiCmdToolbarVolume ); - } - else - { - - Toolbar()->SetFocusedItemL( EMusuiCmdToolbarFullScreen ); - } - - } - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::SetInitialFocusedItemL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::SetToolbarVisibility( TBool aVisible ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiReceiveView::SetToolbarVisibility: %d", - aVisible ); - if ( MUS_NO_TOOLBAR ) - { - MUS_LOG( " Operator variant, no toolbar! Ignoring.." ) - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::SetToolbarVisibility" ); - return; - } - - // Show toolbar only after established session and before of exit procedure - if ( iController->FullScreenSelected() ) - { - MUS_LOG( "mus: [MUSUI ] setting toolbar invisible" ); - - Toolbar()->SetToolbarVisibility( EFalse ); - - SharingContainer().RequestToolbarVisibilityOnceDialogDismissed( NULL ); - } - else - { - CMusUiGeneralView::SetToolbarVisibility( aVisible ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiGeneralView::SetToolbarVisibility" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DynInitToolbarL( TInt aResourceId, - CAknToolbar* aToolbar ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::DynInitToolbarL" ); - - // Items to be removed in Receive View: - if (!AknLayoutUtils::PenEnabled())//(aResourceId == R_MUS_TOOLBAR_NONTOUCH)// - { - if ( iController->DeviceHasDedicatedVolumeKeys() ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiReceiveView::DynInitToolbarL\ - DeviceHasDedicatedVolumeKeys" ); - Toolbar()->RemoveItem( EMusuiCmdToolbarVolume ); - } - else - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarVolume ); - } - - Toolbar()->RemoveItem( EMusuiCmdToolbarFFRev ); - Toolbar()->RemoveItem( EMusuiCmdToolbarZoom ); - Toolbar()->RemoveItem( EMusuiCmdToolbarBrightness); - } - - Toolbar()->RemoveItem( EMusuiCmdToolbarPauseLive ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPauseLive ); - Toolbar()->RemoveItem( EMusuiCmdToolbarPause ); - Toolbar()->RemoveItem( EMusuiCmdToolbarUnPause ); - - if ( aToolbar->FocusedItem() == KErrNotFound && - !AknLayoutUtils::PenEnabled() ) - { - aToolbar->SetFocusedItemL( EMusuiCmdToolbarFullScreen ); - } - - // Last generic base class functionality - CMusUiGeneralView::DynInitToolbarL( aResourceId, aToolbar ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::DynInitToolbarL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::ShowInvitationQueryL( const TDesC& aQuery ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::ShowInvitationQueryL" ); - iContainer->ShowInvitationQueryL( aQuery, *iController ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::ShowInvitationQueryL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DismissInvitationQuery( TBool aDelete ) - { - iContainer->DismissInvitationQuery( aDelete ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::SetFullScreenL( TBool aFullScreen ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::SetFullScreenL" ); - - if ( aFullScreen ) - { - Cba()->MakeVisible( EFalse ); - SetToolbarVisibility( EFalse ); - MusAppUi()->StatusPane()->MakeVisible( EFalse ); - - if( MusAppUi()->CurrentFixedToolbar() ) - MusAppUi()->CurrentFixedToolbar()->MakeVisible( EFalse ); - - if( MusAppUi()->CurrentPopupToolbar() ) - MusAppUi()->CurrentPopupToolbar()->MakeVisible( EFalse ); - - if( MusAppUi()->PopupToolbar() ) - MusAppUi()->PopupToolbar()->MakeVisible( EFalse ); - iController->ChangeOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ); - - iContainer->SetFullScreen( ETrue, MusAppUi()->ApplicationRect() ); - iController->SetRect( MusAppUi()->ApplicationRect() ); - } - else - { - if( MusAppUi()->CurrentFixedToolbar() ) - MusAppUi()->CurrentFixedToolbar()->MakeVisible( ETrue ); - - if( MusAppUi()->CurrentPopupToolbar() ) - MusAppUi()->CurrentPopupToolbar()->MakeVisible( ETrue ); - - if( MusAppUi()->PopupToolbar() ) - MusAppUi()->PopupToolbar()->MakeVisible( ETrue); - // First make toolbar, cba and statuspane visible as those affect - // to client rect - MusAppUi()->StatusPane()->MakeVisible( ETrue ); - SetToolbarVisibility( ETrue ); - Cba()->MakeVisible( ETrue ); - - iController->ChangeOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ); - iContainer->SetFullScreen( EFalse, ClientRect() ); - iController->SetRect( ClientRect() ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::SetFullScreenL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::RefreshView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::RefreshView" ); - - if ( iContainer ) - { - iContainer->SetRect( ClientRect() ); - } - - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if ( iController ) - { - iController->SetRect( videoRect ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::RefreshView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventController* CMusUiReceiveView::EventController() const - { - return iController; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiViewContainer& CMusUiReceiveView::SharingContainer() const - { - return *iContainer; - } - - -// ----------------------------------------------------------------------------- -// From CAknView, Gets called from framework when activating this view -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::DoActivateL" ); - - // Base class activation first - CMusUiGeneralView::DoActivateL( aPrevViewId, - aCustomMessageId, - aCustomMessage ); - - if ( !iContainer ) - { - // create the container and then add myself to the view stack - iContainer = CMusUiReceiveContainer::NewL( *this, ClientRect() ); - iContainer->SetMopParent( this ); - AppUi()->AddToViewStackL( *this, iContainer ); - } - - /* Increase the ordinal position of background container - * So that other control will be drawn first. - */ - UpdateBackgroundOrdinalPosition( ETrue ); - - TRect videoRect( ClientRect().iTl.iX, - ClientRect().iTl.iY, - ClientRect().iBr.iX, - ClientRect().iBr.iY - ToolbarPlaceHolderHeight() ); - - if ( !iController ) - { - iController = CMusUiReceiveController::NewL( *MusAppUi(), - *this, - *this, - videoRect ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::DoActivateL" ); - } - - -// ----------------------------------------------------------------------------- -// From AknView, Gets called from framework when deactivating this view -// ----------------------------------------------------------------------------- -// -void CMusUiReceiveView::DoDeactivate() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiReceiveView::DoDeactivate" ); - - CMusUiGeneralView::DoDeactivate(); // Base class deactivation first - - if ( iContainer ) - { - AppUi()->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiReceiveView::DoDeactivate" ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiresourcehandler.cpp --- a/mmsharing/mmshui/src/musuiresourcehandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ -/* -* 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: Handler for camera, keypad and video player resources -* -*/ - - - -#include "musuiresourcehandler.h" -#include "musuipropertywatch.h" -#include "musuieventobserver.h" -#include "musuidialogutil.h" -#include "muslogger.h" -#include "mussettings.inl" - -#include -#include -#include - -using namespace NMusResourceApi; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiResourceHandler::~CMusUiResourceHandler() - { - delete iCameraResourceWatch; - delete iKeypadResourceWatch; - - delete iChangeProductModeDialog; - delete iDialogPrompt; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiResourceHandler* CMusUiResourceHandler::NewL( - MMusUiEventObserver& aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::NewL()" ) - - CMusUiResourceHandler* self = - new ( ELeave ) CMusUiResourceHandler( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiResourceHandler::NewL()" ) - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiResourceHandler::RequestKeypadL( TBool aMandatory ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::RequestKeypadL" ) - - TBool keypadAvailable( EFalse ); - - switch ( iKeypadAvailability ) - { - case NMusResourceApi::EAvailable: - { - MUS_LOG( "mus: [MUSUI ] Keypad is available" ) - break; - } - case NMusResourceApi::ENotAvailable: - { - MUS_LOG( "mus: [MUSUI ] Keypad is not available, changing mode" ) - iKeypadAvailibilityInProgress = ETrue; - delete iDialogPrompt; - iDialogPrompt = NULL; - iDialogPrompt = StringLoader::LoadL( R_MUS_CHANGE_KEYPAD_MODE_TXT ); - ShowChangeProductModeDialogL( *iDialogPrompt ); - MUS_LOG( " Product mode changed" ) - MUS_LOG1( " Keypad availability is %d", - iKeypadAvailability ) - break; - } - default: - { - MUS_LOG( "mus: [MUSUI ] availability default." ) - break; - } - - } - - switch(iKeypadUsability) - { - case MusSettingsKeys::EUsabilityLandscape: - { - MUS_LOG( "mus: [MUSUI ] Keypad is usable in landscape" ) - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationLandscape ); - break; - } - case MusSettingsKeys::EUsabilityPortrait: - { - MUS_LOG( "mus: [MUSUI ] Keypad is usable in portrait" ) - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationPortrait ); - break; - } - case MusSettingsKeys::EUsabilityAlways: - { - MUS_LOG( "mus: [MUSUI ] Keypad is usable in all mode" ) - keypadAvailable = ETrue; - } - break; - default: - MUS_LOG( "mus: [MUSUI ] usuability default ." ) - break; - } - - keypadAvailable = IsCurrentlyAvailable( iKeypadAvailability, - iKeypadUsability ); - - if ( aMandatory && !keypadAvailable ) - { - MUS_LOG( "mus: [MUSUI ] Mandatory keypad not available, exiting" ) - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ); - iObserver.HandleExit(); - } - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiResourceHandler::RequestKeypadL( %d )", - keypadAvailable ) - - return keypadAvailable; - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiResourceHandler::RequestCameraL( TBool aMandatory ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::RequestCameraL" ) - - TBool cameraAvailable( EFalse ); - - switch ( iCameraAvailability ) - { - case NMusResourceApi::EAvailable: - { - MUS_LOG( "mus: [MUSUI ] Camera is available" ) - cameraAvailable = ETrue; - break; - } - - case NMusResourceApi::ENotAvailable: - { - MUS_LOG( "mus: [MUSUI ] Camera is not available, changing mode" ) - - iCameraAvailibilityInProgress = ETrue; - delete iDialogPrompt; - iDialogPrompt = NULL; - iDialogPrompt = StringLoader::LoadL( - R_MUS_LIVE_SHARING_VIEW_OPEN_CAMERA_LENS_COVER_WAIT_NOTE_TXT ); - ShowChangeProductModeDialogL( *iDialogPrompt ); - - MUS_LOG( " Product mode changed" ) - MUS_LOG1( " Camera availability is %d", - iCameraAvailability ) - break; - } - default: - MUS_LOG( "mus: [MUSUI ] availability default." ) - break; - } - - switch(iCameraUsability) - { - case MusSettingsKeys::EUsabilityLandscape: - { - MUS_LOG( "mus: [MUSUI ] Camera is usable in landscape" ) - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationLandscape ); - break; - } - case MusSettingsKeys::EUsabilityPortrait: - { - MUS_LOG( "mus: [MUSUI ] Camera is usable in portrait" ) - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationPortrait ); - break; - } - case MusSettingsKeys::EUsabilityAlways: - { - MUS_LOG( "mus: [MUSUI ] camera is usable in all mode" ) - cameraAvailable = ETrue; - } - default: - { - MUS_LOG( "mus: [MUSUI ] usuability default." ) - break; - } - } - - cameraAvailable = IsCurrentlyAvailable( iCameraAvailability, - iCameraUsability ); - if ( aMandatory && !cameraAvailable ) - { - MUS_LOG( "mus: [MUSUI ] Mandatory camera not available, exiting" ) - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ); - iObserver.HandleExit(); - } - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiResourceHandler::RequestCameraL( %d )", - cameraAvailable ) - - return cameraAvailable; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiResourceHandler::RequestVideoPlayerL( TBool aMandatory ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::RequestVideoPlayerL" ) - - TBool videoPlayerAvailable( EFalse ); - - /* Video Player will be always available. There is no dynamic variation */ - NMusResourceApi::TAvailability vpAvailability = NMusResourceApi::EAvailable; - - switch ( iVideoplayerUsability ) - { - case MusSettingsKeys::EUsabilityAlways: - { - MUS_LOG( "mus: [MUSUI ] Video player is usuable in all mode" ) - videoPlayerAvailable = ETrue; - break; - } - case MusSettingsKeys::EUsabilityLandscape: - { - MUS_LOG( "mus: [MUSUI ] Video player is usable in landscape" ) - - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationLandscape ); - videoPlayerAvailable = IsCurrentlyAvailable( vpAvailability, - iVideoplayerUsability ); - break; - } - case MusSettingsKeys::EUsabilityPortrait: - { - MUS_LOG( "mus: [MUSUI ] Video player is usable in portrait" ) - - iObserver.SwitchOrientationL( - CAknAppUiBase::EAppUiOrientationPortrait ); - videoPlayerAvailable = IsCurrentlyAvailable( vpAvailability, - iVideoplayerUsability ); - break; - } - default: - { - MUS_LOG( "mus: [MUSUI ] usuability default." ) - break; - } - } - - if ( aMandatory && !videoPlayerAvailable ) - { - MUS_LOG( "mus: [MUSUI ] Mandatory player not available, exiting" ) - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ); - iObserver.HandleExit(); - } - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiResourceHandler::RequestVideoPlayerL(%d)", - videoPlayerAvailable ) - - return videoPlayerAvailable; - } - - -// ----------------------------------------------------------------------------- -// Called by CMusUiPropertyWatch, when resource key values change in P&S -// ----------------------------------------------------------------------------- -// -void CMusUiResourceHandler::PropertyChanged( const TUint aKey, - const TInt aValue ) - { - - MUS_LOG2( "mus: [MUSUI ] -> CMusUiResourceHandler::ResourcePropertyChanged:\ - aKey: [%u] aValue: [%d]", aKey, aValue ) - - switch( aKey ) - { - case NMusResourceApi::KCameraAvailability: - { - MUS_LOG( "mus: [MUSUI ] KCameraAvailability " ) - iCameraAvailability = static_cast< TAvailability >( aValue ); - if ( iCameraAvailibilityInProgress && iChangeProductModeDialog ) - { - TRAP_IGNORE( iChangeProductModeDialog->ProcessFinishedL() ); - } - iCameraAvailibilityInProgress = EFalse; - break; - } - case NMusResourceApi::KKeypadAvailability: - { - MUS_LOG( "mus: [MUSUI ] KKeypadAvailability " ) - iKeypadAvailability = static_cast< TAvailability >( aValue ); - if ( iKeypadAvailibilityInProgress && iChangeProductModeDialog ) - { - TRAP_IGNORE( iChangeProductModeDialog->ProcessFinishedL() ); - } - iKeypadAvailibilityInProgress = EFalse; - break; - } - default: - { - MUS_LOG( "mus: [MUSUI ] avilability property watch default." ) - break; - } - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiResourceHandler::ResourcePropertyChanged" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiResourceHandler::HandlePropertyError( const TInt aReason ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::HandlePropertyError()" ) - - iObserver.HandleError( aReason ); - } - - -// ----------------------------------------------------------------------------- -// C++ constructor -// ----------------------------------------------------------------------------- -// -CMusUiResourceHandler::CMusUiResourceHandler( MMusUiEventObserver& aObserver ) - :iObserver( aObserver ), - iCameraAvailability(NMusResourceApi::EAvailable), - iKeypadAvailability(NMusResourceApi::EAvailable), - iCameraUsability(MusSettingsKeys::EUsabilityAlways), - iKeypadUsability(MusSettingsKeys::EUsabilityAlways), - iVideoplayerUsability(MusSettingsKeys::EUsabilityAlways) - { - } - - -// ----------------------------------------------------------------------------- -// Symbian second phase constructor -// ----------------------------------------------------------------------------- -// -void CMusUiResourceHandler::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::ConstructL()" ) - - iCameraAvailibilityInProgress = EFalse; - iKeypadAvailibilityInProgress = EFalse; - - // Read the value from cenrep and check whether camera,keypad - // and videoplayer usability. - MultimediaSharingSettings::ResourceUsability( iCameraUsability , - iKeypadUsability, - iVideoplayerUsability); - - // Read the value from cenrep and check whether camera and keypad - // available dynamically. - MusSettingsKeys::TAvailability camera,keypad; - MultimediaSharingSettings::ResourceAvailability( camera , - keypad); - - TInt err = KErrNone; - - // Set Camera availability - if(camera == MusSettingsKeys::EAvailabilityDynamic) - { - // read the PS key intial value - err = RProperty::Get( - NMusResourceApi::KCategoryUid, - NMusResourceApi::KCameraAvailability, - (TInt&)iCameraAvailability ); - if(err) - { - MUS_LOG1( "mus: [MUSUI ] Error = %d",err ) - iCameraAvailability = NMusResourceApi::ENotAvailable; - } - // watch the camera ps key for further change - iCameraResourceWatch = CMusUiPropertyWatch::NewL( - *this, - NMusResourceApi::KCategoryUid, - KCameraAvailability ); - } - else - { - iCameraAvailability = NMusResourceApi::EAvailable; - } - - // Set Keypad availability - if(keypad == MusSettingsKeys::EAvailabilityDynamic) - { - // read the PS key intial value - err = RProperty::Get( - NMusResourceApi::KCategoryUid, - NMusResourceApi::KKeypadAvailability, - (TInt&)iKeypadAvailability ); - if(err) - { - MUS_LOG1( "mus: [MUSUI ] Error = %d",err ) - iKeypadAvailability = NMusResourceApi::ENotAvailable; - } - // watch the keypad ps key - iKeypadResourceWatch = CMusUiPropertyWatch::NewL( - *this, - NMusResourceApi::KCategoryUid, - KKeypadAvailability ); - } - else - { - iKeypadAvailability = NMusResourceApi::EAvailable; - } - - // Videoplayer availability always static - - MUS_LOG( "mus: [MUSUI ] <- CMusUiResourceHandler::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiResourceHandler::ShowChangeProductModeDialogL( - const TDesC& aPrompt ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::ShowChangeProductModeDialogL()" ) - - TBool returnValue = EFalse; - - if ( !iChangeProductModeDialog ) - { - iChangeProductModeDialog = new ( ELeave ) CAknWaitDialog( ( - reinterpret_cast( &iChangeProductModeDialog ) ), - ETrue ); - - iChangeProductModeDialog->SetTextL( aPrompt ); - - iChangeProductModeDialog->PrepareLC( - R_MUS_LIVE_SHARING_VIEW_ACTIVATE_CAMERA_WAIT_NOTE ); - returnValue = iChangeProductModeDialog->RunLD(); - - iChangeProductModeDialog = NULL; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiResourceHandler::ShowChangeProductModeDialogL()" ) - - return returnValue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiResourceHandler::IsCurrentlyAvailable( - NMusResourceApi::TAvailability aResourceAvailability, - MusSettingsKeys::TUsability aResourceUsability - ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiResourceHandler::IsCurrentlyAvailable()" ) - - CAknAppUiBase::TAppUiOrientation orientation = iObserver.AppOrientation(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiResourceHandler::IsCurrentlyAvailable()" ) - - return ( aResourceAvailability == NMusResourceApi::EAvailable && - ( - aResourceUsability == MusSettingsKeys::EUsabilityAlways || - (aResourceUsability == MusSettingsKeys::EUsabilityLandscape && - orientation == CAknAppUiBase::EAppUiOrientationLandscape) || - (aResourceUsability == MusSettingsKeys::EUsabilityPortrait && - orientation == CAknAppUiBase::EAppUiOrientationPortrait) - ) - ); - } - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuisendcontroller.cpp --- a/mmsharing/mmshui/src/musuisendcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1059 +0,0 @@ -/* -* 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 "musuisendcontroller.h" -#include "musuieventobserver.h" -#include "musuisharingobserver.h" -#include "musuisendobserver.h" -#include "musuidialogutil.h" -#include "musuicallbackservice.h" -#include "musuifileutil.h" -#include "mussettings.h" -#include "musuipropertywatch.h" -#include "mussessionproperties.h" -#include "mussettingskeys.h" -#include "musuiresourcehandler.h" -#include "muslogger.h" // debug logging - -#include "musengmceoutsession.h" -#include "musenguriparser.h" -#include - -#include -#include -#include - - -using namespace NMusSessionApi; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendController::~CMusUiSendController() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::~CMusUiSendController" ); - - delete iAddress; - delete iRemoteSipAddress; - delete iRemoteSipAddressProposal; - delete iVideoFileName; - delete iLocalizer; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::~CMusUiSendController" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession* CMusUiSendController::EngineSession() - { - return EngineOutSession(); // Engine out session is CMusEngMceSession - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::DeleteEngineSession() - { - // Cancel invite - if ( EngineOutSession() && !ConnectionEstablished() ) - { - MUS_LOG( "mus: [MUSUI ] CMusUiSendController::DeleteEngineSession:\ - Canceling inviting..." ); - TRAP_IGNORE( EngineOutSession()->CancelInviteL() ); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::HandlePropertyError( const TInt aReason ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::HandleError [%d]", - aReason ); - TRAP_IGNORE( DeleteVideoL() ); - - CMusUiEventController::HandlePropertyError( aReason ); // For the base class - - MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleError" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleAsyncEventL" ); - switch ( aEventId ) - { - case EMusUiAsyncInviteCancel: - { - MUS_LOG( "mus: [MUSUI ] CMusUiSendController::\ - HandleAsyncEventL: EMusUiAsyncInviteCancel" ); - HandleExitL(); - break; - } - case EMusUiAsyncManualAddressEntry: - { - iResourceHandler->RequestKeypadL( ETrue ); // Exits on fail - iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); - break; - } - case EMusUiAsyncStartInvitation: - { - MUS_LOG( "mus: [MUSUI ] CMusUiSendController::\ - HandleAsyncEventL: EMusUiAsyncStartInvitation" ); - InviteL(); - break; - } - default: - { - // Not send specific, let the base class handle - CMusUiEventController::HandleAsyncEventL( aEventId ); - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleAsyncEventL" ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiSendController::TypedAddress() const - { - return *iAddress; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiSendController::ManualAddressTyped() const - { - return iManualAddressTyped; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::StartInvitationL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::StartInvitationL" ); - - iCallbackService->AsyncEventL( EMusUiAsyncStartInvitation ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::StartInvitationL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::InviteL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::InviteL" ); - - if ( !iSipRegistrationPending ) - { - TRAPD( error, - iRemoteSipAddress = CMusUiPropertyWatch::ReadDescPropertyL( - KRemoteSipAddress ) ); - if ( error != KErrNone ) - { - iRemoteSipAddress = KNullDesC().AllocL(); - } - - TRAP( error, iRemoteSipAddressProposal = - CMusUiPropertyWatch::ReadDescPropertyL( - KRemoteSipAddressProposal ) ); - if ( error != KErrNone ) - { - iRemoteSipAddressProposal = KNullDesC().AllocL(); - } - - if ( iRemoteSipAddress->Length() > 0 ) - { - if ( iRemoteSipAddress->Find( KMusCommaSymbol ) == KErrNotFound ) - { - InviteL( *iRemoteSipAddress ); - } - else - { - // Split the addresses using KMusCommaSymbol as a separator - CDesCArray* addressArray = - new ( ELeave ) CDesCArrayFlat( - KMusSipAddressesMaxAmount ); - SplitL( *iRemoteSipAddress, KMusCommaSymbol, addressArray ); - // Show List Query Dialog - TBuf selectedAddress; - if ( MusUiDialogUtil::SelectAddressDialogL( addressArray, - selectedAddress ) ) - { - // Invite with the chosen address - InviteL( selectedAddress ); - } - else - { - HandleExitL(); - } - } - } - else - { - iResourceHandler->RequestKeypadL( ETrue ); // Exits on failure - iManualAddressTyped = ETrue; - iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); - } - } - else - { - // Show waiting dialog - delete iDialogPrompt; - iDialogPrompt = NULL; - iDialogPrompt = StringLoader::LoadL( - R_MUS_REGISTRATION_PENDING_WAIT_NOTE_TXT ); - - if ( !iSharingObserver.ShowWaitDialogL( - *iDialogPrompt, - KMusInviteExpireTimeout, //Reuse 1 min timer - R_MUS_LIVE_SHARING_VIEW_NOTE_NO_REG ) ) - { - iEventObserver.HandleExit(); - } - - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::InviteL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::CancelInvitationL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::CancelInvitationL" ); - - if ( EngineOutSession() && !ConnectionEstablished() ) - { - TRAP_IGNORE( EngineOutSession()->CancelInviteL() ); - } - - HandleExitL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::CancelInvitationL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::HandleForegroundEventL( TBool aForeground ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleForegroundEventL" ); - - CMusUiEventController::HandleForegroundEventL( aForeground ); - - if ( ConnectionEstablished() && !ExitOccured() ) - { - if ( aForeground ) - { - if ( iContinuePlayingWhenForeground ) - { - MUS_LOG( "mus: [MUSUI ] Resume playing" ); - PlayL(); - } - } - else - { - MUS_LOG( "mus: [MUSUI ] Pause playing" ); - if ( EngineOutSession() ) - { - iContinuePlayingWhenForeground = IsPlayingL(); - } - PauseL(); - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleForegroundEventL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::PlayL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::PlayL" ); - if ( EngineOutSession() ) - { - EngineOutSession()->PlayL(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::PlayL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::PauseL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::PauseL" ); - if ( EngineOutSession() ) - { - EngineOutSession()->PauseL(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::PauseL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiSendController::IsPlayingL() - { - TBool isPlaying( EFalse ); - - if ( EngineOutSession() ) - { - isPlaying = EngineOutSession()->IsPlayingL(); - } - - return isPlaying; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionEstablished() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionEstablished" ); - - // Common handling first - CMusUiEventController::SessionEstablished(); - - iConnectionEstablished = ETrue; - DismissWaitDialog(); - - if ( iForeground ) - { - MUS_LOG( "mus: [MUSUI ] Enable display and start playing" ); - TRAP_IGNORE( PlayL(); - EnableDisplayL( ETrue ); ) - - iEventObserver.SetToolbarVisibility( ETrue ); - - } - else - { - MUS_LOG( "mus: [MUSUI ] In background, don't start playing yet" ); - iContinuePlayingWhenForeground = ETrue; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionEstablished" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionRejected() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRejected" ); - DismissWaitDialog(); - TRAP_IGNORE ( - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_REJECTED ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRejected" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionBadRequest() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionBadRequest" ); - - DismissWaitDialog(); - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionBadRequest" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionUnauthorized() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionUnauthorized" ); - - DismissWaitDialog(); - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionUnauthorized" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionPaymentRequired() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionPaymentRequired" ); - - DismissWaitDialog(); - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionPaymentRequired" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionRecipientNotFound() - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiSendController::SessionRecipientNotFound [%d]", - iTriedInvitations ); - DismissWaitDialog(); - if ( ExitOccured() ) - { - return; - } - if ( ++iTriedInvitations > 1 ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_WRONG_ADDRESS ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncInviteCancel ) ); - - } - else - { - TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_WRONG_ADDRESS ) ); - iManualAddressTyped = ETrue; - - TRAP_IGNORE( - iCallbackService->AsyncEventL( EMusUiAsyncManualAddressEntry ) ); - - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRecipientNotFound" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionProxyAuthenticationRequired() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionProxyAuthenticationRequired" ); - - DismissWaitDialog(); - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionProxyAuthenticationRequired" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionRequestTimeOut() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestTimeOut" ); - DismissWaitDialog(); - TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_NO_RESPONSE ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestTimeOut" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionUnsupportedMediaType() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionUnsupportedMediaType" ); - DismissWaitDialog(); - if ( !ExitOccured() ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_APP_N_A ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionUnsupportedMediaType" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionBusyHere() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionBusyHere" ); - DismissWaitDialog(); - TRAP_IGNORE( - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_RECIPIENT_N_A ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionBusyHere" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionRequestCancelled() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestCancelled" ); - DismissWaitDialog(); - TRAP_IGNORE( - MusUiDialogUtil::ShowInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_INVITATION_CANCELLED ) ); - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestCancelled" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SessionTemporarilyNotAvailable() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestCancelled" ); - DismissWaitDialog(); - if ( !ExitOccured() ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); - } - - TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestCancelled" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ConstructL" ); - - CMusUiEventController::ConstructL(); // Base class construction - iLocalizer = CDirectoryLocalizer::NewL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendController::CMusUiSendController( - MMusUiEventObserver& aEventObserver, - MMusUiSharingObserver& aSharingObserver, - MMusUiSendObserver& aSendObserver ) - : CMusUiEventController( aEventObserver, aSharingObserver ), - iSendObserver( aSendObserver ), - iTriedInvitations( 0 ), - iContinuePlayingWhenForeground( ETrue ), - iWaitDialogCallback( *this ) - { - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::ExitProcedureL( TBool aUserAcceptance ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ExitProcedureL" ); - - DismissWaitDialog(); - - switch ( iShutdownState ) - { - case EMusUiShutdownStarted: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownStarted" ); - - if ( iVideoToBeSaved && - iVideoFileName && - MusUiFileUtil::FileExists( *iVideoFileName ) ) - { - iShutdownState = EMusUiShutdownVideoSaved; - ShowVideoSavedDialogL(); - ExitProcedureL( ETrue ); // Accept saving - } - else - { - CMusUiEventController::ExitProcedureL( aUserAcceptance ); - } - break; - } - - case EMusUiShutdownVideoSaved: - { - MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownVideoSaved" ); - - // Check if our address is valid sip or tel uri. If not, there is no - // point to query user about permission to save it to contacts. - - TInt error = KErrNotFound; - if ( iAddress ) - { - TMusEngUriParser parser( *iAddress ); - TRAP( error, parser.ParseUriL() ) - } - - // Save Address to Contacts query if manually entered - // and if is the standard variant. - // NOTE: KErrNotSupported means there is more than one contact id. - if ( !iOperatorSpecificFunctionality && ManualAddressTyped() && - iContactId != KErrNotSupported && - error == KErrNone ) - { - iShutdownState = EMusUiShutdownContactSavingQueried; - SaveContactQueryL(); - } - else - { - // Nothing send specific, let the base class handle - CMusUiEventController::ExitProcedureL( aUserAcceptance ); - } - break; - } - - default: - { - // Nothing send specific, let the base class handle - CMusUiEventController::ExitProcedureL( aUserAcceptance ); - break; - } - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ExitProcedureL" ); - } - - -// ----------------------------------------------------------------------------- -// Handles status changes specific to sending sharing types. -// Calls base class version for status changes that are not sending specific. -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::HandleChangedStatusL( - TMusAvailabilityStatus aStatus ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleChangedStatusL" ) - switch( aStatus ) - { - case ESipRegistrationPending: - { - MUS_LOG( "mus: [MUSUI ] ESipRegistrationPending" ); - iSipRegistrationPending = ETrue; - break; - } - case ESipOptionsNotSent: // FALLTHROUGH - case ESipOptionsSent: // FALLTHROUGH - { - break; - } - case EManualActivation: // FALLTHROUGH - case EMultimediaSharingAvailable: - { - MUS_LOG( "mus: [MUSUI ] EManualActivation or EMultimediaSharingAvailable" ) - - if( iSipRegistrationPending ) - { - iSipRegistrationPending = EFalse; - // Set callback service, Call StartInvitationL when wait dialog dismissed - TRAPD( err, iSharingObserver.SetWaitDialogCallbackL( - &iWaitDialogCallback ) ); - // Dismiss pending wait note - iSharingObserver.DismissWaitDialogL(); - if ( err == KErrNotReady ) - { - StartInvitationL(); - } - } - break; - } - - default: - { - // Not sending specific, let the base class handle - CMusUiEventController::HandleChangedStatusL( aStatus ); - break; - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleChangedStatusL" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CMusUiSendController::VideoFileNameL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::VideoFileNameL" ); - - TParse parse; - TPtrC rootPath; - - SetVideoPathValueL();//sets video rootpath according to setting value. - - if ( parse.Set( iVideoFilePath,NULL,NULL) != KErrBadName ) - { - - if(parse.Drive().Compare( PathInfo::MemoryCardRootPath())) - { - TRAPD(error,MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath)); - - switch(error) - { - case KErrNotReady: - case KErrCorrupt: - case KErrLocked: - { - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_VIEW_NOTE_MEMORYCARD_PROBLEM); - - MUS_LOG( "mus: [MUSUI ] -> Changing to Phone Memory " ); - rootPath.Set(PathInfo::PhoneMemoryRootPath()); - TParsePtrC pathPtr(rootPath); - iVideoFilePath = rootPath; - iVideoFilePath += PathInfo::VideosPath(); - // Make sure the new path exists - TRAP_IGNORE( MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath) ) - break; - } - case KErrAlreadyExists: - case KErrNone: - { - MUS_LOG( "mus: [MUSUI ] -> Using MMC " ); - rootPath.Set(PathInfo::MemoryCardRootPath()); - break; - } - default: - { - delete iVideoFileName; - iVideoFileNamePlain = KNullDesC; - iVideoFileName = iVideoFileNamePlain.AllocL(); - HandleError( error); - break; - } - } - } - else//Phone memory is being used. - { - TRAPD(error,MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath)); - - switch(error) - { - case KErrAlreadyExists: - case KErrNone: - { - MUS_LOG( "mus: [MUSUI ] -> Using Phone memory" ); - rootPath.Set(PathInfo::PhoneMemoryRootPath()); - break; - } - default: - { - delete iVideoFileName; - iVideoFileNamePlain = KNullDesC; - iVideoFileName = iVideoFileNamePlain.AllocL(); - HandleError( error); - break; - } - } - } - - } - else - { - delete iVideoFileName; - iVideoFileNamePlain = KNullDesC; - iVideoFileName = iVideoFileNamePlain.AllocL(); - HandleError(KErrBadName); - } - - TParsePtrC pathPtr(rootPath); - iVideoFilePath += pathPtr.NameAndExt(); - MusUiFileUtil::CreateVideoFileNameL(iVideoFilePath, - iVideoFileNamePlain); - - delete iVideoFileName; - TFileName videoFileName; - videoFileName += iVideoFilePath; - videoFileName += iVideoFileNamePlain; - videoFileName += KMusVideoFileNameExtension; - iVideoFileName = videoFileName.AllocL(); - - MUS_LOG_TDESC( "mus: [MUSUI ] <- CMusUiSendController::VideoFileNameL:", - iVideoFileName->Des() ); - return *iVideoFileName; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::ShowInvitingWaitDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ShowWaitDialogL" ); - delete iDialogPrompt; - iDialogPrompt = NULL; - iDialogPrompt = StringLoader::LoadL( - R_MUS_LIVE_SHARING_VIEW_INVITING_WAIT_NOTE_TXT, - MusContactName().Length() > 0 ? - MusContactName() : iOperatorSpecificFunctionality ? - MusTelNumberValue() : *iAddress ); - - if ( !iSharingObserver.ShowWaitDialogL( - *iDialogPrompt, - KMusInviteExpireTimeout, - R_MUS_LIVE_SHARING_VIEW_NOTE_NO_RESPONSE ) ) - { - CancelInvitationL(); - } - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ShowWaitDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::DismissWaitDialog() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::DismissWaitDialog" ); - TRAPD( err, iSharingObserver.DismissWaitDialogL(); ); - if ( err != KErrNone ) - { - HandleError( err ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::DismissWaitDialog" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::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 ); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::SetVideoPathValueL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SetVideoPathValueL" ); - TInt drive = MultimediaSharingSettings::VideoLocationSettingL(); - - TFileName rootPath; - User::LeaveIfError( PathInfo::GetRootPath( rootPath, drive ) ); - - TParsePtrC pathPtr(rootPath); - iVideoFilePath = rootPath; - iVideoFilePath += PathInfo::VideosPath(); - MUS_LOG_TDESC( "mus: [MUSUI ] <- CMusUiSendController::SetVideoPathValueL: ", - iVideoFilePath ); - iLocalizer->SetFullPath( iVideoFilePath ); - if ( iLocalizer->IsLocalized() ) - { - iLocalizedVideoFilePath =iLocalizer->LocalizedName(); - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::ShowVideoSavedDialogL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ShowVideoSavedDialogL" ); - //MUS_LOG_TDESC( "mus: [MUSUI ] ", iVideoFileNamePlain ); - //MUS_LOG_TDESC( "mus: [MUSUI ] ", iVideoFilePath ); - - delete iDialogPrompt; - iDialogPrompt = NULL; - - TBuf buf; - TFileName videoFileName; - videoFileName += iVideoFileNamePlain; - videoFileName += KMusVideoFileNameExtension; - buf = videoFileName; - - CDesCArrayFlat* savingTextsArray = - new ( ELeave ) CDesCArrayFlat( KMusStringSubstArrayGranularity ); - CleanupStack::PushL( savingTextsArray ); - //"File %0U saved to folder %1U" - //%0U = iVideoFileName - //%1U = iVideoFilePath - savingTextsArray->InsertL( 0, videoFileName ); - - if ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EOperatorSpecific ) // For AT&T products - { - HBufC* folder = StringLoader::LoadLC( R_MUS_VIDEO_SAVE_FOLDER_NAME ); - savingTextsArray->InsertL( 1, *folder ); - CleanupStack::PopAndDestroy( folder ); - } - else // Standard products - { - if ( iLocalizer->IsLocalized() ) - { - savingTextsArray->InsertL( 1, iLocalizedVideoFilePath ); - } - else - { - savingTextsArray->InsertL( 1, iVideoFilePath ); - } - } - - MUS_LOG_TDESC( "mus: [MUSUI ] filename:", savingTextsArray->MdcaPoint( 0 ) ); - MUS_LOG_TDESC( "mus: [MUSUI ] path:", savingTextsArray->MdcaPoint( 1 ) ); - - iDialogPrompt = StringLoader::LoadL( R_MUS_VIEW_NOTE_VIDEO_SAVED, - *savingTextsArray ); - CleanupStack::Pop( savingTextsArray ); - - MUS_LOG_TDESC( "mus: [MUSUI ] ", iDialogPrompt->Des() ); - - MusUiDialogUtil::ShowGlobalInformationDialogL( *iDialogPrompt ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ShowVideoSavedDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController::DeleteVideoL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::DeleteVideoL" ); - if ( iVideoFileName ) - { - MusUiFileUtil::DeleteFileL( *iVideoFileName ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::DeleteVideoL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendController:: -TWaitDialogCallback::TWaitDialogCallback( CMusUiSendController& aController ) - : iController( aController ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendController:: -TWaitDialogCallback::DialogDismissedL( TInt /*aButtonId*/ ) - { - iController.StartInvitationL(); - } - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuisendview.cpp --- a/mmsharing/mmshui/src/musuisendview.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* 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: The MUS application's UI class. -* -*/ - - -#include "musuisendview.h" -#include "musuiappui.h" -#include "musuisendcontroller.h" -#include "musuisendviewcontainer.h" -#include "musuidefinitions.h" -#include "musuidialogutil.h" -#include "muslogger.h" // debug logging - -#include - -#include - - -// ----------------------------------------------------------------------------- -// EPOC two-phased constructor -// ----------------------------------------------------------------------------- -// -void CMusUiSendView::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendView::ConstructL" ); - CMusUiGeneralView::ConstructL(); - iSavedOrientation = MusAppUi()->AppOrientation(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendView::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -CMusUiSendView::~CMusUiSendView() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendView::~CMusUiSendView" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendView::~CMusUiSendView" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendView::ManualAddressEntryL( const TDesC& aAddress ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiSendView::ManualAddressEntryL: ", - aAddress ); - - CAknAppUiBase::TAppUiOrientation aOrientation ; - - TBuf address( aAddress ); - if ( SendController() && MusUiDialogUtil::ShowTextQueryDialogL( - R_MUS_TEXT_ENTER_ADDRESS_DIALOG_PROMPT, - address ) ) - { - //to get the AppOrientation before sending invatation - aOrientation = MusAppUi()->AppOrientation(); - SendController()->InviteL( address ); - } - else - { - MusUiDialogUtil::ShowGlobalInformationDialogL( - R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED ); - MusAppUi()->HandleExit(); - } - - if( aOrientation != iSavedOrientation) - { - SendController()->ChangeOrientationL( iSavedOrientation ); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendView::ManualAddressEntryL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventController* CMusUiSendView::EventController() const - { - return SendController(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiViewContainer& CMusUiSendView::SharingContainer() const - { - return *SendContainer(); - } - - -// ----------------------------------------------------------------------------- -// From CAknView, Gets called from framework when activating this view -// ----------------------------------------------------------------------------- -// -void CMusUiSendView::DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - // Base class activation first - CMusUiGeneralView::DoActivateL( aPrevViewId, - aCustomMessageId, - aCustomMessage ); - - } - - -// ----------------------------------------------------------------------------- -// From AknView, Gets called from framework when deactivating this view -// ----------------------------------------------------------------------------- -// -void CMusUiSendView::DoDeactivate() - { - CMusUiGeneralView::DoDeactivate(); // Base class deactivation first - } - - -// ----------------------------------------------------------------------------- -// Called when focus event occurs. -// ----------------------------------------------------------------------------- -// -void CMusUiSendView::DoHandleForegroundEventL( TBool aForeground ) - { - CMusUiGeneralView::HandleForegroundEventL( - aForeground, - iOperatorSpecificFunctionality && - EventControllerL().ConnectionEstablished() && - !EventControllerL().ExitOccured() ); - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuisendviewcontainer.cpp --- a/mmsharing/mmshui/src/musuisendviewcontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* 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 MUS application's UI class. -* -*/ - - -#include "musuiclipsharingviewcontainer.h" -#include "musuisendview.h" -#include "musuilevelindicator.h" -#include "musuidialogutil.h" -#include "musuidefinitions.h" -#include "musuisendcontroller.h" -#include "muslogger.h" // debug logging -#include - -#include -#include -#include -#include - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendViewContainer::CMusUiSendViewContainer() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::ConstructL( CMusUiGeneralView* aView, - const TRect& aRect, - TAknOrientation aIndicatorLayout ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendViewContainer::ConstructL" ); - - CreateWindowL(); - iView = aView; - iBackGround = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, - aRect, - EFalse ); - - iIndicator = CMusUiLevelIndicator::NewL( aIndicatorLayout, - 0, - 100, - this, - aRect, - this ); - iIndicator->SetContainerWindowL( *this ); - - iVideoRect = aRect; - - SetRect( aRect ); - - iIndicator->SetRect( Rect() ); - - MakeVisible( EFalse ); - ActivateL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendViewContainer::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiSendViewContainer::~CMusUiSendViewContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendViewContainer::~CMusUiSendViewContainer" ); - - delete iIndicator; - delete iBackGround; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendViewContainer::~CMusUiSendViewContainer" ); - } - - -// ----------------------------------------------------------------------------- -// Fetches a pointer to the view that owns this container. -// ----------------------------------------------------------------------------- -// -CMusUiGeneralView* CMusUiSendViewContainer::MusUiView() const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendViewContainer::MusUiView" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendViewContainer::MusUiView" ); - return iView; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::SetController( CMusUiSendController* aController ) - { - iSendController = aController; - } - - -// ----------------------------------------------------------------------------- -// Called by framework to redraw the screen area. -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::Draw( const TRect& aRect ) const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiSendViewContainer::Draw" ); - CWindowGc& gc = SystemGc(); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - if(!AknsDrawUtils::Background( skin, - cc, - this, - gc, - iVideoRect, - KAknsDrawParamDefault )) - { - MUS_LOG( "mus: [MUSUI ] Skin not valid or not found" ); - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendViewContainer::Draw" ); - } - - -// ----------------------------------------------------------------------------- -// Called by framework when the view size is changed -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::SizeChanged() - { - if (iBackGround) - { - static_cast - ( iBackGround )->SetRect( Rect() ); - } - iIndicator->SetRect( Rect() ); - } - - -// ----------------------------------------------------------------------------- -// Supply the Mob Object for background skin drawing -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CMusUiSendViewContainer::MopSupplyObject( TTypeUid aId ) - { - if (aId.iUid == MAknsControlContext::ETypeId && iBackGround ) - { - return MAknsControlContext::SupplyMopObject( aId, iBackGround ); - } - return CCoeControl::MopSupplyObject( aId ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::SetLevelIndicatorVisibility( TBool aVisible) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiSendViewContainer::SetLevelIndicatorVisibility( %d )", - aVisible ) - - MakeVisible( aVisible ); - - if ( !aVisible ) - { - iView->LevelIndicatorDismissed(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiSendViewContainer::SetLevelIndicatorVisibility" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiSendViewContainer::IndicatorLevelChanged( TInt aNewLevel ) - { - if ( iSendController ) - { - TRAPD( error, iSendController->HandleSliderValueChangeL( aNewLevel ) ) - - if ( error != KErrNone ) - { - MUS_LOG1( "mus: [MUSUI ] Error during handling of slider value change( %d )", - error ) - - iSendController->HandleError( error ); - } - } - } - - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuistartcontroller.cpp --- a/mmsharing/mmshui/src/musuistartcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: Application's UI class. -* -*/ - - - -#include "musuistartcontroller.h" -#include "musmanagercommon.h" -#include "mussessionproperties.h" -#include "muslogger.h" // debug logging - -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -MusUiStartController::MusUiStartController() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -MultimediaSharing::TMusUseCase MusUiStartController::ReadUseCaseL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStartController::UseCasePropertyL()" ); - TInt val; - User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, - NMusSessionApi::KUseCase, - val ) ); - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiStartController::UseCasePropertyL():\ - [%d]", val ); - - return static_cast< MultimediaSharing::TMusUseCase >( val ); - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuistatuspanehandler.cpp --- a/mmsharing/mmshui/src/musuistatuspanehandler.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,323 +0,0 @@ -/* -* 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 "musuistatuspanehandler.h" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include - -#include -#include -#include -#include -#include -#include -#include -#include // Navi pane container ( CAknNavigationControlContainer ) -#include -#include -#include -#include - - -// constants -#define KMUSMBMFILENAME iEikonEnvironment.EikAppUi()->Application()->BitmapStoreName() - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiStatusPaneHandler* CMusUiStatusPaneHandler::NewL( CEikonEnv& aEikonEnv ) - { - CMusUiStatusPaneHandler* self = - new ( ELeave ) CMusUiStatusPaneHandler( aEikonEnv ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiStatusPaneHandler::~CMusUiStatusPaneHandler() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::~CMusUiStatusPaneHandler" ); - - delete iNaviPaneText; - delete iMediaControl; - delete iVolumePopup; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::~CMusUiStatusPaneHandler" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiStatusPaneHandler::CMusUiStatusPaneHandler( CEikonEnv& aEikonEnv ) - :iEikonEnvironment( aEikonEnv ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::ConstructL" ); - - CEikStatusPane* statusPane = iEikonEnvironment.AppUiFactory()->StatusPane(); - - iNaviPane = STATIC_CAST( - CAknNavigationControlContainer*, - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - iTitlePane = STATIC_CAST( - CAknTitlePane*, - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); - iContextPane = STATIC_CAST( - CAknContextPane*, - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidContext ) ) ); - - iVolumePopup = CAknVolumePopup::ConstructFromResourceL( - R_AVKON_NAVI_PANE_VOLUME_INDICATOR ); - - iMediaControl = CreateMediaNaviL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::ConstructL" ); - } - - -// ----------------------------------------------------------------------------- -// Updates statuspane icons -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetStatusPaneIconsL( TInt32 aIconId, - TInt32 aIconMaskId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetStatusPaneIconsL" ) - - iContextPane->SetPictureFromFileL( KMUSMBMFILENAME, aIconId, aIconMaskId ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetStatusPaneIconsL" ) - } - - -// ----------------------------------------------------------------------------- -// Updates statuspane icons -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetStatusPaneIconsL( CFbsBitmap* aBitmap ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetStatusPaneIconsL" ); - CEikImage* image = new (ELeave) CEikImage(); - image->SetBitmap( aBitmap ); - CEikImage* oldImage = iContextPane->SwapPicture( image ); - delete oldImage; - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetStatusPaneIconsL" ); - } - - -// ----------------------------------------------------------------------------- -// Hides navi-pane decorators and clears text -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::ClearNaviPaneL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::ClearNaviPaneL" ); - delete iNaviPaneText; - iNaviPaneText = NULL; - - // Pushes default decorator object (empty one) to top of the stack - // and draws it - iNaviPane->PushDefaultL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::ClearNaviPaneL" ); - } - - -// ----------------------------------------------------------------------------- -// Sets title-pane text -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetTitleL( const TDesC& aTitle ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetTitleL" ); - iTitlePane->SetTextL( aTitle ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetTitleL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetTitleFromResourceL( TInt aResourceId ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetTitleFromResourceL" ); - HBufC* titlePaneTitle = StringLoader::LoadLC( aResourceId ); - iTitlePane->SetTextL( *titlePaneTitle ); - CleanupStack::PopAndDestroy( titlePaneTitle ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetTitleFromResourceL" ); - } - - -// ----------------------------------------------------------------------------- -// Get the current volume setting. -// ----------------------------------------------------------------------------- -// -TInt CMusUiStatusPaneHandler::GetVolumeControlValue() const - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::GetVolumeControlValue" ); - - TInt volume = iVolumePopup->Value(); - - MUS_LOG1( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::GetVolumeControlValue: [%d]", - volume ); - return volume; - } - - -// ----------------------------------------------------------------------------- -// Activates volume control. -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::ActivateVolumeControlL( TInt aVolume ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::ActivateVolumeControlL" ); - - if ( aVolume < KMusVolumeMuted || aVolume > KMusVolumeMaximum ) - { - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetVolumeControlValue: returning" ); - return; - } - - iVolumePopup->SetValue( aVolume ); - iVolumePopup->ShowVolumePopupL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::ActivateVolumeControlL" ); - } - - -// ----------------------------------------------------------------------------- -// Activate media navi pane. -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::ActivateNaviPaneMediaL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::ActivateNaviPaneMediaL" ); - iNaviPane->PushL( *iMediaControl ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::ActivateNaviPaneMediaL" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::ShowNaviPaneIconL( - TMusUiNaviMediaDecorator aIcon ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::ShowNaviPaneIconL" ); - CMusUiNaviMediaDecorator* mediaNavi = - static_cast( - iMediaControl->DecoratedControl() ); - mediaNavi->ShowIcon( aIcon ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::ShowNaviPaneIconL" ); - } - - -// ----------------------------------------------------------------------------- -// Sets navi-pane label for left side -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetLeftLabelL( const TDesC& aLabel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetLeftLabelL" ); - - static_cast - ( iMediaControl->DecoratedControl() )->SetLeftLabelL( aLabel ); - iNaviPane->DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetLeftLabelL" ); - } - - -// ----------------------------------------------------------------------------- -// Sets navi-pane label for right side -// ----------------------------------------------------------------------------- -// -void CMusUiStatusPaneHandler::SetRightLabelL( const TDesC& aLabel ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::SetRightLabelL" ); - - static_cast - ( iMediaControl->DecoratedControl() )->SetRightLabelL( aLabel ); - iNaviPane->DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::SetRightLabelL" ); - } - - -// ----------------------------------------------------------------------------- -// Create media navi pane. -// ----------------------------------------------------------------------------- -// -CAknNavigationDecorator* CMusUiStatusPaneHandler::CreateMediaNaviL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiStatusPaneHandler::CreateMediaNaviL" ); - CMusUiNaviMediaDecorator* naviDecorator = CMusUiNaviMediaDecorator::NewL(); - CleanupStack::PushL( naviDecorator ); - - CAknNavigationDecorator* decoratedFolder = - CAknNavigationDecorator::NewL( - iNaviPane, - naviDecorator, - CAknNavigationDecorator::ENotSpecified ); - CleanupStack::Pop( naviDecorator );// decoratedFolder owns naviDecorator now - - CleanupStack::PushL( decoratedFolder ); - decoratedFolder->SetContainerWindowL( *iNaviPane ); - naviDecorator->SetContainerWindowL( *decoratedFolder ); - CleanupStack::Pop( decoratedFolder ); - - decoratedFolder->MakeScrollButtonVisible( EFalse ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiStatusPaneHandler::CreateMediaNaviL" ); - return decoratedFolder; - } - - -// ----------------------------------------------------------------------------- -// Get Volump Popup control pointer -// ----------------------------------------------------------------------------- -// -CAknVolumePopup* CMusUiStatusPaneHandler::GetVolumePopup() const - { - return iVolumePopup; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuiviewcontainer.cpp --- a/mmsharing/mmshui/src/musuiviewcontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* 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 MUS application's UI class. -* -*/ - - -#include "musuiviewcontainer.h" -#include "musuidialogutil.h" -#include "musuidefinitions.h" -#include "muslogger.h" // debug logging -#include "musuigeneralview.h" -#include - -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiViewContainer::~CMusUiViewContainer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiViewContainer::~CMusUiViewContainer" ); - - CancelWaitTimer(); - delete iWaitDialogTimer; - - if ( iWaitDialog ) - { - TRAP_IGNORE( iWaitDialog->ProcessFinishedL() ); - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiViewContainer::~CMusUiViewContainer" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiViewContainer::CancelWaitTimer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiViewContainer::CancelWaitTimer" ); - if ( iWaitDialogTimer ) - { - iWaitDialogTimer->Cancel(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiViewContainer::CancelWaitTimer" ); - } - - -// ----------------------------------------------------------------------------- -// Dismisses the current active wait note, if any. -// ----------------------------------------------------------------------------- -// -void CMusUiViewContainer::DismissWaitDialogL( TBool aReturnValue ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiViewContainer::DismissWaitDialogL" ); - - if ( iWaitDialog ) - { - iInvitationWaitDialogDismissed = ETrue; - iWaitDialogReturnValueWhenDismissed = aReturnValue; - - iWaitDialog->ProcessFinishedL(); - iWaitDialog = NULL; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiViewContainer::DismissWaitDialogL" ); - } - - -// ----------------------------------------------------------------------------- -// Runs the Inviting recipient wait note -// ----------------------------------------------------------------------------- -// -TBool CMusUiViewContainer::RunWaitDialogL( const TDesC& aPrompt, - TInt aTimerInSeconds, - TInt aExpirationMessageResourceId ) - { - MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiViewContainer::RunWaitDialogL: ", aPrompt ); - - __ASSERT_ALWAYS( !iWaitDialog, User::Leave( KErrAlreadyExists ) ); - __ASSERT_ALWAYS( !iWaitDialogTimer, User::Leave( KErrAlreadyExists ) ); - - MUS_LOG( " No previous wait dialog, continue " ) - - iExpirationMessageResourceId = aExpirationMessageResourceId; - - iWaitDialog = new( ELeave ) CAknWaitDialog( - reinterpret_cast(&iWaitDialog) ); - - iWaitDialog->SetTextL( aPrompt ); - - TBool retVal = ETrue; - iWaitDialog->PrepareLC( R_MUS_VIEW_INVITING_WAIT_NOTE ); - - if ( aTimerInSeconds > 0 ) - { - iWaitDialogTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - iWaitDialogTimer->Start( KMusOneSecond * aTimerInSeconds, - KMusOneSecond * aTimerInSeconds, - TCallBack( DoWaitNoteTimeout, this ) ); - } - - iShowingWaitDialog = ETrue; - retVal = iWaitDialog->RunLD(); - iShowingWaitDialog = EFalse; - iWaitDialog = NULL; - - MUS_LOG( " Wait dialog's RunLD returned" ) - - if ( iToolbarHandler ) - { - MUS_LOG( " Completing toobar request" ) - iToolbarHandler->SetToolbarVisibility( ETrue ); - iToolbarHandler = NULL; - } - - // Cancel timer when dialog returns. - CancelWaitTimer(); - delete iWaitDialogTimer; - iWaitDialogTimer = NULL; - - if ( iInvitationWaitDialogDismissed ) - { - iInvitationWaitDialogDismissed = EFalse; - retVal = iWaitDialogReturnValueWhenDismissed; - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiViewContainer::RunWaitDialogL" ); - return retVal; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiViewContainer::SetWaitDialogCallbackL( MProgressDialogCallback* aCallback ) - { - __ASSERT_ALWAYS( iWaitDialog, User::Leave( KErrNotReady ) ); - iWaitDialog->SetCallback( aCallback ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusUiViewContainer::WaitDialogShown() const - { - return iShowingWaitDialog; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiViewContainer::RequestToolbarVisibilityOnceDialogDismissed( - CMusUiGeneralView* aToolbarHandler ) - { - MUS_LOG1( - "mus: [MUSUI ] <-> \ -CMusUiViewContainer::RequestToolbarVisibilityOnceDialogDismissed, handler:%d", - reinterpret_cast( aToolbarHandler ) ); - - iToolbarHandler = aToolbarHandler; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiViewContainer::CMusUiViewContainer() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Tick handler, callback function directly called by periodic timer -// ----------------------------------------------------------------------------- -// -TInt CMusUiViewContainer::DoWaitNoteTimeout( TAny* aObject ) - { - // Cast, and call non-static function. - MUS_LOG( "mus: [MUSUI ] -> CMusUiViewContainer::DoWaitNoteTimeout" ); - - CMusUiViewContainer* self = - static_cast( aObject ); - - TRAP_IGNORE( self->DismissWaitDialogL( EFalse ) ); - - if ( self->iExpirationMessageResourceId != 0 ) - { - TRAP_IGNORE( MusUiDialogUtil::ShowGlobalInformationDialogL( - self->iExpirationMessageResourceId ) ) - } - - MUS_LOG( "mus: [MUSUI ] <- CMusUiViewContainer::DoWaitNoteTimeout" ); - // Return 0 ( false ) to indicate that we don't want more ticks - return KErrNone; - } - - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/src/musuizoomindicator.cpp --- a/mmsharing/mmshui/src/musuizoomindicator.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,483 +0,0 @@ -/* -* Copyright (c) 2003, 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 for displaying icons in viewfinder view -* -*/ - - -// USER -#include "musuizoomindicator.h" -#include "muslogger.h" -#include "musuizoomindicatorobserver.h" - -// SYSTEM -#include -#include -#include -#include -#include -#include -#include - - - -// CONSTANTS -const TInt KMusUiZoomDisableTime = 3000000; - - -using namespace AknLayoutScalable_Apps; - -_LIT( KMyMbmFileName, "z:Camcorder.mbm"); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiZoomIndicator::CMusUiZoomIndicator( - TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ) - : iZoomMin( aZoomMin ), - iZoomMax( aZoomMax ), - iZoomLevel( aZoomMin ), - iObserver( aObserver ) - { - MUS_LOG( "mus: mus: [MUSUI ] -> CMusUiZoomIndicator::CMusUiZoomIndicator()" ); - // pass - iDisableZoomTimer = NULL; - iTopMargin = 5; - iBottomMargin = 5; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::CMusUiZoomIndicator()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiZoomIndicator* CMusUiZoomIndicator::NewLC( - TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::NewLC()" ); - CMusUiZoomIndicator* self = new ( ELeave ) CMusUiZoomIndicator( - aZoomMin, - aZoomMax, - aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::NewLC()" ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiZoomIndicator* CMusUiZoomIndicator::NewL( - TInt aZoomMin, - TInt aZoomMax, - MMusUiZoomIndicatorObserver* aObserver ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::NewL()" ); - CMusUiZoomIndicator* self = NewLC( aZoomMin, - aZoomMax, - aObserver ); - CleanupStack::Pop( self ); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::NewL()" ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::ConstructL() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::ConstructL()" ); - - if( iZoomMin > iZoomMax ) - { - User::Leave( KErrArgument ); - } - - iIconElevator = new (ELeave) CEikImage(); - iIconElevator->SetContainerWindowL( *this ); - - iIconMin = new (ELeave) CEikImage(); - iIconMin->SetContainerWindowL( *this ); - - iIconMax = new (ELeave) CEikImage(); - iIconMax->SetContainerWindowL( *this ); - - iIconBg = new (ELeave) CEikImage(); - iIconBg->SetContainerWindowL( *this ); - - - ConstructImageL( iIconMin, - AknsUtils::SkinInstance(), - KAknsIIDQsnIconColors, - EMbmCamcorderQgn_indi_cams_zoom_bg_min, - EMbmCamcorderQgn_indi_cams_zoom_bg_min); - - ConstructImageL( iIconMax, - AknsUtils::SkinInstance(), - KAknsIIDQsnIconColors, - EMbmCamcorderQgn_indi_cams_zoom_bg_max, - EMbmCamcorderQgn_indi_cams_zoom_bg_max); - - ConstructImageL( iIconBg, - AknsUtils::SkinInstance(), - KAknsIIDQsnIconColors, - EMbmCamcorderQgn_indi_cams_zoom_bg, - EMbmCamcorderQgn_indi_cams_zoom_bg); - - ConstructImageL( iIconElevator, - AknsUtils::SkinInstance(), - KAknsIIDQsnIconColors, - EMbmCamcorderQgn_indi_cams_zoom_elevator, - EMbmCamcorderQgn_indi_cams_zoom_elevator); - - - UpdateZoomLayout(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::ConstructL()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiZoomIndicator::~CMusUiZoomIndicator() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::~CMusUiZoomIndicator()" ); - - DisableTimer(); - delete iDisableZoomTimer; - - delete iIconElevator; - delete iIconMin; - delete iIconMax; - delete iIconBg; - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::~CMusUiZoomIndicator()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::SetZoomLevel( TInt aZoomLevel ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiZoomIndicator::SetZoomLevel( %d ) ", - aZoomLevel ); - if( aZoomLevel >= iZoomMin && aZoomLevel <= iZoomMax ) - { - iZoomLevel = aZoomLevel; - } - DisableTimer(); - UpdateZoomLayout(); - EnableTimer(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::SetZoomLevel()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiZoomIndicator::GetZoomLevel() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::GetZoomLevel()" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::GetZoomLevel()" ); - return iZoomLevel; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::SetZoomMin( TInt aZoomMin ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiZoomIndicator::SetZoomMin( %d ) ", aZoomMin ); - if( aZoomMin >= 0 && aZoomMin < iZoomMax ) - { - iZoomMin = aZoomMin; - } - DisableTimer(); - UpdateZoomLayout(); - EnableTimer(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::SetZoomMin()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::SetZoomMax( TInt aZoomMax ) - { - MUS_LOG1( "mus: [MUSUI ] -> CMusUiZoomIndicator::SetZoomMax( %d ) ", aZoomMax ); - if( aZoomMax >= iZoomMin ) - { - iZoomMax = aZoomMax; - } - DisableTimer(); - UpdateZoomLayout(); - EnableTimer(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::SetZoomMax()" ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::SetFullRect( const TRect aRect ) - { - iFullRect = aRect; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::SizeChanged() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::SizeChanged()" ); - UpdateZoomLayout(); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::SizeChanged()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::Draw( const TRect& aRect ) const - { - - CWindowGc& gc = SystemGc(); - - TRect rect( 0,0, iFullRect.Width(), iFullRect.Height() ); - //TRect rect( iFullRect.Width()-20, iFullRect.iTl.iY, iFullRect.iBr.iX, iFullRect.iBr.iY ); //TRect( 40,0,380,382 ) ); - -/* - AknsUtils::RegisterControlPosition( this, TPoint( iFullRect.Width()-20, iFullRect.iTl.iY ) ); - // gc.Clear( aRect ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - if(!AknsDrawUtils::Background( skin, cc,this,gc,rect,KAknsDrawParamDefault )) - { -*/ - MUS_LOG( "mus: [MUSUI ] Skin not valid or not found" ); - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); -// } - -} - - -// ----------------------------------------------------------------------------- -// Draw all icons and texts to given graphics context. -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::DrawIcons( const TRect& /*aRect*/ ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::DrawIcons()" ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::DrawIcons()" ); - } - - -// ----------------------------------------------------------------------------- -// Draw all icons and texts to given graphics context. -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::UpdateZoomLayout() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::UpdateZoomLayout()" ); - - TSize sz = iIconBg->MinimumSize(); - - TRect rect = Rect(); - - // TODO: Remove all magic constants! - AknLayoutUtils::LayoutImage(iIconMax, Rect(), 0, 0, 0, 0, 0, 20, 20 ); - AknLayoutUtils::LayoutImage(iIconMin, Rect(), 0, 0, 68, 0, 0, 20, 20 ); - AknLayoutUtils::LayoutImage(iIconBg, Rect(), 0, 0, 20, 0, 0, 20, 48 ); - - // 20 - 68 - iScaleStep = ( 48 << 8 ) / - ( ( iZoomMax - iZoomMin ) ); - iScaleY = ( 58 ) - - ( ( iScaleStep * iZoomLevel ) >> 8 ); - - - AknLayoutUtils::LayoutImage(iIconElevator, Rect(), 0, 0, iScaleY, 0, 0, 20, 20 ); - - DrawNow(); - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::UpdateZoomLayout()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TInt CMusUiZoomIndicator::CountComponentControls() const - { - return 4; //iIconElevator ? 1 : 0; // return nbr of controls inside this container - //return 0; // return nbr of controls inside this container - } - - -// -------------------------------------------------------------------------- -// Called by framework to retrieve the control specified by index. -// -------------------------------------------------------------------------- -// -CCoeControl* CMusUiZoomIndicator::ComponentControl( TInt aIndex ) const - { - switch ( aIndex ) - { - - case 0: - return iIconMin; - case 1: - return iIconMax; - case 2: - return iIconBg; - case 3: - return iIconElevator; - - default: - return NULL; - } - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::ConstructImageL( CEikImage* aImage, - MAknsSkinInstance* aSkin, - const TAknsItemID& aId, - TInt aBitmapId, - TInt aMaskId ) - - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::ConstructIconL()" ); - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - TParse parse; - parse.Set( KMyMbmFileName, &KDC_APP_RESOURCE_DIR, NULL ); - - AknsUtils::CreateIconL(aSkin, - aId, - bitmap, - mask, - parse.FullName(), - aBitmapId, - aMaskId); - - aImage->SetPicture(bitmap, mask); // Owership transferred to CEikImage - - - - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::ConstructIconL()" ); - - } - - - -// ----------------------------------------------------------------------------- -// Callback for disable zoom indicator. -// ----------------------------------------------------------------------------- -// -TInt CMusUiZoomIndicator::DisableZoomIndicator( TAny* aThis ) - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::DisableZoomIndicator()" ); - CMusUiZoomIndicator* indicator = - static_cast< CMusUiZoomIndicator* > ( aThis ); - indicator->DisableTimer(); - if( indicator->iObserver ) - { - indicator->iObserver->DisableZoomIndicator(); - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::DisableZoomIndicator()" ); - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::DisableTimer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::DisableTimer()" ); - if ( iDisableZoomTimer ) - { - if ( iDisableZoomTimer->IsActive() ) - { - iDisableZoomTimer->Cancel(); - } - } - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::DisableTimer()" ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusUiZoomIndicator::EnableTimer() - { - MUS_LOG( "mus: [MUSUI ] -> CMusUiZoomIndicator::EnableTimer()" ); - - if ( !iDisableZoomTimer ) - { - TRAP_IGNORE( iDisableZoomTimer = CPeriodic::NewL( CActive::EPriorityStandard ) ); - } - else - { - DisableTimer(); - } - - // Start disable timer; callback triggers exit. - iDisableZoomTimer->Start( KMusUiZoomDisableTime, - KMusUiZoomDisableTime, - TCallBack( DisableZoomIndicator, this ) ); - MUS_LOG( "mus: [MUSUI ] <- CMusUiZoomIndicator::EnableTimer()" ); - } - - -// End of File - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/BWINS/ut_uiU.DEF --- a/mmsharing/mmshui/tsrc/ut_ui/BWINS/ut_uiU.DEF Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/group/bld.inf --- a/mmsharing/mmshui/tsrc/ut_ui/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -PRJ_TESTMMPFILES - -//../../../../internal/stubs/mceclientstub/group/mceclientstub.mmp -ut_ui.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/group/ut_ui.mmp --- a/mmsharing/mmshui/tsrc/ut_ui/group/ut_ui.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// To get the APP_LAYER_SYSTEMINCLUDE-definition -#include -#include - -TARGET ut_ui.dll -TARGETTYPE dll -TARGETPATH /DigiaEUnit/Tests -UID 0x1000af5a 0x01700000 - -CAPABILITY EUNIT_CAPS -VENDORID VID_DEFAULT - -MACRO UNIT_TESTING - - -SOURCEPATH ../../../../../tsrc/multimediasharingsettingsstub/src -SOURCE mussettings.cpp - - -// Test suite classes -SOURCEPATH ../src -SOURCE ut_musuidllmain.cpp - -// Defines, stubs and other test helpers -SOURCEPATH ../src -//SOURCE musengstubs.cpp - -SOURCEPATH ../../../../../tsrc/musenginestub/src -SOURCE musengsession.cpp -SOURCE musengmcesession.cpp -SOURCE musengmceoutsession.cpp -SOURCE musenglivesession.cpp -SOURCE musengreceivesession.cpp -SOURCE musengsessiondurationtimer.cpp -SOURCE musengclipsession.cpp - -//SOURCE musengmceutils.cpp - -//SOURCEPATH ../../../../../tsrc/rfsstub/src -//SOURCE f32file.cpp - -SOURCEPATH ../../../../../tsrc/fbsbitmapstub/src -SOURCE fbs.cpp - -SOURCEPATH ../../../../../tsrc/imagedecoderstub/src -SOURCE imageconversion.cpp - -//SOURCEPATH ../../../../../tsrc/centralrepositorystub/src -//SOURCE centralrepositorystub.cpp - -SOURCEPATH ../../../../../tsrc/stringloaderstub/src -SOURCE stringloader.cpp - -SOURCEPATH ../../../../../tsrc/propertystub/src -SOURCE e32property.cpp - -SOURCEPATH ../../../../../tsrc/aknstub/src -SOURCE aknappui.cpp - - -//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 - -// Test classes -SOURCEPATH ../src -SOURCE ut_musuiclipsharingcontroller.cpp -SOURCE ut_musuieventcontroller.cpp -SOURCE ut_musuilivesharingcontroller.cpp -SOURCE ut_musuipropertywatch.cpp -SOURCE ut_musuireceivecontroller.cpp -SOURCE ut_musuistartcontroller.cpp -SOURCE musuipropertyobserveradapter.cpp -SOURCE musuicallbackobserveradapter.cpp -SOURCE musuilivesharingobserveradapter.cpp -SOURCE musuieventobserveradapter.cpp -SOURCE musuiclipsharingobserveradapter.cpp -SOURCE musuireceiveobserveradapter.cpp - -// Tested classes -SOURCEPATH ../../../src -//SOURCE musuiapp.cpp -//SOURCE musuidocument.cpp -//SOURCE musuiappui.cpp -//SOURCE musuigeneralview.cpp -//SOURCE musuisendview.cpp -//SOURCE musuinullview.cpp -//SOURCE musuilivesharingview.cpp -//SOURCE musuilivesharingviewcontainer.cpp -//SOURCE musuireceiveview.cpp -//SOURCE musuiclipsharingview.cpp -//SOURCE musuireceivecontainer.cpp -//SOURCE musuiclipsharingviewcontainer.cpp - -//SOURCE musuistatuspanehandler.cpp -//SOURCE musuinavimediadecorator.cpp -//SOURCE musuiinvitationquery.cpp -//SOURCE musuizoomindicator.cpp - -SOURCE musuistartcontroller.cpp -SOURCE musuipropertywatch.cpp - -SOURCE musuieventcontroller.cpp -SOURCE musuilivesharingcontroller.cpp -SOURCE musuireceivecontroller.cpp -SOURCE musuiclipsharingcontroller.cpp -SOURCE musuibitmapdecoder.cpp -//SOURCE musuiactivitymanger.cpp - -SOURCE musuicallbackservice.cpp - -// Includes - - -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -// Must be before common -USERINCLUDE ../../../../../tsrc/multimediasharingsettingsstub/inc - -USERINCLUDE ../../../../mmshshared/inc - -// to replace musengine with a stub -USERINCLUDE ../../../../../tsrc/musenginestub/inc //TODO: added 4.11. -USERINCLUDE ../../../../mmshengine/inc //TODO: commented 4.11. -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../../inc - -// to replace musengine with a stub -SYSTEMINCLUDE ../../../../../tsrc/musenginestub/inc -//SYSTEMINCLUDE ../../../../../tsrc/rfsstub/inc -SYSTEMINCLUDE ../../../../../tsrc/fbsbitmapstub/inc -SYSTEMINCLUDE ../../../../../tsrc/imagedecoderstub/inc -//SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc -SYSTEMINCLUDE ../../../../../tsrc/stringloaderstub/inc - -//SYSTEMINCLUDE ../../../../../tsrc/contactdatabasestub/inc -SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc - -SYSTEMINCLUDE ../../../../../tsrc/aknstub/inc - - - - - -// ui internal stub - - -// to replace MCE API with a stub: -//SYSTEMINCLUDE ../../../../../tsrc/mceclientstub/inc -// to replace telephony audio routing with a stub: -//SYSTEMINCLUDE ../../../../../tsrc/telephonyaudioroutingstub/src -// to replace DRMCommon with a tub -//SYSTEMINCLUDE ../../../../../tsrc/drmstub/inc - -APP_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib -LIBRARY eunit.lib - -LIBRARY musenginestub.lib -LIBRARY pbkeng.lib // PhoneBook Engine API -LIBRARY phoneclient.lib // Phone client -LIBRARY fbscli.lib // CFbsBitmap -LIBRARY centralrepository.lib // Central repository -LIBRARY cntmodel.lib // Contact Model - - -LIBRARY apgrfx.lib // AppArc server client APIs -LIBRARY apparc.lib // Application framework API -LIBRARY bafl.lib // Resource readers -LIBRARY cone.lib // Cone framework API -LIBRARY efsrv.lib // File Server API -LIBRARY eikcoctl.lib // Control framework API -LIBRARY eikcore.lib // Eikon core controls API -LIBRARY eikctl.lib // Eikon controls -LIBRARY eikdlg.lib // Eikon Dialog API -LIBRARY ws32.lib // Window server client API - -// S60 libraries: -LIBRARY aknnotify.lib // CAknGlobalNote -LIBRARY aknskins.lib // Avkon Skins Utils -LIBRARY avkon.lib // Avkon Utils -LIBRARY commonengine.lib // StringLoader -LIBRARY featmgr.lib // S60 Feature manager API -LIBRARY mgfetch.lib // Media Gallery Fetch Dialog -LIBRARY MGXMediaFileApi.lib // Media Gallery File manager, for updating -LIBRARY pbkview.lib // PhoneBook view API -LIBRARY platformenv.lib // PathInfo -LIBRARY aknicon.lib // AknIconUtils -LIBRARY aknlayout.lib // CdlEngine -LIBRARY gdi.lib // CFont -LIBRARY imageconversion.lib // CIImageDecoder -LIBRARY egul.lib // CGulIcon - - -DEBUGLIBRARY flogger.lib - -//EXPORTUNFROZEN - - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musengtestdefs.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musengtestdefs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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 - -// 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( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); -_LIT( KTestRecipientTelUri, "tel:+3581111111"); -_LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); - -_LIT( KTestRecipientRandomText, "sfjsfjklsjdkfsj" ); -_LIT( KTestRecipientSipUriWithSpace, "s:re cipi ent@" ); -_LIT( KTestRecipientTelUriWithAtSign, "tel:+3581111111@host.domain" ); //invalid - -_LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" ); -_LIT8( KTestRecipientTelUri8, "tel:+3581111111"); -_LIT8( KTestRecipientRandomText8, "sfjsfjklsjdkfsj" ); - -_LIT8( KTestOriginator, "Frank Swis" ); - -_LIT( KTestAudioFileName, "audiofile" ); -_LIT( KTestVideoFileName, "videofile" ); -_LIT( KTestAnotherVideoFileName, "another" ); - -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 KSipStatusCode487RequestCancelled = 487; -const TInt KSipStatusCodeUnknown = 10000; -const TInt KTelephonyVolumeMinValue = 1; -const TInt KTelephonyVolumeDefaultValue = 4; -const TInt KTelephonyVolumeMaxValue = 1; - -// Values originally introduced in telephonyinternalcrkeys.h - -const TUid KCRUidCallHandling = {0x101F8784}; -const TUint32 KTelephonyIncallEarVolume = 0x00000001; -const TUint32 KTelephonyIncallLoudspeakerVolume = 0x00000002; - - -// Helper macros - -#define MUS_TEST_FORWARD_ALLOC_FAILURE( error )\ - if ( error == KErrNoMemory )\ - {\ - User::Leave( error );\ - } - -#define ESTABLISH_OUT_SESSION( outSession )\ - outSession->InviteL( KTestRecipientSipUri );\ - outSession->iSession->iState = CMceSession::EEstablished;\ - if ( outSession->iSession->iManager &&\ - outSession->iSession->iManager->iSessionObserver )\ - {\ - outSession->iSession->iManager->iSessionObserver->SessionStateChanged(\ - *(outSession->iSession),\ - outSession->iSession->iManager->iContainer );\ - } - - -#endif // MUSENGTESTDEFS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuicallbackobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuicallbackobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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_MUSUIOBSERVERSSTUB_H -#define UT_MUSUIOBSERVERSSTUB_H - - -#include "musuiclipsharingobserver.h" -#include "musuipropertyobserver.h" -#include "musuicallbackobserver.h" - - -#include -#include - - -/** -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusUiCallbackObserverAdapter : public CBase, - public MMusUiCallbackObserver - { - - - - public: - - CMusUiCallbackObserverAdapter(); - - ~CMusUiCallbackObserverAdapter(); - - - - - //virtual void HandleError( const TInt aReason ) = 0; - - public: // MMusUiCallbackObserver - - void HandleAsyncEventL( TMusUiAsyncEvent aEventId ); - - - public: // data - - enum TMusUiCallbackObserverFunction - { - ENone, // default value - EHandleAsyncEventL - }; - - - - TMusUiCallbackObserverFunction iCalledObserver; - TInt iErrorCode; - - TMusUiAsyncEvent iHandleAsyncEventId; - - }; - - - - -#endif // UT_MUSSTUBS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuiclipsharingobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuiclipsharingobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __MUSUICLIPSHARINGOBSERVER_H__ -#define __MUSUICLIPSHARINGOBSERVER_H__ - -#include "musuiclipsharingobserver.h" - -#include - - - -class CMusUiClipSharingObserverAdapter : public CBase, - public MMusUiClipSharingObserver - { - - - - public: - - CMusUiClipSharingObserverAdapter(); - - ~CMusUiClipSharingObserverAdapter(); - - - public: - - // MMusUiClipSharingObserver - void RunFetchDialogL(); - - TBool SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ); - - void ManualAddressEntryL( const TDesC& aAddress ); - - void ShowWaitDialogL( const TDesC& aPrompt ); - - void DismissWaitDialogL( ); - - void DismissWaitDialogL( const TDesC& aReason ); - - void ShowErrorDialogL( const TDesC& aMessage ); - - void ShowInformationDialogL( TInt aResourceId ); - - void ShowClipSharingPanesL(); - - void ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ); - - void ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon, - TBool aVisible ); - - void UpdateSessionTime( const TDesC& aSessionTime ); - - void SetVolume( TBool aUp ); - - void HandleError( TInt aError ); - - void HandleExitL(); - - void EndOfClip(); - - - enum TMusUiClipSharingObserverFunction - { - ENone, // default value - ERunFetchDialogL, - ESelectAddressDialogL, - EManualAddressEntryL, - EShowWaitDialogL, - EDismissWaitDialogL, - EDismissWaitDialogL2, - EShowErrorDialogL, - EShowInformationDialogL, - EShowClipSharingPanesL, - EChangeOrientationL, - EShowNaviPaneIconL, - EUpdateSessionTime, - ESetVolume, - EHandleError, - EHandleExitL, - EEndOfClip - - }; - - - TMusUiClipSharingObserverFunction iCalledObserver; - TInt iErrorCode; - TInt iError; - TInt iShowErrorDialogErrorCode ; - - HBufC* iAddress; - - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuieventobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuieventobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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_MUSUIOBSERVERSSTUB_H -#define UT_MUSUIOBSERVERSSTUB_H - - -#include "musuieventobserver.h" - - -#include -#include - -/** -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusUiEventObserverAdapter : public CBase, - public MMusUiEventObserver - { - - - - public: - - CMusUiEventObserverAdapter(); - - ~CMusUiEventObserverAdapter(); - - - public: // MMusUiEventObserver - - void ActivateLocalMusViewL( TUid aViewId ); - void ActivateLocalMusViewL( TUid aViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - TBool ShowConfirmationQueryDialogL( const TDesC& aPrompt ); - void ShowInformationDialogL( const TDesC& aPrompt ); - void ActivateContactViewL( TContactItemId aId ); - void HandleError( const TInt aReason ); // All ready defined - void HandleExitL(); - - - 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 - - enum TMusUiEventObserverFunction - { - ENone, // default value - - // MMusUiEventObserver - EActivateLocalMusViewL, - EActivateLocalMusViewL2, - EShowConfirmationQueryDialogL, - EShowInformationDialogL, - EActivateContactViewL, - EHandleError, - EHandleExitL, - - }; - - - TInt iHandleErrorReason; - TContactItemId iActivatedContactId; - - TMusUiEventObserverFunction iCalledObserver; - - TBool iBoolReturn; - TInt iErrorCode; - - TUid iViewId; - - HBufC* iPrompt; - - - }; - - - - -#endif // UT_MUSSTUBS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuilivesharingobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuilivesharingobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef MUSUILIVESHARINGOBSERVERADAPTER_H -#define MUSUILIVESHARINGOBSERVERADAPTER_H - -#include "musuidefinitions.h" -#include "musuilivesharingobserver.h" - -#include -#include -#include - -class CMusUiLiveSharingObserverAdapter : public MMusUiLiveSharingObserver - { - - public: - - CMusUiLiveSharingObserverAdapter(); - ~CMusUiLiveSharingObserverAdapter(); - - - TBool SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ); - void ManualAddressEntryL( const TDesC& aAddress ); - - void ShowWaitDialogL( const TDesC& aPrompt ); - - void DismissWaitDialogL( ); - - void ShowErrorDialogL( const TDesC& aMessage ); - - void ShowInformationDialogL( TInt aResourceId ); - - void ShowLiveSharingPanesL(); - - void ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ); - - void ShowNaviPaneIconL( - TMusUiNaviMediaDecorator aIcon, - TBool aVisible ); - - void UpdateSessionTime( const TDesC& aSessionTime ); - - void SetVolume( TBool aUp ); - - void SetZoom( TBool aIn ); - - void HandleError( TInt aError ); - - void HandleExitL(); - - void CancelInvitationTimer(); - - - enum TMusUiLiveSharingObserverFuncion - { - ENone, // default value - ESelectAddressDialogL, - EManualAddressEntryL, - EShowWaitDialogL, - EDismissWaitDialogL, - EShowErrorDialogL, - EShowInformationDialogL, - EShowLiveSharingPanesL, - EChangeOrientationL, - EShowNaviPaneIconL, - EUpdateSessionTime, - ESetVolume, - ESetZoom, - EHandleError, - EHandleExitL, - ECancelInvitationTimer - }; - - - - TMusUiLiveSharingObserverFuncion iCalledObserver; - - // Return values - TBool iBoolReturn; - - // Error code - TInt iErrorCode; - - TMusUiNaviMediaDecorator iIcon; - - CAknAppUiBase::TAppUiOrientation iOrientation; - - HBufC* iAddress; - - TInt iError; - TInt iShowErrorDialogErrorCode; - - - }; - -#endif - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuipropertyobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuipropertyobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __MUSUIPROPERTYOBSERVERADAPTER_H__ -#define __MUSUIPROPERTYOBSERVERADAPTER_H__ - -#include "musuipropertyobserver.h" - -class CMusUiPropertyObserverAdapter : public CBase, - public MMusUiPropertyObserver - - { - - public: // MMusUiPropertyObserver - - CMusUiPropertyObserverAdapter(); - ~CMusUiPropertyObserverAdapter(); - - void ResourcePropertyChanged( const TUint aKey, const TInt aValue ); - void SessionPropertyChanged( const TUint aKey, const TInt aValue ); - void HandleError( const TInt aReason ); - - - enum TMusUiPropertyObserverFunction - { - ENone, // default value - EResourcePropertyChanged, - ESessionPropertyChanged, - EHandleError - }; - - - TMusUiPropertyObserverFunction iCalledObserver; - TInt iErrorCode; - - - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuireceiveobserveradapter.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuireceiveobserveradapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 __MUSUIRECEIVEOBSERVERADAPTER_H__ -#define __MUSUIRECEIVEOBSERVERADAPTER_H__ - -#include "musuidefinitions.h" -#include "musuireceiveobserver.h" - -#include -#include -//#include - -class CMusUiReceiveObserverAdapter : public MMusUiReceiveObserver - { - - public: - - CMusUiReceiveObserverAdapter(); - ~CMusUiReceiveObserverAdapter(); - - void ShowErrorDialog( const TDesC& aPrompt ); - - void ShowErrorDialogL( const TDesC& aMessage ); - - void ShowInvitationQueryL( const TDesC& aQuery ); - - void DismissInvitationQuery( TBool aDelete ); - - void ShowWaitDialogL( const TDesC& aPrompt ); - - void DismissWaitDialogL( ); - - void ShowInformationDialogL( TInt aResourceId ); - - void ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon, - TBool aVisible ); - - void ShowStatusPaneL( TBool aVisible ); - - void ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ); - - void UpdateSessionTime( const TDesC& aSessionTime ); - - void SetVolume( TBool aUp ); - - void HandleError( TInt aError ); - - void HandleExitL(); - - - enum TMusUiReceiveObserverFuncion - { - ENone, // default value - EShowErrorDialog, - EShowErrorDialogL, - EShowInvitationQueryL, - EDismissInvitationQuery, - EShowWaitDialogL, - EDismissWaitDialogL, - EShowInformationDialogL, - EShowNaviPaneIconL, - EShowStatusPaneL, - EChangeOrientationL, - EUpdateSessionTime, - ESetVolume, - EHandleError, - EHandleExitL - }; - - - - TMusUiReceiveObserverFuncion iCalledObserver; - - // Return values - TBool iBoolReturn; - - // Error code - TInt iErrorCode; - - TMusUiNaviMediaDecorator iIcon; - - CAknAppUiBase::TAppUiOrientation iOrientation; - - HBufC* iAddress; - - TInt iError; - TInt iShowErrorDialogErrorCode; - TBool iVisible; - TInt iResourceId; - - }; - -#endif - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/musuitestdefines.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/musuitestdefines.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __MUSUITESTDEFINES_H__ -#define __MUSUITESTDEFINES_H__ - -#include - - -// MusUiPropertyWatch -const TInt KMusUiTestPropertyReadInteger = 0xCCCC; - -const TInt KMusUiTestKey = 1; - -_LIT(KMusUiTestPropertyReadDesc, "Test property value"); - - - - - - - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuiclipsharingcontroller.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuiclipsharingcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUICLIPSHARINGCONTROLLER_H__ -#define __UT_MUSUICLIPSHARINGCONTROLLER_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusUiClipSharingObserverAdapter; -class CMusUiClipSharingController; -class CMusUiEventObserverAdapter; -class CMusUiEventController; - -// 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_CMusUiClipSharingController ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiClipSharingController* NewL(); - static UT_CMusUiClipSharingController* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiClipSharingController(); - - private: // Constructors and destructors - - UT_CMusUiClipSharingController(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - - void UT_CMusUiClipSharingController_StartInvitationLL(); - void UT_CMusUiClipSharingController_AddressFoundLL(); - void UT_CMusUiClipSharingController_InviteLL(); - void UT_CMusUiClipSharingController_InviteL2L(); - void UT_CMusUiClipSharingController_SetRectL(); - void UT_CMusUiClipSharingController_CancelInvitationLL(); - void UT_CMusUiClipSharingController_HandleCommandLL(); - void UT_CMusUiClipSharingController_PlayingL(); - void UT_CMusUiClipSharingController_SetFileNameLL(); - void UT_CMusUiClipSharingController_ClipEndedL(); - void UT_CMusUiClipSharingController_ZoomInLL(); - void UT_CMusUiClipSharingController_ZoomOutLL(); - void UT_CMusUiClipSharingController_SplitLL(); - void UT_CMusUiClipSharingController_ShowErrorDialogL(); - void UT_CMusUiClipSharingController_DismissWaitDialogL(); - void UT_CMusUiClipSharingController_EndOfClipL(); - void UT_CMusUiClipSharingController_SessionRejectedL(); - void UT_CMusUiClipSharingController_SessionBadRequestL(); - void UT_CMusUiClipSharingController_SessionUnauthorizedL(); - void UT_CMusUiClipSharingController_SessionPaymentRequiredL(); - void UT_CMusUiClipSharingController_SessionRecipientNotFoundL(); - void UT_CMusUiClipSharingController_SessionProxyAuthenticationRequiredL(); - void UT_CMusUiClipSharingController_SessionRequestTimeOutL(); - void UT_CMusUiClipSharingController_SessionUnsupportedMediaTypeL(); - void UT_CMusUiClipSharingController_SessionRequestCancelledL(); - void UT_CMusUiClipSharingController_SessionEstablishedL(); - void UT_CMusUiClipSharingController_SessionTerminatedL(); - void UT_CMusUiClipSharingController_SessionConnectionLostL(); - void UT_CMusUiClipSharingController_SessionFailedL(); - void UT_CMusUiClipSharingController_StreamIdleL(); - void UT_CMusUiClipSharingController_StreamStreamingL(); - void UT_CMusUiClipSharingController_SessionTimeChangedL(); - void UT_CMusUiClipSharingController_InactivityTimeoutL(); - - - private: // Data - - CMusUiClipSharingObserverAdapter* iClipSharingObserverAdapter; - CMusUiEventObserverAdapter* iEventObserver; - - CMusUiClipSharingController* iClipSharingController; - CMusUiEventController* iEventController; - - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuieventcontroller.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuieventcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUIEVENTCONTROLLER_H__ -#define __UT_MUSUIEVENTCONTROLLER_H__ - - -// EXTERNAL INCLUDES -#include -#include - - -// FORWARD DECLARATIONS -//class CMusEngLiveSession; -//class CMusEngObserverStub; -class CMusUiEventController; -class CMusUiLiveSharingController; -class CMusUiEventObserverAdapter; -class CMusUiLiveSharingObserverAdapter; - -// 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_CMusUiEventController ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiEventController* NewL(); - static UT_CMusUiEventController* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiEventController(); - - private: // Constructors and destructors - - UT_CMusUiEventController(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - - public: // From MMusUiPropertyObserver - - void UT_CMusUiEventController_ResourcePropertyChangedL(); - - void UT_CMusUiEventController_SessionPropertyChangedL(); - - void UT_CMusUiEventController_SessionPropertyChanged2L(); - - void UT_CMusUiEventController_HandleErrorL(); - - - public: // From MMusUiBitmapDecoderObserver - - void UT_CMusUiEventController_UpdateBitmapL(); - - - public: // New functions - - void UT_CMusUiEventController_SetEventObserverL(); - - void UT_CMusUiEventController_HandleForegroundEventLL(); - - void UT_CMusUiEventController_SetCameraStatusL(); - - void UT_CMusUiEventController_SetKeypadStatusL(); - - void UT_CMusUiEventController_SetVideoPlayerStatusL(); - - void UT_CMusUiEventController_SetCameraAvailabilityInProgressL(); - - void UT_CMusUiEventController_CameraAvailableL(); - - void UT_CMusUiEventController_KeypadAvailableL(); - - void UT_CMusUiEventController_VideoPlayerAvailableL(); - - void UT_CMusUiEventController_CameraAvailibilityInProgressL(); - - void UT_CMusUiEventController_MusRemoteSipAddressValueL(); - - void UT_CMusUiEventController_MusProposalAddressValueL(); - - void UT_CMusUiEventController_MusContactNameL(); - - void UT_CMusUiEventController_MusContactBitmapL(); - - void UT_CMusUiEventController_MusVideoCodecValueL(); - - void UT_CMusUiEventController_MusTelNumberValueL(); - - void UT_CMusUiEventController_SipProfileIdL(); - - void UT_CMusUiEventController_SipRegistrationPendingL(); - - void UT_CMusUiEventController_SessionTimeFormattedL(); - - void UT_CMusUiEventController_SaveContactL(); - - void UT_CMusUiEventController_HandleExitLL(); - - void UT_CMusUiEventController_InspectKeypadLL(); - - void UT_CMusUiEventController_UpdateContactLL(); - - void UT_CMusUiEventController_UpdateContactNameL(); - - void UT_CMusUiEventController_UpdateContactPictureLL(); - - void UT_CMusUiEventController_HandleChangedStatusLL(); - - - private: // Data - - - CMusUiLiveSharingObserverAdapter* iLiveSharingObserverAdapter; - CMusUiEventObserverAdapter* iEventObserver; - - CMusUiLiveSharingController* iLiveSharingController; - CMusUiEventController* iEventController; - - - HBufC* _iReturnValue; - HBufC* iVideoFolder; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuilivesharingcontroller.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuilivesharingcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUILIVESHARINGCONTROLLER_H__ -#define __UT_MUSUILIVESHARINGCONTROLLER_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusUiLiveSharingObserverAdapter; -class CMusUiLiveSharingController; -class CMusUiEventObserverAdapter; -class CMusUiEventController; - - -// 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_CMusUiLiveSharingController ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiLiveSharingController* NewL(); - static UT_CMusUiLiveSharingController* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiLiveSharingController(); - - private: // Constructors and destructors - - UT_CMusUiLiveSharingController(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - //public: // new functions: - - void UT_CMusUiLiveSharingController_StartInvitationLL(); - void UT_CMusUiLiveSharingController_AddressFoundLL(); - void UT_CMusUiLiveSharingController_InviteLL(); - void UT_CMusUiLiveSharingController_InviteL2L(); - void UT_CMusUiLiveSharingController_SetRectL(); - void UT_CMusUiLiveSharingController_CancelInvitationLL(); - void UT_CMusUiLiveSharingController_HandleCommandLL(); - void UT_CMusUiLiveSharingController_PlayingL(); - void UT_CMusUiLiveSharingController_CurrentZoomLL(); - void UT_CMusUiLiveSharingController_MinZoomLL(); - void UT_CMusUiLiveSharingController_MaxZoomLL(); - - //private: // new functions: - - void UT_CMusUiLiveSharingController_CenteredRectL(); - void UT_CMusUiLiveSharingController_ZoomInLL(); - void UT_CMusUiLiveSharingController_ZoomOutLL(); - void UT_CMusUiLiveSharingController_SplitLL(); - void UT_CMusUiLiveSharingController_ShowErrorDialogL(); - void UT_CMusUiLiveSharingController_DismissWaitDialogL(); - - - //public: // From MMusEngLiveSessionObserver - - // Empty so far - - //public: // from MMusEngOutSessionObserver - - void UT_CMusUiLiveSharingController_SessionRejectedL(); // e.g. 603 DECLINE - void UT_CMusUiLiveSharingController_SessionBadRequestL(); // 400 - void UT_CMusUiLiveSharingController_SessionUnauthorizedL(); // 401 - void UT_CMusUiLiveSharingController_SessionPaymentRequiredL(); // 402 - void UT_CMusUiLiveSharingController_SessionRecipientNotFoundL(); // 404 - void UT_CMusUiLiveSharingController_SessionProxyAuthenticationRequiredL(); // 407 - void UT_CMusUiLiveSharingController_SessionRequestTimeOutL(); // 408 - void UT_CMusUiLiveSharingController_SessionUnsupportedMediaTypeL(); // 415 - void UT_CMusUiLiveSharingController_SessionRequestCancelledL(); // 487 - - //public: // from MMusEngSessionObserver - - void UT_CMusUiLiveSharingController_SessionEstablishedL(); - void UT_CMusUiLiveSharingController_SessionTerminatedL(); - void UT_CMusUiLiveSharingController_SessionConnectionLostL(); - void UT_CMusUiLiveSharingController_SessionFailedL(); - void UT_CMusUiLiveSharingController_StreamIdleL(); - void UT_CMusUiLiveSharingController_StreamStreamingL(); - void UT_CMusUiLiveSharingController_SessionTimeChangedL(); - void UT_CMusUiLiveSharingController_InactivityTimeoutL(); - - private: // Data - - CMusUiLiveSharingObserverAdapter* iLiveSharingObserverAdapter; - CMusUiEventObserverAdapter* iEventObserver; - - CMusUiLiveSharingController* iLiveSharingController; - CMusUiEventController* iEventController; - - - - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuipropertywatch.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuipropertywatch.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUIPROPERYWATCH_H__ -#define __UT_MUSUIPROPERYWATCH_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -//class CMusEngLiveSession; -//class CMusEngObserverStub; -class CMusUiPropertyWatch; -class CMusUiPropertyObserverAdapter; - -// 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_CMusUiPropertyWatch ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiPropertyWatch* NewL(); - static UT_CMusUiPropertyWatch* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiPropertyWatch(); - - private: // Constructors and destructors - - UT_CMusUiPropertyWatch(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - void UT_CMusUiPropertyWatch_ReadIntPropertyLL(); - void UT_CMusUiPropertyWatch_ReadDescPropertyLL(); - void UT_CMusUiPropertyWatch_DoCancelL(); - void UT_CMusUiPropertyWatch_RunLL(); - void UT_CMusUiPropertyWatch_RunErrorL(); - - - private: // Data - - /* - CMusEngLiveSession* iLiveSession; - CMusEngObserverStub* iObserver; - */ - CMusUiPropertyObserverAdapter* iPropertyObserver; - CMusUiPropertyWatch* iPropertyWatch; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuireceivecontroller.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuireceivecontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUIRECEIVECONTROLLER_H__ -#define __UT_MUSUIRECEIVECONTROLLER_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusUiReceiveObserverAdapter; -class CMusUiReceiveController; -class CMusUiEventObserverAdapter; -class CMusUiEventController; - - - -// 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_CMusUiReceiveController ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiReceiveController* NewL(); - static UT_CMusUiReceiveController* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiReceiveController(); - - private: // Constructors and destructors - - UT_CMusUiReceiveController(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - void UT_CMusUiReceiveController_HandleCommandLL(); - void UT_CMusUiReceiveController_SizeChangedL(); - void UT_CMusUiReceiveController_ShowErrorDialogLL(); - void UT_CMusUiReceiveController_HandleIncomingSessionLL(); - void UT_CMusUiReceiveController_CancelInvitationLL(); - - public: // from CMusUiEventController - - void UT_CMusUiReceiveController_ContinueInvitationLL(); - void UT_CMusUiReceiveController_HandleAsyncEventLL(); - void UT_CMusUiReceiveController_ConnectionEstablishedL(); - void UT_CMusUiReceiveController_PlayLL(); - void UT_CMusUiReceiveController_PauseLL(); - void UT_CMusUiReceiveController_EnableDisplayLL(); - void UT_CMusUiReceiveController_ShowNaviPaneIconLL(); - void UT_CMusUiReceiveController_ChangeOrientationLL(); - void UT_CMusUiReceiveController_CenteredRectL(); - void UT_CMusUiReceiveController_ManualAddressTypedL(); - void UT_CMusUiReceiveController_ShowInformationDialogLL(); - void UT_CMusUiReceiveController_ShutdownLL(); - - public: // from MMusEngReceiveSessionObserver - - void UT_CMusUiReceiveController_IncomingSessionL(); - void UT_CMusUiReceiveController_StreamBufferingL(); - - public: // from MMusEngSessionObserver - - void UT_CMusUiReceiveController_SessionEstablishedL(); - void UT_CMusUiReceiveController_SessionTerminatedL(); - void UT_CMusUiReceiveController_SessionConnectionLostL(); - void UT_CMusUiReceiveController_SessionFailedL(); - void UT_CMusUiReceiveController_StreamIdleL(); - void UT_CMusUiReceiveController_StreamStreamingL(); - void UT_CMusUiReceiveController_SessionTimeChangedL(); - void UT_CMusUiReceiveController_InactivityTimeoutL(); - - public: // from MMusUiInvitationQueryObserver - - void UT_CMusUiReceiveController_InvitationAcceptedLL(); - void UT_CMusUiReceiveController_InvitationRejectedLL(); - - private: // new functions: - - void UT_CMusUiReceiveController_UpdateStatusPaneLL(); - void UT_CMusUiReceiveController_InspectVideoPlayerLL(); - void UT_CMusUiReceiveController_ShowWaitDialogLL(); - - - - - - private: // Data - - CMusUiReceiveObserverAdapter* iReceiveObserverAdapter; - CMusUiEventObserverAdapter* iEventObserver; - - CMusUiReceiveController* iReceiveController; - CMusUiEventController* iEventController; - - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuistartcontroller.h --- a/mmsharing/mmshui/tsrc/ut_ui/inc/ut_musuistartcontroller.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_MUSUISTARTCONTROLLER_H__ -#define __UT_MUSUISTARTCONTROLLER_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -//class CMusEngLiveSession; -//class CMusEngObserverStub; -class CMusUiEventObserverAdapter; - -// 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_CMusUiStartController ): public CEUnitTestSuiteClass - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusUiStartController* NewL(); - static UT_CMusUiStartController* NewLC(); - - /** - * Destructor - */ - ~UT_CMusUiStartController(); - - private: // Constructors and destructors - - UT_CMusUiStartController(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - - void Teardown(); - - private: // Test methods - - void UT_CMusUiStartController_UseCasePropertyLL(); - void UT_CMusUiStartController_SetStartViewLL(); - - - - private: // Data - - - CMusUiEventObserverAdapter* iEventObserver; - - /* - CMusEngLiveSession* iLiveSession; - CMusEngObserverStub* iEventObserver; - */ - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_MUSENGSESSION_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuicallbackobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuicallbackobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuicallbackobserveradapter.h" - - -CMusUiCallbackObserverAdapter::CMusUiCallbackObserverAdapter() - { - iCalledObserver = ENone; - } - - -CMusUiCallbackObserverAdapter::~CMusUiCallbackObserverAdapter() - { - } - - -void CMusUiCallbackObserverAdapter::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) - { - iHandleAsyncEventId = aEventId; - iCalledObserver = EHandleAsyncEventL; - User::LeaveIfError( iErrorCode ); - } \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuiclipsharingobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuiclipsharingobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuiclipsharingobserveradapter.h" - - -CMusUiClipSharingObserverAdapter::CMusUiClipSharingObserverAdapter() - { - iAddress = NULL; - iCalledObserver = ENone; - iErrorCode = KErrNone; - iShowErrorDialogErrorCode = KErrNone; - } - - -CMusUiClipSharingObserverAdapter::~CMusUiClipSharingObserverAdapter() - { - delete iAddress; - } - - -void CMusUiClipSharingObserverAdapter::RunFetchDialogL() - { - iCalledObserver = ERunFetchDialogL; - User::LeaveIfError( iErrorCode ); - } - -TBool CMusUiClipSharingObserverAdapter::SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ) - { - - TInt selectedIndex( 0 ); - aSelectedAddress = (*aAddressArray)[ selectedIndex ]; - delete aAddressArray; - aAddressArray = NULL; - - iCalledObserver = ESelectAddressDialogL; - User::LeaveIfError( iErrorCode ); - return ETrue; - } - - -void CMusUiClipSharingObserverAdapter::ManualAddressEntryL( const TDesC& aAddress ) - { - delete iAddress; - iAddress = aAddress.AllocL(); - iCalledObserver = EManualAddressEntryL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ShowWaitDialogL( const TDesC& aPrompt ) - { - iCalledObserver = EShowWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::DismissWaitDialogL( ) - { - iCalledObserver = EDismissWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::DismissWaitDialogL( const TDesC& aReason ) - { - iCalledObserver = EDismissWaitDialogL2; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ShowErrorDialogL( const TDesC& aMessage ) - { - - iCalledObserver = EShowErrorDialogL; - User::LeaveIfError( iShowErrorDialogErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ShowInformationDialogL( TInt aResourceId ) - { - iCalledObserver = EShowInformationDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ShowClipSharingPanesL() - { - iCalledObserver = EShowClipSharingPanesL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ) - { - iCalledObserver = EChangeOrientationL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::ShowNaviPaneIconL( TMusUiNaviMediaDecorator aIcon, - TBool aVisible ) - { - iCalledObserver = EShowNaviPaneIconL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::UpdateSessionTime( const TDesC& aSessionTime ) - { - iCalledObserver = EUpdateSessionTime; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::SetVolume( TBool aUp ) - { - iCalledObserver = ESetVolume; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::HandleError( TInt aError ) - { - iError = aError; - iCalledObserver = EHandleError; - //User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::HandleExitL() - { - iCalledObserver = EHandleExitL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiClipSharingObserverAdapter::EndOfClip() - { - iCalledObserver = EEndOfClip; - User::LeaveIfError( iErrorCode ); - } - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuieventobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuieventobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuieventobserveradapter.h" - - -// ---- MEMBER FUNCTIONS OF CMusUiObserversStub -------------------------------- - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventObserverAdapter::CMusUiEventObserverAdapter() - { - // NOP - // Initialize... - iCalledObserver = ENone; - iBoolReturn = EFalse; - iErrorCode = KErrUnknown; - iPrompt = NULL; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusUiEventObserverAdapter::~CMusUiEventObserverAdapter() - { - delete iPrompt; - } - - -// -------- Functions from MMusUiEventObserver ----------------- - -void CMusUiEventObserverAdapter::ActivateLocalMusViewL( TUid aViewId ) - { - iCalledObserver = EActivateLocalMusViewL; - iViewId = aViewId; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiEventObserverAdapter::ActivateLocalMusViewL( TUid aViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - iCalledObserver = EActivateLocalMusViewL2; - iViewId = aViewId; - User::LeaveIfError( iErrorCode ); - } - - -TBool CMusUiEventObserverAdapter::ShowConfirmationQueryDialogL( const TDesC& aPrompt ) - { - iPrompt = aPrompt.AllocL(); - iCalledObserver = EShowConfirmationQueryDialogL; - User::LeaveIfError( iErrorCode ); - } - -void CMusUiEventObserverAdapter::ShowInformationDialogL( const TDesC& aPrompt ) - { - iCalledObserver = EShowInformationDialogL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiEventObserverAdapter::ActivateContactViewL( TContactItemId aId ) - { - iCalledObserver = EActivateContactViewL; - iActivatedContactId = aId; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiEventObserverAdapter::HandleError( const TInt aReason ) - { - iHandleErrorReason = aReason; - iCalledObserver = EHandleError; - } - - -void CMusUiEventObserverAdapter::HandleExitL() - { - iCalledObserver = EHandleExitL; - User::LeaveIfError( iErrorCode ); - } - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuilivesharingobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuilivesharingobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuilivesharingobserveradapter.h" - - -CMusUiLiveSharingObserverAdapter::CMusUiLiveSharingObserverAdapter() - { - iAddress = NULL; - iErrorCode = KErrNone; - iShowErrorDialogErrorCode = KErrNone; - } - -CMusUiLiveSharingObserverAdapter::~CMusUiLiveSharingObserverAdapter() - { - delete iAddress; - } - - -TBool CMusUiLiveSharingObserverAdapter::SelectAddressDialogL( CDesCArray* aAddressArray, - TDes& aSelectedAddress ) - { - - - TInt selectedIndex( 0 ); - aSelectedAddress = (*aAddressArray)[ selectedIndex ]; - delete aAddressArray; - aAddressArray = NULL; - - iCalledObserver = ESelectAddressDialogL; - User::LeaveIfError( iErrorCode ); - return ETrue; - } - - -void CMusUiLiveSharingObserverAdapter::ManualAddressEntryL( const TDesC& aAddress ) - { - delete iAddress; - iAddress = aAddress.AllocL(); - iCalledObserver = EManualAddressEntryL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ShowWaitDialogL( const TDesC& aPrompt ) - { - iCalledObserver = EShowWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::DismissWaitDialogL( ) - { - iCalledObserver = EDismissWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ShowErrorDialogL( const TDesC& aMessage ) - { - iCalledObserver = EShowErrorDialogL; - User::LeaveIfError( iShowErrorDialogErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ShowInformationDialogL( TInt aResourceId ) - { - iCalledObserver = EShowInformationDialogL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ShowLiveSharingPanesL() - { - iCalledObserver = EShowLiveSharingPanesL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ) - { - iOrientation = aOrientation; - iCalledObserver = EChangeOrientationL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::ShowNaviPaneIconL( - TMusUiNaviMediaDecorator aIcon, - TBool aVisible ) - { - iIcon = aIcon; - iCalledObserver = EShowNaviPaneIconL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::UpdateSessionTime( const TDesC& aSessionTime ) - { - iCalledObserver = EUpdateSessionTime; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::SetVolume( TBool aUp ) - { - iCalledObserver = ESetVolume; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::SetZoom( TBool aIn ) - { - iCalledObserver = ESetZoom; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::HandleError( TInt aError ) - { - iError = aError; - iCalledObserver = EHandleError; - //User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::HandleExitL() - { - iCalledObserver = EHandleExitL; - User::LeaveIfError( iErrorCode ); - } - - - -void CMusUiLiveSharingObserverAdapter::CancelInvitationTimer() - { - iCalledObserver = ECancelInvitationTimer; - User::LeaveIfError( iErrorCode ); - } - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuipropertyobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuipropertyobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuipropertyobserveradapter.h" - - - -CMusUiPropertyObserverAdapter::CMusUiPropertyObserverAdapter() - { - //iCalledObserver = ENone; - } - - -CMusUiPropertyObserverAdapter::~CMusUiPropertyObserverAdapter() - { - } - - -void CMusUiPropertyObserverAdapter::ResourcePropertyChanged( const TUint aKey, const TInt aValue ) - { - iCalledObserver = EResourcePropertyChanged; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiPropertyObserverAdapter::SessionPropertyChanged( const TUint aKey, const TInt aValue ) - { - iCalledObserver = ESessionPropertyChanged; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiPropertyObserverAdapter::HandleError( const TInt aReason ) - { - iCalledObserver = EHandleError; - User::LeaveIfError( iErrorCode ); - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/musuireceiveobserveradapter.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/musuireceiveobserveradapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "musuireceiveobserveradapter.h" - - -CMusUiReceiveObserverAdapter::CMusUiReceiveObserverAdapter() - { - iAddress = NULL; - iErrorCode = KErrNone; - iShowErrorDialogErrorCode = KErrNone; - } - -CMusUiReceiveObserverAdapter::~CMusUiReceiveObserverAdapter() - { - delete iAddress; - } - - - -void CMusUiReceiveObserverAdapter::ShowErrorDialog( const TDesC& aPrompt ) - { - iCalledObserver = EShowErrorDialog; - } - - - -void CMusUiReceiveObserverAdapter::ShowErrorDialogL( const TDesC& aMessage ) - { - iCalledObserver = EShowErrorDialogL; - User::LeaveIfError( iShowErrorDialogErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::ShowInvitationQueryL( const TDesC& aQuery ) - { - iCalledObserver = EShowInvitationQueryL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::DismissInvitationQuery( TBool aDelete ) - { - iCalledObserver = EDismissInvitationQuery; - } - - - -void CMusUiReceiveObserverAdapter::ShowWaitDialogL( const TDesC& aPrompt ) - { - iCalledObserver = EShowWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::DismissWaitDialogL( ) - { - iCalledObserver = EDismissWaitDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::ShowInformationDialogL( TInt aResourceId ) - { - iResourceId = aResourceId; - iCalledObserver = EShowInformationDialogL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::ShowNaviPaneIconL( - TMusUiNaviMediaDecorator aIcon, - TBool aVisible ) - { - iIcon = aIcon; - iVisible = aVisible; - iCalledObserver = EShowNaviPaneIconL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::ShowStatusPaneL( TBool aVisible ) - { - iCalledObserver = EShowStatusPaneL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::ChangeOrientationL( - CAknAppUiBase::TAppUiOrientation aOrientation ) - { - iOrientation = aOrientation; - iCalledObserver = EChangeOrientationL; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::UpdateSessionTime( const TDesC& aSessionTime ) - { - iCalledObserver = EUpdateSessionTime; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::SetVolume( TBool aUp ) - { - iCalledObserver = ESetVolume; - User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::HandleError( TInt aError ) - { - iError = aError; - iCalledObserver = EHandleError; - //User::LeaveIfError( iErrorCode ); - } - - -void CMusUiReceiveObserverAdapter::HandleExitL() - { - iCalledObserver = EHandleExitL; - User::LeaveIfError( iErrorCode ); - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuiclipsharingcontroller.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuiclipsharingcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,730 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuiclipsharingcontroller.h" -#include "musuiclipsharingcontroller.h" -#include "musuiclipsharingobserveradapter.h" -#include "musuieventobserveradapter.h" -#include "musuidefinitions.h" -#include "musengclipsession.h" -#include -//#include "musestubs.h" -//#include "musengtestdefs.h" - -// SYSTEM INCLUDES -#include -//#include -//#include - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiClipSharingController* UT_CMusUiClipSharingController::NewL() - { - UT_CMusUiClipSharingController* self = UT_CMusUiClipSharingController::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiClipSharingController* UT_CMusUiClipSharingController::NewLC() - { - UT_CMusUiClipSharingController* self = new( ELeave ) UT_CMusUiClipSharingController(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiClipSharingController::~UT_CMusUiClipSharingController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiClipSharingController::UT_CMusUiClipSharingController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiClipSharingController::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiClipSharingController::SetupL() - { - iEventObserver = new (ELeave) CMusUiEventObserverAdapter(); - EUNIT_ASSERT( iEventObserver ); - - iClipSharingObserverAdapter = new (ELeave) CMusUiClipSharingObserverAdapter(); - EUNIT_ASSERT( iClipSharingObserverAdapter ); - - - RProperty::iIntProperty = 0; - RProperty::iErrorCode = KErrNone; - - - iClipSharingController = CMusUiClipSharingController::NewL( iClipSharingObserverAdapter, TRect( 0,0,100,100)); - iEventController = static_cast - ( iClipSharingController ); - - EUNIT_ASSERT( iEventController ); - iEventController->SetEventObserver( iEventObserver ); - EUNIT_ASSERT( iEventController->iObserver == iEventObserver ); - - // Need fake active object event... - _LIT( KFileName , "clip.3gp" ); - iClipSharingController->iFileName = KFileName().AllocL(); - iClipSharingController->HandleAsyncEventL( EMusUiAsyncStartMediaGallery ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiClipSharingController::Teardown() - { - delete iClipSharingController; - iEventController = NULL; - delete iEventObserver; - delete iClipSharingObserverAdapter; - } - - - -// TEST CASES - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_StartInvitationLL() - { - // TODO: - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_AddressFoundLL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_InviteLL() - { - // Precondititions - iClipSharingObserverAdapter->iErrorCode = KErrNone; - iEventController->iCameraAvailable = EAvailable; - iEventController->iSipRegistrationPending = EFalse; - - // sip address length > 0 and no separator - _LIT( KRes, "address" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes().AllocL(); - iClipSharingController->InviteL(); - - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowWaitDialogL ); - - - // sip address length > 0 and separator - _LIT( KRes2, "Address1, Address2, Address3" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes2().AllocL(); - iClipSharingController->iSession->iInvited = EFalse; - iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::ENone; - - iClipSharingController->InviteL(); - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowWaitDialogL ); - - - // sip addres length = 0 - _LIT( KRes3, "" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes3().AllocL(); - iClipSharingController->iSession->iInvited = EFalse; - iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::ENone; - - iClipSharingController->InviteL(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EManualAddressEntryL ); - - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_InviteL2L() - { - // Precondititions - iClipSharingObserverAdapter->iErrorCode = KErrNone; - - // registration not pending and triedinvitations > 1 - iEventController->iSipRegistrationPending = EFalse; - iClipSharingController->iSession->iInvited = EFalse; - iClipSharingController->iManualAddressTyped = EFalse; - iClipSharingController->iTriedInvitations = 2; - - _LIT( KRes, "address" ); - iClipSharingController->InviteL( KRes ); - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowWaitDialogL ); - - - // registration not pending and triedinvitations > 1 - iClipSharingController->iSession->iErrorCode = KErrArgument; - - iEventController->iSipRegistrationPending = EFalse; - iClipSharingController->iSession->iInvited = EFalse; - iClipSharingController->iManualAddressTyped = EFalse; - iClipSharingController->iTriedInvitations = 2; - - iClipSharingController->InviteL( KRes ); - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - - - // registration not pending and triedinvitations = 0 - iClipSharingController->iSession->iErrorCode = KErrArgument; - - iEventController->iSipRegistrationPending = EFalse; - iClipSharingController->iSession->iInvited = EFalse; - iClipSharingController->iManualAddressTyped = EFalse; - iClipSharingController->iTriedInvitations = 0; - - _LIT( KProposal, "proposal_address" ); - delete iEventController->iRemoteSipAddressProposal; - iEventController->iRemoteSipAddressProposal = KProposal().AllocL(); - - // Manual address entry - iClipSharingController->InviteL( KRes ); - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowWaitDialogL ); - EUNIT_ASSERT( iClipSharingController->iTriedInvitations == 1 ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iAddress->Des().Compare( KProposal ) == 0 ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SetRectL() - { - TRect rect = TRect( 0,0, 100,100 ); - - iClipSharingController->iSession->iErrorCode = KErrArgument; - iClipSharingController->SetRect( rect ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleError ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iError == KErrArgument ); - - iClipSharingController->iSession->iErrorCode = KErrNone; - iClipSharingController->SetRect( rect ); - EUNIT_ASSERT( iClipSharingController->iSession->iRect == rect ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_CancelInvitationLL() - { - // Connection established cancel - iClipSharingController->iSession->iInvited = ETrue; - iClipSharingController->iConnectionEstablished = ETrue; - iClipSharingController->iManualAddressTyped = EFalse; - - iClipSharingController->CancelInvitationL(); - EUNIT_ASSERT( iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - - - // No connection cancel - iClipSharingController->iSession->iInvited = ETrue; - iClipSharingController->iConnectionEstablished = EFalse; - iClipSharingController->iManualAddressTyped = EFalse; - - iClipSharingController->CancelInvitationL(); - EUNIT_ASSERT( !iClipSharingController->iSession->iInvited ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_HandleCommandLL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_PlayingL() - { - iClipSharingController->iPlaying = ETrue; - EUNIT_ASSERT( iClipSharingController->Playing() ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SetFileNameLL() - { - _LIT( KRes, "filename" ); - delete iClipSharingController->iFileName; - iClipSharingController->SetFileNameL( KRes ); - EUNIT_ASSERT( iClipSharingController->iFileName->Des().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_ClipEndedL() - { - iClipSharingController->iClipEnded = ETrue; - EUNIT_ASSERT( iClipSharingController->ClipEnded() ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_ZoomInLL() - { - iClipSharingController->ZoomInL(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_ZoomOutLL() - { - iClipSharingController->ZoomOutL(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SplitLL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_ShowErrorDialogL() - { - iClipSharingObserverAdapter->iErrorCode = KErrNone; - iClipSharingController->ShowErrorDialog( 1 ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowErrorDialogL ); - - iClipSharingObserverAdapter->iErrorCode = KErrNone; - iClipSharingObserverAdapter->iShowErrorDialogErrorCode = KErrArgument; - iClipSharingController->ShowErrorDialog( 1 ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleError ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_DismissWaitDialogL() - { - iClipSharingObserverAdapter->iErrorCode = KErrNone; - iClipSharingController->DismissWaitDialog(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EDismissWaitDialogL ); - - iClipSharingObserverAdapter->iErrorCode = KErrArgument; - iClipSharingController->DismissWaitDialog(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleError ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iError == KErrArgument ); - } - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_EndOfClipL() - { - iClipSharingController->iClipEnded = EFalse; - iClipSharingController->EndOfClip(); - EUNIT_ASSERT( iClipSharingController->iClipEnded ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionRejectedL() - { - iClipSharingController->SessionRejected(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionBadRequestL() - { - iClipSharingController->SessionBadRequest(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionUnauthorizedL() - { - iClipSharingController->SessionUnauthorized(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionPaymentRequiredL() - { - iClipSharingController->SessionPaymentRequired(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionRecipientNotFoundL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionProxyAuthenticationRequiredL() - { - iClipSharingController->SessionProxyAuthenticationRequired(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionRequestTimeOutL() - { - iClipSharingController->SessionRequestTimeOut(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionUnsupportedMediaTypeL() - { - iClipSharingController->SessionUnsupportedMediaType(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionRequestCancelledL() - { - iClipSharingController->SessionRequestCancelled(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionEstablishedL() - { - iClipSharingController->SessionEstablished(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EShowClipSharingPanesL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionTerminatedL() - { - iClipSharingController->SessionTerminated(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionConnectionLostL() - { - iClipSharingController->SessionConnectionLost(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionFailedL() - { - iClipSharingController->SessionFailed(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_StreamIdleL() - { - iClipSharingController->StreamIdle(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_StreamStreamingL() - { - iClipSharingController->StreamStreaming(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_SessionTimeChangedL() - { - iClipSharingController->SessionTimeChanged( TTimeIntervalSeconds( 1 ) ); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EUpdateSessionTime ); - } - - -void UT_CMusUiClipSharingController::UT_CMusUiClipSharingController_InactivityTimeoutL() - { - iClipSharingController->InactivityTimeout(); - EUNIT_ASSERT( iClipSharingObserverAdapter->iCalledObserver == CMusUiClipSharingObserverAdapter::EHandleExitL ); - } - - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiClipSharingController, - "UT_CMusUiClipSharingController", - "UNIT" ) - -EUNIT_TEST( - "StartInvitationL - test ", - "CMusUiClipSharingController", - "StartInvitationL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_StartInvitationLL, Teardown) - -EUNIT_TEST( - "AddressFoundL - test ", - "CMusUiClipSharingController", - "AddressFoundL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_AddressFoundLL, Teardown) - -EUNIT_TEST( - "InviteL - test ", - "CMusUiClipSharingController", - "InviteL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_InviteLL, Teardown) - -EUNIT_TEST( - "InviteL2 - test ", - "CMusUiClipSharingController", - "InviteL2", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_InviteL2L, Teardown) - -EUNIT_TEST( - "SetRect - test ", - "CMusUiClipSharingController", - "SetRect", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SetRectL, Teardown) - -EUNIT_TEST( - "CancelInvitationL - test ", - "CMusUiClipSharingController", - "CancelInvitationL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_CancelInvitationLL, Teardown) - -EUNIT_TEST( - "HandleCommandL - test ", - "CMusUiClipSharingController", - "HandleCommandL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_HandleCommandLL, Teardown) - -EUNIT_TEST( - "Playing - test ", - "CMusUiClipSharingController", - "Playing", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_PlayingL, Teardown) - -EUNIT_TEST( - "SetFileNameL - test ", - "CMusUiClipSharingController", - "SetFileNameL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SetFileNameLL, Teardown) - -EUNIT_TEST( - "ClipEnded - test ", - "CMusUiClipSharingController", - "ClipEnded", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_ClipEndedL, Teardown) - -EUNIT_TEST( - "ZoomInL - test ", - "CMusUiClipSharingController", - "ZoomInL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_ZoomInLL, Teardown) - -EUNIT_TEST( - "ZoomOutL - test ", - "CMusUiClipSharingController", - "ZoomOutL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_ZoomOutLL, Teardown) - -EUNIT_TEST( - "SplitL - test ", - "CMusUiClipSharingController", - "SplitL", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SplitLL, Teardown) - -EUNIT_TEST( - "ShowErrorDialog - test ", - "CMusUiClipSharingController", - "ShowErrorDialog", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_ShowErrorDialogL, Teardown) - -EUNIT_TEST( - "DismissWaitDialog - test ", - "CMusUiClipSharingController", - "DismissWaitDialog", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_DismissWaitDialogL, Teardown) - -EUNIT_TEST( - "EndOfClip - test ", - "CMusUiClipSharingController", - "EndOfClip", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_EndOfClipL, Teardown) - -EUNIT_TEST( - "SessionRejected - test ", - "CMusUiClipSharingController", - "SessionRejected", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionRejectedL, Teardown) - -EUNIT_TEST( - "SessionBadRequest - test ", - "CMusUiClipSharingController", - "SessionBadRequest", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionBadRequestL, Teardown) - -EUNIT_TEST( - "SessionUnauthorized - test ", - "CMusUiClipSharingController", - "SessionUnauthorized", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionUnauthorizedL, Teardown) - -EUNIT_TEST( - "SessionPaymentRequired - test ", - "CMusUiClipSharingController", - "SessionPaymentRequired", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionPaymentRequiredL, Teardown) - -EUNIT_TEST( - "SessionRecipientNotFound - test ", - "CMusUiClipSharingController", - "SessionRecipientNotFound", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionRecipientNotFoundL, Teardown) - -EUNIT_TEST( - "SessionProxyAuthenticationRequired - test ", - "CMusUiClipSharingController", - "SessionProxyAuthenticationRequired", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionProxyAuthenticationRequiredL, Teardown) - -EUNIT_TEST( - "SessionRequestTimeOut - test ", - "CMusUiClipSharingController", - "SessionRequestTimeOut", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionRequestTimeOutL, Teardown) - -EUNIT_TEST( - "SessionUnsupportedMediaType - test ", - "CMusUiClipSharingController", - "SessionUnsupportedMediaType", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionUnsupportedMediaTypeL, Teardown) - -EUNIT_TEST( - "SessionRequestCancelled - test ", - "CMusUiClipSharingController", - "SessionRequestCancelled", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionRequestCancelledL, Teardown) - -EUNIT_TEST( - "SessionEstablished - test ", - "CMusUiClipSharingController", - "SessionEstablished", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionEstablishedL, Teardown) - -EUNIT_TEST( - "SessionTerminated - test ", - "CMusUiClipSharingController", - "SessionTerminated", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionTerminatedL, Teardown) - -EUNIT_TEST( - "SessionConnectionLost - test ", - "CMusUiClipSharingController", - "SessionConnectionLost", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionConnectionLostL, Teardown) - -EUNIT_TEST( - "SessionFailed - test ", - "CMusUiClipSharingController", - "SessionFailed", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionFailedL, Teardown) - -EUNIT_TEST( - "StreamIdle - test ", - "CMusUiClipSharingController", - "StreamIdle", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_StreamIdleL, Teardown) - -EUNIT_TEST( - "StreamStreaming - test ", - "CMusUiClipSharingController", - "StreamStreaming", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_StreamStreamingL, Teardown) - -EUNIT_TEST( - "SessionTimeChanged - test ", - "CMusUiClipSharingController", - "SessionTimeChanged", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_SessionTimeChangedL, Teardown) - -EUNIT_TEST( - "InactivityTimeout - test ", - "CMusUiClipSharingController", - "InactivityTimeout", - "FUNCTIONALITY", - SetupL, UT_CMusUiClipSharingController_InactivityTimeoutL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuidllmain.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuidllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// USER INCLUDES -#include "ut_musuiclipsharingcontroller.h" -#include "ut_musuieventcontroller.h" -#include "ut_musuilivesharingcontroller.h" -#include "ut_musuipropertywatch.h" -#include "ut_musuireceivecontroller.h" -#include "ut_musuistartcontroller.h" - -// SYSTEM INCLUDES -#include - - -// ----------------------------------------------------------------------------- -// Test suite factory function. -// ----------------------------------------------------------------------------- -// -EXPORT_C MEUnitTest* CreateTestSuiteL() - { - - CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Main suite" ) ); - - //rootSuite->AddL( UT_MusEngMceUtils::NewLC() ); - //CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiClipSharingController::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiEventController::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiLiveSharingController::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiPropertyWatch::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiReceiveController::NewLC() ); - CleanupStack::Pop(); - - rootSuite->AddL( UT_CMusUiStartController::NewLC() ); - CleanupStack::Pop(); - - CleanupStack::Pop( rootSuite ); - - return rootSuite; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuieventcontroller.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuieventcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,761 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuieventcontroller.h" -#include "musuieventcontroller.h" -#include "musuilivesharingcontroller.h" - -#include "musuilivesharingobserveradapter.h" -#include "musuieventobserveradapter.h" - -#include "musresourceproperties.h" -#include "mussessionproperties.h" -#include "musuidefinitions.h" -#include "musenglivesession.h" -#include "mussettings.h" - - -#include -#include -#include - -//#include "musestubs.h" -//#include "musengtestdefs.h" - -// SYSTEM INCLUDES -#include -//#include -//#include - -using namespace NMusSessionApi; - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiEventController* UT_CMusUiEventController::NewL() - { - UT_CMusUiEventController* self = UT_CMusUiEventController::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiEventController* UT_CMusUiEventController::NewLC() - { - UT_CMusUiEventController* self = new( ELeave ) UT_CMusUiEventController(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiEventController::~UT_CMusUiEventController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiEventController::UT_CMusUiEventController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiEventController::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiEventController::SetupL() - { - _LIT( KPath, "\\private\\1000af5a\\" ); - iVideoFolder = KPath().AllocL(); - - //MultimediaSharingSettings::iVideoFolder = iVideoFolder; - MultimediaSharingSettings::iAutoRecord = MusSettingsKeys::EAutoRecordOff; - MultimediaSharingSettings::iVideoLocation = 2; - - _LIT( KReturn, "savedfilename" ); - _iReturnValue = KReturn().AllocL(); - StringLoader::iReturnValue = _iReturnValue; - - - iEventObserver = new (ELeave) CMusUiEventObserverAdapter(); - EUNIT_ASSERT( iEventObserver ); - - iLiveSharingObserverAdapter = new (ELeave) CMusUiLiveSharingObserverAdapter(); - EUNIT_ASSERT( iLiveSharingObserverAdapter ); - - - RProperty::iIntProperty = 0; - RProperty::iErrorCode = KErrNone; - - - iLiveSharingController = CMusUiLiveSharingController::NewL( iLiveSharingObserverAdapter, TRect( 0,0,100,100)); - iEventController = static_cast - ( iLiveSharingController ); - - EUNIT_ASSERT( iEventController ); - iEventController->SetEventObserver( iEventObserver ); - EUNIT_ASSERT( iEventController->iObserver == iEventObserver ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiEventController::Teardown() - { - delete iLiveSharingController; - iEventController = NULL; - delete iEventObserver; - delete iLiveSharingObserverAdapter; - - delete iVideoFolder; - iVideoFolder = NULL; - //MultimediaSharingSettings::iVideoFolder = NULL; - - delete _iReturnValue ; - _iReturnValue = NULL; - // StringLoader::iReturnValue = NULL; - //StringLoader::Cleanup(); - //MultimediaSharingSettings::Cleanup(); - - } - - -// TEST CASES - -void UT_CMusUiEventController::UT_CMusUiEventController_ResourcePropertyChangedL() - { - // test for setting status - - // Camera availability - iEventController->iCameraAvailibilityInProgress = EFalse; - iEventController->iCameraAvailable = TAvailability(1); - iEventController->ResourcePropertyChanged( KCameraAvailability, 0 ); - EUNIT_ASSERT( iEventController->iCameraAvailable == 0 ); - EUNIT_ASSERT( iEventController->iCameraAvailibilityInProgress == EFalse ); - - _LIT( KRes, "address" ); // Needed for fake, MUS_LOG leaves if null - iLiveSharingController->iAddress = KRes().AllocL(); - iEventController->iCameraAvailibilityInProgress = ETrue; - iEventController->iCameraAvailable = TAvailability(0); - iEventController->ResourcePropertyChanged( KCameraAvailability, 1 ); - EUNIT_ASSERT( iEventController->iCameraAvailable == 1 ); - EUNIT_ASSERT( iEventController->iCameraAvailibilityInProgress == EFalse ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowWaitDialogL ); - - - // Keypad availablity - iEventController->iKeypadAvailable = TAvailability(0); - iEventController->ResourcePropertyChanged( KKeypadAvailability, 2 ); - EUNIT_ASSERT( iEventController->iKeypadAvailable == 2 ); - - // Videoplayer availability - iEventController->iVideoPlayerAvailable = TAvailability(0); - iEventController->ResourcePropertyChanged( KVideoPlayerAvailability, 3 ); - EUNIT_ASSERT( iEventController->iVideoPlayerAvailable == 3 ); - - //Other case - iEventController->ResourcePropertyChanged( -99, 0 ); - EUNIT_ASSERT( iEventController->iCameraAvailable == 1 ); - EUNIT_ASSERT( iEventController->iKeypadAvailable == 2 ); - EUNIT_ASSERT( iEventController->iVideoPlayerAvailable == 3 ); - - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SessionPropertyChangedL() - { - - iEventController->SessionPropertyChanged( KStatus, ESipRegistrationPending ); - EUNIT_ASSERT( iEventController->iSipRegistrationPending ); - - // TODO: Cannot test UpdateContactL it leaves CleanupStack::PopAndDestroy function - // Need to do changes on code - iEventController->SessionPropertyChanged( KContactId, 0 ); - - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SessionPropertyChanged2L() - { - // TODO: Is this functions alive? - // EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_HandleErrorL() - { - - iEventController->HandleError( KErrUnknown ); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EHandleError ); - EUNIT_ASSERT( iEventObserver->iHandleErrorReason == KErrUnknown ); - - } - -void UT_CMusUiEventController::UT_CMusUiEventController_UpdateBitmapL() - { - delete iEventController->iContactBitmap; - iEventController->iContactBitmap = NULL; - CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); - iEventController->UpdateBitmap( bitmap ); - EUNIT_ASSERT( iEventController->iContactBitmap == bitmap ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SetEventObserverL() - { - // Tested in SetupL(); - EUNIT_ASSERT( ETrue ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_HandleForegroundEventLL() - { - // Initalization - iLiveSharingController->iConnectionEstablished = ETrue; // Need for testing - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - - // Enable display - iEventController->HandleForegroundEventL( ETrue ); - EUNIT_ASSERT( iLiveSharingController->iSession->iDisplayEnabled ); - EUNIT_ASSERT( iLiveSharingController->iSession->iPlaying ); - EUNIT_ASSERT( iEventController->iPlaying ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowNaviPaneIconL ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iIcon == EMusUiNaviIconPlay ); - - // Disable display - iEventController->HandleForegroundEventL( EFalse ); - EUNIT_ASSERT( !iLiveSharingController->iSession->iDisplayEnabled ); - EUNIT_ASSERT( !iLiveSharingController->iSession->iPlaying ); - EUNIT_ASSERT( !iEventController->iPlaying ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowNaviPaneIconL ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iIcon == EMusUiNaviIconPause ); - - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SetCameraStatusL() - { - iEventController->iCameraAvailable = TAvailability( 0 ); - iEventController->SetCameraStatus( TAvailability( 2 ) ); - EUNIT_ASSERT( iEventController->iCameraAvailable == 2 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SetKeypadStatusL() - { - iEventController->iKeypadAvailable = TAvailability(0); - iEventController->SetKeypadStatus( TAvailability( 2 ) ); - EUNIT_ASSERT( iEventController->iKeypadAvailable == 2 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SetVideoPlayerStatusL() - { - iEventController->iVideoPlayerAvailable = TAvailability(0); - iEventController->SetVideoPlayerStatus( TAvailability( 3 ) ); - EUNIT_ASSERT( iEventController->iVideoPlayerAvailable == 3 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SetCameraAvailabilityInProgressL() - { - iEventController->iCameraAvailibilityInProgress = 0; - iEventController->SetCameraAvailabilityInProgress( 1 ); - EUNIT_ASSERT( iEventController->iCameraAvailibilityInProgress == 1 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_CameraAvailableL() - { - iEventController->iCameraAvailable = TAvailability( 2 ); - EUNIT_ASSERT( iEventController->CameraAvailable() == 2 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_KeypadAvailableL() - { - iEventController->iKeypadAvailable = TAvailability( 2 ); - EUNIT_ASSERT( iEventController->KeypadAvailable() == 2 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_VideoPlayerAvailableL() - { - iEventController->iVideoPlayerAvailable = TAvailability( 2 ); - EUNIT_ASSERT( iEventController->VideoPlayerAvailable() == 2 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_CameraAvailibilityInProgressL() - { - iEventController->iCameraAvailibilityInProgress = 1; - EUNIT_ASSERT( iEventController->CameraAvailibilityInProgress() == 1 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusRemoteSipAddressValueL() - { - _LIT( KRes, "remote_address"); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes().AllocL(); - EUNIT_ASSERT( iEventController->MusRemoteSipAddressValue().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusProposalAddressValueL() - { - _LIT( KRes, "remote_address"); - delete iEventController->iRemoteSipAddressProposal; - iEventController->iRemoteSipAddressProposal = KRes().AllocL(); - EUNIT_ASSERT( iEventController->MusProposalAddressValue().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusContactNameL() - { - _LIT( KRes, "remote_address"); - delete iEventController->iContactName; - iEventController->iContactName = KRes().AllocL(); - EUNIT_ASSERT( iEventController->MusContactName().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusContactBitmapL() - { - delete iEventController->iContactBitmap; - iEventController->iContactBitmap = new (ELeave) CFbsBitmap(); - EUNIT_ASSERT( iEventController->MusContactBitmap() == iEventController->iContactBitmap ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusVideoCodecValueL() - { - _LIT( KRes, "codec_value"); - delete iEventController->iVideoCodec; - iEventController->iVideoCodec = KRes().AllocL(); - EUNIT_ASSERT( iEventController->MusVideoCodecValue().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_MusTelNumberValueL() - { - _LIT( KRes, "telnumber"); - delete iEventController->iTelNumber; - iEventController->iTelNumber = KRes().AllocL(); - EUNIT_ASSERT( iEventController->MusTelNumberValue().Compare( KRes ) == 0 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SipProfileIdL() - { - iEventController->iSipProfileId = 99; - EUNIT_ASSERT( iEventController->SipProfileId() == 99 ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SipRegistrationPendingL() - { - - iEventController->iSipRegistrationPending = ETrue; - EUNIT_ASSERT( iEventController->SipRegistrationPending() ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SessionTimeFormattedL() - { - - // Localized time format like "00:00:00" - - //TLocale locale; - //locale.TimeSeparator( 2 ) - - //EUNIT_ASSERT( iEventController->MusTelNumberValue().Compare( iEventController->iTelNumber->Des() ) ); - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_SaveContactL() - { - - //iEventController->iContactId = TContactItemId( 1 ); - - //iEventController->SaveContact(); - //EUNIT_ASSERT( iEventObserver->iActivatedContactId == TContactItemId( 1 ) ); - - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_HandleExitLL() - { - - - - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_InspectKeypadLL() - { - - // Initalize - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - iEventObserver->iErrorCode = KErrNone; - - - // Basic case cannot test, nothing changes - // iEventController->iKeypadAvailable = EAvailable; - // iEventController->InspectKeypadL(); - - - // case EAvailableInLandscapeOrientation - iEventController->iKeypadAvailable = EAvailableInLandscapeOrientation; - iEventController->InspectKeypadL(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EChangeOrientationL ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iOrientation == CAknAppUiBase::EAppUiOrientationLandscape ); - - - // case EAvailableInPortraitOrientation - iEventController->iKeypadAvailable = EAvailableInPortraitOrientation; - iEventController->InspectKeypadL(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EChangeOrientationL ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iOrientation == CAknAppUiBase::EAppUiOrientationPortrait ); - - // case ENotDefined - iEventController->iKeypadAvailable = ENotDefined; - iEventController->InspectKeypadL(); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EHandleExitL ); - - // case ENotAvailable - iEventController->iKeypadAvailable = ENotAvailable; - iEventController->InspectKeypadL(); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EHandleExitL ); - - - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_UpdateContactLL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_UpdateContactNameL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_UpdateContactPictureLL() - { - EUNIT_ASSERT( EFalse ); - } - - -void UT_CMusUiEventController::UT_CMusUiEventController_HandleChangedStatusLL() - { - EUNIT_ASSERT( EFalse ); - } - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiEventController, - "UT_CMusUiEventController", - "UNIT" ) - -EUNIT_TEST( - "ResourcePropertyChangedL - test ", - "CMusUiEventController", - "ResourcePropertyChangedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_ResourcePropertyChangedL, Teardown) - -EUNIT_TEST( - "SessionPropertyChangedL - test ", - "CMusUiEventController", - "SessionPropertyChangedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SessionPropertyChangedL, Teardown) - -EUNIT_TEST( - "HandleError - test ", - "CMusUiEventController", - "HandleError", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_HandleErrorL, Teardown) - -EUNIT_TEST( - "UpdateBitmap - test ", - "CMusUiEventController", - "UpdateBitmap", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_UpdateBitmapL, Teardown) - -EUNIT_TEST( - "SetEventObserver - test ", - "CMusUiEventController", - "SetEventObserver", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetEventObserverL, Teardown) - -EUNIT_TEST( - "HandleForegroundEventL - test ", - "CMusUiEventController", - "HandleForegroundEventL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_HandleForegroundEventLL, Teardown) - -EUNIT_TEST( - "SetCameraStatus - test ", - "CMusUiEventController", - "SetCameraStatus", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraStatusL, Teardown) - -EUNIT_TEST( - "SetKeypadStatus - test ", - "CMusUiEventController", - "SetKeypadStatus", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetKeypadStatusL, Teardown) - -EUNIT_TEST( - "SetVideoPlayerStatus - test ", - "CMusUiEventController", - "SetVideoPlayerStatus", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetVideoPlayerStatusL, Teardown) - -EUNIT_TEST( - "SetCameraAvailabilityInProgress - test ", - "CMusUiEventController", - "SetCameraAvailabilityInProgress", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraAvailabilityInProgressL, Teardown) - -EUNIT_TEST( - "EnableLoudspeaker - test ", - "CMusUiEventController", - "EnableLoudspeaker", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraStatusL, Teardown) - -EUNIT_TEST( - "CameraAvailable - test ", - "CMusUiEventController", - "CameraAvailable", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_CameraAvailableL, Teardown) - -EUNIT_TEST( - "KeypadAvailable - test ", - "CMusUiEventController", - "KeypadAvailable", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_KeypadAvailableL, Teardown) - -EUNIT_TEST( - "VideoPlayerAvailable - test ", - "CMusUiEventController", - "VideoPlayerAvailable", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_VideoPlayerAvailableL, Teardown) - -EUNIT_TEST( - "CameraAvailibilityInProgress - test ", - "CMusUiEventController", - "CameraAvailibilityInProgress", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_CameraAvailibilityInProgressL, Teardown) - -EUNIT_TEST( - "MusRemoteSipAddressValue - test ", - "CMusUiEventController", - "MusRemoteSipAddressValue", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusRemoteSipAddressValueL, Teardown) - -EUNIT_TEST( - "MusProposalAddressValue - test ", - "CMusUiEventController", - "MusProposalAddressValue", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusProposalAddressValueL, Teardown) - -EUNIT_TEST( - "MusContactName - test ", - "CMusUiEventController", - "MusContactName", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusContactNameL, Teardown) - -EUNIT_TEST( - "EnableLoudspeakerL - test ", - "CMusUiEventController", - "EnableLoudspeakerL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraStatusL, Teardown) - -EUNIT_TEST( - "MusContactBitmap - test ", - "CMusUiEventController", - "MusContactBitmap", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusContactBitmapL, Teardown) - -EUNIT_TEST( - "MusVideoCodecValue - test ", - "CMusUiEventController", - "MusVideoCodecValue", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusVideoCodecValueL, Teardown) - -EUNIT_TEST( - "MusTelNumberValue - test ", - "CMusUiEventController", - "MusTelNumberValue", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_MusTelNumberValueL, Teardown) - -EUNIT_TEST( - "SipProfileId - test ", - "CMusUiEventController", - "SipProfileId", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SipProfileIdL, Teardown) - -EUNIT_TEST( - "SipRegistrationPending - test ", - "CMusUiEventController", - "SipRegistrationPending", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SipRegistrationPendingL, Teardown) - -EUNIT_TEST( - "SessionTimeFormatted - test ", - "CMusUiEventController", - "SessionTimeFormatted", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SessionTimeFormattedL, Teardown) - -EUNIT_TEST( - "EnableLoudspeakerL - test ", - "CMusUiEventController", - "EnableLoudspeakerL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraStatusL, Teardown) - -EUNIT_TEST( - "SaveContact - test ", - "CMusUiEventController", - "SaveContact", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SaveContactL, Teardown) - -EUNIT_TEST( - "SetCameraStatus - test ", - "CMusUiEventController", - "SetCameraStatus", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_SetCameraStatusL, Teardown) - -EUNIT_TEST( - "HandleExitL - test ", - "CMusUiEventController", - "HandleExitL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_HandleExitLL, Teardown) - - -EUNIT_TEST( - "InspectKeypadL - test ", - "CMusUiEventController", - "InspectKeypadL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_InspectKeypadLL, Teardown) - -EUNIT_TEST( - "UpdateContactL - test ", - "CMusUiEventController", - "UpdateContactL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_UpdateContactLL, Teardown) - -EUNIT_TEST( - "UpdateContactName - test ", - "CMusUiEventController", - "UpdateContactName", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_UpdateContactNameL, Teardown) - -EUNIT_TEST( - "UpdateContactPictureL - test ", - "CMusUiEventController", - "UpdateContactPictureL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_UpdateContactPictureLL, Teardown) - -EUNIT_TEST( - "HandleChangedStatusL - test ", - "CMusUiEventController", - "HandleChangedStatusL", - "FUNCTIONALITY", - SetupL, UT_CMusUiEventController_HandleChangedStatusLL, Teardown) - -EUNIT_END_TEST_TABLE - - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuilivesharingcontroller.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuilivesharingcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,888 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuilivesharingcontroller.h" -#include "musuilivesharingcontroller.h" -#include "musuilivesharingobserveradapter.h" -//#include "musestubs.h" -//#include "musengtestdefs.h" -#include "musuieventobserveradapter.h" -#include "musuidefinitions.h" -#include - -// SYSTEM INCLUDES -#include -#include - -//#include -//#include - -using namespace NMusResourceApi; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiLiveSharingController* UT_CMusUiLiveSharingController::NewL() - { - UT_CMusUiLiveSharingController* self = UT_CMusUiLiveSharingController::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiLiveSharingController* UT_CMusUiLiveSharingController::NewLC() - { - UT_CMusUiLiveSharingController* self = new( ELeave ) UT_CMusUiLiveSharingController(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiLiveSharingController::~UT_CMusUiLiveSharingController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::SetupL() - { - - iEventObserver = new (ELeave) CMusUiEventObserverAdapter(); - EUNIT_ASSERT( iEventObserver ); - - iLiveSharingObserverAdapter = new (ELeave) CMusUiLiveSharingObserverAdapter(); - EUNIT_ASSERT( iLiveSharingObserverAdapter ); - - - RProperty::iIntProperty = 0; - RProperty::iErrorCode = KErrNone; - - - iLiveSharingController = CMusUiLiveSharingController::NewL( iLiveSharingObserverAdapter, TRect( 0,0,100,100)); - iEventController = static_cast - ( iLiveSharingController ); - - EUNIT_ASSERT( iEventController ); - iEventController->SetEventObserver( iEventObserver ); - EUNIT_ASSERT( iEventController->iObserver == iEventObserver ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::Teardown() - { - delete iLiveSharingController; - iEventController = NULL; - delete iEventObserver; - delete iLiveSharingObserverAdapter; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_StartInvitationLL() - { - - //iLiveSharingController->StartInvitationL(); - //EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleAsyncEventL ); - //EUNIT_ASSERT( iLiveSharingObserverAdapter->iHandleAsyncEventId == EMusUiAsyncStartInvitation ); - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_AddressFoundLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_InviteLL() - { - - // Precondititions - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - iEventController->iCameraAvailable = EAvailable; - iEventController->iSipRegistrationPending = EFalse; - - // sip address length > 0 and no separator - _LIT( KRes, "address" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes().AllocL(); - iLiveSharingController->InviteL(); - - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowWaitDialogL ); - - - // sip address length > 0 and separator - _LIT( KRes2, "Address1, Address2, Address3" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes2().AllocL(); - iLiveSharingController->iSession->iInvited = EFalse; - iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::ENone; - - iLiveSharingController->InviteL(); - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowWaitDialogL ); - - - // sip addres length = 0 - _LIT( KRes3, "" ); - delete iEventController->iRemoteSipAddress; - iEventController->iRemoteSipAddress = KRes3().AllocL(); - iLiveSharingController->iSession->iInvited = EFalse; - iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::ENone; - - iLiveSharingController->InviteL(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EManualAddressEntryL ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_InviteL2L() - { - // Precondititions - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - - // registration not pending and triedinvitations > 1 - iEventController->iSipRegistrationPending = EFalse; - iLiveSharingController->iSession->iInvited = EFalse; - iLiveSharingController->iManualAddressTyped = EFalse; - iLiveSharingController->iTriedInvitations = 2; - - _LIT( KRes, "address" ); - iLiveSharingController->InviteL( KRes ); - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowWaitDialogL ); - - - // registration not pending and triedinvitations > 1 - iLiveSharingController->iSession->iErrorCode = KErrArgument; - - iEventController->iSipRegistrationPending = EFalse; - iLiveSharingController->iSession->iInvited = EFalse; - iLiveSharingController->iManualAddressTyped = EFalse; - iLiveSharingController->iTriedInvitations = 2; - - iLiveSharingController->InviteL( KRes ); - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - - - // registration not pending and triedinvitations = 0 - iLiveSharingController->iSession->iErrorCode = KErrArgument; - - iEventController->iSipRegistrationPending = EFalse; - iLiveSharingController->iSession->iInvited = EFalse; - iLiveSharingController->iManualAddressTyped = EFalse; - iLiveSharingController->iTriedInvitations = 0; - - _LIT( KProposal, "proposal_address" ); - delete iEventController->iRemoteSipAddressProposal; - iEventController->iRemoteSipAddressProposal = KProposal().AllocL(); - - // Manual address entry - iLiveSharingController->InviteL( KRes ); - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowWaitDialogL ); - EUNIT_ASSERT( iLiveSharingController->iTriedInvitations == 1 ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iAddress->Des().Compare( KProposal ) == 0 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SetRectL() - { - - TRect rect = TRect( 0,0, 100,100 ); - - iLiveSharingController->iSession->iErrorCode = KErrArgument; - iLiveSharingController->SetRect( rect ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleError ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iError == KErrArgument ); - - iLiveSharingController->iSession->iErrorCode = KErrNone; - iLiveSharingController->SetRect( rect ); - EUNIT_ASSERT( iLiveSharingController->iSession->iRect == iLiveSharingController->CenteredRect( rect ) ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_CancelInvitationLL() - { - - // Connection established cancel - iLiveSharingController->iSession->iInvited = ETrue; - iLiveSharingController->iConnectionEstablished = ETrue; - iLiveSharingController->iManualAddressTyped = EFalse; - - iLiveSharingController->CancelInvitationL(); - EUNIT_ASSERT( iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - - - // No connection cancel - iLiveSharingController->iSession->iInvited = ETrue; - iLiveSharingController->iConnectionEstablished = EFalse; - iLiveSharingController->iManualAddressTyped = EFalse; - - iLiveSharingController->CancelInvitationL(); - EUNIT_ASSERT( !iLiveSharingController->iSession->iInvited ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_HandleCommandLL() - { - // TODO: - - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_PlayingL() - { - iLiveSharingController->iPlaying = ETrue; - EUNIT_ASSERT( iLiveSharingController->Playing() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_CurrentZoomLL() - { - iLiveSharingController->iSession->iCurrentZoom = 14; - EUNIT_ASSERT( iLiveSharingController->CurrentZoomL() == 14 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_MinZoomLL() - { - iLiveSharingController->iSession->iCurrentZoom = 13; - EUNIT_ASSERT( iLiveSharingController->CurrentZoomL() == 13 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_MaxZoomLL() - { - iLiveSharingController->iSession->iCurrentZoom = 12; - EUNIT_ASSERT( iLiveSharingController->CurrentZoomL() == 12 ); - } - -//private: // new functions: - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_CenteredRectL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_ZoomInLL() - { - iLiveSharingController->iSession->iCurrentZoom = 12; - EUNIT_ASSERT( iLiveSharingController->CurrentZoomL() == 13 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_ZoomOutLL() - { - iLiveSharingController->iSession->iCurrentZoom = 12; - EUNIT_ASSERT( iLiveSharingController->CurrentZoomL() == 11 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SplitLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_ShowErrorDialogL() - { - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - iLiveSharingController->ShowErrorDialog( 1 ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EShowErrorDialogL ); - - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - iLiveSharingObserverAdapter->iShowErrorDialogErrorCode = KErrArgument; - iLiveSharingController->ShowErrorDialog( 1 ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleError ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_DismissWaitDialogL() - { - iLiveSharingObserverAdapter->iErrorCode = KErrNone; - iLiveSharingController->DismissWaitDialog(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EDismissWaitDialogL ); - - iLiveSharingObserverAdapter->iErrorCode = KErrArgument; - iLiveSharingController->DismissWaitDialog(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleError ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iError == KErrArgument ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionRejectedL() - { - iLiveSharingController->SessionRejected(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } // e.g. 603 DECLINE - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionBadRequestL() - { - iLiveSharingController->SessionBadRequest(); - EUNIT_ASSERT( ETrue ); - } // 400 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionUnauthorizedL() - { - iLiveSharingController->SessionUnauthorized(); - EUNIT_ASSERT( ETrue ); - } // 401 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionPaymentRequiredL() - { - iLiveSharingController->SessionPaymentRequired(); - EUNIT_ASSERT( ETrue ); - } // 402 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionRecipientNotFoundL() - { - EUNIT_ASSERT( EFalse ); - } // 404 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionProxyAuthenticationRequiredL() - { - iLiveSharingController->SessionProxyAuthenticationRequired(); - EUNIT_ASSERT( ETrue ); - } // 407 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionRequestTimeOutL() - { - iLiveSharingController->SessionRequestTimeOut(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } // 408 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionUnsupportedMediaTypeL() - { - iLiveSharingController->SessionUnsupportedMediaType(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } // 415 - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionRequestCancelledL() - { - iLiveSharingController->SessionRequestCancelled(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } // 487 - -//public: // from MMusEngSessionObserver - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionEstablishedL() - { - - iLiveSharingController->SessionEstablished(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionTerminatedL() - { - iLiveSharingController->SessionTerminated(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionConnectionLostL() - { - iLiveSharingController->SessionConnectionLost(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionFailedL() - { - iLiveSharingController->SessionFailed(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_StreamIdleL() - { - iLiveSharingController->StreamIdle(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_StreamStreamingL() - { - iLiveSharingController->StreamStreaming(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_SessionTimeChangedL() - { - iLiveSharingController->SessionTimeChanged( TTimeIntervalSeconds( 1 ) ); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EUpdateSessionTime ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiLiveSharingController::UT_CMusUiLiveSharingController_InactivityTimeoutL() - { - iLiveSharingController->InactivityTimeout(); - EUNIT_ASSERT( iLiveSharingObserverAdapter->iCalledObserver == CMusUiLiveSharingObserverAdapter::EHandleExitL ); - } - - - -// TEST CASES - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiLiveSharingController, - "UT_CMusUiLiveSharingController", - "UNIT" ) - -EUNIT_TEST( - "StartInvitationL - test ", - "UT_CMusUiLiveSharingController", - "StartInvitationL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_StartInvitationLL, Teardown) - -EUNIT_TEST( - "AddressFoundL - test ", - "UT_CMusUiLiveSharingController", - "AddressFoundL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_AddressFoundLL, Teardown) - -EUNIT_TEST( - "InviteL - test ", - "UT_CMusUiLiveSharingController", - "InviteL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_InviteLL, Teardown) - -EUNIT_TEST( - "InviteL2 - test ", - "UT_CMusUiLiveSharingController", - "InviteL2", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_InviteL2L, Teardown) - -EUNIT_TEST( - "SetRect - test ", - "UT_CMusUiLiveSharingController", - "SetRect", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SetRectL, Teardown) - -EUNIT_TEST( - "CancelInvitationL - test ", - "UT_CMusUiLiveSharingController", - "CancelInvitationL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_CancelInvitationLL, Teardown) - -EUNIT_TEST( - "HandleCommandL - test ", - "UT_CMusUiLiveSharingController", - "HandleCommandL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_HandleCommandLL, Teardown) - -EUNIT_TEST( - "PlayingL - test ", - "UT_CMusUiLiveSharingController", - "PlayingL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_PlayingL, Teardown) - -EUNIT_TEST( - "CurrentZoomL - test ", - "UT_CMusUiLiveSharingController", - "CurrentZoomL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_CurrentZoomLL, Teardown) - -EUNIT_TEST( - "MinZoomL - test ", - "UT_CMusUiLiveSharingController", - "MinZoomL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_MinZoomLL, Teardown) - -EUNIT_TEST( - "MaxZoomL - test ", - "UT_CMusUiLiveSharingController", - "MaxZoomL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_MaxZoomLL, Teardown) - -EUNIT_TEST( - "CenteredRect - test ", - "UT_CMusUiLiveSharingController", - "CenteredRect", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_CenteredRectL, Teardown) - -EUNIT_TEST( - "ZoomInL - test ", - "UT_CMusUiLiveSharingController", - "ZoomInL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_ZoomInLL, Teardown) - -EUNIT_TEST( - "ZoomOutL - test ", - "UT_CMusUiLiveSharingController", - "ZoomOutL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_ZoomOutLL, Teardown) - -EUNIT_TEST( - "SplitL - test ", - "UT_CMusUiLiveSharingController", - "SplitL", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SplitLL, Teardown) - -EUNIT_TEST( - "ShowErrorDialog - test ", - "UT_CMusUiLiveSharingController", - "ShowErrorDialog", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_ShowErrorDialogL, Teardown) - -EUNIT_TEST( - "DismissWaitDialog - test ", - "UT_CMusUiLiveSharingController", - "DismissWaitDialog", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_DismissWaitDialogL, Teardown) - -EUNIT_TEST( - "SessionRejected - test ", - "UT_CMusUiLiveSharingController", - "SessionRejected", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionRejectedL, Teardown) - -EUNIT_TEST( - "SessionUnauthorized - test ", - "UT_CMusUiLiveSharingController", - "SessionUnauthorized", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionUnauthorizedL, Teardown) - -EUNIT_TEST( - "SessionPaymentRequired - test ", - "UT_CMusUiLiveSharingController", - "SessionPaymentRequired", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionPaymentRequiredL, Teardown) - -EUNIT_TEST( - "SessionRecipientNotFound - test ", - "UT_CMusUiLiveSharingController", - "SessionRecipientNotFound", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionRecipientNotFoundL, Teardown) - -EUNIT_TEST( - "SessionProxyAuthenticationRequired - test ", - "UT_CMusUiLiveSharingController", - "SessionProxyAuthenticationRequired", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionProxyAuthenticationRequiredL, Teardown) - -EUNIT_TEST( - "SessionRequestTimeOut - test ", - "UT_CMusUiLiveSharingController", - "SessionRequestTimeOut", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionRequestTimeOutL, Teardown) - -EUNIT_TEST( - "SessionUnsupportedMediaType - test ", - "UT_CMusUiLiveSharingController", - "SessionUnsupportedMediaType", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionUnsupportedMediaTypeL, Teardown) - -EUNIT_TEST( - "SessionRequestCancelled - test ", - "UT_CMusUiLiveSharingController", - "SessionRequestCancelled", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionRequestCancelledL, Teardown) - -EUNIT_TEST( - "SessionEstablished - test ", - "UT_CMusUiLiveSharingController", - "SessionEstablished", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionEstablishedL, Teardown) - -EUNIT_TEST( - "SessionTerminated - test ", - "UT_CMusUiLiveSharingController", - "SessionTerminated", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionTerminatedL, Teardown) - -EUNIT_TEST( - "SessionConnectionLost - test ", - "UT_CMusUiLiveSharingController", - "SessionConnectionLost", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionConnectionLostL, Teardown) - -EUNIT_TEST( - "SessionFailed - test ", - "UT_CMusUiLiveSharingController", - "SessionFailed", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionFailedL, Teardown) - -EUNIT_TEST( - "StreamIdle - test ", - "UT_CMusUiLiveSharingController", - "StreamIdle", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_StreamIdleL, Teardown) - -EUNIT_TEST( - "StreamStreaming - test ", - "UT_CMusUiLiveSharingController", - "StreamStreaming", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_StreamStreamingL, Teardown) - -EUNIT_TEST( - "SessionTimeChanged - test ", - "UT_CMusUiLiveSharingController", - "SessionTimeChanged", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_SessionTimeChangedL, Teardown) - -EUNIT_TEST( - "InactivityTimeout - test ", - "UT_CMusUiLiveSharingController", - "InactivityTimeout", - "FUNCTIONALITY", - SetupL, UT_CMusUiLiveSharingController_InactivityTimeoutL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuipropertywatch.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuipropertywatch.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuipropertywatch.h" -#include "musuipropertywatch.h" -//#include "musestubs.h" -//#include "musengtestdefs.h" -#include "musuitestdefines.h" - -#include "musuipropertyobserveradapter.h" -#include "mussessionproperties.h" - -// SYSTEM INCLUDES -#include -//#include -//#include - - -using namespace NMusSessionApi; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiPropertyWatch* UT_CMusUiPropertyWatch::NewL() - { - UT_CMusUiPropertyWatch* self = UT_CMusUiPropertyWatch::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiPropertyWatch* UT_CMusUiPropertyWatch::NewLC() - { - UT_CMusUiPropertyWatch* self = new( ELeave ) UT_CMusUiPropertyWatch(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiPropertyWatch::~UT_CMusUiPropertyWatch() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::SetupL() - { - // Iniatalize - iPropertyObserver = new (ELeave) CMusUiPropertyObserverAdapter(); - - TUid tmp = { 0 }; // Unit testing dummy - iPropertyWatch = CMusUiPropertyWatch::NewL( *iPropertyObserver, - tmp, - 0 ); // Unit testing dummy - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::Teardown() - { - delete iPropertyWatch; - delete iPropertyObserver; - } - - - -// TEST CASES - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch_ReadIntPropertyLL() - { - - // Teesting leave - RProperty::iErrorCode = KErrNotFound; - RProperty::iIntProperty = KMusUiTestPropertyReadInteger; - TInt value; - TRAPD( err, value = CMusUiPropertyWatch::ReadIntPropertyL( KMusUiTestKey ) ); - EUNIT_ASSERT( err == KErrNotFound ); - - // Testing return value - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = KMusUiTestPropertyReadInteger; - EUNIT_ASSERT( CMusUiPropertyWatch::ReadIntPropertyL( KMusUiTestKey ) == - KMusUiTestPropertyReadInteger ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch_ReadDescPropertyLL() - { - // Teesting leave - RProperty::iErrorCode = KErrNotFound; - TRAPD( err, CMusUiPropertyWatch::ReadDescPropertyL( KMusUiTestKey ) ); - EUNIT_ASSERT( err == KErrNotFound ); - - // Testing return value - RProperty::iErrorCode = KErrNone; - HBufC* result = CMusUiPropertyWatch::ReadDescPropertyL( KMusUiTestKey ); - EUNIT_ASSERT( KMusUiTestPropertyReadDesc().Compare( result->Des() ) ); - delete result; - - //EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch_DoCancelL() - { - RProperty::iErrorCode = KErrNone; - iPropertyWatch->Cancel(); - EUNIT_ASSERT( RProperty::iCalledFunction == RProperty::ECancel ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch_RunLL() - { - - // Leave test - RProperty::iErrorCode = KErrNotFound; - iPropertyWatch->Cancel(); - TRAPD( err, iPropertyWatch->RunL() ); - EUNIT_ASSERT( err == KErrNotFound ); - - - // SessionPropertyChanged - RProperty::iErrorCode = KErrNone; - iPropertyWatch->iPropertyKey = KStatus; - iPropertyWatch->Cancel(); - iPropertyWatch->RunL(); - EUNIT_ASSERT( iPropertyObserver->iCalledObserver == - CMusUiPropertyObserverAdapter::ESessionPropertyChanged ); - - - RProperty::iErrorCode = KErrNone; - iPropertyWatch->iPropertyKey = KTelNumber; - iPropertyWatch->Cancel(); - iPropertyWatch->RunL(); - EUNIT_ASSERT( iPropertyObserver->iCalledObserver == - CMusUiPropertyObserverAdapter::EResourcePropertyChanged ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiPropertyWatch::UT_CMusUiPropertyWatch_RunErrorL() - { - - // Allways returns KErrNone - RProperty::iErrorCode = KErrNone; - EUNIT_ASSERT( iPropertyWatch->RunError( KErrNotFound ) == KErrNone ); - - // is right observer called - RProperty::iErrorCode = KErrNone; - EUNIT_ASSERT( iPropertyObserver->iCalledObserver == - CMusUiPropertyObserverAdapter::EHandleError ); - } - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiPropertyWatch, - "UT_CMusUiPropertyWatch", - "UNIT" ) - -EUNIT_TEST( - "ReadIntPropertyLL - test ", - "CMusUiPropertyWatch", - "ReadIntPropertyLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiPropertyWatch_ReadIntPropertyLL, Teardown) - -EUNIT_TEST( - "ReadDescPropertyLL - test ", - "CMusUiPropertyWatch", - "ReadDescPropertyLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiPropertyWatch_ReadDescPropertyLL, Teardown) - -EUNIT_TEST( - "DoCancelL - test ", - "CMusUiPropertyWatch", - "DoCancelL", - "FUNCTIONALITY", - SetupL, UT_CMusUiPropertyWatch_DoCancelL, Teardown) - -EUNIT_TEST( - "RunLL - test ", - "CMusUiPropertyWatch", - "RunLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiPropertyWatch_RunLL, Teardown) - -EUNIT_TEST( - "RunErrorL - test ", - "CMusUiPropertyWatch", - "RunErrorL", - "FUNCTIONALITY", - SetupL, UT_CMusUiPropertyWatch_RunErrorL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuireceivecontroller.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuireceivecontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,758 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuireceivecontroller.h" -#include "musuireceivecontroller.h" -#include "musuireceiveobserveradapter.h" -//#include "musestubs.h" -//#include "musengtestdefs.h" -#include "musuieventobserveradapter.h" -#include "musuidefinitions.h" -#include -#include - -// SYSTEM INCLUDES -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiReceiveController* UT_CMusUiReceiveController::NewL() - { - UT_CMusUiReceiveController* self = UT_CMusUiReceiveController::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiReceiveController* UT_CMusUiReceiveController::NewLC() - { - UT_CMusUiReceiveController* self = new( ELeave ) UT_CMusUiReceiveController(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiReceiveController::~UT_CMusUiReceiveController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiReceiveController::UT_CMusUiReceiveController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::SetupL() - { - - iEventObserver = new (ELeave) CMusUiEventObserverAdapter(); - EUNIT_ASSERT( iEventObserver ); - - iReceiveObserverAdapter = new (ELeave) CMusUiReceiveObserverAdapter(); - EUNIT_ASSERT( iReceiveObserverAdapter ); - - - RProperty::iIntProperty = 0; - RProperty::iErrorCode = KErrNone; - - - iReceiveController = CMusUiReceiveController::NewL( *iReceiveObserverAdapter, TRect( 0,0,100,100)); - iEventController = static_cast - ( iReceiveController ); - - EUNIT_ASSERT( iEventController ); - iEventController->SetEventObserver( iEventObserver ); - EUNIT_ASSERT( iEventController->iObserver == iEventObserver ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::Teardown() - { - delete iReceiveController; - iEventController = NULL; - delete iEventObserver; - delete iReceiveObserverAdapter; - } - - - -// TEST CASES - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_HandleCommandLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SizeChangedL() - { - - TRect rect = TRect( 0,0, 100, 100 ); - - iReceiveController->iSession->iRect = rect; - iReceiveController->SizeChanged( rect ); - EUNIT_ASSERT( iReceiveController->iSession->iRect == iReceiveController->CenteredRect( rect ) ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ShowErrorDialogLL() - { - _LIT( KRes, "res" ); - //StringLoader::iReturnValue = KRes().AllocLC(); - iReceiveController->ShowErrorDialogL( 1 ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EShowErrorDialog ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_HandleIncomingSessionLL() - { - _LIT( KRes, "originator" ); - - // Not initalized - delete iReceiveController->iOriginator; - iReceiveController->iOriginator = NULL; - iReceiveController->HandleIncomingSessionL( KRes ); - EUNIT_ASSERT( iReceiveController->iOriginator->Des().Compare( KRes ) == 0 ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EShowInvitationQueryL ); - - - _LIT( KEmpty, "" ); - // Initalized - delete iReceiveController->iOriginator; - iReceiveController->iOriginator = KEmpty().AllocL(); - iReceiveController->HandleIncomingSessionL( KRes ); - EUNIT_ASSERT( iReceiveController->iOriginator->Des().Compare( KRes ) == 0 ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EShowInvitationQueryL ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_CancelInvitationLL() - { - iReceiveController->CancelInvitationL(); - EUNIT_ASSERT( !iReceiveController->iSession->iAccepInvitation ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ContinueInvitationLL() - { - iReceiveController->ContinueInvitationL(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_HandleAsyncEventLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ConnectionEstablishedL() - { - iReceiveController->iConnectionEstablished = ETrue; - EUNIT_ASSERT( iReceiveController->ConnectionEstablished() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_PlayLL() - { - iReceiveController->PlayL(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_PauseLL() - { - iReceiveController->PauseL(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_EnableDisplayLL() - { - iReceiveController->iSession->iDisplayEnabled = EFalse; - iReceiveController->EnableDisplayL( ETrue ); - EUNIT_ASSERT( iReceiveController->iSession->iDisplayEnabled ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ShowNaviPaneIconLL() - { - iReceiveController->ShowNaviPaneIconL( EMusUiNaviIconPlay ); - EUNIT_ASSERT( iReceiveObserverAdapter->iIcon == EMusUiNaviIconPlay ); - EUNIT_ASSERT( iReceiveObserverAdapter->iVisible ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EShowNaviPaneIconL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ChangeOrientationLL() - { - - iReceiveController->ChangeOrientationL( CAknAppUiBase::EAppUiOrientationPortrait ); - EUNIT_ASSERT( iReceiveObserverAdapter->iOrientation == CAknAppUiBase::EAppUiOrientationPortrait ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EChangeOrientationL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_CenteredRectL() - { - - - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ManualAddressTypedL() - { - EUNIT_ASSERT( !iReceiveController->ManualAddressTyped() ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ShowInformationDialogLL() - { - iReceiveController->ShowInformationDialogL( 12 ); - EUNIT_ASSERT( iReceiveObserverAdapter->iResourceId == 12 ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EShowInformationDialogL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ShutdownLL() - { - iReceiveController->HandleExitL(); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EHandleExitL ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_IncomingSessionL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_StreamBufferingL() - { - EUNIT_ASSERT( EFalse ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SessionEstablishedL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SessionTerminatedL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SessionConnectionLostL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SessionFailedL() - { - iReceiveController->SessionFailed(); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EDismissWaitDialogL ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_StreamIdleL() - { - iReceiveController->StreamIdle(); - EUNIT_ASSERT( ETrue ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_StreamStreamingL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_SessionTimeChangedL() - { - iReceiveController->SessionTimeChanged( TTimeIntervalSeconds( 13 ) ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EUpdateSessionTime ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_InactivityTimeoutL() - { - iReceiveController->HandleExitL(); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EHandleExitL ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_InvitationAcceptedLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_InvitationRejectedLL() - { - iReceiveController->InvitationRejectedL(); - EUNIT_ASSERT( !iReceiveController->iSession->iAccepInvitation ); - EUNIT_ASSERT( iReceiveObserverAdapter->iCalledObserver == CMusUiReceiveObserverAdapter::EHandleExitL ); - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_UpdateStatusPaneLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_InspectVideoPlayerLL() - { - EUNIT_ASSERT( EFalse ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiReceiveController::UT_CMusUiReceiveController_ShowWaitDialogLL() - { - EUNIT_ASSERT( EFalse ); - } - - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiReceiveController, - "UT_CMusUiReceiveController", - "UNIT" ) - -EUNIT_TEST( - "HandleCommandLL - test ", - "CMusUiReceiveController", - "HandleCommandLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_HandleCommandLL, Teardown) - -EUNIT_TEST( - "SizeChangedL - test ", - "CMusUiReceiveController", - "SizeChangedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SizeChangedL, Teardown) - -EUNIT_TEST( - "ShowErrorDialogLL - test ", - "CMusUiReceiveController", - "ShowErrorDialogLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShowErrorDialogLL, Teardown) - -EUNIT_TEST( - "HandleIncomingSessionLL - test ", - "CMusUiReceiveController", - "HandleIncomingSessionLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_HandleIncomingSessionLL, Teardown) - -EUNIT_TEST( - "CancelInvitationLL - test ", - "CMusUiReceiveController", - "CancelInvitationLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_CancelInvitationLL, Teardown) - -EUNIT_TEST( - "ContinueInvitationLL - test ", - "CMusUiReceiveController", - "ContinueInvitationLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ContinueInvitationLL, Teardown) - -EUNIT_TEST( - "HandleAsyncEventLL - test ", - "CMusUiReceiveController", - "HandleAsyncEventLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_HandleAsyncEventLL, Teardown) - -EUNIT_TEST( - "ConnectionEstablishedL - test ", - "CMusUiReceiveController", - "ConnectionEstablishedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ConnectionEstablishedL, Teardown) - -EUNIT_TEST( - "PlayLL - test ", - "CMusUiReceiveController", - "PlayLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_PlayLL, Teardown) - -EUNIT_TEST( - "PauseLL - test ", - "CMusUiReceiveController", - "PauseLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_PauseLL, Teardown) - -EUNIT_TEST( - "EnableDisplayLL - test ", - "CMusUiReceiveController", - "EnableDisplayLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_EnableDisplayLL, Teardown) - -EUNIT_TEST( - "ShowNaviPaneIconLL - test ", - "CMusUiReceiveController", - "ShowNaviPaneIconLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShowNaviPaneIconLL, Teardown) - -EUNIT_TEST( - "ChangeOrientationLL - test ", - "CMusUiReceiveController", - "ChangeOrientationLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ChangeOrientationLL, Teardown) - -EUNIT_TEST( - "CenteredRectL - test ", - "CMusUiReceiveController", - "CenteredRectL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_CenteredRectL, Teardown) - -EUNIT_TEST( - "ManualAddressTypedL - test ", - "CMusUiReceiveController", - "ManualAddressTypedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ManualAddressTypedL, Teardown) - -EUNIT_TEST( - "ShowInformationDialogLL - test ", - "CMusUiReceiveController", - "ShowInformationDialogLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShowInformationDialogLL, Teardown) - -EUNIT_TEST( - "ShowInformationDialogLL - test ", - "CMusUiReceiveController", - "ShowInformationDialogLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShowInformationDialogLL, Teardown) - -EUNIT_TEST( - "ShutdownLL - test ", - "CMusUiReceiveController", - "ShutdownLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShutdownLL, Teardown) - -EUNIT_TEST( - "IncomingSessionL - test ", - "CMusUiReceiveController", - "IncomingSessionL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_IncomingSessionL, Teardown) - -EUNIT_TEST( - "StreamBufferingL - test ", - "CMusUiReceiveController", - "StreamBufferingL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_StreamBufferingL, Teardown) - -EUNIT_TEST( - "SessionEstablishedL - test ", - "CMusUiReceiveController", - "SessionEstablishedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SessionEstablishedL, Teardown) - -EUNIT_TEST( - "SessionTerminatedL - test ", - "CMusUiReceiveController", - "SessionTerminatedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SessionTerminatedL, Teardown) - -EUNIT_TEST( - "SessionConnectionLostL - test ", - "CMusUiReceiveController", - "SessionConnectionLostL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SessionConnectionLostL, Teardown) - -EUNIT_TEST( - "SessionFailedL - test ", - "CMusUiReceiveController", - "SessionFailedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SessionFailedL, Teardown) - -EUNIT_TEST( - "StreamIdleL - test ", - "CMusUiReceiveController", - "StreamIdleL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_StreamIdleL, Teardown) - -EUNIT_TEST( - "StreamStreamingL - test ", - "CMusUiReceiveController", - "StreamStreamingL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_StreamStreamingL, Teardown) - -EUNIT_TEST( - "SessionTimeChangedL - test ", - "CMusUiReceiveController", - "SessionTimeChangedL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_SessionTimeChangedL, Teardown) - -EUNIT_TEST( - "InactivityTimeoutL - test ", - "CMusUiReceiveController", - "InactivityTimeoutL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_InactivityTimeoutL, Teardown) - -EUNIT_TEST( - "InvitationAcceptedLL - test ", - "CMusUiReceiveController", - "InvitationAcceptedLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_InvitationAcceptedLL, Teardown) - -EUNIT_TEST( - "InvitationRejectedLL - test ", - "CMusUiReceiveController", - "InvitationRejectedLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_InvitationRejectedLL, Teardown) - -EUNIT_TEST( - "UpdateStatusPaneLL - test ", - "CMusUiReceiveController", - "UpdateStatusPaneLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_UpdateStatusPaneLL, Teardown) - -EUNIT_TEST( - "InspectVideoPlayerLL - test ", - "CMusUiReceiveController", - "InspectVideoPlayerLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_InspectVideoPlayerLL, Teardown) - -EUNIT_TEST( - "ShowWaitDialogLL - test ", - "CMusUiReceiveController", - "ShowWaitDialogLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiReceiveController_ShowWaitDialogLL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/mmshui/tsrc/ut_ui/src/ut_musuistartcontroller.cpp --- a/mmsharing/mmshui/tsrc/ut_ui/src/ut_musuistartcontroller.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "ut_musuistartcontroller.h" -#include "musuistartcontroller.h" - -#include "musuidefinitions.h" -#include "musmanagercommon.h" - -#include "musuieventobserveradapter.h" - -#include - - -// SYSTEM INCLUDES -#include -//#include -//#include - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiStartController* UT_CMusUiStartController::NewL() - { - UT_CMusUiStartController* self = UT_CMusUiStartController::NewLC(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiStartController* UT_CMusUiStartController::NewLC() - { - UT_CMusUiStartController* self = new( ELeave ) UT_CMusUiStartController(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -UT_CMusUiStartController::~UT_CMusUiStartController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Default constructor -// ----------------------------------------------------------------------------- -// -UT_CMusUiStartController::UT_CMusUiStartController() - { - // NOP - } - - -// ----------------------------------------------------------------------------- -// Second phase construct -// ----------------------------------------------------------------------------- -// -void UT_CMusUiStartController::ConstructL() - { - // The ConstructL from the base class CEUnitTestSuiteClass must be called. - // It generates the test case table. - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiStartController::SetupL() - { - iEventObserver = new (ELeave) CMusUiEventObserverAdapter(); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiStartController::Teardown() - { - - delete iEventObserver; - - // Tests are made in construction phase - // Because class implementation is constructor based - - } - - - -// TEST CASES - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiStartController::UT_CMusUiStartController_UseCasePropertyLL() - { - EUNIT_ASSERT( iEventObserver ); - - // Testing leave - RProperty::iErrorCode = KErrNotFound; - TRAPD( err, CMusUiStartController::NewL( *iEventObserver ) ); - EUNIT_ASSERT( err == KErrNotFound ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusUiStartController::UT_CMusUiStartController_SetStartViewLL() - { - EUNIT_ASSERT( iEventObserver ); - - // Testing leave - RProperty::iErrorCode = KErrNotFound; - RProperty::iIntProperty = -9999; - iEventObserver->iErrorCode = KErrNone; - TRAPD( err, CMusUiStartController::NewL( *iEventObserver ) ); - EUNIT_ASSERT( err == KErrNotFound ); - - // Testing leave - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = -9999; - iEventObserver->iErrorCode = KErrCancel; - TRAP( err, CMusUiStartController::NewL( *iEventObserver ) ); - EUNIT_ASSERT( err == KErrCancel ); - - // case default - - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = -9999; - iEventObserver->iErrorCode = KErrNone; - CMusUiStartController* scdefault = CMusUiStartController::NewL( *iEventObserver ); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EHandleExitL ); - - delete scdefault; - - // case EMusLiveVideo - - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = EMusLiveVideo; - iEventObserver->iErrorCode = KErrNone; - CMusUiStartController* sclive = CMusUiStartController::NewL( *iEventObserver ); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EActivateLocalMusViewL ); - EUNIT_ASSERT( iEventObserver->iViewId == KMusUidLiveSharingView ); - - delete sclive; - - // case EMusClipVideo - - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = EMusClipVideo; - iEventObserver->iErrorCode = KErrNone; - CMusUiStartController* scclip = CMusUiStartController::NewL( *iEventObserver ); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EActivateLocalMusViewL ); - EUNIT_ASSERT( iEventObserver->iViewId == KMusUidClipSharingView ); - - delete scclip; - - // case EMusReceive - - RProperty::iErrorCode = KErrNone; - RProperty::iIntProperty = EMusReceive; - iEventObserver->iErrorCode = KErrNone; - CMusUiStartController* screceive = CMusUiStartController::NewL( *iEventObserver ); - EUNIT_ASSERT( iEventObserver->iCalledObserver == CMusUiEventObserverAdapter::EActivateLocalMusViewL ); - EUNIT_ASSERT( iEventObserver->iViewId == KMusUidReceivingView ); - - delete screceive; - - } - - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusUiStartController, - "UT_CMusUiStartController", - "UNIT" ) - -EUNIT_TEST( - "UseCasePropertyLL - test ", - "CMusUiStartController", - "UseCasePropertyLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiStartController_UseCasePropertyLL, Teardown) - -EUNIT_TEST( - "SetStartViewLL - test ", - "CMusUiStartController", - "SetStartViewLL", - "FUNCTIONALITY", - SetupL, UT_CMusUiStartController_SetStartViewLL, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE diff -r b31261fd4e04 -r ccd8e69b5392 mmsharing/tsrc/group/bld.inf --- a/mmsharing/tsrc/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/group/bld.inf --- a/mmsharinguis_plat/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* -* 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 "../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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/group/bld.inf --- a/mmsharinguis_plat/multimedia_sharing_manager_api/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musavailabilityobserver.h --- a/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musavailabilityobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musdomainpskeys.h --- a/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musdomainpskeys.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanager.h --- a/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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, - 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanagercommon.h --- a/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanagercommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* 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 - }; - /** Contains the possible commands of MultimediaSharing. */ - enum TCommandType - { - ECommandNotDefined, - ECommandManualActivation - }; - } - -#endif // MUSMANAGERCOMMON_H - -// End of File diff -r b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/multimedia_sharing_manager_api.metaxml --- a/mmsharinguis_plat/multimedia_sharing_manager_api/multimedia_sharing_manager_api.metaxml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_manager_api/tsrc/group/bld.inf --- a/mmsharinguis_plat/multimedia_sharing_manager_api/tsrc/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_resource_api/group/bld.inf --- a/mmsharinguis_plat/multimedia_sharing_resource_api/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_resource_api/inc/musresourceproperties.h --- a/mmsharinguis_plat/multimedia_sharing_resource_api/inc/musresourceproperties.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_resource_api/multimedia_sharing_resource_api.metaxml --- a/mmsharinguis_plat/multimedia_sharing_resource_api/multimedia_sharing_resource_api.metaxml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - Multimedia Sharing Resource API - To provide properties defining the availability of required resources - c++ - mmsharing - - - - - - - - no - no - - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_settings_api/group/bld.inf --- a/mmsharinguis_plat/multimedia_sharing_settings_api/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_settings_api/inc/mussettingskeys.h --- a/mmsharinguis_plat/multimedia_sharing_settings_api/inc/mussettingskeys.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* 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 the type of privcy exchange. - Defines that how are SIP PRIVACY id handled */ - const TInt KPrivacyExchange( 0x10 ); - - enum TPrivacyExchange - { - EPrivacy = 1, - ENoPrivacy - }; - - } - - -#endif // MUSSETTINGSKEYS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmsharinguis_plat/multimedia_sharing_settings_api/multimedia_sharing_settings_api.metaxml --- a/mmsharinguis_plat/multimedia_sharing_settings_api/multimedia_sharing_settings_api.metaxml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - Multimedia Sharing Settings API - To provide permanent settings for Multimedia Sharing - c++ - mmsharing - - - - - - - - no - no - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/group/bld.inf --- a/mmshplugins/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/data/10282896.rss --- a/mmshplugins/mmcctranscoder/data/10282896.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/group/bld.inf --- a/mmshplugins/mmcctranscoder/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/group/transcoder.mmp --- a/mmshplugins/mmcctranscoder/group/transcoder.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/mcctranscoderlogs.h --- a/mmshplugins/mmcctranscoder/inc/mcctranscoderlogs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcoderaudiocodec.h --- a/mmshplugins/mmcctranscoder/inc/transcoderaudiocodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcodercodecinfo.h --- a/mmshplugins/mmcctranscoder/inc/transcodercodecinfo.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcoderimpl.h --- a/mmshplugins/mmcctranscoder/inc/transcoderimpl.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcoderimpl.inl --- a/mmshplugins/mmcctranscoder/inc/transcoderimpl.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,251 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcodersessioninfo.h --- a/mmshplugins/mmcctranscoder/inc/transcodersessioninfo.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcoderuids.hrh --- a/mmshplugins/mmcctranscoder/inc/transcoderuids.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/inc/transcodervideocodec.h --- a/mmshplugins/mmcctranscoder/inc/transcodervideocodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcoder.cpp --- a/mmshplugins/mmcctranscoder/src/transcoder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcoderaudiocodec.cpp --- a/mmshplugins/mmcctranscoder/src/transcoderaudiocodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcodercodecinfo.cpp --- a/mmshplugins/mmcctranscoder/src/transcodercodecinfo.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcoderimpl.cpp --- a/mmshplugins/mmcctranscoder/src/transcoderimpl.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,653 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcoderimplementationproxy.cpp --- a/mmshplugins/mmcctranscoder/src/transcoderimplementationproxy.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcodersessioninfo.cpp --- a/mmshplugins/mmcctranscoder/src/transcodersessioninfo.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,557 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/src/transcodervideocodec.cpp --- a/mmshplugins/mmcctranscoder/src/transcodervideocodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/data/Testt.mp4 Binary file mmshplugins/mmcctranscoder/tsrc/stubs/data/Testt.mp4 has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/data/TimerAudio.3gp Binary file mmshplugins/mmcctranscoder/tsrc/stubs/data/TimerAudio.3gp has changed diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/group/ABLD.BAT --- a/mmshplugins/mmcctranscoder/tsrc/stubs/group/ABLD.BAT Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\IPAS_Domain\IPAS_Domain\ipappsrv\multimediacommscontroller\mmcctranscoder\tsrc\stubs\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/group/bld.inf --- a/mmshplugins/mmcctranscoder/tsrc/stubs/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/group/dummytranscoder.mmp --- a/mmshplugins/mmcctranscoder/tsrc/stubs/group/dummytranscoder.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/mmcctranscoder.h --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/mmcctranscoder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedaudioclipinfo.h --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedaudioclipinfo.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.h --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,346 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.inl --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.inl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedmovie.h --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedmovie.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,601 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedvideoclipinfo.h --- a/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedvideoclipinfo.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,379 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/stubs/src/vedmovie.cpp --- a/mmshplugins/mmcctranscoder/tsrc/stubs/src/vedmovie.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,331 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/BWINS/ut_transcoderu.def --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/BWINS/ut_transcoderu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/eabi/ut_transcoderu.def --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/eabi/ut_transcoderu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/bld.inf --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 -ut_transcoder.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/ut_transcoder.mmp --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/ut_transcoder.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include - -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoder.h --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoderimpl.h --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoderimpl.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscodersessioninfo.h --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscodersessioninfo.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoder.cpp --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoderimpl.cpp --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoderimpl.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,681 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscodersessioninfo.cpp --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscodersessioninfo.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_transcoderdllmain.cpp --- a/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_transcoderdllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/data/10282389.rss --- a/mmshplugins/mmshaiwplugin/data/10282389.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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; - } - }; - } - }; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/data/musaiwprovider.rss --- a/mmshplugins/mmshaiwplugin/data/musaiwprovider.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/group/bld.inf --- a/mmshplugins/mmshaiwplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/group/musaiwprovider.mmp --- a/mmshplugins/mmshaiwplugin/group/musaiwprovider.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/inc/musaiwprovider.h --- a/mmshplugins/mmshaiwplugin/inc/musaiwprovider.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* 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 ShowErrorNoteL( TInt aError ); - - HBufC* ErrorNoteTextLC( TInt aError ); - - HBufC8* ErrorNoteText8L( TInt aError, RResourceFile& aResourceFile ); - - void DoInitialiseL(); - - void DoInitializeMenuPaneL( CAiwMenuPane& aMenuPane, TInt aIndex ); - - -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/inc/musaiwprovider.hrh --- a/mmshplugins/mmshaiwplugin/inc/musaiwprovider.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/src/musaiwprovider.cpp --- a/mmshplugins/mmshaiwplugin/src/musaiwprovider.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,558 +0,0 @@ -/* -* 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 - -#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 - -//////// 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 */ ) - { - FeatureManager::InitializeLibL(); - TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); - FeatureManager::UnInitializeLib(); - if( support ) - { - DoInitializeMenuPaneL( aMenuPane, aIndex ); - } - } - - -// ----------------------------------------------------------------------------- -// Initializes menu pane by adding provider-specific menu items. -// ----------------------------------------------------------------------------- -// -void CMusAiwProvider::DoInitializeMenuPaneL( - CAiwMenuPane& aMenuPane, - TInt aIndex) - { - MUS_LOG1( "mus: [AIWPRO] -> CMusAiwProvider::DoInitializeMenuPaneL( %d )", - aIndex ) - - if( iResourceFileName == NULL ) - { - iResourceFileName = MusResourceFinderUtil::ResourcePathL( - KMusAiwProviderResource ); - } - TFileName filename ( *iResourceFileName ); - MUS_LOG_TDESC( "mus: [AIWPRO] Resource filename: ", filename ) - - if( ApplicationRunningL() ) - { - 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 - { - NoVariationStartUpL( filename, aMenuPane, aIndex ); - } - } - - - MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::DoInitializeMenuPaneL" ) - } - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -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 ( iAvailability == MultimediaSharing::ESipRegistrationPending || - iAvailability == MultimediaSharing::ESipOptionsSent || - iAvailability == MultimediaSharing::EMultimediaSharingAvailable || - iAvailability == MultimediaSharing::EErrCallOnHold || - iAvailability == MultimediaSharing::EErrConferenceCall || - iAvailability == MultimediaSharing::ESipOptionsNotCapable || - iAvailability == MultimediaSharing::ESipOptionsNotSent || - iAvailability == MultimediaSharing::EErrNetwork || - iAvailability == MultimediaSharing::EManualActivation || - iAvailability == MultimediaSharing::EErrConnection || - iAvailability == MultimediaSharing::EErrSipRegistration ) - { - 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" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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, manager->StartApplicationL( - MultimediaSharing::EMusLiveVideo ) ); - break; - } - case EMusCommandClipShare: - { - MUS_LOG( "mus: [AIWPRO] \ - EMusCommandClipShare: Will now attempt to start Mus." ) - TRAP( error, manager->StartApplicationL( - MultimediaSharing::EMusClipVideo ) ); - break; - } - case EMusCommandImageShare: - { - MUS_LOG( "mus: [AIWPRO] \ - EMusCommandImageShare: Will now attempt to start Mus." ) - TRAP( error, manager->StartApplicationL( - MultimediaSharing::EMusStillImage ) ); - break; - } - case EMusCommandContinue: - { - MUS_LOG( "mus: [AIWPRO] \ - EMusCommandContinue: Will now attempt to start/continue Mus." ) - TRAP( error, manager->StartApplicationL( - 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" ) - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/src/musaiwprovidermain.cpp --- a/mmshplugins/mmshaiwplugin/src/musaiwprovidermain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BMARM/ut_aopluginu.def --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BMARM/ut_aopluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BWINS/ut_musaiwprovideru.def --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BWINS/ut_musaiwprovideru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/EABI/ut_musaiwprovideru.def --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/EABI/ut_musaiwprovideru.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/bld.inf --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_TESTMMPFILES -ut_musaiwprovider.mmp - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/ut_musaiwprovider.mmp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/ut_musaiwprovider.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// 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/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 - - -USERINCLUDE ../inc -USERINCLUDE ../../../inc -USERINCLUDE ../../../../../tsrc/musmanagerstub/inc -USERINCLUDE ../../../../../tsrc/ututils/inc -USERINCLUDE ../../../../../inc -USERINCLUDE ../../../../../tsrc/Apastub/inc -USERINCLUDE ../../../../../tsrc/resourcefilestub/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 - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/musaiwproviderstubs.h --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/musaiwproviderstubs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwprovider.h --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwprovider.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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; - -/** - * 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_InitializeMenuPaneL7L(); - - - void UT_CMusAiwProvider_HandleMenuCmdLL(); - void UT_CMusAiwProvider_ApplicationRunningLL(); - void UT_CMusAiwProvider_ShowErrorNoteLL(); - void UT_CMusAiwProvider_ErrorNoteTextLCL(); - void UT_CMusAiwProvider_ErrorNoteText8LL(); - void UT_ImplementationGroupProxyL(); - - - private: // data - - CMusAiwProvider* iProvider; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // MUSAIWPROVIDERTEST_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwresourcefinder.h --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwresourcefinder.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwproviderstubs.cpp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwproviderstubs.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -//#include "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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwresourcefinderstub.cpp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwresourcefinderstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwprovider.cpp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwprovider.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1087 +0,0 @@ -/* -* 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 -#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" -#define MUS_MEMORY_LEAVE_CHECKING_ON - -#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" ); - -_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 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusAiwProvider::Teardown( ) - { - delete iProvider; - } - - -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -// - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 = 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 ); - - // 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 = 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 ); - - // 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 = 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 ); - - // 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 = 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 ); - - // 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 = 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 ); - - // 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 = 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 ); - - // 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_InitializeMenuPaneL7L() - { - - RFs fs; - User::LeaveIfError( fs.Connect() ); - - CleanupClosePushL( fs ); - - BaflUtils::CopyFile( fs, KMusAiwProviderResource(), - KResourceFilenameRom() ); - - CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); - - 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 ); - - // 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 "Mush not supported" - FeatureManager::MultimediaSharingNotSupported(); - CMusManager::SetAvailability( MultimediaSharing::EMultimediaSharingAvailable ); - menuPaneCount = eikPane->NumberOfItemsInPane(); - iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); - MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount ) - FeatureManager::MultimediaSharingSupported(); - - // set camera support on - FeatureManager::CameraSupported(); - 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 ); - EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusClipVideo ) - - iProvider->HandleMenuCmdL( EMusCommandImageShare, *pl, *pl, 0, this ); - EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusStillImage ) - - iProvider->HandleMenuCmdL( EMusCommandContinue, *pl, *pl, 0, this ); - 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_ApplicationRunningLL() - { - // Stub returns EFalse as default - 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 ); - } - - - - -// 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 - test7", - "CMusAiwProvider", - "InitializeMenuPaneL", - "FUNCTIONALITY", - SetupL, UT_CMusAiwProvider_InitializeMenuPaneL7L, Teardown) - -EUNIT_TEST( - "HandleMenuCmdL - test", - "CMusAiwProvider", - "HandleMenuCmdL", - "FUNCTIONALITY", - SetupL, UT_CMusAiwProvider_HandleMenuCmdLL, 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_END_TEST_TABLE - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwproviderdllmain.cpp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwproviderdllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwresourcefinder.cpp --- a/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwresourcefinder.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/data/musaoplugin.rss --- a/mmshplugins/mmshaoplugin/data/musaoplugin.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/group/bld.inf --- a/mmshplugins/mmshaoplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/group/musaoplugin.mmp --- a/mmshplugins/mmshaoplugin/group/musaoplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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 musclirmonitor.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 etel3rdparty.lib - -// MultimediaSharing libraries: -LIBRARY musmanagerclient.lib -LIBRARY featmgr.lib - -DEBUGLIBRARY flogger.lib - -PAGED diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/mmusptteventobserver.h --- a/mmshplugins/mmshaoplugin/inc/mmusptteventobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/mmustsypropertyobserver.h --- a/mmshplugins/mmshaoplugin/inc/mmustsypropertyobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/musaoplugin.h --- a/mmshplugins/mmshaoplugin/inc/musaoplugin.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* 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" - -// 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: - - /** - * 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(); - -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); - -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 - - /* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/musaoplugin.hrh --- a/mmshplugins/mmshaoplugin/inc/musaoplugin.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallconferenceeventmonitor.h --- a/mmshplugins/mmshaoplugin/inc/muscallconferenceeventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallconferencemonitor.h --- a/mmshplugins/mmshaoplugin/inc/muscallconferencemonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* 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(); - - 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 ) - - }; - -#endif // MUSCALLCONFERENCEMONITOR_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscalleventmonitor.h --- a/mmshplugins/mmshaoplugin/inc/muscalleventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 -#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 ); - - /** - * Destructor. - */ - ~CMusCallEventMonitor(); - - private: - - /** - * C++ constructor. - */ - CMusCallEventMonitor( const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver ); - - /** - * 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallmonitor.h --- a/mmshplugins/mmshaoplugin/inc/muscallmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* 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 -#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 ); - - /** - * 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); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallmonitorbase.h --- a/mmshplugins/mmshaoplugin/inc/muscallmonitorbase.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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 -#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 ); - - - protected: - - /** - * C++ constructor. - */ - CMusCallMonitorBase( const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver ); - - /** - * Notify observer that our state changed - */ - virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal ); - - /** - * Inspect the dialled number and set the PS key controlling whether - * to add Privacy-header accordingly. - */ - void SetClirSetting( const TDesC& aDialledNumber ) const; - - /** - * Should set the privacy ps key to on off based on incoming cs call privacy settings. - * aCallInfo : Callinfo package read from current cs call. - */ - void SetTerminatingPrivacy( const RMobileCall& aCall ) const; - - /** - * Removes privacy prefix away from phone number - * @return returns dialed number witout prefix. - */ - HBufC* RemovePrefix( const TDesC& aOriginator ) const; - - 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; - - MUS_UNITTEST( UT_CMusCallMonitor ) - MUS_UNITTEST( UT_CMusCallEventMonitor ) - MUS_UNITTEST( UT_CMusCallStatusMonitor ) - MUS_UNITTEST( UT_CMusCallMonitorBase ) - }; - -#endif // MUSAOCALLMONITORBASE_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallstatusmonitor.h --- a/mmshplugins/mmshaoplugin/inc/muscallstatusmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 -#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 ); - - /** - * Destructor. - */ - ~CMusCallStatusMonitor(); - - private: - - /** - * C++ constructor. - */ - CMusCallStatusMonitor(const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver ); - - /** - * 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muscallstatusmonitorobserver.h --- a/mmshplugins/mmshaoplugin/inc/muscallstatusmonitorobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/musclirmonitor.h --- a/mmshplugins/mmshaoplugin/inc/musclirmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitor that observes the calling line identity restriction -* setting -* -*/ - - - -#ifndef MUSCLIRMONITOR_H -#define MUSCLIRMONITOR_H - -#include "musunittesting.h" - -#include -#include -#include - - -/** - * Monitor, which observes status of CLIR setting that controls whether the - * caller's phone number/id is shown to the called party. - * - * @lib musaoplugin.dll - */ -class CMusClirMonitor : public CActive - { - - public: // constructors and destructor - - /** - * Two-phased constructor. Leaves on failure. - */ - static CMusClirMonitor* NewL(); - - /** - * Destructor. - */ - ~CMusClirMonitor(); - - - public: // API - - /** - * Starts the asynchronous reading of CLIR setting. When reading - * completes, the PS key is updated. - */ - void ReadClir(); - - private: - - /** - * C++ constructor. - */ - CMusClirMonitor(); - - private: // functions from base class CActive - - void ConstructL(); - - void RunL(); - - void DoCancel(); - - TInt RunError( TInt aError ); - - void TranslateResult( CTelephony::TIdentityServiceStatus aResult ); - - private: // Data - - CTelephony* iTelephony; //owned - CTelephony::TIdentityServiceV1 iTIdentityServiceV1; - CTelephony::TIdentityServiceV1Pckg iTIdentityServiceV1Pckg; - - // Tells if phone's number/id is allowed to be sent to the remove party - TBool iAllowed; - - // How many times RunL has been completed with an error in a row - TInt iErrorCount; - - MUS_UNITTEST( UT_CMusClirMonitor ) - - }; - -#endif // MUSCLIRMONITOR_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muspropertymonitor.h --- a/mmshplugins/mmshaoplugin/inc/muspropertymonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* 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 -#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(); - - /** - * Destructor. - */ - ~CMusPropertyMonitor(); - - private: - - /** - * C++ constructor. - */ - CMusPropertyMonitor(); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - - /** - * Starts Mus Manager Client.In turn it will start Mus Manager - * Server and Availability Plugin. - */ - void StartMusClientL(); - - /* - * Stops Mus Manager Client. - */ - void StopMusClient(); - - - 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; - - /** - * Instance of MusManager Client. Owned. - */ - CMusManager* iManager; - - MUS_UNITTEST( UT_CMusPropertyMonitor ) - - }; - -#endif // MUSPROPERTYMONITOR_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/muspttcallmonitor.h --- a/mmshplugins/mmshaoplugin/inc/muspttcallmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/inc/mustsypropertymonitor.h --- a/mmshplugins/mmshaoplugin/inc/mustsypropertymonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* 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 - -#include "musunittesting.h" -#include "mussesseioninformationapi.h" -#include "mmustsypropertyobserver.h" -// Enable the below line if Kodiak Ptt has to be monitered -// #include "mmusptteventobserver.h" -#include -#include -#include - -class CMusCallMonitor; -class CMusPTTCallMonitor; -class CMusCallConferenceMonitor; -class CMusClirMonitor; - -/** - * 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 ); - - /** - * Destructor. - */ - ~CMusTsyPropertyMonitor(); - - /* - * Returns the current call object. - */ - - const RCall& Call(); - - /** - * Function from MMusTsyPropertyObserver - */ - void NotifyCallStateChanged(NMusSessionInformationApi::TMusCallEvent aVal, TName& aCallName); - - private: - - /** - * C++ constructor. - */ - CMusTsyPropertyMonitor( RMobilePhone& aPhone ); - - /** - * 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(); - - /** - * 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; - - /** - * Conference call monitor, owned. - */ - CMusCallConferenceMonitor* iConferenceMonitor; - - /** - * Instance of RProperty. - */ - RProperty iPropertyEvent; - - CMusClirMonitor* iClirMonitor; - - - MUS_UNITTEST( UT_CMusTsyPropertyMonitor ) - - }; - -#endif // MUSTSYPROPERTYMONITOR_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/musaoplugin.cpp --- a/mmshplugins/mmshaoplugin/src/musaoplugin.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* -* 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 "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 -#include - -using namespace NMusSessionInformationApi; - -// ----------------------------------------------------------------------------- -// 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" ) - FeatureManager::InitializeLibL(); - TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); - FeatureManager::UnInitializeLib(); - if ( support ) - { - DefinePropertiesL(); - User::LeaveIfError( iServer.Connect() ); - User::LeaveIfError( iPhone.Open( iServer, KMmTsyPhoneName() ) ); - iTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL(iPhone); - iPropertyMonitor = CMusPropertyMonitor::NewL(); - // 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 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); - DefinePropertyL(NMusSessionInformationApi::KMUSPrivacy, - RProperty::EInt,( TInt ) NMusSessionInformationApi::EPrivacyOff); - DefinePropertyL(KMusClirSetting, - RProperty::EInt,( TInt ) ESendOwnNumber); - - - 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::KMUSForbidden); - DeleteProperty(NMusSessionInformationApi::KMusCallDirection); - DeleteProperty(NMusSessionInformationApi::KMUSPrivacy); - DeleteProperty(KMusClirSetting); - 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;; - } - - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/musaopluginmain.cpp --- a/mmshplugins/mmshaoplugin/src/musaopluginmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscallconferenceeventmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muscallconferenceeventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscallconferencemonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muscallconferencemonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -/* -* 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") - } - -// End of file - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscalleventmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muscalleventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* 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 ) - { - MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::NewL" ) - CMusCallEventMonitor* self = new (ELeave) CMusCallEventMonitor(aCall, aObserver); - 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 ) - : CMusCallMonitorBase(aCall, aObserver) - - { - - } - - -// ----------------------------------------------------------------------------- -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscallmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muscallmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* 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) - { - MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::StartMonitorL" ) - if(IsMonitored())User::Leave(KErrAlreadyExists); - User::LeaveIfError( iCall.OpenExistingCall( aLine, iCallName ) ); - iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, aObserver ); - iCallEventMonitor = CMusCallEventMonitor::NewL( iCall, aObserver ); - - 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 ); - } - - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscallmonitorbase.cpp --- a/mmshplugins/mmshaoplugin/src/muscallmonitorbase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,323 +0,0 @@ -/* -* 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 "mussettings.h" - -#include -#include -#include -#include -#include - -_LIT( KDoNotSendOwnNumber, "#31#" ); -_LIT( KDoSendOwnNumber, "*31#" ); - - -// ----------------------------------------------------------------------------- -// 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 ) - : CActive( EPriorityNormal ),iCall(aCall),iTsyObserver( aObserver ) - - { - // 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 ) - /* - * 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. - */ - 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 )); - } - if( aVal != NMusSessionInformationApi::ENoCall) - { - RMobileCall::TMobileCallInfoV3 callInfo; - RMobileCall::TMobileCallInfoV3Pckg pckg( callInfo ); - - User::LeaveIfError(iCall.GetMobileCallInfo( pckg )); - if( callInfo.iEmergency ) - { - User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - ( TInt ) NMusSessionInformationApi::ENoCall )); - } - } - /* - If Call is Connected then set the Call info. - */ - if( aVal==NMusSessionInformationApi::ECallConnected ) - { - SetCallInfoL(); - } - - } - - 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 ); - HBufC* cleanTelNo( NULL ); - if( remoteNumber.iTelNumber.Length() > 0 ) - { - MUS_LOG( "mus: [MUSAO] remoteNumber.iTelNumber.Lenght > 0" ) - telNo = remoteNumber.iTelNumber.AllocLC(); - } - else - { - MUS_LOG( "mus: [MUSAO] remoteNumber.iTelNumber.Lenght =< 0" ) - RMobilePhone::TMobileAddress dialledParty = callInfo.iDialledParty; - telNo = dialledParty.iTelNumber.AllocLC(); - - } - if ( MultimediaSharingSettings::PrivacySetting() ) - { - SetClirSetting( *telNo ); - } - cleanTelNo = RemovePrefix( *telNo ); - CleanupStack::PushL( cleanTelNo ); - - User::LeaveIfError(RProperty::Set( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusTelNumber, - *cleanTelNo )); - MUS_LOG_TDESC("mus: [MUSAO] telNo = ", (*cleanTelNo)) - CleanupStack::PopAndDestroy(cleanTelNo); - 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 ) - { - SetTerminatingPrivacy( iCall ); - User::LeaveIfError(RProperty::Set( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallDirection, - ( TInt ) NMusSessionInformationApi::ECallTerminated )); - } - else - { - User::LeaveIfError(RProperty::Set( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallDirection, - ( TInt ) NMusSessionInformationApi::ENoDirection )); - } - - - 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 ); - } - -// -------------------------------------------------------------------------- -// void CMusCallMonitorBase::SetClirSetting() -// Determine CLIR setting from dialled digits -// -------------------------------------------------------------------------- -// -void CMusCallMonitorBase::SetClirSetting( const TDesC& aDialledNumber ) const - { - MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::SetClirSetting" ); - - NMusSessionInformationApi::TMusClirSetting - sendNumber( NMusSessionInformationApi::ESendOwnNumber ); - - TPtrC prefix = aDialledNumber.Left( KDoNotSendOwnNumber().Length() ); - if ( prefix == KDoNotSendOwnNumber() ) - { - sendNumber = NMusSessionInformationApi::EDoNotSendOwnNumber; - } - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, sendNumber ); - MUS_LOG1( "mus: [MUSAO] <- CMusCallMonitorBase::SetClirSetting send nbr=%d", - sendNumber == NMusSessionInformationApi::ESendOwnNumber ); - } - - -// -------------------------------------------------------------------------- -// void CMusCallMonitorBase::RemovePrefix() -// -------------------------------------------------------------------------- -// -HBufC* CMusCallMonitorBase::RemovePrefix( const TDesC& aOriginator ) const - { - MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::removePrefix" ); - - HBufC * withoutPrefix(NULL); - - TPtrC prefix = aOriginator.Left( KDoNotSendOwnNumber().Length() ); - if ( prefix == KDoNotSendOwnNumber()|| prefix == KDoSendOwnNumber() ) - { - MUS_LOG( "Number have a prefix" ); - withoutPrefix = aOriginator.AllocL(); - *withoutPrefix = aOriginator; - TPtr ptr = withoutPrefix->Des(); - ptr.Delete(0,KDoNotSendOwnNumber().Length()); - } - else - { - withoutPrefix = aOriginator.AllocL(); - } - - MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::RemovePrefix" ); - return withoutPrefix; - } - - -// -------------------------------------------------------------------------- -// void CMusCallMonitorBase::SetTerminatingPrivacy() -// -------------------------------------------------------------------------- -// -void CMusCallMonitorBase::SetTerminatingPrivacy( const RMobileCall& aCall ) const - { - MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::SetTerminatingPrivacy" ) - RMobileCall::TMobileCallInfoV3 callInfo; - RMobileCall::TMobileCallInfoV3Pckg callInfoPckg( callInfo ); - if( aCall.GetMobileCallInfo( callInfoPckg ) != KErrNone ) - { - return; // error cannot do - } - MUS_LOG( "mus: [MUSAO] Get remote status" ) - RMobileCall::TMobileCallRemoteIdentityStatus remoteStatus = - callInfo.iRemoteParty.iRemoteIdStatus; - - if( remoteStatus == RMobileCall::ERemoteIdentitySuppressed ) - { - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - ( TInt ) NMusSessionInformationApi::EPrivacyOn ); - } - else - { - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - ( TInt ) NMusSessionInformationApi::EPrivacyOff ); - } - MUS_LOG1( "mus: [MUSAO] Remote status = %d",remoteStatus ) - MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::SetTerminatingPrivacy" ) - } - -// End of file - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muscallstatusmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muscallstatusmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* 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 ) - { - MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::NewL" ) - CMusCallStatusMonitor* self = - new( ELeave )CMusCallStatusMonitor( aCall, aObserver ); - 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 ) - : CMusCallMonitorBase( aCall, aObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/musclirmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/musclirmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitor that observes the calling line identity restriction -* setting -* -*/ - - -#include "musclirmonitor.h" -#include "muslogger.h" -#include "mussesseioninformationapi.h" -#include -#include - -const TInt KMaxErrorsBeforeStop = 5; - -using namespace NMusSessionInformationApi; - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::NewL -// ----------------------------------------------------------------------------- -// -CMusClirMonitor* CMusClirMonitor::NewL() - { - MUS_LOG( "mus: [CALLMN] -> CMusClirMonitor::NewL" ) - - CMusClirMonitor* self = new (ELeave) CMusClirMonitor; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::NewL" ) - return self; - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::~CMusClirMonitor -// ----------------------------------------------------------------------------- -// -CMusClirMonitor::~CMusClirMonitor() - { - MUS_LOG( "mus: [CALLMN] -> CMusClirMonitor::~CMusClirMonitor" ) - - Cancel(); - delete iTelephony; - - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::~CMusClirMonitor" ) - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::CMusClirMonitor -// Read the parameter's current value -// ----------------------------------------------------------------------------- -// -CMusClirMonitor::CMusClirMonitor() : - CActive( EPriorityNormal ), - iTIdentityServiceV1Pckg( iTIdentityServiceV1 ), - iAllowed( ETrue ), - iErrorCount( 0 ) - { - MUS_LOG( "mus: [CALLMN] -> CMusClirMonitor::CMusClirMonitor" ) - - CActiveScheduler::Add( this ); - - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::CMusClirMonitor" ) - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::ConstructL -// ----------------------------------------------------------------------------- -// -void CMusClirMonitor::ConstructL() - { - iTelephony = CTelephony::NewL(); - ReadClir(); // Read the initial value - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::RunL -// ----------------------------------------------------------------------------- -// -void CMusClirMonitor::RunL() - { - MUS_LOG1( "mus: [CALLMN] -> CMusClirMonitor::RunL iStatus=%d", - iStatus.Int() ) - - if ( iStatus == KErrNone ) - { - TranslateResult( iTIdentityServiceV1.iIdentityStatus ); - iErrorCount = 0; - } - else - { - ++iErrorCount; - MUS_LOG1( "mus: [CALLMN] Failed, error count(%d)", iErrorCount ) - - // If reading fails, retry few times - if ( iErrorCount <= KMaxErrorsBeforeStop ) - { - ReadClir(); - } - } - - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::RunL" ) - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::DoCancel -// ----------------------------------------------------------------------------- -// -void CMusClirMonitor::DoCancel() - { - MUS_LOG( "mus: [CALLMN] -> CMusClirMonitor::DoCancel" ) - - iTelephony->CancelAsync( CTelephony::EGetIdentityServiceStatusCancel ); - - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::DoCancel" ) - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::RunError -// Ignore errors and continue -// ----------------------------------------------------------------------------- -// -TInt CMusClirMonitor::RunError( TInt aError ) - { - MUS_LOG1( "mus: [CALLMN] <-> CMusClirMonitor::RunError aError %d", aError ) - aError = KErrNone; // Get rid of "aError is not used" warning in UREL - return aError; - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::ReadClir -// ----------------------------------------------------------------------------- -// -void CMusClirMonitor::ReadClir() - { - MUS_LOG( "mus: [CALLMN] -> CMusClirMonitor::ReadClir" ) - - if ( !IsActive( )) - { - CTelephony::TIdentityService condition = - CTelephony::EIdServiceCallerRestriction; - iTelephony->GetIdentityServiceStatus( iStatus, - condition, - iTIdentityServiceV1Pckg ); - SetActive(); - } - - MUS_LOG( "mus: [CALLMN] <- CMusClirMonitor::ReadClir" ) - } - - -// ----------------------------------------------------------------------------- -// CMusClirMonitor::TranslateResult -// ----------------------------------------------------------------------------- -// -void -CMusClirMonitor::TranslateResult( CTelephony::TIdentityServiceStatus aResult ) - { - MUS_LOG1( "mus: [CALLMN] -> CMusClirMonitor::TranslateResult aResult=%d", - aResult ) - - switch ( aResult ) - { - case CTelephony::EIdServiceActivePermanent: - case CTelephony::EIdServiceActiveDefaultRestricted: - iAllowed = EFalse; - break; - - case CTelephony::EIdServiceActiveDefaultAllowed: - case CTelephony::EIdServiceNotProvisioned: - iAllowed = ETrue; - break; - - case CTelephony::EIdServiceUnknown: - default: - ; // retain current value - } - - TMusClirSetting sendNumber( EDoNotSendOwnNumber ); - if ( iAllowed ) - { - sendNumber = ESendOwnNumber; - } - RProperty::Set( KCategoryUid, KMusClirSetting, sendNumber ); - - MUS_LOG1( "mus: [CALLMN] <- CMusClirMonitor::TranslateResult allowed=%d", - iAllowed ) - } - -// end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muspropertymonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muspropertymonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* 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 "musmanager.h" -#include "mussesseioninformationapi.h" -#include "muslogger.h" - - -// ----------------------------------------------------------------------------- -// Symbian two-phase constructor. -// ----------------------------------------------------------------------------- -// -CMusPropertyMonitor* CMusPropertyMonitor::NewL() - { - MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::NewL" ) - CMusPropertyMonitor* self = new (ELeave) CMusPropertyMonitor(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::NewL" ) - return self; - } - -// ----------------------------------------------------------------------------- -// C++ constructor. -// ----------------------------------------------------------------------------- -// -CMusPropertyMonitor::CMusPropertyMonitor() - :CActive( EPriorityNormal ) - { - } - -// ----------------------------------------------------------------------------- -// 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(); - delete iManager; - 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(); - TInt value = NMusSessionInformationApi::ENoCall; - User::LeaveIfError(iPropertyEvent.Get( value )); - switch(value) - { - /* CallHold and ConferenceCall are Error Cases.Will be handled by - Availability Plugin and Inform to AIW. - */ - case NMusSessionInformationApi::ECallHold: - MUS_LOG( "mus: [MUSAO] CallEvent = ECallHold" ) - break; - case NMusSessionInformationApi::EConferenceCall: - MUS_LOG( "mus: [MUSAO] CallEvent = EConferenceCall" ) - break; - /* When Call is connected , start the MusClient */ - case NMusSessionInformationApi::ECallConnected: - MUS_LOG( "mus: [MUSAO] CallEvent = ECallConnected" ) - StartMusClientL(); - break; - /* When Call is disconnected , stop the MusClient */ - case NMusSessionInformationApi::ENoCall: - MUS_LOG( "mus: [MUSAO] CallEvent = ENoCall" ) - StopMusClient(); - break; - default: - MUS_LOG( "mus: [MUSAO] CallEvent = default. Treated ENoCall" ) - StopMusClient(); - } - 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::StartMusClient() -// This will start the MusManager Client which inturn should start -// MusManager Server and Availability Plugin. -// ----------------------------------------------------------------------------- -// -void CMusPropertyMonitor::StartMusClientL() - { - MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::StartMusClient" ) - if( !iManager ) - { - iManager = CMusManager::NewL(); - } - iManager->ExamineAvailabilityL(); - MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::StartMusClient" ) - } - -// ----------------------------------------------------------------------------- -// CMusPropertyMonitor::StopMusClient() -// This will stop the MusManager Client which inturn should stop -// MusManager Server and Availability Plugin. -// ----------------------------------------------------------------------------- -// -void CMusPropertyMonitor::StopMusClient() - { - MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::StopMusClient" ) - if( iManager ) - { - delete iManager; - iManager = NULL; - } - MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::StopMusClient" ) - - } - -// ----------------------------------------------------------------------------- -// 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 ) - if( iManager ) - { - delete iManager; - iManager = NULL; - } - aError = KErrNone; // We handled this error already. So return KErrNone. - MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::RunError " ) - return aError; - } - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/muspttcallmonitor.cpp --- a/mmshplugins/mmshaoplugin/src/muspttcallmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/src/mustsypropertymonitor.cpp --- a/mmshplugins/mmshaoplugin/src/mustsypropertymonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,452 +0,0 @@ -/* -* 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 "muslogger.h" -#include "mussettings.h" -#include "musclirmonitor.h" - -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// Symbian two-phase constructor. -// ----------------------------------------------------------------------------- -// -CMusTsyPropertyMonitor* CMusTsyPropertyMonitor::NewL( RMobilePhone& aPhone ) - { - MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::NewL" ) - CMusTsyPropertyMonitor* self = new (ELeave) CMusTsyPropertyMonitor(aPhone); - 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; - delete iClirMonitor; - iCallMonitorArray.ResetAndDestroy(); - 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); - - if (MultimediaSharingSettings::PrivacySetting()) - { - iClirMonitor = CMusClirMonitor::NewL(); - } - - User::LeaveIfError( iPropertyEvent.Attach( - KPSUidCtsyCallInformation, - KCTsyCallState ) ); - iPropertyEvent.Subscribe( iStatus ); - SetActive(); - MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::ConstructL" ) - } - -// ----------------------------------------------------------------------------- -// C++ constructor. -// ----------------------------------------------------------------------------- -// -CMusTsyPropertyMonitor::CMusTsyPropertyMonitor(RMobilePhone& aPhone) - : CActive( EPriorityNormal ),iPhone(aPhone) - { - } - -// ----------------------------------------------------------------------------- -// 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(); - TInt value = EPSCTsyCallStateUninitialized; - User::LeaveIfError(iPropertyEvent.Get( value )); - MUS_LOG1( "mus: [MUSAO] iTsyCallMonitor->CallState = %d",value ) - switch(value) - { - case EPSCTsyCallStateNone: - SetStateL(NMusSessionInformationApi::ENoCall); - // Sometimes disconnected call goes stright to this state - // so we have to call this function to remove call monitors. - RemoveAllCallMonitor(); - break; - case EPSCTsyCallStateDisconnecting: - case EPSCTsyCallStateAnswering: - case EPSCTsyCallStateConnected: - case EPSCTsyCallStateHold: - // in all above states if multible call exist then - // we have to find all the calls state and do accordingly. - MonitorCallL(); - 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 ) - { - if ( iClirMonitor ) - { - //Start async reading of CLIR from phone settings - iClirMonitor->ReadClir(); - } - - CMusCallMonitor* callMonitor = CMusCallMonitor::NewL( aCallName, - IsPttCallExist() ); - CleanupStack::PushL( callMonitor ); - iCallMonitorArray.AppendL( callMonitor ); - CleanupStack::Pop( callMonitor ); - callMonitor->StartMonitorL(iLine, *this); - } - 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() -// Monitors the call and if needed adds/removes call monitor. -// ----------------------------------------------------------------------------- -// -void CMusTsyPropertyMonitor::MonitorCallL() - { - 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 1) - { - // 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::MonitorCallL") - } - - -// ----------------------------------------------------------------------------- -// 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" ) - } -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BMARM/ut_aopluginu.def --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BMARM/ut_aopluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BWINS/ut_aopluginu.def --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BWINS/ut_aopluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/EABI/ut_aopluginu.def --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/EABI/ut_aopluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/bld.inf --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_TESTMMPFILES -ut_aoplugin.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/ut_aoplugin.mmp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/ut_aoplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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_musclirmonitor.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 musclirmonitor.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 -SOURCEPATH ../../../../../tsrc/featmgrstub/src -SOURCE FeatMgr.cpp - -USERINCLUDE ../../../../../tsrc/featmgrstub/inc -USERINCLUDE ../inc -USERINCLUDE ../../../../../tsrc/propertystub/inc -USERINCLUDE ../../../../../tsrc/etelstub/inc -USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc - -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../../../../../inc -SYSTEMINCLUDE ../../../../../tsrc/etelstub/inc -SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc -SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc -SYSTEMINCLUDE ../../../../../tsrc/musmanagerstub/inc - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY connmon.lib -LIBRARY ecom.lib -LIBRARY eunit.lib -LIBRARY euser.lib -LIBRARY bafl.lib -LIBRARY efsrv.lib -LIBRARY etel3rdparty.lib - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/muscommonstubs.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/muscommonstubs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* 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 ); - void CallHoldL( const TDesC& aTelNumber ); - 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; - - HBufC* iTelNumber; - RMobileCall::TMobileCallEvent iCallEvent; - - - }; - - - - -#endif // UT_MUSCOMMONSTUBS_H - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaocalleventmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaocalleventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* 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 ); - - virtual void CallHoldL( const TDesC& aTelNumber ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaoplugin.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaoplugin.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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 NewLL(); - void DefinePropertiesLL(); - void DefinePropertyL_IntPropertyL(); - void DefinePropertyL_DesCPropertyL(); - void DeletePropertiesL(); - - void UT_HandleServerCommandLL(); - -private: // data - - CMusAoPlugin* iPlugin; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // MUSAOPLUGINTEST_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferenceeventmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferenceeventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferencemonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferencemonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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(); - - private: // Data - - CMusCallConferenceMonitor* iConferenceCallMonitor; - RMobilePhone iMobilePhone; - RMobileLine iLine; - RPointerArray iCallMonitorArray; - - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_CMusCallConferenceMonitor_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscalleventmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscalleventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusCallEventMonitor_H__ -#define __UT_CMusCallEventMonitor_H__ - - -// EXTERNAL INCLUDES -#include -#include -#include "etelmm.h" -#include "mussesseioninformationapi.h" -#include "mmustsypropertyobserver.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 - { - 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 ); - - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusCallMonitor_H__ -#define __UT_CMusCallMonitor_H__ - - -// EXTERNAL INCLUDES -#include -#include -#include "etelmm.h" -#include "mussesseioninformationapi.h" -#include "mmustsypropertyobserver.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 - { - 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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitorbase.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitorbase.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusCallMonitorBase_H__ -#define __UT_CMusCallMonitorBase_H__ - - -// EXTERNAL INCLUDES -#include -#include -#include "etelmm.h" -#include "muscallmonitorbase.h" -#include "mussesseioninformationapi.h" -#include "mmustsypropertyobserver.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 ); - ~CMusCallMonitorMock(); - - private: - - void RunL(); - void DoCancel(); - }; - - - -// CLASS DEFINITION -/** - * Tester class for CMusCallMonitorBase. - * - */ -NONSHARABLE_CLASS( UT_CMusCallMonitorBase ): public CEUnitTestSuiteClass, - MMusTsyPropertyObserver - { - 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 ); - - - 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_SetClirSettingL(); - void UT_SetTerminatingPrivacyL(); - void UT_RemovePrefixL(); - - - private: // Data - CMusCallMonitorBase* iCallMonitorBase; - RMobileCall iCall; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_CMusCallMonitorBase_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallstatusmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallstatusmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusCallStatusMonitor_H__ -#define __UT_CMusCallStatusMonitor_H__ - - -// EXTERNAL INCLUDES -#include -#include -#include "etelmm.h" -#include "mussesseioninformationapi.h" -#include "mmustsypropertyobserver.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 - { - 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 ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musconferencecallmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musconferencecallmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muslineeventmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muslineeventmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspropertymonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspropertymonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusPropertyMonitor_H__ -#define __UT_CMusPropertyMonitor_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 - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusPropertyMonitor* NewL(); - static UT_CMusPropertyMonitor* NewLC(); - - /** - * Destructor - */ - ~UT_CMusPropertyMonitor(); - - 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(); - - private: // Data - CMusPropertyMonitor* iMusPropertyMonitor; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_CMusPropertyMonitor_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspttcallmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspttcallmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musresourcefinderutil.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musresourcefinderutil.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_mustsypropertymonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_mustsypropertymonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __UT_CMusTsyPropertyMonitor_H__ -#define __UT_CMusTsyPropertyMonitor_H__ - - -// EXTERNAL INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CMusCommonObserverStub; -class CMusTsyPropertyMonitor; - -// 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 - { - public: // Constructors and destructors - - /** - * Two phase construction - */ - static UT_CMusTsyPropertyMonitor* NewL(); - static UT_CMusTsyPropertyMonitor* NewLC(); - - /** - * Destructor - */ - ~UT_CMusTsyPropertyMonitor(); - - private: // Constructors and destructors - - UT_CMusTsyPropertyMonitor(); - void ConstructL(); - - private: // Test case setup and teardown - - void SetupL(); - void Setup2L(); - 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_MonitorCallLL(); - void UT_CMusTsyPropertyMonitor_MonitorCallL_2L(); - void UT_CMusTsyPropertyMonitor_RemoveUnUsedCallMonitorsL(); - - private: // Data - CMusTsyPropertyMonitor* iMusTsyPropertyMonitor; - RMobilePhone iPhone; - - - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // __UT_CMusTsyPropertyMonitor_H__ - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/muscommonstubs.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/muscommonstubs.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 ) - { - delete iTelNumber; - iTelNumber = aTelNumber.AllocL(); - iCallConnectedCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusCommonObserverStub::CallHoldL( const TDesC& aTelNumber ) - { - delete iTelNumber; - iTelNumber = aTelNumber.AllocL(); - iCallHoldCalled = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_aopluginDllMain.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_aopluginDllMain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* 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_musclirmonitor.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_CMusClirMonitor::NewLC() ); - CleanupStack::Pop(); - - CleanupStack::Pop( rootSuite ); - return rootSuite; - } - - - -// END OF FILE - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaocalleventmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaocalleventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,285 +0,0 @@ -/* -* 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*/ ) - { - iCallConnected = ETrue; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusAoCallEventMonitor::CallHoldL( const TDesC& /*aTelNumber*/ ) - { - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaoplugin.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaoplugin.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,486 +0,0 @@ -/* -* 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 "FeatMgr.h" - - - -#pragma warn_illtokenpasting off - -_LIT( KEmptyTelNumber, ""); - - -// ----------------------------------------------------------------------------- -// 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::NewLL() - { - - TInt res = KErrNone; - TInt ret = KErrNone; - FeatureManager::MultimediaSharingNotSupported(); - iPlugin->DeleteProperties(); - delete iPlugin; - iPlugin = NULL ; - iPlugin = CMusAoPlugin::NewL(); - EUNIT_ASSERT( iPlugin ); - EUNIT_ASSERT( iPlugin->iTsyPropertyMonitor == NULL); - EUNIT_ASSERT( iPlugin->iPropertyMonitor == NULL); - // 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 - TBuf<15> telnumber; // TODO change to des - User::LeaveIfError( RProperty::Get( - NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusTelNumber, - telnumber ) ); - EUNIT_ASSERT_EQUALS( telnumber.Compare( KEmptyTelNumber ), 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 ) - FeatureManager::MultimediaSharingSupported(); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusAoPlugin::DefinePropertiesLL() - { -/* Test 1 */ - /* 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. - TInt 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(); - - // camera information property - TInt 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 ) - - // 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 ) - - // Call privacy - ret = RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - res ); - EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusAoPlugin::UT_HandleServerCommandLL() - { - TAny* a = iPlugin->HandleServerCommandL( EAOManagerPluginStart, NULL ); - EUNIT_ASSERT( a ) - } - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusAoPlugin, - "UT_CMusAoPlugin", - "UNIT") - -EUNIT_TEST( - "UT_NewLL", - "CMusAoPlugin", - "NewL", - "FUNCTIONALITY", - SetupL, NewLL, Teardown) - -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_END_TEST_TABLE - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaopluginmain.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaopluginmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferenceeventmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferenceeventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferencemonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferencemonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 ); - */ - 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 ); - - } - - -// 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_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscalleventmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscalleventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,343 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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(); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - val ); - TInt callEnt = val; - RTelHelper::SetCallEvent( RMobileCall::ELocalTransfer ); - iCallEventMonitor->RunL(); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - val ); - - EUNIT_ASSERT( callEnt==val ); - - // 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(); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - val ); - callEnt = val; - RTelHelper::SetCallEvent( RMobileCall::ERemoteConferenceCreate ); - iCallEventMonitor->RunL(); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - val ); - EUNIT_ASSERT( callEnt==val ); - - // Test : Remote conference transfer - iCallEventMonitor->Cancel(); - RTelHelper::SetCallEvent( RMobileCall::ERemoteTransferring ); - iCallEventMonitor->RunL(); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - val ); - EUNIT_ASSERT( val==callEnt ); - - // 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; - EUNIT_ASSERT_EQUALS(iCallEventMonitor->RunError(error), KErrNone); - EUNIT_ASSERT_EQUALS(iCallEventMonitor->RunError(KErrNone), KErrNone); - } - - - - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 ); - - EUNIT_ASSERT( iCallMonitor->iCallStatusMonitor ); - EUNIT_ASSERT( iCallMonitor->iCallEventMonitor ); - - EUNIT_ASSERT_LEAVE( iCallMonitor->StartMonitorL( iLine, *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 ); - - 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 ); - EUNIT_ASSERT( iCallMonitor->IsMonitored() ); - - - } - - - - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitorbase.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitorbase.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,401 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "e32property.h" -#include "ut_muscallmonitorbase.h" -#include "mussesseioninformationapi.h" - -// SYSTEM INCLUDES -#include - - -CMusCallMonitorMock::CMusCallMonitorMock( const RMobileCall& aCall, - MMusTsyPropertyObserver& aObserver ) - : CMusCallMonitorBase( aCall, aObserver ) - { - } - - -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*/ ) - { - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusCallMonitorBase::SetupL() - { - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - 0 ); - RTelHelper::SetCallDirection( RMobileCall::EDirectionUnknown ); - iCallMonitorBase = new CMusCallMonitorMock( iCall, *this ); - } - - -void UT_CMusCallMonitorBase::Setup2L() - { - iCallMonitorBase = new CMusCallMonitorMock( iCall, *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 ); - } - - - iCallMonitorBase->SetStateL( NMusSessionInformationApi::ECallHold ); - 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 ); - - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusCallMonitorBase::UT_RunErrorL() - { - EUNIT_ASSERT( iCallMonitorBase->RunError( KErrNotFound ) == KErrNone ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusCallMonitorBase::UT_SetClirSettingL() - { - TInt tmp; - _LIT( KTestNumber1, "11111" ); - _LIT( KTestNumber2, "#31#11111" ); - - iCallMonitorBase->SetClirSetting( KTestNumber1() ); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, - tmp ); - EUNIT_ASSERT( tmp==NMusSessionInformationApi::ESendOwnNumber); - - iCallMonitorBase->SetClirSetting( KTestNumber2() ); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusClirSetting, - tmp ); - EUNIT_ASSERT( tmp==NMusSessionInformationApi::EDoNotSendOwnNumber); - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusCallMonitorBase::UT_SetTerminatingPrivacyL() - { - TInt tmp; - - iCallMonitorBase->SetTerminatingPrivacy( iCallMonitorBase->iCall ); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - tmp ); - EUNIT_ASSERT( tmp==NMusSessionInformationApi::EPrivacyOff); - - RTelHelper::SetRemoteIdStatus( RMobileCall::ERemoteIdentitySuppressed ); - iCallMonitorBase->SetTerminatingPrivacy( iCallMonitorBase->iCall ); - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMUSPrivacy, - tmp ); - EUNIT_ASSERT( tmp==NMusSessionInformationApi::EPrivacyOn); - - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusCallMonitorBase::UT_RemovePrefixL() - { - _LIT( KTestNumber1, "11111" ); - _LIT( KTestNumber2, "#31#11111" ); - _LIT( KTestNumber3, "*31#11111" ); - - - HBufC* test1 = iCallMonitorBase->RemovePrefix( KTestNumber1 ); - CleanupStack::PushL( test1 ); - EUNIT_ASSERT( *test1 == KTestNumber1 ); - CleanupStack::PopAndDestroy( test1 ); - - HBufC* test2 = iCallMonitorBase->RemovePrefix( KTestNumber3 ); - CleanupStack::PushL( test2 ); - EUNIT_ASSERT( *test2 == KTestNumber1 ); - CleanupStack::PopAndDestroy( test2 ); - - HBufC* test3 = iCallMonitorBase->RemovePrefix( KTestNumber2 ); - CleanupStack::PushL( test3 ); - EUNIT_ASSERT( *test3 == KTestNumber1 ); - CleanupStack::PopAndDestroy( test3 ); - - - - } - - -// 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( - "SetClirSetting - test", - "CMusCallMonitorBase", - "SetClirSetting", - "FUNCTIONALITY", - SetupL, UT_SetClirSettingL, Teardown) - -EUNIT_TEST( - "SetTerminatingPrivacy - test", - "CMusCallMonitorBase", - "SetTerminatingPrivacy", - "FUNCTIONALITY", - SetupL, UT_SetTerminatingPrivacyL, Teardown) - -EUNIT_TEST( - "RemovePrefix - test", - "CMusCallMonitorBase", - "RemovePrefix", - "FUNCTIONALITY", - SetupL, UT_RemovePrefixL, Teardown) - - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallstatusmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallstatusmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,345 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 - User::LeaveIfError( - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - callEvent ) ); - TInt callEnt = callEvent; - iCallStatusMonitor->iCallStatus = RMobileCall::EStatusDisconnecting; - iCallStatusMonitor->CheckStateL(); - User::LeaveIfError( - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - callEvent ) ); - EUNIT_ASSERT( callEnt==callEvent ); - EUNIT_ASSERT( iCallStatusMonitor == NULL ) - - // RMobileCall::EStatusDisconnectingWithInband - // iCallStatusMonitor was deleted by the previous call - iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, *this ); - User::LeaveIfError( - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - callEvent ) ); - callEnt = callEvent; - iCallStatusMonitor->iCallStatus = RMobileCall::EStatusDisconnectingWithInband; - iCallStatusMonitor->CheckStateL(); - User::LeaveIfError( - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - callEvent ) ); - EUNIT_ASSERT( callEnt == callEvent ); - EUNIT_ASSERT( iCallStatusMonitor == NULL ) - - // RMobileCall::EStatusHold - // iCallStatusMonitor was deleted by the previous call - iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, *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); - } - - - - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musclirmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musclirmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,291 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitor that observes the calling line identity restriction -* setting -* -*/ - -#include "musclirmonitor.h" -#include "ut_musclirmonitor.h" -#include "e32property.h" - -#include -#include -#include -#include - - -#pragma warn_illtokenpasting off - -// Constants - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::NewLC -// ----------------------------------------------------------------------------- -// -UT_CMusClirMonitor* UT_CMusClirMonitor::NewLC() - { - UT_CMusClirMonitor* self = new (ELeave) UT_CMusClirMonitor(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::ConstructL -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_CMusClirMonitor -// ----------------------------------------------------------------------------- -// -UT_CMusClirMonitor::UT_CMusClirMonitor() : - CEUnitTestSuiteClass() - { - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::~UT_CMusClirMonitor -// ----------------------------------------------------------------------------- -// -UT_CMusClirMonitor::~UT_CMusClirMonitor() - { - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_ReadClir -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_ReadClir() - { - // Cancel initial request - iMonitor->Cancel(); - - iMonitor->ReadClir(); - EUNIT_ASSERT( iMonitor->IsActive() ); - - // Monitor is already reading, new attempts do nothing - iMonitor->ReadClir(); - iMonitor->ReadClir(); - - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, 0 ); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_RunL -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_RunL() - { - CTelephony::TIdentityServiceStatus value1 = - CTelephony::EIdServiceActivePermanent; - CTelephony::TIdentityServiceStatus value2 = - CTelephony::EIdServiceNotProvisioned; - - EUNIT_ASSERT( iMonitor->iAllowed ); - iMonitor->Cancel(); - iMonitor->iTIdentityServiceV1.iIdentityStatus = value1; - iMonitor->iStatus = KErrNone; - iMonitor->RunL(); - EUNIT_ASSERT( !iMonitor->iAllowed ); - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, 0 ); - - - iMonitor->Cancel(); - iMonitor->iTIdentityServiceV1.iIdentityStatus = value2; - iMonitor->iStatus = KErrGeneral; - iMonitor->RunL(); - // iAllowed value does not change because request completed with error - EUNIT_ASSERT( !iMonitor->iAllowed ); - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, 1 ); - - - iMonitor->Cancel(); - iMonitor->iTIdentityServiceV1.iIdentityStatus = value2; - iMonitor->iStatus = KErrNone; - iMonitor->RunL(); - EUNIT_ASSERT( iMonitor->iAllowed ); - // After successful read, error count is reset - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, 0 ); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_RunLErrorsL -// Test that if reading fails, it is retried few times. -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_RunLErrorsL() - { - // Must have same value as in musclirmonitor.cpp - const TInt KMaxErrorsBeforeStop = 5; - - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, 0 ); - - for ( TInt i = 1; i <= KMaxErrorsBeforeStop; ++i ) - { - // Reading fails - iMonitor->Cancel(); - iMonitor->iStatus = KErrNotSupported; - iMonitor->RunL(); - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, i ); - // Retry started - EUNIT_ASSERT( iMonitor->IsActive() ); - } - - // Reading fails - iMonitor->Cancel(); - iMonitor->iStatus = KErrNotSupported; - iMonitor->RunL(); - EUNIT_ASSERT_EQUALS( iMonitor->iErrorCount, KMaxErrorsBeforeStop + 1 ); - - // No more retries - EUNIT_ASSERT( !iMonitor->IsActive() ); - } - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_DoCancel -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_DoCancel() - { - EUNIT_ASSERT( iMonitor->IsActive() ); - - // Can't call DoCancel directly, must call it via the CActive::Cancel - iMonitor->Cancel(); - - EUNIT_ASSERT( !iMonitor->IsActive() ); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_RunError -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_RunError() - { - EUNIT_ASSERT( iMonitor->RunError( KErrNone ) == KErrNone ); - EUNIT_ASSERT( iMonitor->RunError( KErrGeneral ) == KErrNone ); - EUNIT_ASSERT( iMonitor->RunError( 48 ) == KErrNone ); - EUNIT_ASSERT( iMonitor->RunError( -2092 ) == KErrNone ); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::UT_TranslateResult -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::UT_TranslateResult() - { - iMonitor->iAllowed = EFalse; - - iMonitor->TranslateResult( CTelephony::EIdServiceActiveDefaultAllowed ); - EUNIT_ASSERT( iMonitor->iAllowed ); - - iMonitor->TranslateResult( CTelephony::EIdServiceActivePermanent ); - EUNIT_ASSERT( !iMonitor->iAllowed ); - - iMonitor->TranslateResult( CTelephony::EIdServiceNotProvisioned ); - EUNIT_ASSERT( iMonitor->iAllowed ); - - iMonitor->TranslateResult( CTelephony::EIdServiceActiveDefaultRestricted ); - EUNIT_ASSERT( !iMonitor->iAllowed ); - - iMonitor->TranslateResult( CTelephony::EIdServiceUnknown ); - EUNIT_ASSERT( !iMonitor->iAllowed ); - } - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::SetupL -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::SetupL() - { - iMonitor = CMusClirMonitor::NewL(); - } - - -// ----------------------------------------------------------------------------- -// UT_CMusClirMonitor::Teardown -// ----------------------------------------------------------------------------- -// -void UT_CMusClirMonitor::Teardown() - { - delete iMonitor; - iMonitor = NULL; - PropertyHelper::Close(); - - } - -// test table - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusClirMonitor, - "UT_CMusClirMonitor", - "UNIT" ) - -EUNIT_TEST( - "UT_ReadClir", - "CMusClirMonitor", - "ReadClir", - "FUNCTIONALITY", - SetupL, UT_ReadClir, Teardown) - -EUNIT_TEST( - "UT_RunL", - "CMusClirMonitor", - "RunL", - "FUNCTIONALITY", - SetupL, UT_RunL, Teardown) - -EUNIT_TEST( - "UT_RunLErrorsL", - "CMusClirMonitor", - "RunL", - "FUNCTIONALITY", - SetupL, UT_RunLErrorsL, Teardown) - -EUNIT_TEST( - "UT_DoCancel", - "CMusClirMonitor", - "DoCancel", - "FUNCTIONALITY", - SetupL, UT_DoCancel, Teardown) - -EUNIT_TEST( - "UT_RunError", - "CMusClirMonitor", - "RunError", - "FUNCTIONALITY", - SetupL, UT_RunError, Teardown) - -EUNIT_TEST( - "UT_TranslateResult", - "CMusClirMonitor", - "TranslateResult", - "FUNCTIONALITY", - SetupL, UT_TranslateResult, Teardown) - -EUNIT_END_TEST_TABLE diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musclirmonitor.h --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musclirmonitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitor that observes the calling line identity restriction -* setting -* -*/ - - - -#ifndef UT_MUSCLIRMONITORTEST_H -#define UT_MUSCLIRMONITORTEST_H - -#include -#include - - -class CMusClirMonitor; -class CMusAoPlugin; - - -NONSHARABLE_CLASS( UT_CMusClirMonitor ) - : public CEUnitTestSuiteClass - { - -public: // constructors and destructor - - /** - * Destructor. - */ - ~UT_CMusClirMonitor(); - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed UT_CMusClirMonitor object. - */ - static UT_CMusClirMonitor* NewLC(); - -private: - - /** - * C++ constructor. - */ - UT_CMusClirMonitor(); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - -public: - - void UT_ReadClir(); - - void UT_RunL(); - - void UT_RunLErrorsL(); - - void UT_DoCancel(); - - void UT_RunError(); - - void UT_TranslateResult(); - -private: - - void SetupL(); - - void Teardown(); - -private: // data - - // Owned - CMusClirMonitor* iMonitor; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // UT_MUSCLIRMONITORTEST_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscommondllmain.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscommondllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// USER INCLUDES -#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" - -// 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(); - - CleanupStack::Pop( rootSuite ); - - return rootSuite; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musconferencecallmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musconferencecallmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* -* 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 ) - // Make sure RunError handles the error compleatly and returns - // KErrNone - EUNIT_ASSERT( iMonitor->RunError( KErrGeneral ) == 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muslineeventmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muslineeventmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,369 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspropertymonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspropertymonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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(); - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ENoCall; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusPropertyMonitor::Teardown() - { - delete iMusPropertyMonitor; - PropertyHelper::Close(); - } - - - - - - -// TEST CASES - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_RunLL() - { - EUNIT_ASSERT( iMusPropertyMonitor); - EUNIT_ASSERT( !iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ENoCall; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( !iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ECallConnected; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ECallConnected; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ECallHold; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::EConferenceCall; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ENoCall; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( !iMusPropertyMonitor->iManager ); - - iMusPropertyMonitor->iPropertyEvent.iPValue = 555; - iMusPropertyMonitor->Cancel(); - iMusPropertyMonitor->RunL(); - EUNIT_ASSERT( !iMusPropertyMonitor->iManager ); - - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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( iMusPropertyMonitor ); - TInt error = KErrNotFound; - iMusPropertyMonitor->RunError(error); - } - - - - - - -// 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_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspttcallmonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspttcallmonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musresourcefinderutil.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musresourcefinderutil.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_mustsypropertymonitor.cpp --- a/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_mustsypropertymonitor.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,468 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INTERNAL INCLUDES -#include "etelmm.h" -#include "e32property.h" -#include "ut_mustsypropertymonitor.h" -#include "mustsypropertymonitor.h" -#include "mussettings.h" - - -// SYSTEM INCLUDES -#include -#include - -_LIT(KTelNo,"1234"); - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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() - { - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - 0 ); - MultimediaSharingSettings::SetPropertyValueL( - MusSettingsKeys::KPrivacyExchange, - MusSettingsKeys::EPrivacy ); - - iMusTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL( iPhone ); - iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateUninitialized; - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusTsyPropertyMonitor::Setup2L() - { - RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallEvent, - 0 ); - MultimediaSharingSettings::SetPropertyValueL( - MusSettingsKeys::KPrivacyExchange, - MusSettingsKeys::ENoPrivacy ); - - iMusTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL( iPhone ); - iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateUninitialized; - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusTsyPropertyMonitor::Teardown() - { - delete iMusTsyPropertyMonitor; - PropertyHelper::Close(); - iPhone.Close(); - - } - - - -// TEST CASES - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_NewLL() - { - EUNIT_ASSERT( iMusTsyPropertyMonitor); - EUNIT_ASSERT( MultimediaSharingSettings::PrivacySetting() );//feature is on by default - EUNIT_ASSERT( iMusTsyPropertyMonitor->iClirMonitor ); - - MultimediaSharingSettings::SetPropertyValueL( MusSettingsKeys::KPrivacyExchange, - MusSettingsKeys::ENoPrivacy ); - delete iMusTsyPropertyMonitor; - iMusTsyPropertyMonitor = NULL; - - iMusTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL( iPhone ); - EUNIT_ASSERT( !MultimediaSharingSettings::PrivacySetting() );//feature is on by default - EUNIT_ASSERT( !iMusTsyPropertyMonitor->iClirMonitor ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_RunLL() - { - 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_MonitorCallLL() - { - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusIdle ); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusHangingUp ); - - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusConnected ); - if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallCount, - 0 ) != KErrNone ) - { - User::Leave( KErrNoMemory ); - } - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusAnswering ); - //already exist - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); - - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusUnknown ); - - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusIdle ); - iMusTsyPropertyMonitor->MonitorCallL(); - - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_MonitorCallL_2L() - { - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); - EUNIT_ASSERT( !iMusTsyPropertyMonitor->iClirMonitor ); - - RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusConnected ); - if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallCount, - 0 ) != KErrNone ) - { - User::Leave( KErrNoMemory ); - } - iMusTsyPropertyMonitor->MonitorCallL(); - EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); - - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ); - } - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - UT_CMusTsyPropertyMonitor, - "UT_CMusTsyPropertyMonitor", - "UNIT" ) - - -EUNIT_TEST( - "NewL - test", - "CMusTsyPropertyMonitor", - "NewL", - "FUNCTIONALITY", - SetupL, UT_CMusTsyPropertyMonitor_NewLL, Teardown) - -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( - "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( - "MonitorCallL no clir - test", - "CMusTsyPropertyMonitor", - "MonitorCallL", - "FUNCTIONALITY", - Setup2L, UT_CMusTsyPropertyMonitor_MonitorCallL_2L, Teardown) - -EUNIT_END_TEST_TABLE - -// END OF FILE - - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/data/1028238F.rss --- a/mmshplugins/mmshsettingsuiplugin/data/1028238F.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/data/mussettingsuirsc.rss --- a/mmshplugins/mmshsettingsuiplugin/data/mussettingsuirsc.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,518 +0,0 @@ -/* -* 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: 18 % << 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_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_note_on; - }, - LBUF - { - txt = qtn_msh_set_note_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/group/bld.inf --- a/mmshplugins/mmshsettingsuiplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/group/mussettingsplugin.mmp --- a/mmshplugins/mmshsettingsuiplugin/group/mussettingsplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mmussipprofilehandler.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mmussipprofilehandler.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* 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. -* Version : %version: 6 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - -#ifndef M_MMUSSIPPROFILEHANDLER_H -#define M_MMUSSIPPROFILEHANDLER_H - -#include -#include - -class CSIPProfile; - -/** -* MMusSIPProfileHandler class -* Mixin class for SIP profile manipulation. -* Handles SIP profile manipulations. -*/ -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 a reference to the SIP profile array. - * 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 Reference to internally cached SIP profile array. - */ - virtual RPointerArray& 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; - - /* - * - * - */ - virtual void DisableProfileL() = 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mussettingscontainer.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mussettingscontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* -* 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; - - /** - * Listbox items. - */ - CGSListBoxItemTextArray* iListboxItemArray; - - }; - -#endif // C_CMUSSETTINGSCONTAINER_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mussettingsmodel.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mussettingsmodel.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* 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. -* Version : %version: 10 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#ifndef C_MUSSETTINGSMODEL_H -#define C_MUSSETTINGSMODEL_H - -#include -#include -//class CDesCArray; -class MMusSIPProfileHandler; -class CMusSIPProfileModel; -class CAknMemorySelectionDialogMultiDrive; - - -/** - * CMusSettingsModel is the model class of GS application. - * It provides functions to get and set setting values. - */ -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 recorded video saving mode. - * @return 2: phone memory - * 4: memory card - */ - TInt VSSettingsRecordedVideoSavingL(); - - /** - * operator specific variant - * Sets activation item - * @param aActive (enabled/disabled). - */ - void SetActivationItem( TBool aActive ); - - /** - * operator specific variant - * @return activation item - */ - TBool ActivationItem( ); - - /** - * 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 ); - - /** - * Initialize SIP profile enabler data. - */ - void InitializeProfileEnablerL(); - - void ConstructL(); - -private: // data - - /** - * SIP profile handler. - */ - MMusSIPProfileHandler& iHandler; - - /** - * Operator variant. If SIP profile disabled - */ - TBool iProfileDisabled; - - }; - -#endif // C_MUSSETTINGSMODEL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* 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. -* Version : %version: 21 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#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(); - - void OpenResourceFileL(); - void CloseResourceFile(); - - /** - * 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 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 - - HBufC* iCaption; - bool iResourceFileOpen; - - /** - * Instance of SIP profile handler to manage SIP profiles. - * Own. - */ - CMusSIPProfileModel* iHandler; - - - /** - * 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.hrh --- a/mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h --- a/mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* 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. -* Version : %version: 7 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#ifndef C_MUSSIPPROFILEMODEL_H -#define C_MUSSIPPROFILEMODEL_H - - -#include "mmussipprofilehandler.h" -#include -#include - - -class CSIPManagedProfileRegistry; -class CMusSettingsModel; - - -/** - * CMusSIPProfileModel model class. - * Model class implementing SIP profile model. - */ -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(); - - - /* - * - * - */ - virtual void DisableProfileL(); - - /* - * - * - */ - virtual void EnableProfileL(); - - /* - * - * - */ - virtual TBool ProfileEnabledL(); - - /** - * 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 a reference to the SIP profile array. - * 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 Reference to internally cached SIP profile array. - */ - virtual RPointerArray& 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 ); - - - - /** - * Set CMusSettingsModel to handle ProfileRegistry Event. - * @param aCMusSettingsModel the CMusSettingsModel to handle ProfileRegistry Event - */ - void SetCMusSettingsModel(CMusSettingsModel* aCMusSettingsModel); - -protected: - - /** - * Sorts internal array of SIP profiles by id. - */ - void SortProfilesL(); - - -private: - - CMusSIPProfileModel(); - - void ConstructL(); - - -private: // data - - /** - * Instance of the SIP profile registry engine for managing SIP profiles. - * Own. - */ - CSIPManagedProfileRegistry* iEngine; - - /** - * Locally cached array of SIP profiles. - */ - RPointerArray iProfiles; - - /** - * CMusSettingsModel to handle ProfileRegistry - * Event - */ - CMusSettingsModel* iCMusSettingsModel; - - }; - -#endif // C_MUSSIPPROFILEMODEL_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/src/mussettingscontainer.cpp --- a/mmshplugins/mmshsettingsuiplugin/src/mussettingscontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,459 +0,0 @@ -/* -* 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. -* Version : %version: 20 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#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 - - -#ifdef RD_MULTIPLE_DRIVE -#include - -#endif - -/** 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 = MultimediaSharingSettings::OperatorVariantSettingL(); - - 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; - 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 ); - - // OCC: removed "Automatic in home network" choice - 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 ); - - 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()" ) - - MusSettingsKeys::TActivation activation = - MultimediaSharingSettings::ActivationSettingL(); - - if ( activation != MusSettingsKeys::EAlwaysActive ) - { - // We make sure that if someone has written to CenRep value bigger - // than 1 (which after OCC changes means 'Off') we treat it as 'Off'. - activation = MusSettingsKeys::EActiveInHomeNetworks; - } - - AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ activation ] ); - - MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeActivationItemL()" ) - } - - -// ----------------------------------------------------------------------------- -// Adds operator specific activation setting item to listbox. -// ----------------------------------------------------------------------------- -// -void CMusSettingsContainer::MakeOperatorActivationItemL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeOperatorActivationItemL()" ) - MUS_LOG1( "Activation item( %d )", - iModel.ActivationItem() ) - AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iModel.ActivationItem() ] ); - - 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 = MultimediaSharingSettings::SipProfileSettingL(); - - 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 = MultimediaSharingSettings::AutoRecordSettingL(); - - 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, " ) - MUS_LOG( "[MUSSET] e.g. remote drive deleted, using system drive" ) - - driveNumber = RFs::GetSystemDrive(); - index = dlg->FindIndexByDrive( driveNumber ); - MultimediaSharingSettings::SetVideoLocationSettingL( 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()" ) - - MusSettingsKeys::TAuditoryNotification auditoryNotification = - MultimediaSharingSettings::AuditoryNotificationSettingL(); - - MUS_LOG1( "[MUSSET] -> CMusSettingsContainer::Mode:%d()", - auditoryNotification ) - - // If unset, use and set default value - if ( auditoryNotification < 0 || auditoryNotification > 1 ) - { - auditoryNotification = MusSettingsKeys::EAuditoryNotificationOff; - MultimediaSharingSettings::SetAuditoryNotificationSettingL( - MusSettingsKeys::EAuditoryNotificationOff ); - } - - AddItemL( KGSSettIdNote, ( *iActivationItems )[ auditoryNotification ] ); - - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/src/mussettingsmodel.cpp --- a/mmshplugins/mmshsettingsuiplugin/src/mussettingsmodel.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -/* -* 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. -* Version : %version: 17 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - -#include "mussettingsmodel.h" -#include "muslogger.h" -#include "mussipprofilemodel.h" -#include "mussettings.h" -#include "mmussipprofilehandler.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()" ) - InitializeProfileEnablerL(); - static_cast (&iHandler)->SetCMusSettingsModel(this); - MUS_LOG( "[MUSSET] <- CMusSettingsModel::ConstructL()" ) - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusSettingsModel::~CMusSettingsModel() - { - MUS_LOG( "[MUSSET] -> CMusSettingsModel::~CMusSettingsModel()" ) - MUS_LOG( "[MUSSET] <- CMusSettingsModel::~CMusSettingsModel()" ) - } - -// ----------------------------------------------------------------------------- -// Returns recorded video saving mode. -// ----------------------------------------------------------------------------- -// -TInt CMusSettingsModel::VSSettingsRecordedVideoSavingL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsRecordedVideoSavingL()" ) - TInt vsVideoLocationMode = MultimediaSharingSettings::VideoLocationSettingL(); - MUS_LOG1( - "[MUSSET] <- CMusSettingsContainer::VSSettingsRecordedVideoSavingL()( %d )", - vsVideoLocationMode ) - return vsVideoLocationMode; - } - -// ---------------------------------------------------------------------------- -// Change Activation. -// ---------------------------------------------------------------------------- -// -void CMusSettingsModel::SetActivationItem( TBool aActive ) - { - MUS_LOG( "[MUSSET] -> CMusSettingsContainer::SetActivationItem()" ) - MUS_LOG1( " Profile disabled? ( %d )", aActive ) - iProfileDisabled = aActive; - MUS_LOG( "[MUSSET] <- CMusSettingsContainer::SetActivationItem()" ) - } - -// ---------------------------------------------------------------------------- -// Get Activation item. -// ---------------------------------------------------------------------------- -// -TBool CMusSettingsModel::ActivationItem() - { - MUS_LOG( "[MUSSET] -> CMusSettingsContainer::SetActivationItem()" ) - MUS_LOG( "[MUSSET] <- CMusSettingsContainer::SetActivationItem()" ) - return iProfileDisabled; - } - -// ----------------------------------------------------------------------------- -// Returns the list of profile names -// ----------------------------------------------------------------------------- -CDesCArray* CMusSettingsModel::ListOfProfileNamesL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsModel::ListOfProfileNamesL()" ) - RPointerArray& 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[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()[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 ); - } - -// ----------------------------------------------------------------------------- -// Initialize SIP profile enabler data. -// ----------------------------------------------------------------------------- -void CMusSettingsModel::InitializeProfileEnablerL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsModel::InitializeProfileEnabler()" ) - if ( MultimediaSharingSettings::OperatorVariantSettingL() == - MusSettingsKeys::EOperatorSpecific ) - { - TBool enabled(EFalse); - - CMusSIPProfileModel& handler = - static_cast( iHandler ); - TRAPD( error, enabled = handler.ProfileEnabledL()); - if ( error != KErrNone ) - { - MUS_LOG( "Error returned" ) - // Problems with re-reading profiles; use existing array - SetActivationItem( EFalse ); - } - else - { - MUS_LOG1("SIP registration service( %d )", - enabled ) - if( enabled ) - { - SetActivationItem( enabled ); - } - else - { - SetActivationItem( enabled); - } - } - } - MUS_LOG( "[MUSSET] <- CMusSettingsModel::InitializeProfileEnabler()" ) - } - -// ----------------------------------------------------------------------------- -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/src/mussettingsplugin.cpp --- a/mmshplugins/mmshsettingsuiplugin/src/mussettingsplugin.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,789 +0,0 @@ -/* -* 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. -* Version : %version: 34 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#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; - } - - CloseResourceFile(); - - delete iModel; - iModel = NULL; - delete iHandler; - iHandler = NULL; - delete iDiskNotifyHandler; - delete iCaption; - MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::~CMusSettingsPlugin()" ) - } - -// ----------------------------------------------------------------------------- -// -// -// ----------------------------------------------------------------------------- -// -void CMusSettingsPlugin::ConstructL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::ConstructL()" ) - FeatureManager::InitializeLibL(); - - iResourceFileOpen = false; - OpenResourceFileL(); - - 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 - - iCaption = StringLoader::LoadL( R_GS_VS_PLUGIN_CAPTION ); - CloseResourceFile(); - - 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()" ) - OpenResourceFileL(); - 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(); - CloseResourceFile(); - 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 ) - switch ( aCommand ) - { - case EGSMSKCmdAppChange: -// case EGSCmdAppChange: - { - 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()" ) - if ( iCaption && iCaption->Length() <= aCaption.MaxLength() ) - { - aCaption.Copy( *iCaption ); - } - - 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(); - MUS_LOG1( "[MUSSET] Item selected: ", currentItem ) - - switch ( currentItem ) - { - case KGSSettIdVSActivation: - { - SwitchOnOffValueL( KGSSettIdVSActivation ); - break; - } - case KGSSettIdSIPProfile: - { - ShowVSSettingsProfileSettingDialogL(); - break; - } - case KGSSettIdAutoRecord: - { - SwitchOnOffValueL( KGSSettIdAutoRecord ); - break; - } - case KGSSettIdRecordedVideoSaving: - { - ShowVSSettingsRecordedVideoSavingSettingDialogL(); - break; - } - case KGSSettIdNote: - { - SwitchOnOffValueL( 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 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 = MultimediaSharingSettings::SipProfileSettingL(); - 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 ) - { - MultimediaSharingSettings::SetSipProfileSettingL( - 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( - MultimediaSharingSettings::SipProfileSettingL() ); - 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 ); - MultimediaSharingSettings::SetSipProfileSettingL( 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(); - - TBool result( EFalse ); - TDriveNumber driveNumber((TDriveNumber)currentValue); - result = dlg->ExecuteL( driveNumber, NULL, NULL ); - - if ( result != CAknCommonDialogsBase::TReturnKey( - CAknCommonDialogsBase::ERightSoftkey) ) - { - if ( /*( TInt )*/ driveNumber != currentValue ) - { - MultimediaSharingSettings::SetVideoLocationSettingL( ( TInt ) driveNumber ); - } - 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 = - MultimediaSharingSettings::AuditoryNotificationSettingL(); - TInt intCurrentValue = static_cast( currentValue ); - - CAknRadioButtonSettingPage* dlg; - CDesCArrayFlat* items; - - if ( MultimediaSharingSettings::OperatorVariantSettingL() == - 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 ); - MultimediaSharingSettings::SetAuditoryNotificationSettingL( - 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 ) - { - MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL()" ) - - switch( aValue ) - { - case KGSSettIdVSActivation: - { - MusSettingsKeys::TOperatorVariant operatorVarValue = - MultimediaSharingSettings::OperatorVariantSettingL(); - - if ( operatorVarValue == MusSettingsKeys::EOperatorSpecific ) - { - - TInt aCallCount = 0; - RProperty::Get( NMusSessionInformationApi::KCategoryUid, - NMusSessionInformationApi::KMusCallCount, - aCallCount ); - MUS_LOG1( "CallCount ( %d )", aCallCount) - if ( aCallCount == 0 ) - { - TBool enabled = EFalse; - TRAPD( error, enabled = iHandler->ProfileEnabledL( )); - if ( error != KErrNone ) - { - // Problems with re-reading profiles; use existing array - MUS_LOG1("Error returned( %d )", error ) - } - else - { - if( enabled ) - { - TRAPD( error, iHandler->EnableProfileL() ); - if ( error != KErrNone ) - { - // Problems with re-reading profiles; use existing array - iModel->SetActivationItem( ETrue ); - } - iModel->SetActivationItem( EFalse ); - } - else - { - TRAP_IGNORE( iHandler->DisableProfileL() ); - iModel->SetActivationItem( ETrue ); - } - } - } - } - else - { - if ( MusSettingsKeys::EAlwaysActive == - MultimediaSharingSettings::ActivationSettingL() ) - { - MUS_LOG( "[MUSSET] Activation setting set off" ) - //MusSettingsKeys::ENever = 2 can not be used anymore - //EActiveInHomeNetworks = 1 is used instead -> off - MultimediaSharingSettings::SetActivationSettingL( - MusSettingsKeys::EActiveInHomeNetworks ); - } - else - { - MUS_LOG( "[MUSSET] Activation setting set on" ) - MultimediaSharingSettings::SetActivationSettingL( - MusSettingsKeys::EAlwaysActive ); - } - } - break; - } - case KGSSettIdAutoRecord: - { - if ( MusSettingsKeys::EAutoRecordOff == - MultimediaSharingSettings::AutoRecordSettingL() ) - { - MultimediaSharingSettings::SetAutoRecordSettingL( - MusSettingsKeys::EAutoRecordOn ); - } - else - { - MultimediaSharingSettings::SetAutoRecordSettingL( - MusSettingsKeys::EAutoRecordOff ); - } - break; - } - case KGSSettIdNote: - { - if ( MusSettingsKeys::EAuditoryNotificationOn == - MultimediaSharingSettings::AuditoryNotificationSettingL() ) - { - MultimediaSharingSettings::SetAuditoryNotificationSettingL( - MusSettingsKeys::EAuditoryNotificationOff ); - } - else - { - MultimediaSharingSettings::SetAuditoryNotificationSettingL( - MusSettingsKeys::EAuditoryNotificationOn ); - } - break; - } - - default: - { - MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL() - error unknown setting" ) - User::Leave( KErrArgument ); - } - } - - Container()->UpdateListBoxL( aValue ); - - MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::SwitchOnOffValueL()" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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()" ) - - OpenResourceFileL(); - - 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; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusSettingsPlugin::OpenResourceFileL() - { - MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::OpenResourceFileL()" ) - - if (!iResourceFileOpen) - { - HBufC* fileName = MusResourceFinderUtil::ResourcePathL( - KVSSettingsResourceFileName ); - TFileName fName(*fileName); - delete fileName; - MUS_LOG_TDESC( "[MUSSET] Resource FileName ",fName ) - iResources.OpenL(fName); - iResourceFileOpen = true; - } - - MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::OpenResourceFileL()" ) - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusSettingsPlugin::CloseResourceFile() - { - MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::CloseResourceFile()" ) - iResources.Close(); - iResourceFileOpen = false; - MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CloseResourceFile()" ) - } - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/src/mussettingspluginimplementationtable.cpp --- a/mmshplugins/mmshsettingsuiplugin/src/mussettingspluginimplementationtable.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/src/mussipprofilemodel.cpp --- a/mmshplugins/mmshsettingsuiplugin/src/mussipprofilemodel.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,355 +0,0 @@ -/* -* 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. -* Version : %version: 16 % << Don't touch! Updated by Synergy at check-out. -* -*/ - - - -#include "mussipprofilemodel.h" -#include "muslogger.h" -#include "mussettings.inl" -#include -#include -#include -#include -#include -#include -#include "mussettingsmodel.h" - - -const TInt KUnknownProfileId = 0; - -/** -* VSC Enable/Disable is of type TBool -*/ -const TUint32 KMuSVSCDisable = 200; - - -// ======== MEMBER FUNCTIONS ======== - - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -CMusSIPProfileModel::CMusSIPProfileModel() - { - } - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -void CMusSIPProfileModel::ConstructL() - { - MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ConstructL()" ) - iEngine = CSIPManagedProfileRegistry::NewL( *this ); - iEngine->ProfilesL( iProfiles ); - SortProfilesL(); - } - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -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()" ) - iProfiles.ResetAndDestroy(); - delete iEngine; - MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::~CMusSIPProfileModel()" ) - } - -// ---------------------------------------------------------------------------- -// Returns reference to the locally cached SIP profile array. -// ---------------------------------------------------------------------------- -// -RPointerArray& CMusSIPProfileModel::ProfileArrayL() - { - 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[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 ); - TInt error = iProfiles[i]->GetParameter( KSIPDefaultProfile, defProfile ); - if ( error == KErrNone && defProfile ) - { - iProfiles[i]->GetParameter( KSIPProfileId, id ); - break; - } - } - - MUS_LOG1( "[MUSSET] <- CMusSIPProfileModel::DefaultProfileId()( %d )", - id ) - return id; - } - -// ----------------------------------------------------------------------------- -// Disable SIP Registration. -// ----------------------------------------------------------------------------- -// -void CMusSIPProfileModel::DisableProfileL() - { - MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::DisableProfileL " ) - CSIPManagedProfile* managedProfile = static_cast( - iEngine->ProfileL( DefaultProfileId()) ); - CleanupStack::PushL( managedProfile ); - //Disable registration from profile.dat file - MUS_LOG( "Add registration parameter profile.dat file " ) - TInt err = managedProfile->SetParameter( KMuSVSCDisable, (TBool)ETrue ); - User::LeaveIfError(err); - iEngine->SaveL( *managedProfile ); - CleanupStack::PopAndDestroy( managedProfile ); - MUS_LOG( "[MUSSET] <- CMusAvaRegisterAvailability::DisableProfileL " ) - } - -// ----------------------------------------------------------------------------- -// Enable SIP Registration. -// ----------------------------------------------------------------------------- -// -void CMusSIPProfileModel::EnableProfileL() - { - MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::EnableProfileL " ) - CSIPManagedProfile* managedProfile = static_cast( - iEngine->ProfileL( DefaultProfileId() ) ); - CleanupStack::PushL( managedProfile ); - //Disable registration from profile.dat file - MUS_LOG( "Add registration parameter profile.dat file " ) - TInt err = managedProfile->SetParameter( KMuSVSCDisable, (TBool)EFalse ); - User::LeaveIfError(err); - iEngine->SaveL( *managedProfile ); - CleanupStack::PopAndDestroy( managedProfile ); - MUS_LOG( "[MUSSET] <- CMusAvaRegisterAvailability::EnableRegisterL " ) - } - -// ----------------------------------------------------------------------------- -// if SIP Registration enabled. -// ----------------------------------------------------------------------------- -// -TBool CMusSIPProfileModel::ProfileEnabledL() - { - MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::ProfileEnabledL " ) - CSIPManagedProfile* managedProfile = static_cast( - iEngine->ProfileL( DefaultProfileId() ) ); - CleanupStack::PushL( managedProfile ); - //Activation status from profile.dat file - TBool enabled = EFalse; - MUS_LOG( "Get registration parameter from profile.dat file " ) - TInt err = managedProfile->GetParameter( KMuSVSCDisable, enabled ); - MUS_LOG1( "KMuSVSCDisable value %d )", - enabled ) - CleanupStack::PopAndDestroy( managedProfile ); - MUS_LOG( "[MUSSET] <- CMusAvaRegisterAvailability::ProfileEnabledL " ) - return enabled; - } - -// ---------------------------------------------------------------------------- -// 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 ); - - for ( TInt i = 0; i < iProfiles.Count(); i++ ) - { - TUint32 id( KUnknownProfileId ); - TInt error = iProfiles[i]->GetParameter( KSIPProfileId, id ); - if ( error == KErrNone && 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 ( aIndex < iProfiles.Count() ) - { - if ( iProfiles[aIndex]->GetParameter( KSIPProfileId, profileId ) ) - { - profileId = KUnknownProfileId; - } - } - - MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ProfileIdByIndex()" ) - return profileId; - } - -// ---------------------------------------------------------------------------- -// 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[a]->GetParameter( - KSIPProfileId, profileIdFirst ) ); - User::LeaveIfError( iProfiles[b]->GetParameter( - KSIPProfileId, profileIdSecond ) ); - if ( profileIdFirst > profileIdSecond ) - { - CSIPProfile* tmp = iProfiles[b]; - iProfiles[b] = iProfiles[a]; - iProfiles[a] = tmp; - } - } - } - } - -// ---------------------------------------------------------------------------- -// From class MSIPProfileRegistryObserver. -// Notifies of an event in SIP profile registry. -// ---------------------------------------------------------------------------- -// -void CMusSIPProfileModel::ProfileRegistryEventOccurred( - TUint32 aSIPProfileId, TEvent aEvent ) - { - MUS_LOG("[MUSSET] -> CMusSIPProfileModel::ProfileRegistryEventOccurred()" ) - MUS_LOG2(" SIPProfileId is %d,Event is %d",aSIPProfileId,aEvent) - - // We revert back to default settings if the profile used by MuS is deleted - if ( aEvent == EProfileDestroyed ) - { - TRAP_IGNORE( - //if the profile is the profile used by mush - if ( MultimediaSharingSettings::SipProfileSettingL() == - aSIPProfileId ) - { - //set the profile to default - MultimediaSharingSettings::SetSipProfileSettingL( - CMusSettingsModel::KVsSipProfileDefault ); - //set mush off - MultimediaSharingSettings::SetActivationSettingL( - MusSettingsKeys::EActiveInHomeNetworks ); - } - ); - } - - if ( aEvent == EProfileCreated || - aEvent == EProfileUpdated || - aEvent == EProfileDestroyed ) - { - // Profiles have been manipulated in SIP side, we must delete client - // side profile objects and retrieve them again. If fetching fails, - // we have empty array which is better than showing wrong values to - // user. - iProfiles.ResetAndDestroy(); - TRAP_IGNORE( iEngine->ProfilesL( iProfiles ) ); - TRAP_IGNORE( SortProfilesL() ); - } - - 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()" ) - } - -// ---------------------------------------------------------------------------- -//Set CMusSettingsModel to handle ProfileRegistry Event. -// ---------------------------------------------------------------------------- -// -void CMusSIPProfileModel::SetCMusSettingsModel(CMusSettingsModel* aCMusSettingsModel) - { - iCMusSettingsModel = aCMusSettingsModel; - } diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_udeb.bat --- a/mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_udeb.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_urel.bat --- a/mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_urel.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_udeb.pkg --- a/mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_udeb.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_urel.pkg --- a/mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_urel.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/data/mussipcrplugin.rss --- a/mmshplugins/mmshsipcrplugin/data/mussipcrplugin.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/group/bld.inf --- a/mmshplugins/mmshsipcrplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/group/mussipcrplugin.mmp --- a/mmshplugins/mmshsipcrplugin/group/mussipcrplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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 featmgr.lib -DEBUGLIBRARY flogger.lib // file logger - -PAGED - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.h --- a/mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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; - -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: // data - - TUid DoChannelL( RStringF aMethod ); - -private: // data - - CMusManager* iManager; - - }; - - -#endif // MUSSIPCRPLUGIN_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.hrh --- a/mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/src/mussipcrplugin.cpp --- a/mmshplugins/mmshsipcrplugin/src/mussipcrplugin.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/* -* 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 -#include -#include - -_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; - 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(); - 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*/) - { - FeatureManager::InitializeLibL(); - TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); - FeatureManager::UnInitializeLib(); - TUid uid; - uid.iUid = ( TInt ) CMusManager::ESipInviteNotDesired; - if ( support ) - { - uid = DoChannelL( aMethod ); - } - return uid; - } - - -// ------------------------------------------------------------------------- -// CMusSipCrPlugin::DoChannelL -// ------------------------------------------------------------------------- -TUid CMusSipCrPlugin::DoChannelL( RStringF aMethod ) - { - MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::DoChannelL()" ); - - if ( aMethod == SIPStrings::StringF( SipStrConsts::EOptions ) ) - { - TUid uid; - uid.iUid = ( TInt ) CMusManager::ESipOptions; - MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::DoChannelL(): 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::DoChannelL(): \ - KNotAllowedSipInvite %d", uid.iUid ); - return uid; - } - else - { - TUid uid; - uid.iUid = ( TInt ) CMusManager::ESipInviteDesired; - MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::DoChannelL(): \ - KAllowedSipInvite %d", uid.iUid ); - return uid; - } - } - } - - - -// ------------------------------------------------------------------------- -// 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::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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/src/mussipcrpluginmain.cpp --- a/mmshplugins/mmshsipcrplugin/src/mussipcrpluginmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/BWINS/ut_sipcrpluginu.def --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/BWINS/ut_sipcrpluginu.def Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 2 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/bld.inf --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_TESTMMPFILES -ut_sipcrplugin.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/ut_sipcrplugin.mmp --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/ut_sipcrplugin.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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/featmgrstub/src -SOURCE FeatMgr.cpp - -USERINCLUDE ../../../../../tsrc/featmgrstub/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 - -EXPORTUNFROZEN - -// End of file diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/inc/mussipcrplugintest.h --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/inc/mussipcrplugintest.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* 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_ChannelL(); - - void UT_ConnectL(); - - void UT_Capabilities(); - - void UT_ImplementationGroupProxy(); - - -public: - void SetupL(); - void Teardown(); - - -private: // data - - CMusSipCrPlugin* iPlugin; - - EUNIT_DECLARE_TEST_TABLE; - - }; - -#endif // MUSAOPLUGINTEST_H diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/mussipcrplugintest.cpp --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/mussipcrplugintest.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,310 +0,0 @@ -/* -* 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 "musunittesting.h" -#include "musmanagerstub.h" -#include "mussipcrplugin.h" -#include "mussipcrplugintest.h" -#include "muslogger.h" -#include "musmanager.h" - -#include -#include -#include -#include -#include -#include "FeatMgr.h" - - -// Next row is to disable warning emerging from EUnit code. -#pragma warn_illtokenpasting off - - -// -------------------------------------------------------------------------- -// 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(); - } - - -// -------------------------------------------------------------------------- -// -// -------------------------------------------------------------------------- -// -void CMusSipCrPluginTest::Teardown( ) - { - delete iPlugin; - } - - - -// ------------------------- Test functions begin --------------------------- - - -// -------------------------------------------------------------------------- -// -// -------------------------------------------------------------------------- -// -void CMusSipCrPluginTest::UT_ChannelL() - { - SIPStrings::OpenL(); - - 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 - 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 ) - //Feature Manager testing - FeatureManager::MultimediaSharingNotSupported(); - response = iPlugin->ChannelL( - SIPStrings::StringF( SipStrConsts::EOptions ), - KNullDesC8(), - array, - KNullDesC8(), - NULL ); - - EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteNotDesired ) - // Everything is OK - CMusManager::SetAvailability( - ( MultimediaSharing::TMusAvailabilityStatus ) KErrNone ); - - response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), - KNullDesC8(), - array, - KNullDesC8(), - NULL ); - - EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteNotDesired ) - - // 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 ) - FeatureManager::MultimediaSharingSupported(); - SIPStrings::Close(); - - } - - -// -------------------------------------------------------------------------- -// -// -------------------------------------------------------------------------- -// -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 ); - } - - - - -// TEST TABLE - -EUNIT_BEGIN_TEST_TABLE( - CMusSipCrPluginTest, - "CMusSipCrPluginTest", - "CMusSipCrPluginTest" ) - -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_END_TEST_TABLE - diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/ut_mussipcrplugindllmain.cpp --- a/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/ut_mussipcrplugindllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/data/10282390.rss --- a/mmshplugins/mmshwpadapterplugin/data/10282390.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/data/muswpadapterresource.rss --- a/mmshplugins/mmshwpadapterplugin/data/muswpadapterresource.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/group/bld.inf --- a/mmshplugins/mmshwpadapterplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/group/muswpadapter.mmp --- a/mmshplugins/mmshwpadapterplugin/group/muswpadapter.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/inc/muswpadapter.h --- a/mmshplugins/mmshwpadapterplugin/inc/muswpadapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/inc/muswpadapteruids.h --- a/mmshplugins/mmshwpadapterplugin/inc/muswpadapteruids.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/inc/muswpitem.h --- a/mmshplugins/mmshwpadapterplugin/inc/muswpitem.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/src/muswpadapter.cpp --- a/mmshplugins/mmshwpadapterplugin/src/muswpadapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,404 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/src/muswpadaptergroupproxy.cpp --- a/mmshplugins/mmshwpadapterplugin/src/muswpadaptergroupproxy.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/src/muswpitem.cpp --- a/mmshplugins/mmshwpadapterplugin/src/muswpitem.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -/* -* 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::EAlwaysActive; - } - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/BWINS/ut_muswpadapterU.DEF --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/BWINS/ut_muswpadapterU.DEF Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/bld.inf --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_TESTMMPFILES - -ut_muswpadapter.mmp diff -r b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/ut_muswpadapter.mmp --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/ut_muswpadapter.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include - -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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/muswpadapterstubs.h --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/muswpadapterstubs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpadapter.h --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpadapter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpitem.h --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpitem.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef UT_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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/muswpadapterstubs.cpp --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/muswpadapterstubs.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapter.cpp --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapter.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,736 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapterdllmain.cpp --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapterdllmain.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpitem.cpp --- a/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpitem.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,400 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// 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::EAlwaysActive ) - 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 b31261fd4e04 -r ccd8e69b5392 mmshplugins/tsrc/group/bld.inf --- a/mmshplugins/tsrc/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 package_definition.xml --- a/package_definition.xml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 rom/multimediasharing.iby --- a/rom/multimediasharing.iby Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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__ - - -#ifdef __MULTIMEDIA_SHARING - - -/*======================================================================== -* MUS UI -* ======================================================================== -*/ -S60_APP_EXE(musui) -S60_APP_AIF_ICONS(musui) -data=DATAZ_\BITMAP_DIR\musuiicons.mif BITMAP_DIR\musuiicons.mif -data=DATAZ_\BITMAP_DIR\musuitoolbaricons.mif BITMAP_DIR\musuitoolbaricons.mif -data=ZPRIVATE\10003A3F\APPS\musui_reg.rsc PRIVATE\10003A3F\IMPORT\APPS\musui_reg.rsc -#ifndef RD_APPS_TO_EXES -SCALABLE_IMAGE(System\Apps\musui,System\Apps\musui,musui) -#else -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,musui) -#endif - - -/*======================================================================== -* 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\musengine.dll SHARED_LIB_DIR\musengine.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) - -// 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 - - -/*======================================================================== -* MUS SIS stub -* ======================================================================== -*/ -data=DATAZ_\system\install\multimediasharing_stub.sis system\install\multimediasharing_stub.sis - - -/*======================================================================== -* 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 b31261fd4e04 -r ccd8e69b5392 rom/multimediasharing_stub.SIS Binary file rom/multimediasharing_stub.SIS has changed diff -r b31261fd4e04 -r ccd8e69b5392 rom/multimediasharingresources.iby --- a/rom/multimediasharingresources.iby Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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__ - -#ifdef __MULTIMEDIA_SHARING - -/*======================================================================== -* MUS UI -* ======================================================================== -*/ -S60_APP_RESOURCE( musui ) - -/*======================================================================== -* 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 b31261fd4e04 -r ccd8e69b5392 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/inc/apacmdln.h --- a/tsrc/Apastub/inc/apacmdln.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/inc/apgcli.h --- a/tsrc/Apastub/inc/apgcli.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,304 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/inc/apgtask.h --- a/tsrc/Apastub/inc/apgtask.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/src/apacmdln.cpp --- a/tsrc/Apastub/src/apacmdln.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "apacmdln.h" - - -CApaCommandLine* CApaCommandLine::NewLC() - { - CApaCommandLine* line = new(ELeave ) CApaCommandLine(); - CleanupStack::PushL( line ); - - return line; - } - -CApaCommandLine::CApaCommandLine() - { - - } - -void CApaCommandLine::SetExecutableNameL( const TDesC& ) - { - - } - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/src/apgcli.cpp --- a/tsrc/Apastub/src/apgcli.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/Apastub/src/apgtask.cpp --- a/tsrc/Apastub/src/apgtask.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorapp.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorapp.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorappui.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorappui.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* 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(); - iPhoneResources->ReadL(); - - CCenrepEditorView1* view1 = new (ELeave) CCenrepEditorView1; - CleanupStack::PushL( view1 ); - view1->ConstructL(); - AddViewL( view1 ); // transfer ownership to CAknViewAppUi - CleanupStack::Pop(); // view1 - - iOtherResources = COtherResources::NewL(); - iOtherResources->ReadL(); - - 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditordocument.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditordocument.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorlistbox.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorlistbox.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorlistbox2.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorlistbox2.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include -#include "cenrepeditorListbox2.h" - -#include "cenrepeditorListbox2.h" -#include - -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 EOtherRResourcePrivacyVariationMode: - settingItem=ConstructByValueL( aIdentifier, iOtherResources->iPrivacyVariation ); - 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 ); - break; - default: - break; - } - return settingItem; - } - - -void COtherResourcesListbox::SetData(COtherResources* aOtherResources) - { - iOtherResources = aOtherResources; - } - -void COtherResourcesListbox::SizeChanged() - { - if (ListBox()) - { - ListBox()->SetRect(Rect()); - } - } - - -// ------------------------------------------------------------------ -// CPhoneResourcesListbox::ConstructByValueL( aIdentifier, ) -// ------------------------------------------------------------------ -// - -CAknSettingItem* COtherResourcesListbox::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 ; - } - - -void COtherResourcesListbox::EditItemL(TInt aIndex, TBool aCalledFromMenu) - { - CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu); - - CAknSettingItem* currentItem = SettingItemArray()->At(aIndex); - if ( currentItem->Identifier() == EOtherResourceEncodingDevice ) - { - TLex lex( currentItem->SettingTextL() ); - TUint uid; - TInt err = lex.Val(uid, EHex); - - if ( (err != KErrNone) || !lex.Eos() ) - { - currentItem->LoadL(); - currentItem->UpdateListBoxTextL(); - - CAknWarningNote* warningNote = new (ELeave) CAknWarningNote; - warningNote->ExecuteLD(_L("Invalid value")); - } - } - } diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorlistbox3.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorlistbox3.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditormodel.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditormodel.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,523 +0,0 @@ -/* -* 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() - { - // create a new expense object - CPhoneResources* self = new (ELeave) CPhoneResources(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -CPhoneResources* CPhoneResources::NewL() - { - CPhoneResources* self = CPhoneResources::NewLC(); - CleanupStack::Pop(); - return self; - } - -void CPhoneResources::ConstructL() - { - iCameraAvailability = -1; - iKeypadAvailability = -1 ; - iVideoPlayerAvailability = -1; - iCameraInformation = -1; - iKodiakPhoneCall = -1; - iDummy = 1; // just a postive value , dirty idea but just works at this time - } - -void CPhoneResources::ReadL() - { - TInt err = KErrNone; - // 1. camera property - err = RProperty::Get( NMusResourceApi::KCategoryUid, - NMusResourceApi::KCameraAvailability, - iCameraAvailability); - if(err)HandleError(ETrue,err,_L("CameraAvailability")); - // 2. keypad property - err = RProperty::Get( NMusResourceApi::KCategoryUid, - NMusResourceApi::KKeypadAvailability, - iKeypadAvailability ); - if(err)HandleError(ETrue , err,_L("KeypadAvailability")); - // 3. video player property - err = RProperty::Get( NMusResourceApi::KCategoryUid, - NMusResourceApi::KVideoPlayerAvailability, - iVideoPlayerAvailability ); - if(err)HandleError( ETrue, err ,_L("VideoPlayerAvailability")); - // 3. video player property - err = RProperty::Get( NMusResourceApi::KCategoryUid, - NMusResourceApi::KCameraInformation, - iCameraInformation ); - if(err)HandleError( ETrue, err ,_L("CameraInformation")); - err = RProperty::Get( KPSUidCtsyCallInformation, - KCTsyKodiakPtt, - iKodiakPhoneCall ); - if(err) - { - iKodiakPhoneCall = EPSCTsyKodiakPttNotActive; - RProperty::Define(KPSUidCtsyCallInformation,KCTsyKodiakPtt,EPSCTsyKodiakPttNotActive); - } - } - - -CPhoneResources::~CPhoneResources() - { - } - -void CPhoneResources::SaveL() - { - //TInt err = KErrNone; - - User::LeaveIfError(SetValueL( NMusResourceApi::KCategoryUid, - NMusResourceApi::KCameraAvailability, - iCameraAvailability)); - //if(err)HandleError( EFalse, err ,_L("CameraAvailability")); - // 2. keypad property - User::LeaveIfError(SetValueL( NMusResourceApi::KCategoryUid, - NMusResourceApi::KKeypadAvailability, - iKeypadAvailability )); - //if(err)HandleError(EFalse, err,_L("KeypadAvailability")); - // 3. video player property - User::LeaveIfError(SetValueL( NMusResourceApi::KCategoryUid, - NMusResourceApi::KVideoPlayerAvailability, - iVideoPlayerAvailability )); - //if(err)HandleError(EFalse, err,_L("VideoPlayerAvailability")); - // 3. video player property - User::LeaveIfError(SetValueL( NMusResourceApi::KCategoryUid, - NMusResourceApi::KCameraInformation, - iCameraInformation )); - //if(err)HandleError(EFalse, err,_L("CameraInformation")); - // 4. Kodiak PS Key - User::LeaveIfError(SetValueL( KPSUidCtsyCallInformation, - KCTsyKodiakPtt, - iKodiakPhoneCall )); - //if(err)HandleError( EFalse, err ,_L("KodiakPSKeyInformation")); - } - -TInt CPhoneResources::SetValueL(TUid aCategory, TUint aKey, TInt aValue) - { - if(aValue<0)return KErrNone; // dont care if the key is not read intially - return RProperty::Set( aCategory, aKey, aValue ); - } - - -void CPhoneResources::HandleError(TBool aType ,TInt aError , TPtrC aKeyName ) - { - CAknErrorNote *dlg = new CAknErrorNote(ETrue); - TBuf<100> buf; - if(aType) - { - buf.Append(_L("Unable to Read Key ")); - } - else - { - buf.Append(_L("Unable to Save ")); - } - buf.Append(aKeyName); - buf.Append(_L(" Error ")); - buf.AppendNum(aError); - dlg->ExecuteLD(buf); - } - -COtherResources* COtherResources::NewLC() - { - // create a new expense object - 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() - { - iActivation = -1 ; - iOperatorVariant = -1 ; - iAuditoryNotification = -1; - iPopupNotification = -1 ; - iPopupNotificationType = -1 ; - iEdgeDtmSupport = -1 ; - iSessionSetupMethod = -1 ; - iAutoRecord = -1 ; - iVideoLocation = -1 ; - iSipProfileId = -1 ; - iUiOrientation = -1 ; - iCapabilityQuery = -1; - iProductModeVariation=-1; - iEncodingDevice = -1; - iPrivacyVariation = -1; - iDummy = 1; // just a postive value - } - -void COtherResources::ReadL() - { - - TRAPD(err,ReadCRKeyValuesL()); - if(err) HandleError (ETrue,err,_L("Read Error")); - - } - -void COtherResources::ReadCRKeyValuesL() -{ - - TInt err=KErrNone; - CRepository* cr = NULL ; - TRAP(err,cr = CRepository::NewL( MusSettingsKeys::KRepositoryUid )); - cr->CleanupCancelTransactionPushL(); - if(err) - { - CAknErrorNote *dlg = new CAknErrorNote(ETrue); - dlg->ExecuteLD(_L(\ - "Unable to Construct CRepository for UID 0x1028238B")); - return ; // dont leave - } - - ReadKeyValueL( cr, MusSettingsKeys::KActivation,iActivation ); - ReadKeyValueL( cr, MusSettingsKeys::KOperatorVariant,iOperatorVariant); - ReadKeyValueL( cr, MusSettingsKeys::KAuditoryNotification, iAuditoryNotification); - ReadKeyValueL( cr, MusSettingsKeys::KPopupNotification, iPopupNotification); - ReadKeyValueL( cr, MusSettingsKeys::KPopupNotificationType, iPopupNotificationType); - ReadKeyValueL( cr, MusSettingsKeys::KEdgeDtmSupport, iEdgeDtmSupport); - ReadKeyValueL( cr, MusSettingsKeys::KForceInternetSignaling, iSessionSetupMethod); - ReadKeyValueL( cr, MusSettingsKeys::KAutoRecord, iAutoRecord); - ReadKeyValueL( cr, MusSettingsKeys::KVideoLocation, iVideoLocation); - ReadKeyValueL( cr, MusSettingsKeys::KSipProfileId, iSipProfileId); - ReadKeyValueL( cr, MusSettingsKeys::KUiOrientation, iUiOrientation); - ReadKeyValueL( cr, MusSettingsKeys::KCapabilityQuery, iCapabilityQuery); - ReadKeyValueL( cr, MusSettingsKeys::KProductModeVariation, iProductModeVariation); - ReadKeyValueL( cr, MusSettingsKeys::KEncoderConfigurationInfo, iEncoderInfo ); - ReadKeyValueL( cr, MusSettingsKeys::KEncodingDevice, iEncodingDevice ); - ReadKeyValueL( cr, MusSettingsKeys::KPrivacyExchange, iPrivacyVariation ); - - iEncodingDeviceStr.Zero(); - iEncodingDeviceStr.AppendNum(iEncodingDevice, EHex); - - CleanupStack::PopAndDestroy(cr); - delete cr; - -} - - -COtherResources::~COtherResources() - { - } - -void COtherResources::SaveL() - { - - TRAPD(err,SaveCRKeyValuesL()); - if(err) HandleError (ETrue,err,_L("Save Error")); - - } - -void COtherResources::SaveCRKeyValuesL() - { - CRepository* cr = NULL ; - TRAPD(err,cr = CRepository::NewL( MusSettingsKeys::KRepositoryUid )); - cr->CleanupCancelTransactionPushL(); - if(err) - { - CAknErrorNote *dlg = new CAknErrorNote(ETrue); - dlg->ExecuteLD(_L(\ - "Unable to Construct CRepository for UID 0x1028238B")); - User::Leave(err); - } - SetKeyValueL( cr,MusSettingsKeys::KActivation, iActivation); - SetKeyValueL( cr,MusSettingsKeys::KOperatorVariant, iOperatorVariant); - SetKeyValueL( cr,MusSettingsKeys::KAuditoryNotification, iAuditoryNotification); - SetKeyValueL( cr,MusSettingsKeys::KPopupNotification, iPopupNotification); - SetKeyValueL( cr,MusSettingsKeys::KPopupNotificationType, iPopupNotificationType); - SetKeyValueL( cr,MusSettingsKeys::KEdgeDtmSupport, iEdgeDtmSupport); - SetKeyValueL( cr,MusSettingsKeys::KForceInternetSignaling, iSessionSetupMethod); - SetKeyValueL( cr,MusSettingsKeys::KAutoRecord, iAutoRecord); - SetKeyValueL( cr,MusSettingsKeys::KVideoLocation, iVideoLocation); - SetKeyValueL( cr,MusSettingsKeys::KSipProfileId, iSipProfileId); - SetKeyValueL( cr,MusSettingsKeys::KUiOrientation, iUiOrientation); - SetKeyValueL( cr,MusSettingsKeys::KCapabilityQuery, iCapabilityQuery); - SetKeyValueL( cr,MusSettingsKeys::KProductModeVariation, iProductModeVariation); - SetKeyValueL( cr,MusSettingsKeys::KEncoderConfigurationInfo, iEncoderInfo ); - SetKeyValueL( cr,MusSettingsKeys::KPrivacyExchange, iPrivacyVariation ); - - TLex lex( iEncodingDeviceStr ); - TUint uid; - err = lex.Val(uid, EHex); - if ( (err == KErrNone) && lex.Eos() ) - { - iEncodingDevice = uid; - SetKeyValueL( cr, MusSettingsKeys::KEncodingDevice, iEncodingDevice ); - } - - CleanupStack::PopAndDestroy(cr); - delete cr; - } - -void COtherResources::SetKeyValueL(CRepository* repository, const TInt & aKey , TInt & aVal) - { - if(aVal<0) return; // dont care if key is not intially read - TUint32 key(aKey); - User::LeaveIfError(repository->StartTransaction( - CRepository::EConcurrentReadWriteTransaction)); - User::LeaveIfError(repository->Set(key,aVal)); - User::LeaveIfError(repository->CommitTransaction(key)); - } - -void COtherResources::ReadKeyValueL(CRepository* repository, const TInt & aKey , TInt & aVal) - { - TUint32 key(aKey); - User::LeaveIfError(repository->StartTransaction( - CRepository::EConcurrentReadWriteTransaction)); - User::LeaveIfError(repository->Get(key,aVal)); - User::LeaveIfError(repository->CommitTransaction(key)); - } - -void COtherResources::SetKeyValueL(CRepository* repository, TInt aKey, const TDesC& aVal) - { - TUint32 key(aKey); - User::LeaveIfError(repository->StartTransaction( - CRepository::EConcurrentReadWriteTransaction)); - User::LeaveIfError(repository->Set(key,aVal)); - User::LeaveIfError(repository->CommitTransaction(key)); - } - -void COtherResources::ReadKeyValueL(CRepository* repository, TInt aKey, TDes& aVal) - { - TUint32 key(aKey); - User::LeaveIfError(repository->StartTransaction( - CRepository::EConcurrentReadWriteTransaction)); - User::LeaveIfError(repository->Get(key,aVal)); - User::LeaveIfError(repository->CommitTransaction(key)); - } - -void COtherResources::HandleError(TBool aType , - TInt aError , TPtrC aKeyName ) - { - CAknErrorNote *dlg = new CAknErrorNote(ETrue); - TBuf<100> buf; - if(aType) - { - buf.Append(_L("Unable to Read Key ")); - } - else - { - buf.Append(_L("Unable to Save Key ")); - } - buf.Append(aKeyName); - buf.Append(_L(" Error ")); - buf.AppendNum(aError); - dlg->ExecuteLD(buf); - } - -CMusApplication* CMusApplication::NewLC() - { - // create a new expense object - 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() - { - TInt status = KErrGeneral; - /*TRequestStatus requestStatus; - TRAPD(err,iMultimediasharing-> - MonitorAvailabilityL( - requestStatus, - MultimediaSharing::TMusAvailabilityStatus(status)) - ); - if(err)HandleError(err,_L("MusAvailability ")); - User::WaitForRequest(requestStatus); - */ - return status; - } - - - -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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview1.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview1.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview1container.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview1container.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview2.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview2.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview2container.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview2container.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview3.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview3.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/Src/cenrepeditorview3container.cpp --- a/tsrc/CenrepEditor/Src/cenrepeditorview3container.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/data/cenrepeditor.rss --- a/tsrc/CenrepEditor/data/cenrepeditor.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1026 +0,0 @@ -/* -* 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_availability_settings_page; - name = "CameraAvailability"; - associated_resource = r_availability_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EPhoneResouceKeypad; - setting_page_resource = r_availability_settings_page; - name = "KeypadAvailability"; - associated_resource = r_availability_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EPhoneResouceVideoPlayer; - setting_page_resource = r_availability_settings_page; - name = "VideoPlayerAvailability"; - associated_resource = r_availability_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EPhoneResouceCameraInformation; - setting_page_resource = r_CameraInformation_settings_page; - name = "CameraInformation"; - associated_resource = r_CameraInformation_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EKodiakPhoneCall; - setting_page_resource = r_kodiak_call_settings_page; - name = "KodiakPTT"; - associated_resource = r_kodiak_call_settings_page_texts; - } - }; - } - - - -//camera -RESOURCE AVKON_SETTING_PAGE r_availability_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_availability_settings_page_texts - { - setting_texts_resource = r_availability_page_texts_array; - popped_up_texts_resource = r_availability_settings_page_popedup; - } - -RESOURCE ARRAY r_availability_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=1; text = "1.EAvailable"; }, - AVKON_ENUMERATED_TEXT { value=2; text = "2.ENotAvailable"; } - }; - } - -RESOURCE ARRAY r_availability_settings_page_popedup - { - items = - { - LBUF { txt = "1.EAvailable"; }, - LBUF { txt = "2.ENotAvailable"; } - }; - } - -//camera information -RESOURCE AVKON_SETTING_PAGE r_CameraInformation_settings_page - { - number = 1; - label = "Value"; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -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_SETTING_PAGE r_kodiak_call_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_kodiak_call_settings_page_texts - { - setting_texts_resource = r_kodiak_call_settings_page_texts_array; - popped_up_texts_resource = r_kodiak_call_settings_page_popedup; - } - -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 ARRAY r_kodiak_call_settings_page_popedup - { - items = - { - LBUF { txt = "0.EPSCTsyKodiakPttNotActive"; }, - LBUF { txt = "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_activation_editor_settings_page; - name = "Activation"; - associated_resource = r_activation_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceOperatorVariant; - setting_page_resource = r_operator_editor_settings_page; - name = "OperatorVariant"; - associated_resource = r_operator_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceAuditoryNotification; - setting_page_resource = r_Auditory_editor_settings_page; - name = "AuditoryNotification"; - associated_resource = r_Auditory_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourcePopupNotification; - setting_page_resource = r_Popup_editor_settings_page; - name = "PopupNotification"; - associated_resource = r_Popup_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourcePopupNotificationType; - setting_page_resource = r_PopupType_editor_settings_page; - name = "PopupNotificationType"; - associated_resource = r_PopupType_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceEdgeDtmSupport; - setting_page_resource = r_edgedtm_editor_settings_page; - name = "EdgeDtmSupport"; - associated_resource = r_edgedtm_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceSessionSetupMethod; - setting_page_resource = r_signal_editor_settings_page; - name = "ForceInternetSignaling"; - associated_resource = r_signal_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceAutoRecord; - setting_page_resource = r_videosaving_editor_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_uiorientation_editor_settings_page; - name = "UiOrientation"; - associated_resource = r_uiorientation_editor_settings_page_texts; - }, - AVKON_SETTING_ITEM - { - identifier = EOtherResourceCapabilityQuery; - setting_page_resource = r_capquery_editor_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 = EOtherRResourcePrivacyVariationMode; - setting_page_resource = r_privacy_settings_page; - name = "Privacy variation"; - associated_resource = r_privacy_editor_settings_page_texts; - }, - 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"; - } - }; - } - -//activation -RESOURCE AVKON_SETTING_PAGE r_activation_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_activation_editor_settings_page_texts - { - setting_texts_resource = r_activation_editor_settings_page_texts_array; - popped_up_texts_resource = r_activation_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_activation_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EAlwaysActive"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.ENever"; } - }; - } - -RESOURCE ARRAY r_activation_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EAlwaysActive"; }, - LBUF { txt = "1.ENever"; } - }; - } - -//operator variant -RESOURCE AVKON_SETTING_PAGE r_operator_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_operator_editor_settings_page_texts - { - setting_texts_resource = r_operator_editor_settings_page_texts_array; - popped_up_texts_resource = r_operator_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_operator_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EStandard"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EOperatorSpecific"; } - }; - } - -RESOURCE ARRAY r_operator_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EStandard"; }, - LBUF { txt = "1.EOperatorSpecific"; } - }; - } - -//Auditory Notification -RESOURCE AVKON_SETTING_PAGE r_Auditory_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_Auditory_editor_settings_page_texts - { - setting_texts_resource = r_Auditory_editor_settings_page_texts_array; - popped_up_texts_resource = r_Auditory_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_Auditory_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EAuditoryNotificationOn"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EAuditoryNotificationOff"; } - }; - } - -RESOURCE ARRAY r_Auditory_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EAuditoryNotificationOn"; }, - LBUF { txt = "1.EAuditoryNotificationOff"; } - }; - } - - -//Popup Notification -RESOURCE AVKON_SETTING_PAGE r_Popup_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_Popup_editor_settings_page_texts - { - setting_texts_resource = r_Popup_editor_settings_page_texts_array; - popped_up_texts_resource = r_Popup_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_Popup_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EPopupNotificationOn"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EPopupNotificationOff"; } - }; - } - -RESOURCE ARRAY r_Popup_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EPopupNotificationOn"; }, - LBUF { txt = "1.EPopupNotificationOff"; } - }; - } - -//Popup Notification Type -RESOURCE AVKON_SETTING_PAGE r_PopupType_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_PopupType_editor_settings_page_texts - { - setting_texts_resource = r_PopupType_editor_settings_page_texts_array; - popped_up_texts_resource = r_PopupType_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_PopupType_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.ENotificationTypeQueryUser"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.ENotificationTypePopup"; } - }; - } - -RESOURCE ARRAY r_PopupType_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.ENotificationTypeQueryUser"; }, - LBUF { txt = "1.ENotificationTypePopup"; } - }; - } - - -//EDGE/DTM -RESOURCE AVKON_SETTING_PAGE r_edgedtm_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_edgedtm_editor_settings_page_texts - { - setting_texts_resource = r_edgedtm_editor_settings_page_texts_array; - popped_up_texts_resource = r_edgedtm_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_edgedtm_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EDtmModeAllowed"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EDtmModeNotAllowed"; } - }; - } - -RESOURCE ARRAY r_edgedtm_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EDtmModeAllowed"; }, - LBUF { txt = "1.EDtmModeNotAllowed"; } - }; - } - -//Internet Signalling -RESOURCE AVKON_SETTING_PAGE r_signal_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_signal_editor_settings_page_texts - { - setting_texts_resource = r_signal_editor_settings_page_texts_array; - popped_up_texts_resource = r_signal_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_signal_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EForceInternetSignaling"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EFollowProfileConfiguration"; } - }; - } - -RESOURCE ARRAY r_signal_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EForceInternetSignaling"; }, - LBUF { txt = "1.EFollowProfileConfiguration"; } - }; - } - -//Video Saving -RESOURCE AVKON_SETTING_PAGE r_videosaving_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_videosaving_editor_settings_page_texts - { - setting_texts_resource = r_videosaving_editor_settings_page_texts_array; - popped_up_texts_resource = r_videosaving_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_videosaving_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EAutoRecordOn"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EAutoRecordOff"; } - }; - } - -RESOURCE ARRAY r_videosaving_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EAutoRecordOn"; }, - LBUF { txt = "1.EAutoRecordOff"; } - }; - } - -//UI Orientation -RESOURCE AVKON_SETTING_PAGE r_uiorientation_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_uiorientation_editor_settings_page_texts - { - setting_texts_resource = r_uiorientation_editor_settings_page_texts_array; - popped_up_texts_resource = r_uiorientation_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_uiorientation_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.EPortrait"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.ELandscape"; } - }; - } - -RESOURCE ARRAY r_uiorientation_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EPortrait"; }, - LBUF { txt = "1.ELandscape"; } - }; - } - -//Capability Query -RESOURCE AVKON_SETTING_PAGE r_capquery_editor_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_capquery_editor_settings_page_texts - { - setting_texts_resource = r_capquery_editor_settings_page_texts_array; - popped_up_texts_resource = r_capquery_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_capquery_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=0; text = "0.ESequential"; }, - AVKON_ENUMERATED_TEXT { value=1; text = "1.EParallel"; }, - AVKON_ENUMERATED_TEXT { value=2; text = "2.ENoOptions"; } - }; - } - -RESOURCE ARRAY r_capquery_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.ESequential"; }, - LBUF { txt = "1.EParallel"; }, - LBUF { txt = "2.ENoOptions"; } - }; - } - -//Privacy -RESOURCE AVKON_SETTING_PAGE r_privacy_settings_page - { - number = 1; - type = EAknCtPopupSettingList; - editor_resource_id = r_enumerated_text_setting_other_editor; - } - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_privacy_editor_settings_page_texts - { - setting_texts_resource = r_privacy_editor_settings_page_texts_array; - popped_up_texts_resource = r_privacy_editor_settings_page_popedup; - } - -RESOURCE ARRAY r_privacy_editor_settings_page_texts_array - { - items = - { - AVKON_ENUMERATED_TEXT { value=1; text = "0.EPrivacyOn"; }, - AVKON_ENUMERATED_TEXT { value=2; text = "1.ErivacyOff"; } - }; - } -RESOURCE ARRAY r_privacy_editor_settings_page_popedup - { - items = - { - LBUF { txt = "0.EPrivacyOn"; }, - LBUF { txt = "1.ErivacyOfff"; } - }; - } - -// 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_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; - popped_up_texts_resource = r_usecase_array_texts; - } -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 ARRAY r_usecase_array_texts - { - items = { - LBUF - { - txt = "Live"; - }, - LBUF - { - txt = "Clip"; - }, - LBUF - { - txt = "StillImage"; - }, - LBUF - { - txt = "Receive"; - }, - LBUF - { - txt = "Continue"; - } - }; - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/data/cenrepeditor_reg.rss --- a/tsrc/CenrepEditor/data/cenrepeditor_reg.rss Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/group/CenrepEditor.mmp --- a/tsrc/CenrepEditor/group/CenrepEditor.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* 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 -#include - -TARGET CenrepEditor.exe -TARGETTYPE exe - -UID 0x100039CE 0x10282398 -VENDORID VID_DEFAULT -CAPABILITY EUNIT_CAPS - - -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 -USERINCLUDE ../../../common/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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/group/bld.inf --- a/tsrc/CenrepEditor/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditor.hrh --- a/tsrc/CenrepEditor/inc/cenrepeditor.hrh Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* 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, - EOtherRResourcePrivacyVariationMode - }; -enum TAvkonViewApplicationStartStop - { - EApplicationStartStop=1 - }; - -#endif // AIWTESTAPP_HRH diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditor.loc --- a/tsrc/CenrepEditor/inc/cenrepeditor.loc Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorApp.h --- a/tsrc/CenrepEditor/inc/cenrepeditorApp.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorappui.h --- a/tsrc/CenrepEditor/inc/cenrepeditorappui.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditordocument.h --- a/tsrc/CenrepEditor/inc/cenrepeditordocument.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorlistbox.h --- a/tsrc/CenrepEditor/inc/cenrepeditorlistbox.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorlistbox2.h --- a/tsrc/CenrepEditor/inc/cenrepeditorlistbox2.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef 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); - - public: // Implementation from base class - // void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); - // TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); - - void EditItemL(TInt aIndex, TBool aCalledFromMenu); - - private: - void SizeChanged(); - CAknSettingItem* ConstructByValueL( TInt aIdentifier, - TInt& aVal ); - - private: - COtherResources* iOtherResources; - }; - -#endif diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorlistbox3.h --- a/tsrc/CenrepEditor/inc/cenrepeditorlistbox3.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditormodel.h --- a/tsrc/CenrepEditor/inc/cenrepeditormodel.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* 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(); - void SaveCRKeyValuesL(); - void ReadL(); - void ReadCRKeyValuesL(); - void ReadKeyValueL(CRepository* repository, const TInt & aKey , TInt & aVal); - void SetKeyValueL(CRepository* repository, const TInt & aKey , TInt & aVal); - - void ReadKeyValueL(CRepository* repository, TInt aKey, TDes& aVal); - void SetKeyValueL(CRepository* repository, TInt aKey, const TDesC& aVal); - - private : - void HandleError(TBool aType ,TInt aError , TPtrC aKeyName ); - - 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 iPrivacyVariation; - TInt iDummy; - - TBuf iEncoderInfo; - TBuf iEncodingDeviceStr; - - private : - void ConstructL(); - }; - -class CPhoneResources : public CBase - { - public: - static CPhoneResources* NewL(); - static CPhoneResources* NewLC(); - ~CPhoneResources(); - public : - void SaveL(); - void ReadL(); - private : - void HandleError(TBool aType ,TInt aError , TPtrC aKeyName ); - public: - TInt iCameraAvailability; - TInt iKeypadAvailability; - TInt iVideoPlayerAvailability; - TInt iCameraInformation; - TInt iKodiakPhoneCall; - TInt iDummy; - - private : - void ConstructL(); - TInt 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview1.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview1.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview1container.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview1container.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview2.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview2.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview2container.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview2container.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview3.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview3.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/inc/cenrepeditorview3container.h --- a/tsrc/CenrepEditor/inc/cenrepeditorview3container.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/install/cenrepeditor.pkg --- a/tsrc/CenrepEditor/install/cenrepeditor.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; -; 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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/install/cenrepeditor.sis Binary file tsrc/CenrepEditor/install/cenrepeditor.sis has changed diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/install/cenrepeditor.sisx Binary file tsrc/CenrepEditor/install/cenrepeditor.sisx has changed diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/install/sis_udeb.bat --- a/tsrc/CenrepEditor/install/sis_udeb.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/CenrepEditor/install/sis_update_udeb.bat --- a/tsrc/CenrepEditor/install/sis_update_udeb.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -@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-tmp.sis -signsis -cr -s "cenrepeditor-tmp.SIS" "cenrepeditor.sisx" "RDTest_02.der" "RDTest_02.key" -REM del cenrepeditor-tmp.sis diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/aknstub/inc/aknappui.h --- a/tsrc/aknstub/inc/aknappui.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __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 b31261fd4e04 -r ccd8e69b5392 tsrc/aknstub/src/aknappui.cpp --- a/tsrc/aknstub/src/aknappui.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "aknappui.h" - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/centralrepositorystub/inc/centralrepository.h --- a/tsrc/centralrepositorystub/inc/centralrepository.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ -/* -* 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 - - -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(); - - -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; - - TUid iRepositoryUid; - - - - }; - -#endif // __CENTRALREPOSITORY_H__ diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/centralrepositorystub/src/centralrepositorystub.cpp --- a/tsrc/centralrepositorystub/src/centralrepositorystub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -/* -* 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; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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.Reset(); - iValues.Reset(); - iDesC8Keys.Reset(); - 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; - } - } - } - - 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; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CRepository::CRepository( TUid aRepositoryUid ) - :iRepositoryUid( aRepositoryUid ) - { - } - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/cmusavainterfacestub/inc/cmusavainterfacestub.h --- a/tsrc/cmusavainterfacestub/inc/cmusavainterfacestub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* 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 ); - -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 b31261fd4e04 -r ccd8e69b5392 tsrc/cmusavainterfacestub/src/cmusavainterfacestub.cpp --- a/tsrc/cmusavainterfacestub/src/cmusavainterfacestub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,293 +0,0 @@ -/* -* 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::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::NewL( - TUid /*aUid*/, - TInt /*aVersion*/, - HBufC* /*aName*/, - HBufC8* /*aDataType*/, - HBufC8* /*aOpaqueData*/, - TDriveUnit /*aDrive*/, - TBool /*aRomOnly*/, - TBool /*aRomBased*/) - { - 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(); - } - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/drmstub/inc/drmcommon.h --- a/tsrc/drmstub/inc/drmcommon.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,697 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/drmstub/src/drmcommonstub.cpp --- a/tsrc/drmstub/src/drmcommonstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 b31261fd4e04 -r ccd8e69b5392 tsrc/etelstub/inc/etel.h --- a/tsrc/etelstub/inc/etel.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1190 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/etelstub/inc/etelmm.h --- a/tsrc/etelstub/inc/etelmm.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12672 +0,0 @@ -/* -* 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 ); - static void SetRemoteIdStatus( RMobileCall::TMobileCallRemoteIdentityStatus aStatus ); - }; - -#endif // __ETELMM_H__ - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/etelstub/src/etelstub.cpp --- a/tsrc/etelstub/src/etelstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,388 +0,0 @@ -/* -* 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; -static RMobileCall::TMobileCallRemoteIdentityStatus iRemoteIdStatus = RMobileCall::ERemoteIdentityUnknown; - - -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() - { - - } - -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; - callInfo.iRemoteParty.iRemoteIdStatus = iRemoteIdStatus; - 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; - } -void RTelHelper::SetRemoteIdStatus( RMobileCall::TMobileCallRemoteIdentityStatus aStatus ) - { - iRemoteIdStatus = aStatus; - } - -EXPORT_C void -RMobilePhone::GetIdentityServiceStatus(TRequestStatus& aReqStatus, - TMobilePhoneIdService /*aService*/, - TMobilePhoneIdServiceStatus& /*aStatus*/, - TMobileInfoLocation /*aLocation*/) const - { - aReqStatus = KRequestPending; - } - -EXPORT_C void -RMobilePhone::NotifyIdentityServiceStatus(TRequestStatus& aReqStatus, - const TMobilePhoneIdService /*aService*/, - TMobilePhoneIdServiceStatus& /*aStatus*/) const - { - aReqStatus = KRequestPending; - } diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/fbsbitmapstub/inc/fbs.h --- a/tsrc/fbsbitmapstub/inc/fbs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __FBSBITMAP__ -#define __FBSBITMAP__ - -#include - -enum TDisplayMode - { - ///No display mode - ENoneCopy, - ///Monochrome display mode (1 bpp) - EGray2Copy, - ///Four grayscales display mode (2 bpp) - EGray4Copy, - ///16 grayscales display mode (4 bpp) - EGray16Copy, - ///256 grayscales display mode (8 bpp) - EGray256Copy, - ///Low colour EGA 16 colour display mode (4 bpp) - EColor16Copy, - ///256 colour display mode (8 bpp) - EColor256Copy, - ///64,000 colour display mode (16 bpp) - EColor64KCopy, - ///True colour display mode (24 bpp) - EColor16MCopy, - ///(Not an actual display mode used for moving buffers containing bitmaps) - ERgbCopy, - ///4096 colour display (12 bpp). - EColor4KCopy, - EColor16MUCopy, - ///Display mode with alpha (24bpp colour plus 8bpp alpha) - EColor16MACopy, - //Any new display mode should be insterted here! - //There might be up to 255 display modes, so value of the last - //inserted EColorXXX enum item should be less than 256 - - //BC reasons! - EColorLastCopy, - }; - -class CFbsBitmap - { - - - public: - - CFbsBitmap(); - ~CFbsBitmap(); - - - TInt Create( const TSize& aSizeInPixels, TDisplayMode aDispMode); - - TInt CFbsBitmap::Load(const TDesC& /*aFileName*/, - TInt32 /*aId*/,TBool /*aShareIfLoaded*/); - - - TInt CFbsBitmap::Load(const TDesC& /*aFileName*/, - TInt32 /*aId*/,TBool /*aShareIfLoaded*/, - TUint /*aFileOffset*/); - - - - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/fbsbitmapstub/src/fbs.cpp --- a/tsrc/fbsbitmapstub/src/fbs.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include - - -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; - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/featmgrstub/inc/FeatMgr.h --- a/tsrc/featmgrstub/inc/FeatMgr.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -// 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 b31261fd4e04 -r ccd8e69b5392 tsrc/featmgrstub/src/FeatMgr.cpp --- a/tsrc/featmgrstub/src/FeatMgr.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/imagedecoderstub/inc/imageconversion.h --- a/tsrc/imagedecoderstub/inc/imageconversion.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __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 b31261fd4e04 -r ccd8e69b5392 tsrc/imagedecoderstub/src/imageconversion.cpp --- a/tsrc/imagedecoderstub/src/imageconversion.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing.pkg --- a/tsrc/install/multimediasharing.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing.xml --- a/tsrc/install/multimediasharing.xml Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - 1 - Multimedia Sharing - Upgrade package for Multimedia Sharing - - - - S60 - - 5 - 0 - - 2008 - 28 - - - - - - - - - \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing_stub.pkg --- a/tsrc/install/multimediasharing_stub.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing_udeb.pkg --- a/tsrc/install/multimediasharing_udeb.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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\musengine.dll"-"!:\sys\bin\musengine.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" diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing_update_udeb.pkg --- a/tsrc/install/multimediasharing_update_udeb.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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"} - -; ----------------------------------------------------------------------------------- - -;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\musengine.dll"-"!:\sys\bin\musengine.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" - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing_update_urel.pkg --- a/tsrc/install/multimediasharing_update_urel.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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"} - -; ----------------------------------------------------------------------------------- - -;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\musengine.dll"-"!:\sys\bin\musengine.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" diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/install/multimediasharing_urel.pkg --- a/tsrc/install/multimediasharing_urel.pkg Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; 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\musengine.dll"-"!:\sys\bin\musengine.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" diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/install/sis_udeb.bat --- a/tsrc/install/sis_udeb.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/sis_update_udeb.bat --- a/tsrc/install/sis_update_udeb.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/sis_update_urel.bat --- a/tsrc/install/sis_update_urel.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/install/sis_urel.bat --- a/tsrc/install/sis_urel.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/group/bld.inf --- a/tsrc/mceclientstub/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_MMPFILES -mceclientstub.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/group/mceclientstub.mmp --- a/tsrc/mceclientstub/group/mceclientstub.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 - -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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceamrcodec.h --- a/tsrc/mceclientstub/inc/mceamrcodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceaudiocodec.h --- a/tsrc/mceclientstub/inc/mceaudiocodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceaudiostream.h --- a/tsrc/mceclientstub/inc/mceaudiostream.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceavccodec.h --- a/tsrc/mceclientstub/inc/mceavccodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcecamerasource.h --- a/tsrc/mceclientstub/inc/mcecamerasource.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* 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; - - 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 ); - - /** - * 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(); - - /** - * Second-phase constructor. - */ - void ConstructL( CMceManager* aManager ); - - private: // Owned data - - TCameraInfo iCameraInfo; - - private: // Not owned data - - //CMceManager* iManager; - - private: // Reserved for future use - - TAny* iReserved; - - - public: // stub data - - TInt iCameraIndex; - TInt iZoomFactor; - TInt iDigitalZoomFactor; - TInt iContrast; - TInt iBrightness; - TInt iExposure; - TInt iWhiteBalance; - - }; - -#endif diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcecodec.h --- a/tsrc/mceclientstub/inc/mcecodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,412 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcedefs.h --- a/tsrc/mceclientstub/inc/mcedefs.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcedisplaysink.h --- a/tsrc/mceclientstub/inc/mcedisplaysink.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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 ); - - /** - * 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(); - - /** - * second-phase constructor - */ - void ConstructL( CMceManager* aManager ); - - private: // Reserved for future use - - TAny* iReserved; - - public: // stub data - - TInt iDisplayIndex; - - TRect iDisplayRect; - - TUint iDisplayPriority; - - TRotation iRotation; - - }; - -#endif diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcefilesink.h --- a/tsrc/mceclientstub/inc/mcefilesink.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcefilesource.h --- a/tsrc/mceclientstub/inc/mcefilesource.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceh263codec.h --- a/tsrc/mceclientstub/inc/mceh263codec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceinsession.h --- a/tsrc/mceclientstub/inc/mceinsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* 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. - */ - 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 \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceinsessionobserver.h --- a/tsrc/mceclientstub/inc/mceinsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcemanager.h --- a/tsrc/mceclientstub/inc/mcemanager.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,267 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcemediasink.h --- a/tsrc/mceclientstub/inc/mcemediasink.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcemediasource.h --- a/tsrc/mceclientstub/inc/mcemediasource.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcemediastream.h --- a/tsrc/mceclientstub/inc/mcemediastream.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mceoutsession.h --- a/tsrc/mceclientstub/inc/mceoutsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* 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); - - /** - * 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcertpobserver.h --- a/tsrc/mceclientstub/inc/mcertpobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcertpsink.h --- a/tsrc/mceclientstub/inc/mcertpsink.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcertpsource.h --- a/tsrc/mceclientstub/inc/mcertpsource.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcesession.h --- a/tsrc/mceclientstub/inc/mcesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcesessionobserver.h --- a/tsrc/mceclientstub/inc/mcesessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcespeakersink.h --- a/tsrc/mceclientstub/inc/mcespeakersink.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcestreambundle.h --- a/tsrc/mceclientstub/inc/mcestreambundle.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcestreamobserver.h --- a/tsrc/mceclientstub/inc/mcestreamobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcetransactiondatacontainer.h --- a/tsrc/mceclientstub/inc/mcetransactiondatacontainer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcevideocodec.h --- a/tsrc/mceclientstub/inc/mcevideocodec.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/inc/mcevideostream.h --- a/tsrc/mceclientstub/inc/mcevideostream.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceamrcodec.cpp --- a/tsrc/mceclientstub/src/mceamrcodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceaudiocodec.cpp --- a/tsrc/mceclientstub/src/mceaudiocodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceaudiostream.cpp --- a/tsrc/mceclientstub/src/mceaudiostream.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceavccodec.cpp --- a/tsrc/mceclientstub/src/mceavccodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcecamerasource.cpp --- a/tsrc/mceclientstub/src/mcecamerasource.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ -/* -* 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 ); - self->ConstructL( &aManager ); - 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 1; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -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 ) - { - iType = KMceCameraSource; - iCameraInfo.iMinZoom = 1; - iCameraInfo.iMaxZoom = 3; - iCameraInfo.iMaxDigitalZoom = 10; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMceCameraSource::ConstructL( CMceManager* /*aManager*/ ) - { - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcecodec.cpp --- a/tsrc/mceclientstub/src/mcecodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,304 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcedisplaysink.cpp --- a/tsrc/mceclientstub/src/mcedisplaysink.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* 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 ); - self->ConstructL( &aManager ); - 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; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMceDisplaySink::ConstructL( CMceManager* /*aManager*/ ) - { - } - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcefilesink.cpp --- a/tsrc/mceclientstub/src/mcefilesink.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcefilesource.cpp --- a/tsrc/mceclientstub/src/mcefilesource.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,389 +0,0 @@ -/* -* 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 ) - { - __ASSERT_ALWAYS( aManager, User::Leave( KErrArgument ) ); - - 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceh263codec.cpp --- a/tsrc/mceclientstub/src/mceh263codec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceinsession.cpp --- a/tsrc/mceclientstub/src/mceinsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* 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 -// ----------------------------------------------------------------------------- -// - -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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcemanager.cpp --- a/tsrc/mceclientstub/src/mcemanager.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,302 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcemediasink.cpp --- a/tsrc/mceclientstub/src/mcemediasink.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcemediasource.cpp --- a/tsrc/mceclientstub/src/mcemediasource.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcemediastream.cpp --- a/tsrc/mceclientstub/src/mcemediastream.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,401 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mceoutsession.cpp --- a/tsrc/mceclientstub/src/mceoutsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* 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 ) - { - 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::~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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcertpsink.cpp --- a/tsrc/mceclientstub/src/mcertpsink.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcertpsource.cpp --- a/tsrc/mceclientstub/src/mcertpsource.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcesession.cpp --- a/tsrc/mceclientstub/src/mcesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,397 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcespeakersink.cpp --- a/tsrc/mceclientstub/src/mcespeakersink.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcestreambundle.cpp --- a/tsrc/mceclientstub/src/mcestreambundle.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcetransactiondatacontainer.cpp --- a/tsrc/mceclientstub/src/mcetransactiondatacontainer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcevideocodec.cpp --- a/tsrc/mceclientstub/src/mcevideocodec.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/mcevideostream.cpp --- a/tsrc/mceclientstub/src/mcevideostream.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/mceclientstub/src/staticdllentry.cpp --- a/tsrc/mceclientstub/src/staticdllentry.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/mmusavasettingsstub/inc/mmusavasettingsstub.h --- a/tsrc/mmusavasettingsstub/inc/mmusavasettingsstub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* 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; - - /** - * Returns the direction of the mobile call. - * - * @return 0, if the direction of the call is unknown. - * 1, call is from public number. - * 2, call is from private number - */ - virtual TInt CallPrivacy(); - - - -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; - - /** - * Call privacy indicator - * - */ - - TInt iCallPrivacy; - - MUS_UNITTEST( UT_CMusAvailabilityPluginManager ) - - }; - -#endif // MMUSAVASETTINGSSTUB_H diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/mmusavasettingsstub/src/mmusavasettingsstub.cpp --- a/tsrc/mmusavasettingsstub/src/mmusavasettingsstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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; - } - -TInt CMusAvaSettings2::CallPrivacy() - { - return iCallPrivacy; - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/multimediasharingsettingsstub/inc/mussettings.h --- a/tsrc/multimediasharingsettingsstub/inc/mussettings.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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::TAutoRecord AutoRecordSettingL(); - - static TInt VideoLocationSettingL(); - - static HBufC* VideoFolderSettingLC(); - - - static HBufC* iVideoFolder; - static MusSettingsKeys::TAutoRecord iAutoRecord; - static TInt iVideoLocation; - - - }; - - -#endif // MUSSETTINGS_H \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/multimediasharingsettingsstub/src/mussettings.cpp --- a/tsrc/multimediasharingsettingsstub/src/mussettings.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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: - - -HBufC* MultimediaSharingSettings::VideoFolderSettingLC() - { - HBufC* res = iVideoFolder->AllocLC(); - return res; - - } - - -MusSettingsKeys::TAutoRecord MultimediaSharingSettings::AutoRecordSettingL() - { - return iAutoRecord; - } - - -TInt MultimediaSharingSettings::VideoLocationSettingL() - { - return iVideoLocation; - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musavaailabilitystub/inc/musavaavailabilitystub.h --- a/tsrc/musavaailabilitystub/inc/musavaavailabilitystub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* 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(); - -public: - - TInt iExecuteError; - TBool iExecuteLeave; - MMusAvaObserver::TAvailabilityStatus iStatusStub; - MMusAvaObserver::TAvailabilityName iNameStub; - -private: - - /** - * Pointer to CMusAvaSharedObject object - */ - CMusAvaSharedObject* iSharedObj; - - /** - * Pointer to CMusAvaSettingsImp object - */ - CMusAvaSettingsImp& iSettings; - }; - - -#endif // __MUSAVANETWORKAVAILABILITY_H__ \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musavaailabilitystub/src/musavaailabilitystub.cpp --- a/tsrc/musavaailabilitystub/src/musavaailabilitystub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* 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; - } - -// ------------------------------------------------------------------------- -// Constructor function. -// ------------------------------------------------------------------------- -// -CMusAvaAvailabilityStub::CMusAvaAvailabilityStub( - MMusAvaAvailabilityObserver& aObserver, - CMusAvaSettingsImp& aSettings) - :CMusAvaAvailability( aObserver ), - iSettings( aSettings ) - { - } - - -// ------------------------------------------------------------------------- -// Second phase constructor. -// ------------------------------------------------------------------------- -// -void CMusAvaAvailabilityStub::ConstructL() - { - - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/group/ABLD.BAT --- a/tsrc/musenginestub/group/ABLD.BAT Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\work\src\internal\stubs\musenginestub\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/group/bld.inf --- a/tsrc/musenginestub/group/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -PRJ_MMPFILES -musenginestub.mmp \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/group/musenginestub.mmp --- a/tsrc/musenginestub/group/musenginestub.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 musenginestub.dll -TARGETTYPE dll -UID 0x1000008d 0x00000112 // Experimental UID - -CAPABILITY EUNIT_CAPS -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE musengsession.cpp -SOURCE musengmcesession.cpp -SOURCE musengmceoutsession.cpp -SOURCE musenglivesession.cpp -SOURCE musengreceivesession.cpp -SOURCE musengsessiondurationtimer.cpp -SOURCE musengclipsession.cpp - - -USERINCLUDE ../inc - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib - - -EXPORTUNFROZEN \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengclipsession.h --- a/tsrc/musenginestub/inc/musengclipsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* 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 MMusEngClipSessionObserver; -class CMusEngLiveSession; -class CMceFileSource; - -class CMusEngClipSession : public CMusEngMceOutSession - { - - public: - - /** - * - * @since S60 v3.2 - */ - IMPORT_C static CMusEngClipSession* NewL( - const TDesC& aFileName, - const TRect& aRect, - MMusEngClipSessionObserver* aSessionObserver, - TUint aSipProfileId = 0 ); - - /** - * - * @since 3.2 - */ - ~CMusEngClipSession(); - - - public: // new API - - /** - * Sets file to be shared during session. - * @pre Session must be established - * @pre New file cannot be DRM protected - * @leave One of the system wide error codes - * @param aFileName Name of the file to be shared - * @since S60 v3.2 - */ - IMPORT_C void ChangeClipL( const TDesC& aFileName ); - - /** - * - * @since S60 v3.2 - */ - IMPORT_C void FastForwardL( TBool aUseFFWD ); - - /** - * - * @since S60 v3.2 - */ - IMPORT_C void FastRewindL( TBool aUseFRWD ); - - /** - * - * @since S60 v3.2 - */ - IMPORT_C TTimeIntervalSeconds PositionL(); - - /** - * - * @since S60 v3.2 - */ - IMPORT_C TTimeIntervalSeconds DurationL(); - - /** - * - * @since S60 v3.2 - */ - IMPORT_C void SetPositionL (const TTimeIntervalSeconds &aPosition); - - - public: - - /** - * - * @since S60 v3.2 - */ - IMPORT_C void SetSessionObserver( - MMusEngClipSessionObserver* aSessionObserver ); - - - public: // implementation of virtual API from CMusEngMceOutSession - - /** - * Resumes previously paused session. - * Continues showing file on display, resumes clip's audio, continues - * playing file and enables streaming to network. - * - * @since S60 v3.2 - */ - IMPORT_C void PlayL(); - - /** - * Pauses session. - * Holds display, mutes clip's audio, pauses file and - * disables all streaming to network. - * - * @since S60 v3.2 - */ - IMPORT_C void PauseL(); - - - protected: // implementation of virtual helper from CMusEngMceOutSession - - /** - * - * @since S60 v3.2 - */ - void CompleteSessionStructureL(); - - - private: - - /** - * - * @since S60 v3.2 - */ - CMusEngClipSession( MMusEngClipSessionObserver* aSessionObserver, - const TRect& aRect, - TUint aSipProfileId = 0 ); - - /** - * @leave KErrPermissionDenied if file is DRM protected - * @since S60 v3.2 - */ - void ConstructL( const TDesC& aFileName ); - - - private: // HELPERS - - /** - * - * @since S60 v3.2 - */ - TBool IsProtectedFileL( const TDesC& aClipFile ); - - /** - * Constructs audio stream structure during session completion and adds - * it to session. - * @pre iSession != NULL - * @pre iFileSource != NULL - */ - void ConstructAudioStructureL(); - - public: // Data - - CMceFileSource* iFileSource; - - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengclipsessionobserver.h --- a/tsrc/musenginestub/inc/musengclipsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 MUSHENGCLIPSESSIONOBSERVER_H -#define MUSHENGCLIPSESSIONOBSERVER_H - -// INCLUDES -#include -#include "musengoutsessionobserver.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 CMSSession::SetSessionObserver function. -* -* @lib ???.lib -*/ -class MMusEngClipSessionObserver : public MMusEngOutSessionObserver - { - public: - - virtual void EndOfClip() = 0; - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musenglivesession.h --- a/tsrc/musenginestub/inc/musenglivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* 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" - -// SYSTEM -#include - -// FORWARD DECLARATIONS -class MMusEngLiveSessionObserver; - - -class CMusEngLiveSession : public CMusEngMceOutSession - { - - public: - - /** - * Creates new MultimediaSharing Live session. - * - * @since S60 v3.2 - * @param aFileName Media filename - * @param aRect UI drawing area. It is allowed handle from engine - * @param aSessionObserver Session specific callbacks - * @param aSipProfileId SIP profile to be used, 0 is default profile - * @return CMusEngLiveSession* New instanse of specified class - */ - IMPORT_C static CMusEngLiveSession* NewL( - const TDesC& aFileName, - const TRect& aRect, - MMusEngLiveSessionObserver* aSessionObserver, - TUint aSipProfileId = 0); - - /** - * Creates new MultimediaSharing Live session. - * - * @since S60 v3.2 - * @param aRect UI drawing area. It is allowed handle from engine - * @param aSessionObserver Session specific callbacks - * @param aSipProfileId SIP profile to be used, 0 is default profile - * @return CMusEngLiveSession* New instanse of specified class - */ - IMPORT_C static CMusEngLiveSession* NewL( - const TRect& aRect, - MMusEngLiveSessionObserver* aSessionObserver, - TUint aSipProfileId = 0 ); - - public: - - /** - * Destructor - * - * @since S60 v3.2 - */ - ~CMusEngLiveSession(); - - - - public: // NEW API FUNCTIONS live session specific - - /** - * Sets callback interface pointer - * - * @since S60 v3.2 - * @param aSessionObserver Pointer to class which implements interface - */ - IMPORT_C void SetSessionObserver( - MMusEngLiveSessionObserver* aSessionObserver ); - - /** - * Gets current zoom factor - * - * @pre Session is established - * @leave KErrNotReady if precondition not fullfilled - * @since S60 v3.2 - */ - IMPORT_C TInt CurrentZoomL() const; - - /** - * Gets maximum zoom factor - * - * @pre Session is established - * @leave KErrNotReady if precondition not fullfilled - * @since S60 v3.2 - */ - IMPORT_C TInt MaxZoomL() const; - - IMPORT_C TInt MinZoomL() const; - - /** - * Increases zoom factor by one. - * - * @pre Session is established - * @leave KErrNotReady if precondition not fullfilled - * @since S60 v3.2 - */ - IMPORT_C void ZoomInL(); - - /** - * Decreases zoom factor by one. - * - * @pre Session is established - * @leave KErrNotReady if precondition not fullfilled - * @since S60 v3.2 - */ - IMPORT_C void ZoomOutL(); - - /** - * Sets zoom factor to default. - * - * @pre Session is established - * @leave KErrNotReady if precondition not fullfilled - * @since S60 v3.2 - */ - IMPORT_C void ZoomDefaultL(); - - public: // implementation of virtual API from CMusEngMceOutSession - - /** - * Resumes previously paused session. - * Continues using viewfinder and enables streaming video. - * - * @since S60 v3.2 - */ - IMPORT_C void PlayL(); - - /** - * Pauses session. - * Holds display and disables streaming video to network. - * - * @since S60 v3.2 - */ - IMPORT_C void PauseL(); - - - protected: // inherited from CMusEngMceOutSession - - /** - * - * @since S60 v3.2 - */ - void CompleteSessionStructureL(); - - - private: - - /** - * Constructor - - * @since S60 v3.2 - */ - CMusEngLiveSession( MMusEngLiveSessionObserver* aSessionObserver, - const TRect& aRect, - TUint aSipProfileId = 0 ); - - /** - * Second-phase constructor - * - * @since S60 v3.2 - */ - void ConstructL(); - - - public: - - /** - * - * @since S60 v3.2 - */ - //TCameraInfo iCameraInfo; - - /** - * - * @since S60 v3.2 - */ - TInt iDefaultZoomFactor; - TInt iPlaying; - TInt iCurrentZoom; - - - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musenglivesessionobserver.h --- a/tsrc/musenginestub/inc/musenglivesessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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 MUSHENGLIVESESSIONOBSERVER_H -#define MUSHENGLIVESESSIONOBSERVER_H - -// INCLUDES -#include "musengoutsessionobserver.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 CMSSession:: function. -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class MMusEngLiveSessionObserver : public MMusEngOutSessionObserver - { - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengmceoutsession.h --- a/tsrc/musenginestub/inc/musengmceoutsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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" - - -// FORWARD DECLARATIONS -class CSIPProfile; -class CMusSipProfileHandler; -class MMusEngOutSessionObserver; - -// CLASS DECLARATION -/** -* Class for handling MCE out sessions. Direct inherit classes are -* CMusEngLiveSession and CMusEngClipSession. -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusEngMceOutSession : public CMusEngMceSession - { - - public: - - /** - * Destructor - * - * @since S60 v3.2 - */ - ~CMusEngMceOutSession(); - - - public: // NEW API FUNCTIONS - - /** - * Sends invite to specified address - * @leave KErrAlreadyExists if session establishment is already - * in progress - * - * @since S60 v3.2 - */ - IMPORT_C void InviteL( const TDesC& aRecipient ); - - /** - * Cancels Invite. - * @pre Invite is sent. - * @since S60 v3.2 - */ - IMPORT_C void CancelInviteL( ); - - - public: // VIRTUAL API - - /** - * Resumes previously paused session. Exact behavior depends on - * exact session type. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void PlayL() = 0; - - /** - * Pauses session. Exact behavior depends on exact session type. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void PauseL() = 0; - - - protected: // Must be implemented in derived class - - /** - * - * @since S60 v3.2 - */ - virtual void CompleteSessionStructureL() = 0; - - - protected: // helper function inherited from CMusEngMceSession - - /** - * Function handling MCE session termination. - * - * @since S60 v3.2 - */ - //void HandleTermination( TMceTransactionDataContainer* aContainer ); - - - protected: - - /** - * Constructor - * - * @since S60 v3.2 - */ - CMusEngMceOutSession( const TRect& aRect, TUint aSipProfileId = 0 ); - - /** - * Second-phase constructor - * - * @since S60 v3.2 - */ - void ConstructL(); - - - protected: // HELPERS - - #if (defined (__WINS__) || defined(__WINSCW__)) - /** - * - * @since S60 v3.2 - */ - void SipProfileChanged(); - #endif - - - private: - - /** - * - * @since S60 v3.2 - */ - void CreateMceSessionStructureL(); - - /** - * - * @since S60 v3.2 - */ - MMusEngOutSessionObserver* OutSessionObserver(); - - /** - * Parses, validates and creates new recipient address - * out of given address. - * @return Parsed recipient URI. Ownership is transferred. - * @since S60 v3.2 - */ - HBufC8* ParseRecipientUriL( const TDesC& aRecipient ); - - - protected: // DATA - - /** - * Repository id of SipProfile - * - * @since S60 v3.2 - */ - TUint iSipProfileId; - - /** - * Owned by iSipProfileHandler - * - * @since S60 v3.2 - */ - //CSIPProfile* iSipProfile; - - /** - * Callback pointer to interface - * - * @since S60 v3.2 - */ - //CMusSipProfileHandler* iSipProfileHandler; - - - public: // DATA - - /** - * - * @since S60 v3.2 - */ - HBufC8* iRecipient; - TBool iInvited; - - }; -#endif //MUSHENGMCESESSION_H diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengmcesession.h --- a/tsrc/musenginestub/inc/musengmcesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,303 +0,0 @@ -/* -* 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 "musengsessiondurationtimerobserver.h" - -// SYSTEM -/* -#include -#include -#include -#include -*/ - -/* -class CMceManager; -class CMceSession; -*/ -class CMusEngSessionDurationTimer; - - -// CONSTANTS - -_LIT8( KMusEngAcceptContactHeader, - "Accept-Contact: *;+g.3gpp.cs-voice; explicit" ); -_LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs" ); - -// 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 -* simplified commands like a SessionDisconnected. -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusEngMceSession : public CMusEngSession, - public MMusEngSessionDurationTimerObserver - { - - public: - - /** - * Destructor - * - * @since S60 v3.2 - */ - ~CMusEngMceSession(); - - - public: // API FUNCTIONS - - /** - * Terminates session. - * @pre Session is established - * @post Session is ready to be deleted - * @leave KErrNotReady if precondition is not fullfilled - * @since S60 v3.2 - */ - IMPORT_C void TerminateL(); - - /** - * Releases all this session internal observers. This function is needed - * before we could get session store out of this session. - * TODO: Is this function really needed? At least at the moment it is - * not called from UI. -HR 21.8. - * - * @since S60 v3.2 - */ - IMPORT_C void ReleaseInternalObservers(); - - /** - * Get session time return estabilished session time - * - * @since S60 v3.2 - * @return TTime returns time if connection established else < 0 - */ - IMPORT_C TTimeIntervalSeconds GetSessionTime() const; - - /** - * Returns current connection state - * - * @since S60 v3.2 - * @return TBool returns current connection state - */ - IMPORT_C TBool ConnectionActive() const; - - - public: // VIRTUAL API - - // No virtual api - - - public: // from CMusEngSession - - /** - * Increases volume level by one - * - * @pre Session is ongoing - * @since S60 v3.2 - */ - IMPORT_C void VolumeUpL(); - - /** - * Decreases volume level by one - * - * @pre Session is ongoing - * @since S60 v3.2 - */ - IMPORT_C void VolumeDownL(); - - /** - * Permission to draw on screen device. - * - * @pre Session is ongoing - * @since S60 v3.2 - */ - IMPORT_C void EnableDisplayL( TBool aEnable ); - - /** - * Implements virtual from CMusEngSession - * - * @pre Session is ongoing - * @since S60 v3.2 - */ - IMPORT_C void MuteL(); - - /** - * Implements virtual from CMusEngSession - * - * @pre Session is ongoing - * @since S60 v3.2 - */ - IMPORT_C void UnmuteL(); - - - protected: // CONSTRUCTORS - - /** - * Constructor - * - * @since S60 v3.2 - */ - CMusEngMceSession( const TRect& aRect ); - - /** - * Second-phase constructor - * - * @since S60 v3.2 - */ - void ConstructL(); - - - protected: // HELPER FUNCTIONS - - /** - * - * @since S60 v3.2 - */ - void RectChangedL(); - - /** - * Sets session specific SDP line to a session - * - * @since S60 v3.2 - */ - //void SetSessionSdpLinesL( CMceSession& aSession ); - - - protected: // internal API - - /** - * - * @since S60 v3.2 - */ - virtual TBool IsRtpcInactivityTimoutSupported(); - - - private: // HELPER FUNCTIONS - - /** - * Start counting session time - * - * @since S60 v3.2 - */ - void InitializeSessionTimer(); - - /** - * Callback - * - * @since S60 v3.2 - */ - void UpdateTimerEvent(); - - /** - * - * - * @since S60 v3.2 - */ - void DoMuteL( TBool aMute ); - - /** - * Increases or decreases current volume of all speakers in session - * structure by one. - * @pre Current volume of all the speakers is less than MaxVolumeL() - * and at least 1. - */ - void ChangeVolumeByOneL( TBool aIncreaseVolume ); - - - private: // Helpers - - /** - * Helper function to avoid three different traps. - * Should be replaced when MCE supports different kind of method - * detecting end of clip. - * - * @since S60 v3.2 - */ - void CheckClipEndL(); - - - public: // MEMBERS - - /** - * 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. - * - * @since S60 v3.2 - */ - //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. - * - * @since S60 v3.2 - */ - //CMceSession* iSession; - - - public: - - /** - * 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. - * - * @since S60 v3.2 - */ - //TMceTransactionDataContainer iTransactionDataContainer; - - /** - * Session time. Acts simultaneously as RTCP inactivity timer. - * - * @since S60 v3.2 - */ - TTime iStartTime; - - CMusEngSessionDurationTimer* iUpdateTimer; - - /** - * Value indicating seconds gone since last received RTCP sender or - * receiver report. Value 20 indicates RTCP inactivity timeout. - */ - TInt iSecondsFromLastRtcpReport; - TInt iDisplayEnabled; - - }; -#endif //MUSHENGMCESESSION_H diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengobserver.h --- a/tsrc/musenginestub/inc/musengobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengoutsessionobserver.h --- a/tsrc/musenginestub/inc/musengoutsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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 MUSHENGOUTSESSIONOBSERVER_H -#define MUSHENGOUTSESSIONOBSERVER_H - -// INCLUDES -#include "musengsessionobserver.h" - -// 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. -* -* This observer is set using CMusEngSession::SetSessionObserver function. -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class MMusEngOutSessionObserver : public MMusEngSessionObserver - { - public: - - /** - * Indicates that MT has rejected session. ( e.g. 603 DECLINE ) - * @since S60 v3.2 - */ - virtual void SessionRejected() = 0; - - /** - * The following functions represent a specific reason in answer - * to sent INVITE. - * @since S60 v3.2 - */ - - 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 SessionRequestCancelled() = 0; // 487 - - - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengpreviewsession.h --- a/tsrc/musenginestub/inc/musengpreviewsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengpreviewsessionobserver.h --- a/tsrc/musenginestub/inc/musengpreviewsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengreceivesession.h --- a/tsrc/musenginestub/inc/musengreceivesession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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 - - - -#include "musengmcesession.h" - - -class MMusEngReceiveSessionObserver; - -class CMusEngReceiveSession : public CMusEngMceSession - - { - - 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 - */ - IMPORT_C static CMusEngReceiveSession* NewL( - const TRect& aRect, - MMusEngReceiveSessionObserver* aSessionObserver ); - /** - * Destructor - * - * @since S60 v3.2 - */ - ~CMusEngReceiveSession(); - - - public: // API - - /** - * Accept or deny processed invitation - * - * @param aAccept ETrue if session is to be accepted and EFalse if - * to be rejected. - */ - IMPORT_C void AcceptInvitationL(const TBool& aAccept); - - - public: - - /** - * Sets callback interface pointer - * - * @param aSessionObserver Pointer to class which implements interface - */ - IMPORT_C void SetSessionObserver( - MMusEngReceiveSessionObserver* aSessionObserver ); - - - - protected: // internal API - - /** - * - * @since S60 v3.2 - */ - TBool IsRtpcInactivityTimoutSupported(); - - - private: // CONSTRUCTORS - - CMusEngReceiveSession( MMusEngReceiveSessionObserver* aSessionObserver, - const TRect& aRect ); - - void ConstructL(); - - public: // HELPERS - - //CMceInSession* InSession(); - - MMusEngReceiveSessionObserver* ReceiveSessionObserver(); - - // void CompleteSessionStructureL( CMceInSession& aInSession ); - - - public: // DATA - - // CMceInSession* iTemporaryInSession; // Owned - TBool iAccepInvitation; - - }; - -#endif - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengreceivesessionobserver.h --- a/tsrc/musenginestub/inc/musengreceivesessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 "musengsessionobserver.h" - -// CLASS DECLARATION - -/** -* -* -* @lib ???.lib -*/ -class MMusEngReceiveSessionObserver : public MMusEngSessionObserver - { - - public: - - /** - * - * - * @since S60 v3.2 - */ - virtual void IncomingSession( const TDesC& aOriginator ) = 0; - - - /** - * Current receiving session is buffering received RTP. - * - * @since S60 v3.2 - */ - virtual void StreamBuffering() = 0; - }; - -#endif \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengsession.h --- a/tsrc/musenginestub/inc/musengsession.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* 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 MUSHENGSESSION_H -#define MUSHENGSESSION_H - -// USER INCLUDES - -//SYSTEM INCLUDES -#include - - -// FORWARD DECLARATIONS -class MMusEngSessionObserver; - -// CLASS DECLARATION - -/** -* Base class for Multimedia Sharing Engine sessions, inherited by -* CMusEngMceSession. -* -* CMusEngSession encapsulates all common activities example using -* resources. -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusEngSession : public CBase - { - - public: - - /** - * Desctructor, finalize session - * - * @since S60 v3.2 - */ - ~CMusEngSession(); - - - public: // API FUNCTIONS - - /** - * Returns currently assigned drawing area - * - * @since S60 v3.2 - * @return TRect This session drawing area recttangle - */ - IMPORT_C TRect Rect() const; - - /** - * Sets new drawing area - * - * @since S60 v3.2 - * @param TRect This session new drawing area rectangle - */ - IMPORT_C void SetRectL( const TRect& aRect ); - - /** - * Activates/deactivates loadspeaker - * - * @since S60 v3.2 - * @param TBool Enable or disable loudspeaker - * @param TBool Show activation dialog - */ - IMPORT_C void EnableLoudspeakerL( TBool aEnable, TBool aShowDialog ); - - /** - * Checks is loudspeaker enabled or disabled. - * - * @since S60 v3.2 - * @return TBool true if enabled - */ - IMPORT_C TBool IsLoudSpeakerEnabled() const; - - /** - * Returns current volume level - * - * @since S60 v3.2 - */ - IMPORT_C TInt VolumeL() const; - - - public: // VIRTUAL API FUNCTIONS - - /** - * Increases volume level by one. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void VolumeUpL(); - - /** - * Decreases volume level by one - * - * @since S60 v3.2 - */ - IMPORT_C virtual void VolumeDownL(); - - /** - * Enables or disables display. Call to this function is considered - * as a permission or denial to draw to the display. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void EnableDisplayL( TBool aEnable ) = 0; - - /** - * Mutes current audio stream meaning that any audio is not played or - * sent to network. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void MuteL() = 0; - - /** - * Unmute current audio stream meaning that all the audio is played - * and if needed also sent to network. - * - * @since S60 v3.2 - */ - IMPORT_C virtual void UnmuteL() = 0; - - - protected: // INTERNAL - - virtual void RectChangedL() = 0; - - - protected: - - /** - * Constructor, private cannot be instantiate - * - * - * @since S60 v3.2 - * @param TRect reserved drawing area for this session - */ - CMusEngSession( const TRect& aRect ); - - - protected: - - /** - * second-phase constructor, called by those session specific - * constructors - * - * @since S60 v3.2 - */ - void ConstructL(); - - - protected: // MEMBERS - - /** - * Callback pointer to interface, not own - * - * @since S60 v3.2 - */ - MMusEngSessionObserver* iSessionObserver; - - - public: // MEMBERS - - /** - * Drawing area rect - * - * @since S60 v3.2 - */ - TRect iRect; - - /** - * Telephone utilities - * - * @since S60 v3.2 - */ - //CMusEngTelephoneUtils* iTelephoneUtils; - - TInt iErrorCode; - - - }; - -#endif //MUSHENGSESSION_H \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengsessiondurationtimer.h --- a/tsrc/musenginestub/inc/musengsessiondurationtimer.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* 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 - -// KERNEL INCLUDES -#include - -// FORWARD DECLERATIONS -class MMusEngSessionDurationTimerObserver; - -class CMusEngSessionDurationTimer - { - - public: - - /** - * - * @since S60 v3.2 - */ - static CMusEngSessionDurationTimer* NewL( - MMusEngSessionDurationTimerObserver& aObserver ); - - /** - * - * @since S60 v3.2 - */ - ~CMusEngSessionDurationTimer(); - - - public: // API - - /** - * - * @since S60 v3.2 - */ - - - private: - - /** - * - * @since S60 v3.2 - */ - CMusEngSessionDurationTimer( - MMusEngSessionDurationTimerObserver& aObserver ); - - /** - * - * @since S60 v3.2 - */ - void ConstructL(); - - - - public: // DATA - - /** - * - * @since S60 v3.2 - */ - //RTimer iTimer; - - /** - * - * @since S60 v3.2 - */ - MMusEngSessionDurationTimerObserver& iObserver; - - }; - -#endif // _MUSENGSESSIONDURATIONTIMER_H_ - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengsessiondurationtimerobserver.h --- a/tsrc/musenginestub/inc/musengsessiondurationtimerobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengsessionobserver.h --- a/tsrc/musenginestub/inc/musengsessionobserver.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/inc/musengtelephoneutils.h --- a/tsrc/musenginestub/inc/musengtelephoneutils.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 - -// FORWARD DECLARATIONS -//class CRepository; -//class CTelephonyAudioRouting; - -/** -* -* @lib musengine.lib -* @since S60 v3.2 -*/ -class CMusEngTelephoneUtils : public CBase - //public MTelephonyAudioRoutingObserver - { - public: - - /** - * - * @since S60 v3.2 - */ - static CMusEngTelephoneUtils* NewL(); - - /** - * - * @since S60 v3.2 - */ - ~CMusEngTelephoneUtils(); - - - public: // API - - /** - * - * @since S60 v3.2 - */ - void LoudspeakerL( TBool aEnable, TBool aShowDialog ); - - /** - * - * @since S60 v3.2 - */ - TBool IsLoudSpeakerEnabled() const; - - /** - * - * @since S60 v3.2 - */ - TInt GetVolumeL() const; - - /** - * - * @since S60 v3.2 - */ - void SetVolumeL( TInt aVolume ); - - - - private: - - /** - * - * @since S60 v3.2 - */ - CMusEngTelephoneUtils(); - - /** - * - * @since S60 v3.2 - */ - void ConstructL(); - - - private: // HELPER - - /** - * - * @since S60 v3.2 - */ - TInt ValidateVolume( const TInt aVolume ) const; - - - public: // DATA - - /** - * Stores the audio routing state at startup. - */ - //CTelephonyAudioRouting::TAudioOutput iAudioOutputAtStartup; - - /** - * Telephony audio routing instance. Owned. - */ - //CTelephonyAudioRouting* iTelephonyAudioRouting; - - /** - * Central repository. Owned. - * - * @since S60 v3.2 - */ - //CRepository* iRepository; - - }; - - -#endif // MUSENGTELEPHONEUTILS_H \ No newline at end of file diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengclipsession.cpp --- a/tsrc/musenginestub/src/musengclipsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* 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 "musengclipsessionobserver.h" -#include "musengsessionobserver.h" -#include "musengmceoutsession.h" -#include "musenglivesession.h" - - -// SYSTEM -/*#include -#include -#include -#include -#include -#include -#include -#include -#include -*/ - -// CONSTANTS - -const TInt KMicroSecondsInOneSecond = 1000000; - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngClipSession* CMusEngClipSession::NewL( - const TDesC& aFileName, - const TRect& aRect, - MMusEngClipSessionObserver* aSessionObserver, - TUint aSipProfileId ) - { - CMusEngClipSession* self = new( ELeave ) CMusEngClipSession( - aSessionObserver, - aRect, - aSipProfileId ); - CleanupStack::PushL( self ); - self->ConstructL( aFileName ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngClipSession::~CMusEngClipSession() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::ChangeClipL( const TDesC& aFileName ) - { - } - - -// ----------------------------------------------------------------------------- -// TODO: At the moment behavior of MCE is not known and all the FFWD commands -// are only forwarded to MCE. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::FastForwardL( TBool aUseFFWD ) - { - } - - -// ----------------------------------------------------------------------------- -// TODO: At the moment behavior of MCE is not known and all the FRWD commands -// are only forwarded to MCE. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::FastRewindL( TBool aUseFRWD ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalSeconds CMusEngClipSession::PositionL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalSeconds CMusEngClipSession::DurationL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::SetPositionL ( - const TTimeIntervalSeconds& aPosition ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::SetSessionObserver( - MMusEngClipSessionObserver* aSessionObserver) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::PlayL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngClipSession::PauseL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngClipSession::CompleteSessionStructureL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngClipSession::CMusEngClipSession( - MMusEngClipSessionObserver* aSessionObserver, - const TRect& aRect, - TUint aSipProfileId ) - : CMusEngMceOutSession( aRect, aSipProfileId ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngClipSession::ConstructL( const TDesC& aFileName ) - { - } - - -// ----------------------------------------------------------------------------- -// Check is file DRM protected. -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngClipSession::IsProtectedFileL( const TDesC& aClipFile ) - { - } - - -// ----------------------------------------------------------------------------- -// If member file contains audio, add appropriate amount of audio streams to -// session structure -// ----------------------------------------------------------------------------- -// -void CMusEngClipSession::ConstructAudioStructureL() - { - } - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musenglivesession.cpp --- a/tsrc/musenginestub/src/musenglivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -/* -* 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 "musenglivesessionobserver.h" -//#include "musunittesting.h" -//#include "musengmceutils.h" - -// SYSTEM -/* -#include -#include -#include -#include -#include -#include -*/ - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL( - const TDesC& /*aFileName*/, - const TRect& aRect, - MMusEngLiveSessionObserver* aSessionObserver, - TUint aSipProfileId ) - { - CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( - aSessionObserver, - aRect, - aSipProfileId ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL( - const TRect& aRect, - MMusEngLiveSessionObserver* aSessionObserver, - TUint aSipProfileId ) - { - CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( - aSessionObserver, - aRect, - aSipProfileId); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngLiveSession::~CMusEngLiveSession() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::SetSessionObserver( - MMusEngLiveSessionObserver* aSessionObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::CurrentZoomL() const - { - return iCurrentZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MaxZoomL() const - { - return iCurrentZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngLiveSession::MinZoomL() const - { - return iCurrentZoom; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomInL() - { - iCurrentZoom++; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomOutL() - { - iCurrentZoom--; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::ZoomDefaultL() - { - } - - -// ----------------------------------------------------------------------------- -// Enable camera -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::PlayL() - { - iPlaying = ETrue; - } - - -// ----------------------------------------------------------------------------- -// Disable camera -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngLiveSession::PauseL() - { - iPlaying = EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::CompleteSessionStructureL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngLiveSession::CMusEngLiveSession( - MMusEngLiveSessionObserver* aSessionObserver, - const TRect& aRect, - TUint aSipProfileId ) - :CMusEngMceOutSession( aRect, aSipProfileId ), - iDefaultZoomFactor( -1 ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngLiveSession::ConstructL( /*const TDesC& aFileName*/ ) - { - } - - - - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengmceoutsession.cpp --- a/tsrc/musenginestub/src/musengmceoutsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* 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 "musenglivesessionobserver.h" -//#include "mussipprofilehandler.h" - -// SYSTEM -/* -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -*/ -const TInt KMaxUriLength = 512; -_LIT8( KMusEngAtSign, "@" ); -_LIT8( KMusEngPlusSign, "+" ); -_LIT8( KMusEngSipPrefix, "sip:" ); -_LIT8( KMusEngTelPrefix, "tel:" ); - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession::~CMusEngMceOutSession() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceOutSession::InviteL( const TDesC& aRecipient ) - { - iInvited = ETrue; - User::LeaveIfError( iErrorCode ); - - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceOutSession::CancelInviteL() - { - iInvited = EFalse; - User::LeaveIfError( iErrorCode ); - } - - -// ----------------------------------------------------------------------------- -// Handle MCE session termination. Called by MCE observer function of the -// base class. -// ----------------------------------------------------------------------------- -// - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceOutSession::CMusEngMceOutSession( const TRect& aRect, - TUint aSipProfileId ) - : CMusEngMceSession( aRect ), - iSipProfileId( aSipProfileId ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceOutSession::ConstructL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceOutSession::CreateMceSessionStructureL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -MMusEngOutSessionObserver* CMusEngMceOutSession::OutSessionObserver() - { - return static_cast(iSessionObserver); - } - - -// ----------------------------------------------------------------------------- -// TODO: Using UTF8 is to wide. It should handle the escape characters -// correctly. UTF7 is not working, since it converts + as +- -// ----------------------------------------------------------------------------- -// -HBufC8* CMusEngMceOutSession::ParseRecipientUriL( const TDesC& aRecipient ) - { - } - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengmcesession.cpp --- a/tsrc/musenginestub/src/musengmcesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* 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 "musengsessiondurationtimer.h" -#include "musengoutsessionobserver.h" -//#include "musengmceutils.h" -//#include "musuid.hrh" -#include "musengclipsessionobserver.h" - -// SYSTEM -/* -#include -#include -#include -#include -#include -#include -#include -#include -*/ - -const TInt KMusEngTimerInterval = 1000000; // 1 second -const TInt KMusEngRtcpInactivityThreshold = 20; // seconds - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession::~CMusEngMceSession() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::TerminateL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::ReleaseInternalObservers() - { - } - - -// ----------------------------------------------------------------------------- -// Returns estabilished session time. If not established return -// value is < 0 -// ----------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalSeconds CMusEngMceSession::GetSessionTime() const - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngMceSession::ConnectionActive() const - { - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::VolumeUpL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::VolumeDownL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::EnableDisplayL( TBool aEnable ) - { - iDisplayEnabled = aEnable; - } - - -// ----------------------------------------------------------------------------- -// Mutes playback of sended audio streams. Audio data is still streamed. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::MuteL() - { - } - - -// ----------------------------------------------------------------------------- -// Unmutes playback of sended audio streams. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngMceSession::UnmuteL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngMceSession::CMusEngMceSession( const TRect& aRect ) - : CMusEngSession( aRect ), - iSecondsFromLastRtcpReport ( 0 ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::ConstructL() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::RectChangedL() - { - } - - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngMceSession::IsRtpcInactivityTimoutSupported() -{ - return EFalse; -} - -// ----------------------------------------------------------------------------- -// Initializes session timer to current time -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::InitializeSessionTimer() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::UpdateTimerEvent() - { - } - - -// ----------------------------------------------------------------------------- -// Enables or disables all the speaker and rtp sinks of all the audio streams -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::DoMuteL( TBool aMute ) - { - } - - -// ----------------------------------------------------------------------------- -// Changes volume of all speaker sinks in the session structure -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::ChangeVolumeByOneL( TBool aIncreaseVolume ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngMceSession::CheckClipEndL() - { - } - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengpreviewsession.cpp --- a/tsrc/musenginestub/src/musengpreviewsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengreceivesession.cpp --- a/tsrc/musenginestub/src/musengreceivesession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* 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 "musengreceivesessionobserver.h" -//#include "musengmceutils.h" -//#include "muslogger.h" - -// SYSTEM INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -const TInt KMaxUriLength = 512; - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngReceiveSession::~CMusEngReceiveSession() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C CMusEngReceiveSession* CMusEngReceiveSession::NewL( - const TRect& aRect, - MMusEngReceiveSessionObserver* aSessionObserver) - { - CMusEngReceiveSession* self = - new( ELeave ) CMusEngReceiveSession( aSessionObserver, aRect ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngReceiveSession::AcceptInvitationL( - const TBool& aAccept ) - { - iAccepInvitation = aAccept; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngReceiveSession::SetSessionObserver( - MMusEngReceiveSessionObserver* aSessionObserver) - { - iSessionObserver = aSessionObserver; - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngReceiveSession::IsRtpcInactivityTimoutSupported() -{ - return ETrue; -} - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngReceiveSession::CMusEngReceiveSession( - MMusEngReceiveSessionObserver* aSessionObserver, - const TRect& aRect ) - : CMusEngMceSession( aRect ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngReceiveSession::ConstructL() - { - } - - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -MMusEngReceiveSessionObserver* CMusEngReceiveSession::ReceiveSessionObserver() - { - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengsession.cpp --- a/tsrc/musenginestub/src/musengsession.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* 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 "musengsessionobserver.h" -#include "musengtelephoneutils.h" - -// SYSTEM INCLUDES - -//#include - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngSession::~CMusEngSession() // destruct - virtual, so no export - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TRect CMusEngSession::Rect() const - { - return iRect; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::SetRectL( const TRect& aRect ) - { - iRect = aRect; - User::LeaveIfError( iErrorCode ); - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::EnableLoudspeakerL( TBool aEnable, - TBool aShowDialog ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CMusEngSession::IsLoudSpeakerEnabled() const - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CMusEngSession::VolumeL() const - { - } - - -// ----------------------------------------------------------------------------- -// Increases CS call volume level by one. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::VolumeUpL( ) - { - } - - -// ----------------------------------------------------------------------------- -// Decreases CS call volume level by one. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CMusEngSession::VolumeDownL( ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngSession::CMusEngSession( const TRect& aRect ) - { - iRect = aRect; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngSession::ConstructL() // second-phase constructor - { - iErrorCode = KErrNone; - } - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengsessiondurationtimer.cpp --- a/tsrc/musenginestub/src/musengsessiondurationtimer.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngSessionDurationTimer::CMusEngSessionDurationTimer( - MMusEngSessionDurationTimerObserver& aObserver ) - : iObserver( aObserver) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngSessionDurationTimer::ConstructL() - { - } - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musenginestub/src/musengtelephoneutils.cpp --- a/tsrc/musenginestub/src/musengtelephoneutils.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* 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" - -// SYSTEM -/* -#include -#include -*/ - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngTelephoneUtils* CMusEngTelephoneUtils::NewL() - { - CMusEngTelephoneUtils* self = new( ELeave ) CMusEngTelephoneUtils(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngTelephoneUtils::~CMusEngTelephoneUtils() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMusEngTelephoneUtils::LoudspeakerL( TBool aEnable, TBool aShowDialog ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CMusEngTelephoneUtils::IsLoudSpeakerEnabled() const - { - } - - -// ----------------------------------------------------------------------------- -// Gets the CS call volume level. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -TInt CMusEngTelephoneUtils::GetVolumeL() const - { - } - - -// ----------------------------------------------------------------------------- -// Sets the CS call volume level. -// Leaves if error occurs when accessing central repository. -// ----------------------------------------------------------------------------- -// -void CMusEngTelephoneUtils::SetVolumeL( TInt aVolume ) - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -CMusEngTelephoneUtils::CMusEngTelephoneUtils() - { - } - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void 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 - { - } - - - - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/musmanagerstub/group/musmanagerstub.mmp --- a/tsrc/musmanagerstub/group/musmanagerstub.mmp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musmanagerstub/inc/musmanagerstub.h --- a/tsrc/musmanagerstub/inc/musmanagerstub.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -/* -* 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, - 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 b31261fd4e04 -r ccd8e69b5392 tsrc/musmanagerstub/src/musmanagerstub.cpp --- a/tsrc/musmanagerstub/src/musmanagerstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/propertystub/inc/e32property.h --- a/tsrc/propertystub/inc/e32property.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __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 b31261fd4e04 -r ccd8e69b5392 tsrc/propertystub/src/e32property.cpp --- a/tsrc/propertystub/src/e32property.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "e32property.h" -#include - -static RArray iIntProperty; -static TInt iErrorCode = KErrNone; -static RProperty::TPropertyCalledFunctions iCalledFunction = RProperty::ENone; -static TName iString = 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/inc/cwpcharacteristic.h --- a/tsrc/provisioningenginestub/inc/cwpcharacteristic.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/inc/cwpparameter.h --- a/tsrc/provisioningenginestub/inc/cwpparameter.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/inc/mwpelement.h --- a/tsrc/provisioningenginestub/inc/mwpelement.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/inc/mwppairvisitor.h --- a/tsrc/provisioningenginestub/inc/mwppairvisitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/inc/mwpvisitor.h --- a/tsrc/provisioningenginestub/inc/mwpvisitor.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/src/cwpadapterstub.cpp --- a/tsrc/provisioningenginestub/src/cwpadapterstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/src/cwpcharacteristicstub.cpp --- a/tsrc/provisioningenginestub/src/cwpcharacteristicstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/provisioningenginestub/src/cwpparameterstub.cpp --- a/tsrc/provisioningenginestub/src/cwpparameterstub.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/resourcefilestub/inc/barsc.h --- a/tsrc/resourcefilestub/inc/barsc.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/resourcefilestub/src/barsc.cpp --- a/tsrc/resourcefilestub/src/barsc.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "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 b31261fd4e04 -r ccd8e69b5392 tsrc/rfsstub/inc/f32file.h --- a/tsrc/rfsstub/inc/f32file.h Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __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 b31261fd4e04 -r ccd8e69b5392 tsrc/rfsstub/src/f32file.cpp --- a/tsrc/rfsstub/src/f32file.cpp Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include "f32file.h" - - - -RFs::RFs() - { - iErrorCode = KErrNone; - } - -RFs::~RFs() - { - - } - - - -TInt RFs::Connect() - { - return iErrorCode; - } - -void RFs::Close() - { - } - diff -r b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/EunitRunner.bat --- a/tsrc/scripts/EunitRunner.bat Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,517 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/EunitRunner.pl --- a/tsrc/scripts/EunitRunner.pl Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,721 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -#!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 b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/bld.inf --- a/tsrc/scripts/bld.inf Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/buildcheck.cmd --- a/tsrc/scripts/buildcheck.cmd Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -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 b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/codetest.py --- a/tsrc/scripts/codetest.py Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# 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 b31261fd4e04 -r ccd8e69b5392 tsrc/scripts/runLint.cmd --- a/tsrc/scripts/runLint.cmd Tue Feb 02 00:09:07 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -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