# HG changeset patch # User hgs # Date 1274083395 -10800 # Node ID 831068540b07ff56ee63973fd70403a0c218a662 # Parent e7f64b6bf69e1585807bd17fd46bbb1f3d95e722 201019_1 diff -r e7f64b6bf69e -r 831068540b07 layers.sysdef.xml --- a/layers.sysdef.xml Sun May 02 21:57:48 2010 +0300 +++ b/layers.sysdef.xml Mon May 17 11:03:15 2010 +0300 @@ -15,9 +15,10 @@ - - - + + + + diff -r e7f64b6bf69e -r 831068540b07 package_definition.xml --- a/package_definition.xml Sun May 02 21:57:48 2010 +0300 +++ b/package_definition.xml Mon May 17 11:03:15 2010 +0300 @@ -36,9 +36,6 @@ - - - diff -r e7f64b6bf69e -r 831068540b07 tsrc/group/bld.inf --- a/tsrc/group/bld.inf Sun May 02 21:57:48 2010 +0300 +++ b/tsrc/group/bld.inf Mon May 17 11:03:15 2010 +0300 @@ -24,7 +24,6 @@ //build files for usb #include "../../usbclasses/msmmplugin/tsrc/MsmmPluginTest/group/bld.inf" -#include "../../usbuis/usbui/tsrc/USBUiApiTest/group/bld.inf" #include "../../usbuis/usbuinotif/tsrc/USBUiNotifApiTest/group/bld.inf" #include "../../usbclasses/usbhidclassdriver/tsrc/UsbHidClassDriverTest/group/bld.inf" diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbotgwatcher/src/cusbnotenotifier.cpp --- a/usbengines/usbotgwatcher/src/cusbnotenotifier.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbnotenotifier.cpp Mon May 17 11:03:15 2010 +0300 @@ -130,14 +130,15 @@ LOG1( "iStatus = %d" , iStatus.Int()); - // if error occured, deal with it in RunError - LEAVEIFERROR(iStatus.Int()); + // if iStatus contains some other than KErrNone code + // do not perform any special actions, + // just forward the error code to caller iNotifier.CancelNotifier(iUsbNoteNotifier.iCat); // report to owner that show is over iUsbNoteNotifier.iNotifManager.NotifierShowCompletedL(iUsbNoteNotifier, - KErrNone, iRes()); + iStatus.Int(), iRes()); } // --------------------------------------------------------------------------- @@ -159,8 +160,6 @@ LOG1("aError = %d" , aError); - iNotifier.CancelNotifier(iUsbNoteNotifier.iCat); - // try to continue return KErrNone; } diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/group/bld.inf --- a/usbengines/usbwatcher/group/bld.inf Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/group/bld.inf Mon May 17 11:03:15 2010 +0300 @@ -33,7 +33,6 @@ backup_registration.xml /epoc32/release/winscw/udeb/z/private/101F9696/backup_registration.xml backup_registration.xml /epoc32/release/winscw/urel/z/private/101F9696/backup_registration.xml -../loc/usbman.loc MW_LAYER_LOC_EXPORT_PATH(usbman.loc) ../rom/usbwatcher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(usbwatcher.iby) // This file contains actual personality rss data ../rom/usbwatcher_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(usbwatcher_resources.iby) @@ -46,6 +45,5 @@ ../conf/usbwatcher_101F8801.crml MW_LAYER_CRML(usbwatcher_101F8801.crml) ../rom/mtp_symbian_temp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mtp_symbian_temp.iby) - // End of file diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/group/usbwatcherserver.mmp --- a/usbengines/usbwatcher/group/usbwatcherserver.mmp Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/group/usbwatcherserver.mmp Mon May 17 11:03:15 2010 +0300 @@ -37,7 +37,7 @@ SOURCE cusbdevicelock.cpp SOURCE cusbdevconstarter.cpp SOURCE cusbglobalsystemstateobserver.cpp -SOURCE tusbindicatorhandler.cpp +SOURCE cusbindicatorhandler.cpp USERINCLUDE ../inc @@ -45,6 +45,7 @@ MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE ../../usbotgwatcher/inc SYSTEMINCLUDE /epoc32/include/usb +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore START RESOURCE usbman_pcsmtp.rss @@ -84,5 +85,6 @@ LIBRARY centralrepository.lib // Central Repository (USB Personality API) LIBRARY featmgr.lib LIBRARY usbotgwatcher.lib //OTG +LIBRARY hbcore.lib DEBUGLIBRARY flogger.lib // File logging diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/inc/cusbindicatorhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbengines/usbwatcher/inc/cusbindicatorhandler.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for class CUsbIndicatorHandler +* +*/ + + +#ifndef CUSBINDICATORHANDLER_H +#define CUSBINDICATORHANDLER_H + +#include +#include +#include +#include + +class CHbIndicatorSymbian; +class CHbSymbianVariant; + +/** +* USB indicator handler class for device side. +* +* This class shows USB indicator when device state changes to Configured, +* and hides USB indicator when device leaves Configured state. Suspended + * state does not change the indicator. +* +* @since TB9.2 +*/ +NONSHARABLE_CLASS( CUsbIndicatorHandler ) : public CBase + { + friend class CtTUsbIndicatorHandler; + +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CUsbIndicatorHandler(); + + /** + * Two-phased constructor. + */ + static CUsbIndicatorHandler* NewL(); + + /** + * Two-phased constructor. + */ + static CUsbIndicatorHandler* NewLC(); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CUsbIndicatorHandler(); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + + +public: + + /** + * Set USB indicator (On/Off, maybe more in future) according to + * the change of USB device state + * + * @param aStateOld previous USB device state + * @param aStateNew current USB device state + */ + void HandleDeviceStateChangeL( TUsbDeviceState aStateOld, + TUsbDeviceState aStateNew, TInt aPersonality ); + +private: + /** + * Show USB connected indicator (On/Off, maybe more in future) + * + * @since TB9.2 + * @param aActivate activate or deactivate the indicator + * @param aPersonality the personality id + */ + void ShowUsbConnectedIndicatorL( TBool aActivate, TInt aPersonality ); + + /** + * Show USB addressed state indicator (On/Off, maybe more in future) + * + * @since TB9.2 + * @param aActivate activate or deactivate the indicator + */ + void ShowUsbAddressedIndicator( TBool aActivate ); + +private: + /** + * The device state before suspend. + * Used to filter out suspend from others; + */ + TUsbDeviceState iDevStateB4Suspend; + + CHbIndicatorSymbian* iSymbianIndicator; + + CHbSymbianVariant* iIndicatorParameters; + + // remember whether indicators are active or not + // simplifies little bit the state handling in HandleDeviceStateChange + TBool iAddressedIndicatorActive; + TBool iConnectedIndicatorActive; + + }; + + +#endif // CUSBINDICATORHANDLER_H + +// End of File diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/inc/cusbwatcher.h --- a/usbengines/usbwatcher/inc/cusbwatcher.h Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/inc/cusbwatcher.h Mon May 17 11:03:15 2010 +0300 @@ -30,7 +30,7 @@ #include "debug.h" #include "musbwatchernotify.h" #include "cusbwatchersession.h" -#include "tusbindicatorhandler.h" +#include "cusbindicatorhandler.h" class CUsbActiveState; @@ -180,7 +180,7 @@ * @param aStateOld old device state * @param aStateNew new device state */ - void StateChangeNotify( TUsbDeviceState aStateOld, + void StateChangeNotifyL( TUsbDeviceState aStateOld, TUsbDeviceState aStateNew ); @@ -442,7 +442,7 @@ /* * USB indicator handler to handle device side indicator */ - TUsbIndicatorHandler iUsbIndicatorHandler; + CUsbIndicatorHandler* iUsbIndicatorHandler; /* * Starting mode is normal? diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/loc/usbman.loc --- a/usbengines/usbwatcher/loc/usbman.loc Sun May 02 21:57:48 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies 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 usbwatcher -* -*/ - - -//d: List item text of USBUI Setting view -//d: for "Ovi suite". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_ovisuite "Ovi Suite" - -//d: List item text of USBUI Setting view -//d: for "Mass storage". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_mass_storage "Mass storage" - -//d: List item text of USBUI Setting view -//d: for "Image print". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_ptp "Image print" - -//d: List item text of USBUI Setting view -//d: for "Media transfer". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_mtp "Media transfer" - -//d: List item text of USBUI Setting view -//d: for "Ovi Suite". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_ovisuite_mtp "Ovi Suite" - -//d: List item text of USBUI Setting view -//d: for "Connect to internet". -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_quickconnect "Connect PC to Web" - -//d: List item text of USBUI Setting view, not to be localized -//d: for "RNDIS" -//d: This text is also used in USB connected popup -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 5.2 -// -#define qtn_usb_mode_rndis "Connect PC with RNDIS" - -//d: text describing the mass storage mode, shown in preview pop up in USB UI Setting -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_mass_storage "Access your phone’s memory card from the device you are connected to." - -//d: text describing the ovi suite mode, shown in preview pop up in USB UI setting -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_ovi_suite "Manage your phone with Ovi Suite and sync your media content." - -//d: text describing the media transfer mode, shown in preview pop up in USB UI setting -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_mtp "Sync your media content with Windows Media Player or Nokia Ovi Player, or connect to compatible stereos." - -//d: text describing the picture transfer mode, shown in preview pop up in USB UI setting -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_ptp "Print pictures with a compatible printer." - -//d: text describing the Phone as modem mode, shown in preview pop up in USB UI setting -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_pam "Use your mobile phone as a modem" - -//d: text describing the Phone as RNDIS mode, shown in preview pop up in USB UI setting, not to be localized -//l: popup_preview_text_window/opt6 -//r: 5.2 -#define qtn_usb_mode_msg_rndis "Use your mobile phone as RNDIS" diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/rom/mtp_symbian_temp.iby --- a/usbengines/usbwatcher/rom/mtp_symbian_temp.iby Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/rom/mtp_symbian_temp.iby Mon May 17 11:03:15 2010 +0300 @@ -122,7 +122,6 @@ ECOM_PLUGIN(mtpmetadataservice.dll, mtpmetadataservice.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\2001A9A3.rsc resource\mtp\2001A9A3.rsc -data=EPOCROOT##epoc32\data\Z\deviceexperiences\default\en-us\A42998DC-D9BD-4287-A2EA-46116889443C.devicemetadata-ms deviceexperiences\default\en-us\A42998DC-D9BD-4287-A2EA-46116889443C.devicemetadata-ms #endif // SYMBIAN_EXCLUDE_MTP #endif // MTP_METADATASERVICE_IBY diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp --- a/usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbactivepersonalityhandler.cpp Mon May 17 11:03:15 2010 +0300 @@ -270,12 +270,9 @@ iDeviceState = aStateNew; switch ( aStateNew ) { - case EUsbDeviceStateAddress: + case EUsbDeviceStateConfigured: { - if( iAskOnConnectionSetting && - ( aStateOld != EUsbDeviceStateSuspended ) && - ( aStateOld != EUsbDeviceStateConfigured ) - ) + if( aStateOld != EUsbDeviceStateSuspended ) { iPersonalityParams->PersonalityNotifier().ShowQuery( KCableConnectedNotifierUid, iDummy, diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/cusbactivestate.cpp --- a/usbengines/usbwatcher/src/cusbactivestate.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbactivestate.cpp Mon May 17 11:03:15 2010 +0300 @@ -56,7 +56,7 @@ // start USB if cable is pluged-in at bootup if( EUsbDeviceStateUndefined != iCurrentState ) { - iOwner.StateChangeNotify( iPreviousState, iCurrentState ); + iOwner.StateChangeNotifyL( iPreviousState, iCurrentState ); iPreviousState = iCurrentState; } iUsbMan.DeviceStateNotification( KUsbAllStates, iCurrentState, iStatus ); @@ -106,7 +106,7 @@ { LOG2( "USB device state changed: %d ==> %d", iPreviousState, newState ); - iOwner.StateChangeNotify( iPreviousState, newState ); + iOwner.StateChangeNotifyL( iPreviousState, newState ); iPreviousState = newState; } else diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/cusbindicatorhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbengines/usbwatcher/src/cusbindicatorhandler.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This implements TUsbIndicatorHandler class. +* +*/ + +#include +#include +#include +#include +#include "debug.h" +#include "cusbindicatorhandler.h" + + +// --------------------------------------------------------------------------- +// C++ Constructor +// --------------------------------------------------------------------------- +// + +CUsbIndicatorHandler::CUsbIndicatorHandler() + { + // No implementation required + } + +CUsbIndicatorHandler::~CUsbIndicatorHandler() + { + delete iSymbianIndicator; + + } + +CUsbIndicatorHandler* CUsbIndicatorHandler::NewLC() + { + CUsbIndicatorHandler* self = new (ELeave) CUsbIndicatorHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CUsbIndicatorHandler* CUsbIndicatorHandler::NewL() + { + CUsbIndicatorHandler* self = CUsbIndicatorHandler::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +void CUsbIndicatorHandler::ConstructL() + { + LOG_FUNC + + iDevStateB4Suspend = EUsbDeviceStateUndefined; + iSymbianIndicator = CHbIndicatorSymbian::NewL(); + } + +// --------------------------------------------------------------------------- +// Change USB Indicator +// --------------------------------------------------------------------------- +// +void CUsbIndicatorHandler::HandleDeviceStateChangeL( TUsbDeviceState aStateOld, + TUsbDeviceState aStateNew, TInt aPersonality ) + { + LOG_FUNC + + LOG2( "USB device state changed: %d ==> %d", aStateOld, aStateNew ); + + if ( EUsbDeviceStateAddress == aStateNew ) // Entering addressed state + { + // going down configured -> addressed + if( ( EUsbDeviceStateConfigured == aStateOld ) || + ( ( EUsbDeviceStateSuspended == aStateOld ) && + ( EUsbDeviceStateConfigured == iDevStateB4Suspend ) ) ) + { + ShowUsbConnectedIndicatorL( EFalse, aPersonality ); + } + + // connecting indicator will be shown when addressed state is entered going up or down + // note that when disconnecting the cable (no need to show connecting indicator) + // the state change is CONFIGURED => SUSPENDED => POWERED => UNDEFINED + // filter out case of addressed -> suspended -> addressed + if ( ( EUsbDeviceStateSuspended != aStateOld ) || + ( EUsbDeviceStateAddress != iDevStateB4Suspend) ) + { + ShowUsbAddressedIndicator( ETrue ); + } + } + + else if ( EUsbDeviceStateConfigured == aStateNew ) // Entering configured state + { + // filter out case of configed -> suspended -> configed + if ( ( EUsbDeviceStateSuspended != aStateOld ) || + ( EUsbDeviceStateConfigured != iDevStateB4Suspend) ) + { + ShowUsbAddressedIndicator( EFalse ); + ShowUsbConnectedIndicatorL( ETrue, aPersonality ); + } + } + + else if ( EUsbDeviceStateUndefined == aStateNew ) // Entering undefined + { + ShowUsbAddressedIndicator( EFalse ); + ShowUsbConnectedIndicatorL( EFalse, aPersonality ); + } + + + else if ( EUsbDeviceStateSuspended == aStateNew ) + // If current state is suspend, we do not change the indicator, but save + // the previous state + { + iDevStateB4Suspend = aStateOld; + } + else // New device state is not configured, nor suspended, nor addressed + { + ShowUsbConnectedIndicatorL( EFalse, aPersonality ); + } + + } + +// --------------------------------------------------------------------------- +// Show USB Indicator +// --------------------------------------------------------------------------- +// +void CUsbIndicatorHandler::ShowUsbConnectedIndicatorL( TBool aActivate, TInt aPersonality ) + { + LOG_FUNC + TBool success = EFalse; + _LIT(KUsbIndicator, "com.nokia.hb.indicator.usb.device.connected/1.0"); + + if (aActivate) + { + RUsb usbman; + User::LeaveIfError(usbman.Connect()); + CleanupClosePushL(usbman); + HBufC* description = NULL; + User::LeaveIfError(usbman.GetDescription(aPersonality, + description)); + CleanupStack::PopAndDestroy(&usbman); + CleanupStack::PushL(description); + CHbSymbianVariant* parameters = CHbSymbianVariant::NewL(description, CHbSymbianVariant::EDes); + CleanupStack::PopAndDestroy(description); + success = iSymbianIndicator->Activate(KUsbIndicator, parameters); + LOG1( "calling CHbIndicatorSymbian::Activate(), returned %d", success); + if (!success) + { + TInt indicatorerror = iSymbianIndicator->Error(); + LOG1( "activating the indicator failed with %d", indicatorerror); + } + else + { + iConnectedIndicatorActive = ETrue; + } + delete parameters; + } + else if (iConnectedIndicatorActive) + { + success = iSymbianIndicator->Deactivate(KUsbIndicator); + LOG1( "calling CHbIndicatorSymbian::Deactivate(), returned %d", success); + if (success) + { + iConnectedIndicatorActive = EFalse; + } + LOG( "calling CHbIndicatorSymbian::Deactivate()"); + } + + } + +void CUsbIndicatorHandler::ShowUsbAddressedIndicator( TBool aActivate ) + { + LOG_FUNC + TBool success = EFalse; + _LIT(KUsbIndicator, "com.nokia.hb.indicator.usb.device.inprogress/1.0"); + if (aActivate) + { + success = iSymbianIndicator->Activate(KUsbIndicator); + LOG1( "calling CHbIndicatorSymbian::Activate(), returned %d", success); + if (!success) + { + TInt indicatorerror = iSymbianIndicator->Error(); + LOG1( "activating the indicator failed with %d", indicatorerror); + } + else + { + iAddressedIndicatorActive = ETrue; + } + } + else if (iAddressedIndicatorActive) + { + success = iSymbianIndicator->Deactivate(KUsbIndicator); + LOG1( "calling CHbIndicatorSymbian::Deactivate(), returned %d", success); + if (success) + { + iAddressedIndicatorActive = EFalse; + } + LOG( "calling CHbIndicatorSymbian::Deactivate()"); + } + } + + + +// End of file diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/cusbwatcher.cpp --- a/usbengines/usbwatcher/src/cusbwatcher.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbwatcher.cpp Mon May 17 11:03:15 2010 +0300 @@ -106,6 +106,7 @@ iGlobalStateObserver = CUsbGlobalSystemStateObserver::NewL( *this ); iUsbDevConStarter = CUsbDevConStarter::NewL(); iActiveState = CUsbActiveState::NewL( iUsbMan, *this ); + iUsbIndicatorHandler = CUsbIndicatorHandler::NewL(); } // ---------------------------------------------------------------------------- @@ -147,6 +148,7 @@ delete iUsbDeviceLock; delete iGlobalStateObserver; iSupportedPersonalities.Close(); + delete iUsbIndicatorHandler; } // ---------------------------------------------------------------------------- @@ -217,7 +219,7 @@ // This method notifies CUsbWatcher class about USB state changes. // ---------------------------------------------------------------------------- // -void CUsbWatcher::StateChangeNotify( TUsbDeviceState aStateOld, +void CUsbWatcher::StateChangeNotifyL( TUsbDeviceState aStateOld, TUsbDeviceState aStateNew ) { LOG_FUNC @@ -226,7 +228,7 @@ // Not show USB indicator in charging mode if ( iNormalStart ) { - iUsbIndicatorHandler.HandleDeviceStateChange( aStateOld, aStateNew ); + iUsbIndicatorHandler->HandleDeviceStateChangeL( aStateOld, aStateNew, iPersonalityId ); } if ( IsDeviceA() ) // Will be handled by UsbOtgWatcher diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/tusbindicatorhandler.cpp --- a/usbengines/usbwatcher/src/tusbindicatorhandler.cpp Sun May 02 21:57:48 2010 +0300 +++ /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: This implements TUsbIndicatorHandler class. -* -*/ - - -#include -#include // SAknNotifierPackage -#include //EAknIndicatorUSBConnection -#include "tusbindicatorhandler.h" -#include "debug.h" - -// --------------------------------------------------------------------------- -// C++ Constructor -// --------------------------------------------------------------------------- -// -TUsbIndicatorHandler::TUsbIndicatorHandler() - : iDevStateB4Suspend( EUsbDeviceStateUndefined ) - , iUsbIndicator(EFalse) - { - } - -// --------------------------------------------------------------------------- -// Change USB Indicator -// --------------------------------------------------------------------------- -// -void TUsbIndicatorHandler::HandleDeviceStateChange( TUsbDeviceState aStateOld, - TUsbDeviceState aStateNew ) - { - LOG_FUNC - - LOG2( "USB device state changed: %d ==> %d", aStateOld, aStateNew ); - - if ( EUsbDeviceStateConfigured == aStateNew ) // Entering configed state - { - // filter out case of configed -> suspended -> configed - if ( ( EUsbDeviceStateSuspended != aStateOld ) || - ( EUsbDeviceStateConfigured != iDevStateB4Suspend) ) - { - ShowUsbIndicator( ETrue ); - } - } - else if ( EUsbDeviceStateSuspended == aStateNew ) - // If current state is suspend, we do not change the indicator, but save - // the previous state - { - iDevStateB4Suspend = aStateOld; - } - else // New device state is not configured, nor suspended - { - // Hide USB indicator if previous state is either configured, or - // suspended AND state before is not configured - if( ( EUsbDeviceStateConfigured == aStateOld ) || - ( ( EUsbDeviceStateSuspended == aStateOld ) && - ( EUsbDeviceStateConfigured == iDevStateB4Suspend ) ) ) - { - ShowUsbIndicator( EFalse ); - } - } - } - -// --------------------------------------------------------------------------- -// Show USB Indicator -// --------------------------------------------------------------------------- -// -void TUsbIndicatorHandler::ShowUsbIndicator( TInt aUsbIndicatorState ) - { - LOG_FUNC - - iUsbIndicator = aUsbIndicatorState; - LOG1( "USB indicator state %d", aUsbIndicatorState ); - RNotifier notifier; - TInt err = notifier.Connect(); - if ( KErrNone == err ) - { - TPckgBuf< SAknNotifierPackage > pckg; - pckg().iParamData.iSmallIndicatorUid = - TUid::Uid( EAknIndicatorUSBConnection ); - pckg().iParamData.iValue = aUsbIndicatorState ? - EAknIndicatorStateOn : EAknIndicatorStateOff ; - notifier.StartNotifier( KAknSmallIndicatorUid, pckg ); - notifier.Close(); - } - else - { - LOG1( "RNotifier::Connect error: %d", err ); - } - } - -// End of file diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/usbman_pcs.rss --- a/usbengines/usbwatcher/src/usbman_pcs.rss Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/usbman_pcs.rss Mon May 17 11:03:15 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include "usbman.rh" #include "usbvariation.rh" @@ -52,7 +51,7 @@ product = per_product; id = KUsbPersonalityIdPCSuite; class_uids = "101fbf22, 101fbf24, 10281F2A, 101FB43A"; - description = qtn_usb_mode_ovisuite; + description = "ovi suite"; detailedDescription = qtn_usb_mode_msg_ovi_suite; property = 0x00000000; @@ -72,7 +71,7 @@ product = per_product; id = KUsbPersonalityIdMS; class_uids = "10204bbc"; - description = qtn_usb_mode_mass_storage; + description = "mass storage"; detailedDescription = qtn_usb_mode_msg_mass_storage; property = 0x00000000; diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/usbman_pcsmtp.rss --- a/usbengines/usbwatcher/src/usbman_pcsmtp.rss Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/usbman_pcsmtp.rss Mon May 17 11:03:15 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include "usbman.rh" #include "usbvariation.rh" @@ -54,7 +53,7 @@ product = per_product; id = KUsbPersonalityIdPCSuiteMTP; class_uids = "102827B3, 101fbf22, 101fbf24, 10281F2A, 101FB43A"; - description = qtn_usb_mode_ovisuite_mtp; + description = "ovi suite"; detailedDescription = qtn_usb_mode_msg_ovi_suite; property = 0x00000000; } @@ -72,7 +71,7 @@ product = per_product; id = KUsbPersonalityIdMS; class_uids = "10204bbc"; - description = qtn_usb_mode_mass_storage; + description = "mass storage"; detailedDescription = qtn_usb_mode_msg_mass_storage; property = 0x00000000; } @@ -90,7 +89,7 @@ product = per_product; id = KUsbPersonalityIdMTP; class_uids = "102827B3"; - description = qtn_usb_mode_mtp; + description = "media transfer"; detailedDescription = qtn_usb_mode_msg_mtp; property = 0x00000000; } diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/usbman_pcsmtppam.rss --- a/usbengines/usbwatcher/src/usbman_pcsmtppam.rss Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/usbman_pcsmtppam.rss Mon May 17 11:03:15 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include "usbman.rh" #include "usbvariation.rh" @@ -53,7 +52,7 @@ product = per_product; id = KUsbPersonalityIdPCSuiteMTP; class_uids = "102827B3, 101fbf22, 101fbf24, 10281F2A, 101FB43A"; - description = qtn_usb_mode_ovisuite_mtp; + description = "ovi suite"; detailedDescription = qtn_usb_mode_msg_ovi_suite; property = 0x00000000; @@ -73,7 +72,7 @@ product = per_product; id = KUsbPersonalityIdMS; class_uids = "10204bbc"; - description = qtn_usb_mode_mass_storage; + description = "mass storage"; detailedDescription = qtn_usb_mode_msg_mass_storage; property = 0x00000000; @@ -115,7 +114,7 @@ product = per_product; id = KUsbPersonalityIdMTP; class_uids = "102827B3"; - description = qtn_usb_mode_mtp; + description = "media transfer"; detailedDescription = qtn_usb_mode_msg_mtp; property = 0x00000000; @@ -135,7 +134,7 @@ product = per_product; id = KUsbPersonalityIdModemInst; class_uids = "2000FDA9"; - description = qtn_usb_mode_quickconnect; + description = "phone as modem"; detailedDescription = qtn_usb_mode_msg_pam; property = 0x00000000; } diff -r e7f64b6bf69e -r 831068540b07 usbengines/usbwatcher/src/usbman_pcspam.rss --- a/usbengines/usbwatcher/src/usbman_pcspam.rss Sun May 02 21:57:48 2010 +0300 +++ b/usbengines/usbwatcher/src/usbman_pcspam.rss Mon May 17 11:03:15 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include "usbman.rh" #include "usbvariation.rh" @@ -52,7 +51,7 @@ product = per_product; id = KUsbPersonalityIdPCSuite; class_uids = "101fbf22, 101fbf24, 10281F2A, 101FB43A"; - description = qtn_usb_mode_ovisuite; + description = "ovi suite"; detailedDescription = qtn_usb_mode_msg_ovi_suite; property = 0x00000000; @@ -72,7 +71,7 @@ product = per_product; id = KUsbPersonalityIdMS; class_uids = "10204bbc"; - description = qtn_usb_mode_mass_storage; + description = "mass storage"; detailedDescription = qtn_usb_mode_msg_mass_storage; property = 0x00000000; @@ -114,7 +113,7 @@ product = per_product; id = KUsbPersonalityIdModemInst; class_uids = "2000FDA9"; - description = qtn_usb_mode_quickconnect; + description = "phone as modem"; detailedDescription = qtn_usb_mode_msg_pam; property = 0x00000000; } diff -r e7f64b6bf69e -r 831068540b07 usbuis/group/bld.inf --- a/usbuis/group/bld.inf Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/group/bld.inf Mon May 17 11:03:15 2010 +0300 @@ -15,8 +15,6 @@ * */ - -#include "../usbui/group/bld.inf" #include "../usbuinotif/group/bld.inf" #include "../imageprintuiprovider/group/bld.inf" #include "../imageprintui/group/bld.inf" \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/imageprintui/src/settingscontainer.cpp --- a/usbuis/imageprintui/src/settingscontainer.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/imageprintui/src/settingscontainer.cpp Mon May 17 11:03:15 2010 +0300 @@ -36,7 +36,7 @@ #include "settingsitems.h" #include "settingstables.h" #ifdef __SERIES60_HELP -#include // Help id +//#include // Help id #endif @@ -254,10 +254,12 @@ // void CSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const { + /* FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::GetHelpContext")); aContext.iMajor = KUidUSB; aContext.iContext = KUSB_HLP_PRINT_SETTINGS; FLOG(_L("[IMAGEPRINTUI]\t CSettingsContainer::GetHelpContext complete")); +*/ } diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/inc/usbaddressedindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbaddressedindicator.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBADDRESSEDINDICATOR_H +#define USBADDRESSEDINDICATOR_H + + +#include + +/** + * USB indicator class. + * Handles client request and showing the indications. + */ +class UsbAddressedIndicator : public HbIndicatorInterface +{ + friend class TestUsbIndicatorPlugin; + +public: + /** + * Constructor + */ + UsbAddressedIndicator(const QString &indicatorType); + + /** + * Destructor + */ + ~UsbAddressedIndicator(); + + /** + * @see HbIndicatorInterface + */ + bool handleInteraction(InteractionType type); + + /** + * @see HbIndicatorInterface + */ + QVariant indicatorData(int role) const; + + +protected: + /** + * @see HbIndicatorInterface + */ + bool handleClientRequest(RequestType type, const QVariant ¶meter); + +private: + + QString mSecDisplayName; + +}; + +#endif /* USBADDRESSEDINDICATOR_H */ + + + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/inc/usbindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbindicator.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: USB Indicator Class +* +*/ + +#ifndef USBINDICATOR_H +#define USBINDICATOR_H + +#include "usbindicatorplugin.h" +#include + +#define KUsbIconFile "qtg_large_usb" + +/** + * USB indicator class. + * Handles client request and showing the indications. + */ +class USBIndicator : public HbIndicatorInterface +{ + friend class TestUsbIndicatorPlugin; + +public: + /** + * Constructor + */ + USBIndicator(const QString &indicatorType); + + /** + * Destructor + */ + ~USBIndicator(); + + /** + * @see HbIndicatorInterface + */ + bool handleInteraction(InteractionType type); + + /** + * @see HbIndicatorInterface + */ + QVariant indicatorData(int role) const; + +protected: + /** + * @see HbIndicatorInterface + */ + bool handleClientRequest(RequestType type, const QVariant ¶meter); + +private: + + QString mSecDisplayName; +}; + +#endif /* USBINDICATOR_H*/ + + + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/inc/usbindicatorplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbindicatorplugin.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: USB Indicator Plugin Class +* +*/ + +#ifndef USBINDICATORPLUGIN_H +#define USBINDICATORPLUGIN_H + + +#include +#include +#include + +const QString ConnectedIndicator = ("com.nokia.hb.indicator.usb.device.connected/1.0"); +const QString AddressedIndicator = ("com.nokia.hb.indicator.usb.device.inprogress/1.0" ); + +_LIT(KUSBExe, "USBSettingsApp.exe"); +const TInt KUSBUIUid = 0x2002E70C; + +/*! + USB indicator plugin class. + Main class of USB indicator plugin. + */ +class UsbIndicatorPlugin : public QObject, public HbIndicatorPluginInterface +{ + Q_OBJECT + Q_INTERFACES(HbIndicatorPluginInterface) + +public: + /*! + Constructor + */ + UsbIndicatorPlugin(); + + /*! + Destructor + */ + ~UsbIndicatorPlugin(); + + /*! + @see HbIndicatorPluginInterface + */ + QStringList indicatorTypes() const; + + /*! + @see HbIndicatorPluginInterface + */ + inline bool accessAllowed(const QString &indicatorType, + const QVariantMap &securityInfo) const; + /*! + @see HbIndicatorPluginInterface + */ + HbIndicatorInterface* createIndicator(const QString &indicatorType); + + /*! + @see HbIndicatorPluginInterface + */ + inline int error() const; + +private: + Q_DISABLE_COPY(UsbIndicatorPlugin) + + /*! + Error value + */ + int mError; + + /*! + Indicator types + supported indicator types. + */ + QStringList mIndicatorTypes; + + bool mTranslatorLoaded; + + QTranslator mTranslator; +}; + +// ---------------------------------------------------------------------------- +// UsbIndicatorPlugin::accessAllowed +// ---------------------------------------------------------------------------- +bool UsbIndicatorPlugin::accessAllowed(const QString &indicatorType, + const QVariantMap &securityInfo) const +{ + Q_UNUSED(indicatorType) + Q_UNUSED(securityInfo) + + // This plugin doesn't perform operations that may compromise security. + // All clients are allowed to use. + return true; +} + +// ---------------------------------------------------------------------------- +// UsbIndicatorPlugin::error +// ---------------------------------------------------------------------------- +inline int UsbIndicatorPlugin::error() const +{ + return mError; +} + + +#endif /* USBIndicatorPlugin_H */ diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/rom/usbindicatorplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/rom/usbindicatorplugin.iby Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __USBINDICATORPLUGIN_IBY__ +#define __USBINDICATORPLUGIN_IBY__ + +REM DLL + +#ifdef __USB +file=ABI_DIR\UREL\USBIndicatorPlugin.dll SHARED_LIB_DIR\USBIndicatorPlugin.dll UNPAGED +data=\epoc32\data\z\pluginstub\USBIndicatorPlugin.qtplugin \resource\plugins\indicators\USBIndicatorPlugin.qtplugin +#endif +#endif \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/rom/usbindicatorpluginresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/rom/usbindicatorpluginresources.iby Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBINDICATORPLUGINRESOURCES_IBY +#define USBINDICATORPLUGINRESOURCES_IBY +// Use standard macros +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\usbindimenu.qm QT_TRANSLATIONS_DIR\usbindimenu.qm + +#endif \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/src/usbaddressedindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/src/usbaddressedindicator.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "usbaddressedindicator.h" +#include +#include +#include +#include +#include "usbindicatorplugin.h" +#include "usbindicator.h" + + +/*! + UsbAddressedIndicator::UsbAddressedIndicator +*/ +UsbAddressedIndicator::UsbAddressedIndicator(const QString &indicatorType) : +HbIndicatorInterface(indicatorType, + HbIndicatorInterface::ProgressCategory, + InteractionActivated) + { + } + +/*! + UsbAddressedIndicator::~UsbAddressedIndicator +*/ +UsbAddressedIndicator::~UsbAddressedIndicator() + { + } + + +/*! + UsbAddressedIndicator::handleInteraction +*/ +bool UsbAddressedIndicator::handleInteraction(InteractionType type) + { + bool handled = false; + TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), + TUid::Uid(KUSBUIUid)); + if (type == InteractionActivated) + { + RProcess usbUiProcess; + TInt result = usbUiProcess.Create(KUSBExe(), KNullDesC, uidtype); + if (result == KErrNone) { + usbUiProcess.Resume(); + } + usbUiProcess.Close(); + handled = true; + } + return handled; + } + +/*! + UsbAddressedIndicator::indicatorData + returns the data and icon that needs to be displayed in the universal pop up and indicator menu +*/ +QVariant UsbAddressedIndicator::indicatorData(int role) const +{ + switch(role) + { + case PrimaryTextRole: + { + QString text = QString(hbTrId("txt_usb_dblist_usb_connecting")); + return text; + } + case DecorationNameRole: + { + QString iconName(KUsbIconFile); + return iconName; + } + default: + return QVariant(); + } +} + +/*! + UsbAddressedIndicator::handleClientRequest + handles client's activate and deactivate request +*/ +bool UsbAddressedIndicator::handleClientRequest( RequestType type, + const QVariant ¶meter) +{ + switch (type) { + case RequestActivate: + { + emit dataChanged(); + } + + break; + default: + emit deactivate(); + break; + } + //request always handled + return true; +} + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/src/usbindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/src/usbindicator.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "usbindicator.h" +#include +#include +#include + + +const QString TextIdPrefix = ("txt_usb_dblist_usb_connected_val_"); +/*! + USBIndicator::USBIndicator +*/ +USBIndicator::USBIndicator(const QString &indicatorType) : +HbIndicatorInterface(indicatorType, + HbIndicatorInterface::SettingCategory, + InteractionActivated) +{ +} + +/*! + USBIndicator::~USBIndicator +*/ +USBIndicator::~USBIndicator() +{ +} + + +/*! + USBIndicator::handleInteraction +*/ +bool USBIndicator::handleInteraction(InteractionType type) +{ + bool handled = false; + TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), + TUid::Uid(KUSBUIUid)); + if (type == InteractionActivated) { + RProcess usbUiProcess; + TInt result = usbUiProcess.Create(KUSBExe(), KNullDesC, uidtype); + if (result == KErrNone) { + usbUiProcess.Resume(); + } + usbUiProcess.Close(); + handled = true; + } + return handled; +} + +/*! + USBIndicator::indicatorData + returns the data and icon that needs to be displayed in the universal pop up and indicator menu +*/ +QVariant USBIndicator::indicatorData(int role) const +{ + switch(role) { + case PrimaryTextRole: + { + QString text = QString(hbTrId("txt_usb_dblist_usb_connected")); + return text; + } + case SecondaryTextRole: + { + return mSecDisplayName; + } + case DecorationNameRole: + { + QString iconName(KUsbIconFile); + return iconName; + } + default: + return QVariant(); + } +} + +/*! + USBIndicator::handleClientRequest + handles client's activate and deactivate request +*/ +bool USBIndicator::handleClientRequest( RequestType type, + const QVariant ¶meter) +{ + switch (type) { + case RequestActivate: + { + QString friendlyName = parameter.toString(); + friendlyName.replace( QChar(' '), QChar('_') ); + QString textId = TextIdPrefix + friendlyName; + mSecDisplayName = hbTrId(textId.toAscii()); + emit dataChanged(); + } + break; + default: + mSecDisplayName.clear(); + emit deactivate(); + break; + } + //request always handled + return true; +} diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/src/usbindicatorplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/src/usbindicatorplugin.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "usbindicatorplugin.h" +#include +#include +#include +#include "usbindicator.h" +#include "usbaddressedindicator.h" + +Q_EXPORT_PLUGIN(UsbIndicatorPlugin) + +/*! + UsbIndicatorPlugin::UsbIndicatorPlugin +*/ +UsbIndicatorPlugin::UsbIndicatorPlugin() : mError(0), mTranslatorLoaded(0) +{ +} + +/*! + UsbIndicatorPlugin::~UsbIndicatorPlugin +*/ +UsbIndicatorPlugin::~UsbIndicatorPlugin() +{ + if (mTranslatorLoaded) { + QApplication::removeTranslator(&mTranslator); + } +} + +/*! + UsbIndicatorPlugin::indicatorTypes + Return notification types this plugin implements +*/ +QStringList UsbIndicatorPlugin::indicatorTypes() const +{ + QStringList types; + types << ConnectedIndicator; + types << AddressedIndicator; + return types; +} + + + +/*! + UsbIndicatorPlugin::createIndicator + Creates and returns the HbIndicatorInterface +*/ +HbIndicatorInterface* UsbIndicatorPlugin::createIndicator(const QString &indicatorType) +{ + if (!mTranslatorLoaded) { + // add translator for application library + QString locale = QLocale::system().name(); + QString filename = QString("usbindimenu_") + locale; + bool success = mTranslator.load(filename, QString("z:/resource/qt/translations")); + QApplication::installTranslator(&mTranslator); + mTranslatorLoaded = true; + } + + HbIndicatorInterface *indicator = NULL; + if (indicatorType == ConnectedIndicator) { + indicator = new USBIndicator(indicatorType); + } + else if (indicatorType == AddressedIndicator) { + indicator = new UsbAddressedIndicator(indicatorType); + } + return indicator; +} + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbindicatorplugin/usbindicatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/usbindicatorplugin.pro Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,26 @@ +TEMPLATE = lib +TARGET = usbindicatorplugin +CONFIG += plugin +CONFIG += hb +HEADERS += inc/usbindicatorplugin.h \ + inc/usbindicator.h \ + inc/usbaddressedindicator.h + +SOURCES += src/usbindicatorplugin.cpp \ + src/usbindicator.cpp \ + src/usbaddressedindicator.cpp + +TRANSLATIONS = usbindimenu.ts + +symbian { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.UID3 = 0x2002E70D + pluginstub.sources = usbindicatorplugin.dll + pluginstub.path = /resource/plugins/indicators + DEPLOYMENT += pluginstub +} +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "qmakepluginstubs/usbindicatorplugin.qtplugin /epoc32/data/z/pluginstub/usbindicatorplugin.qtplugin" \ + "rom/usbindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(usbindicatorplugin.iby)" \ + "rom/usbindicatorpluginresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(usbindicatorpluginresources.iby)" diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/USBSettingsApp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/USBSettingsApp.pro Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,28 @@ +TEMPLATE = app +TARGET = USBSettingsApp +QT += core \ + gui +HEADERS += inc/usbsettingsapp.h \ + inc/usbuimodelactive.h \ + inc/usbuisettingmodel.h +SOURCES += src/usbuimodelactive.cpp \ + src/usbuisettingmodel.cpp \ + src/main.cpp \ + src/usbsettingsapp.cpp +LIBS += -lusbwatcher +LIBS += -lxqsettingsmanager +LIBS += -lusbman +FORMS += src/USBSettingsApp.ui +CONFIG += hb +TRANSLATIONS = usbview.ts +RESOURCES += src/usbsettinglayout.qrc \ + src/usbsettingsapp.qrc +symbian: { + TARGET.UID3 = 0x2002E70C + TARGET.CAPABILITY = LocalServices WriteDeviceData + RSS_RULES = "hidden = KAppIsHidden;" +} + +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "rom/usbsettingsapp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(usbsettingsapp.iby)" \ + "rom/usbsettingsappresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(usbsettingsappresources.iby)" \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/inc/ui_USBSettingsApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/inc/ui_USBSettingsApp.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,66 @@ +/******************************************************************************** +** Form generated from reading UI file 'USBSettingsApp.ui' +** +** Created: Fri Mar 5 17:51:29 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_USBSETTINGSAPP_H +#define UI_USBSETTINGSAPP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_USBSettingsApp +{ +public: + QWidget *centralwidget; + QMenuBar *menubar; + QStatusBar *statusbar; + + void setupUi(QMainWindow *USBSettingsApp) + { + if (USBSettingsApp->objectName().isEmpty()) + USBSettingsApp->setObjectName(QString::fromUtf8("USBSettingsApp")); + USBSettingsApp->resize(800, 600); + centralwidget = new QWidget(USBSettingsApp); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + USBSettingsApp->setCentralWidget(centralwidget); + menubar = new QMenuBar(USBSettingsApp); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 800, 21)); + USBSettingsApp->setMenuBar(menubar); + statusbar = new QStatusBar(USBSettingsApp); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + USBSettingsApp->setStatusBar(statusbar); + + retranslateUi(USBSettingsApp); + + QMetaObject::connectSlotsByName(USBSettingsApp); + } // setupUi + + void retranslateUi(QMainWindow *USBSettingsApp) + { + USBSettingsApp->setWindowTitle(QApplication::translate("USBSettingsApp", "USBSettingsApp", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class USBSettingsApp: public Ui_USBSettingsApp {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_USBSETTINGSAPP_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/inc/usbdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/inc/usbdebug.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef USBDEBUG_H +#define USBDEBUG_H + +#include + +#if defined(_DEBUG) + inline QDebug myDebug() + { + return qDebug(); + } +#else + inline QNoDebug myDebug() + { + return QNoDebug(); + } +#endif + + +#endif // MYDEBUG_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/inc/usbsettingsapp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/inc/usbsettingsapp.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBSETTINGSAPP_H +#define USBSETTINGSAPP_H + +#include +#include + +const int KUSBPortrateMinLine = 4; +const int KUSBPortrateMaxLine = 4; +const int KUSBLandscapeMinLine = 2; +const int KUSBLandscapeMaxLine = 2; + +class UsbUiSettingModel; +class QItemSelectionModel; +class HbView; +class HbDocumentLoader; +class HbListViewItem; + +class USBSettingsApp : public HbMainWindow +{ + Q_OBJECT + +public: + USBSettingsApp(QWidget *parent = 0); + ~USBSettingsApp(); + +public slots: + /* + * Handles the orientation change + * @param orientation is teh new orientation to be set + */ + void setOrientation(Qt::Orientation orientation); + +private: + /* + * Loads the DOCML and build the view by finding the widgets from it + * @param Orientation at loading time + */ + void load(Qt::Orientation); + +private: + // pointer to the HbDocumentLoader to load the DOCML owned by this class + HbDocumentLoader *mDocumentLoader; + // Pointer to the view, owned + HbView *mView; + //Pointer to model, owned + UsbUiSettingModel *mModel; + //Pointer to selection model, owned + QItemSelectionModel *mSelectionModel; + HbListViewItem *mListViewItem; +}; + +#endif // USBSETTINGSAPP_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/inc/usbuimodelactive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/inc/usbuimodelactive.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBUIMODELACTIVE_H +#define USBUIMODELACTIVE_H + +#include +#include +#include + +class UsbUiModelActivePrivate; + +/*! + \class UsbUiModelActive + \brief Helper class for using active objects in Qt classes. + + UsbUiModelActive is a helper class for using active objects + from any Qt class. It wraps a CActive-derived class in an interface + that uses Qt's signal-slot mechanism for communicating status changes + of the active object. + + */ +class UsbUiModelActive : public QObject +{ + Q_OBJECT + friend class UsbUiModelActivePrivate; + +public: + explicit UsbUiModelActive( int priority = CActive::EPriorityStandard, + QObject *parent = NULL ); + ~UsbUiModelActive(); + + inline TRequestStatus &RequestStatus(); + inline void SetActive(); + inline void Cancel(); + inline bool IsActive(); + +public: + /* + * Sets the the selected personality through usbwatcher + * @param personality is the personality to be set + */ + void SetUsbPersonality(int personality); + /* + * cancels the personality set in usbwatcher + */ + void CancelSetPersonality(); + +signals: + void requestCompleted( int status ); + +private: + /*! + * emits a signal when the request is completed + * @param status is the error + */ + void emitRequestCompleted( int status ); + +private: + UsbUiModelActivePrivate *d; + + /** Handle to USBWatcher for setting the personality */ + RUsbWatcher iUsbWatcher; +}; + + +/*! + \class UsbUiModelActivePrivate + \brief Private class of UsbUiModelActive, for using active objects in Qt classes. + + UsbUiModelActivePrivate is a helper class for using active objects + from any Qt class. It derives from CActive and allows other classes to use + it for passing to asynchronous function calls through its RequestStatus method. + + */ +class UsbUiModelActivePrivate : public CActive +{ + friend class UsbUiModelActive; + +public: + explicit UsbUiModelActivePrivate( UsbUiModelActive *parent, int priority ); + ~UsbUiModelActivePrivate(); + +private: + virtual void RunL(); + virtual void DoCancel(); + virtual TInt RunError( TInt aError ); + +private: + UsbUiModelActive *q; + +}; + +inline bool UsbUiModelActive::IsActive() +{ + return d->IsActive(); +} + +inline TRequestStatus &UsbUiModelActive::RequestStatus() +{ + return d->iStatus; +} + +inline void UsbUiModelActive::SetActive() +{ + d->SetActive(); +} + +inline void UsbUiModelActive::Cancel() +{ + d->Cancel(); +} + +#endif /* USBUIMODELACTIVE_H */ diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/inc/usbuisettingmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/inc/usbuisettingmodel.h Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBUISETTINGMODEL_H +#define USBUISETTINGMODEL_H + + +#include +#include +#include +#include +#include + +typedef QList< QMap< int, QVariant > > UsbUiModelDataSource; + +class RUsb; +class UsbUiModelActive; +class QItemSelection; +class QItemSelectionModel; + +class UsbUiSettingModel : public QAbstractItemModel +{ + Q_OBJECT + friend class TestUsbUiModelActive; + +public: + UsbUiSettingModel( QObject *parent = 0); + virtual ~UsbUiSettingModel(); + + /* + * Returns the index of the item in the model specified by the given row, column and parent index. + * @param row is the row number of the specified item + * @param column is the column number of the specified item + * @param parent QModelIndex parent + */ + virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; + /* + * Returns QModelIndex() because this model item has no parent + * @param child is the index of item model, the parent of which is going to be returned + * @param child is not used in here + */ + virtual QModelIndex parent( const QModelIndex &child ) const; + /* + * Returns the number of rows under the given parent + * @param parent QModelIndex parent + */ + virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const; + /* + * Returns the number of columns for the children of the given parent. + * @param parent QModelIndex parent + */ + virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const; + /* + *Returns the data stored under the given role for the item referred to by the index. + */ + virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; + + const QModelIndex* sourceData() const; + + /* + * informs the model of the changes in selectionModel and the new mode + * will be Handeled by the Model + */ + void setSelectionModel(QItemSelectionModel *selectionModel); + +public slots: + /* + * Provides notification of changes in selected usb mode + * @param key is not used + * @param value is the value read from cenrep key + */ + void cenrepChanged( const XQSettingsKey &key, const QVariant &value ); + + /* + * it checks the response from usbwatcher to see if the new mode change has been successful + * it will go back to the previous personality if it has not been successful + * @param status is the error code returned from usbwatcher + */ + void personalitySetCompleted (int status ); + + /** + * This slot handles selection change from the selection model. + * The personality is set according to the selection. + * @param selected Item selection of selected items + * @param deselected Item selection of deselected items + */ + void handleSelectionChange(const QItemSelection &selected, + const QItemSelection &deselected ); + +private: + /* + * Get the translated mode name + * @param friendlyName is the usb personality friendly name + */ + QString modeName( QString &friendlyName ); + + /* + * Get the current USB personality ID + * Returns 0, if the key is missing or the value cannot be converted + * to integer. + * @return The current personality id + */ + int currentMode(); + + /** + * Initialize the model data + * @param modeId The current mode ID + */ + void initializeModelData( int modeId ); + + /** + * Update the selection model + * @param newPersonality is the new personality id + */ + void updateSelectionModel(int newPersonality); + + /** + * Check from the USB Manager if the USB personality is hidden. + * @param usbman Already opened USB Manager session + * @param personalityId The ID of the personality to be checked. + * @return For hidden personality, true is returned. + */ + bool isPersonalityHidden(RUsb &usbman, TInt personalityId); + + /** + * Get the personality friendly name from USB Manager + * The friendly name can be used in text IDs. + * @param usbman The open USB Manager session + * @param personalityId The ID of the personality + * @return Friendly name for personality + */ + QString getFriendlyName(RUsb &usbman, TInt personalityId); + +private: + + UsbUiModelDataSource mSettingsList; + + // current USB personality + int mCurrentMode; + + //variable to access central repository + XQSettingsManager mSettingsManager; + + QList mPersonalityIds; + //owned by the class + // modelactive is used for the interaction with the usbwatcher + UsbUiModelActive *mModelActive; + + QItemSelectionModel *mSelectionModel; +}; + +#endif // USBUISETTINGMODEL_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/rom/usbsettingsapp.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/rom/usbsettingsapp.iby Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef USBSETTINGSAPP_IBY +#define USBSETTINGSAPP_IBY +// Use standard macros +#include + +#ifdef __USB +file=/epoc32/release/armv5/urel/usbsettingsapp.exe PROGRAMS_DIR/usbsettingsapp.exe +data=/epoc32/data/z/private/10003a3f/import/apps/usbsettingsapp_reg.rsc /private/10003a3f/import/apps/usbsettingsapp_reg.rsc +#endif + +#endif diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/rom/usbsettingsappresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/rom/usbsettingsappresources.iby Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBSETTINGSAPPRESOURCES_IBY +#define USBSETTINGSAPPRESOURCES_IBY +// Use standard macros +#include + +#ifdef __USB +S60_APP_RESOURCE(usbsettingsapp) +data=DATAZ_\QT_TRANSLATIONS_DIR\usbview.qm QT_TRANSLATIONS_DIR\usbview.qm +#endif + +#endif \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/USBSettingsApp.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/USBSettingsApp.ui Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,30 @@ + + USBSettingsApp + + + + 0 + 0 + 800 + 600 + + + + USBSettingsApp + + + + + + 0 + 0 + 800 + 21 + + + + + + + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/hblistviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/hblistviewitem.css Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,125 @@ + +/* + Layout selection +*/ + +HbListViewItem[layoutName="usb"]{ + layout:usb-1; +} + +HbListViewItem[layoutName="usb"][modelItemType="SeparatorItem"]{ + layout:separator-1; +} + +/* + Standard primitive properties +*/ + +HbListViewItem::selection-icon{ + fixed-height: var(hb-param-graphic-size-primary-small); + fixed-width: var(hb-param-graphic-size-primary-small); +} + +HbListViewItem::selection-icon[graphicsSize="Image"][!selectionMode][icon-1]{ + left: 0; +} + +HbListViewItem::multiselection-toucharea{ + fixed-width: 6.0un; +} + +HbListViewItem::icon-1{ + fixed-height: var(hb-param-graphic-size-primary-medium); + fixed-width: var(hb-param-graphic-size-primary-medium); +} + +HbListViewItem::icon-1[graphicsSize="SmallIcon"]{ + fixed-height: var(hb-param-graphic-size-primary-small); + fixed-width: var(hb-param-graphic-size-primary-small); +} + +HbListViewItem::icon-1[graphicsSize="LargeIcon"]{ + fixed-height: var(hb-param-graphic-size-primary-large); + fixed-width: var(hb-param-graphic-size-primary-large); +} + +HbListViewItem::icon-1[graphicsSize="Image"]:portrait{ + fixed-height: var(hb-param-graphic-size-image-portrait); + fixed-width: var(hb-param-graphic-size-image-portrait); +} + +HbListViewItem::icon-1[graphicsSize="Image"]:landscape{ + fixed-height: var(hb-param-graphic-size-image-landscape); + fixed-width: var(hb-param-graphic-size-image-landscape); +} + +HbListViewItem::text-1{ + text-height: var(hb-param-text-height-primary); + font-variant: primary; + pref-width:-1; + text-align: left; +} + +HbListViewItem::text-1[modelItemType="StandardItem"][stretchingStyle="StretchLandscape"]:landscape{ + pref-width: 30.0un; +} + +HbListViewItem::text-1[modelItemType="SeparatorItem"]{ + text-height: var(hb-param-text-height-secondary); + font-variant: secondary; + text-align: right; +} + +HbListViewItem::text-2{ + text-height: var(hb-param-text-height-secondary); + font-variant: secondary; + pref-width:-1; + text-align: left top; +} + + HbListViewItem::text-2[stretchingStyle="StretchLandscape"]:landscape{ + pref-width: 30.0un; + } + +HbListViewItem::text-3{ + text-height: var(hb-param-text-height-secondary); + fixed-width: 18.0un; + font-variant: secondary; + text-align: right; +} + +HbListViewItem::frame{ + border-width: var(hb-param-background-list-main); +} + +HbListViewItem::frame[insidePopup]{ + border-width: var(hb-param-background-list-popup); +} + +HbListViewItem::text-2[modelItemType="SeparatorItem"]{ + minimum-height: 0.0un; + minimum-width: 0.0un; + fixed-height: 0.0un; + fixed-width: 0.0un; +} + +HbListViewItem::text-3[modelItemType="SeparatorItem"]{ + minimum-height: 0.0un; + minimum-width: 0.0un; + fixed-height: 0.0un; + fixed-width: 0.0un; +} + +HbListViewItem::icon-1[modelItemType="SeparatorItem"]{ + minimum-height: 0.0un; + minimum-width: 0.0un; + fixed-height: 0.0un; + fixed-width: 0.0un; +} + +HbListViewItem::icon-2[modelItemType="SeparatorItem"]{ + minimum-height: 0.0un; + minimum-width: 0.0un; + fixed-height: 0.0un; + fixed-width: 0.0un; +} diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/hblistviewitem.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/hblistviewitem.widgetml Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/main.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include "usbsettingsapp.h" +#include + +int main(int argc, char *argv[]) +{ + HbApplication usbApp(argc, argv); + QTranslator translator; + + // add translator for application library + QString locale = QLocale::system().name(); + QString filename = QString("usbview_") + locale; + bool success = translator.load( filename, QString("/resource/qt/translations") ); + if (success) + { + usbApp.installTranslator(&translator); + } + + USBSettingsApp settingsapp; + settingsapp.show(); + + return usbApp.exec(); + +} diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbsettinglayout.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbsettinglayout.qrc Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,5 @@ + + + hblistviewitem.widgetml + hblistviewitem.css + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbsettingsapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbsettingsapp.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "usbsettingsapp.h" +#include +#include +#include +#include +#include +#include +#include +#include "usbuisettingmodel.h" +#include "usbdebug.h" + +#define DOCML ":/xml/usbsettingsapp.docml" + +USBSettingsApp::USBSettingsApp(QWidget *parent) + : HbMainWindow(parent), mView(NULL), mListViewItem(NULL) +{ + myDebug() << ">>> USBSettingsApp::USBSettingsApp"; + //Init the document loader and we load the view + mModel = new UsbUiSettingModel(this); + mSelectionModel = new QItemSelectionModel(mModel); + mDocumentLoader = new HbDocumentLoader(); + connect(this, SIGNAL(orientationChanged(Qt::Orientation)), + this,SLOT(setOrientation(Qt::Orientation))); + load(orientation()); + myDebug() << "<<< USBSettingsApp::USBSettingsApp"; +} + +USBSettingsApp::~USBSettingsApp() +{ + myDebug() << ">>> USBSettingsApp::~USBSettingsApp"; + delete mView; + delete mModel; + delete mDocumentLoader; + myDebug() << "<<< USBSettingsApp::~USBSettingsApp"; +} +/*! +loads the DOCML and build the view by finding the widgets from it +*/ +void USBSettingsApp::load(Qt::Orientation orientation) +{ + myDebug() << ">>> USBSettingsApp::load"; + bool loaded = true; + + //Sets loader to initial state + mDocumentLoader->reset(); + //Load the common section + mDocumentLoader->load(DOCML, &loaded); + + //Loads the view + if ( loaded ) { + myDebug() << " USBSettingsApp::load DOCML loaded"; + QGraphicsWidget *widget = mDocumentLoader->findWidget(QString("view")); + if (widget) { + myDebug() << " USBSettingsApp::load view found"; + mView = qobject_cast(widget); + this->addView(mView); + this->setCurrentView(mView); + } + QGraphicsWidget *listViewWidget = mDocumentLoader->findWidget(QString("listView")); + if (listViewWidget) { + myDebug() << " USBSettingsApp::load listView found"; + HbListView *listView = qobject_cast(listViewWidget); + listView->setModel(mModel); + listView->setSelectionMode(HbAbstractItemView::SingleSelection); + listView->setSelectionModel(mSelectionModel); + mModel -> setSelectionModel(mSelectionModel); + HbStyleLoader::registerFilePath(":/"); + listView->setLayoutName("usb"); + //scroll to the selected index, if not hidden personality + QModelIndexList indexList = mSelectionModel->selectedIndexes(); + if ( !indexList.isEmpty() ) { + myDebug() << " USBSettingsApp::load scrollTo " << indexList[0].row(); + myDebug() << " USBSettingsApp::load scrollTo disabled"; + //listView->scrollTo(indexList[0]); + } + } + + QGraphicsWidget *listViewItemWidget = mDocumentLoader->findWidget(QString("listItemPrototype")); + if (listViewItemWidget) { + myDebug() << " USBSettingsApp::load mListViewItem found"; + mListViewItem = qobject_cast(listViewItemWidget); + mListViewItem->setGraphicsSize(HbListViewItem::LargeIcon); + setOrientation(orientation); + } + + QGraphicsWidget *groupBoxWidget = mDocumentLoader->findWidget(QString("groupBox")); + if (groupBoxWidget) { + myDebug() << " USBSettingsApp::load groupBox found"; + HbGroupBox *groupBox = qobject_cast(groupBoxWidget); + groupBox->setHeading(QString(hbTrId("txt_usb_subhead_select_connection_type"))); + } + } + myDebug() << "<<< USBSettingsApp::load"; +} +/*! + Handles the orientation change +*/ +void USBSettingsApp::setOrientation(Qt::Orientation orientation) +{ + myDebug() << ">>> USBSettingsApp::setOrientation"; + if (mListViewItem) { + switch (orientation) { + case Qt::Horizontal: + mListViewItem->setSecondaryTextRowCount(KUSBLandscapeMinLine, KUSBLandscapeMaxLine); + break; + case Qt::Vertical: + mListViewItem->setSecondaryTextRowCount(KUSBPortrateMinLine, KUSBPortrateMaxLine); + break; + default: + break; + } + } + myDebug() << "<<< USBSettingsApp::setOrientation"; +} + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbsettingsapp.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbsettingsapp.docml Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbsettingsapp.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbsettingsapp.qrc Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,5 @@ + + + usbsettingsapp.docml + + \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbsettingsapp.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbsettingsapp.ts Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,396 @@ + + + + + + The second line contains the progress indicator + USB disconnecting + USB disconnecting + qtl_indimenu_pri_medium_graphic + usb_05 + dblist_1 + us + False + + + + Unable to eject the USB device. Some of the applicatios may still be using it. + Unable to eject the USB device. Some of the applicatios may still be using it. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + + Mass storage + Mass storage + qtl_list_pri_large_graphic_add + usb_03 + dblist_2 + us + False + + + Note this is continuation from the heading. Tells which interface we show to the host device + to OVI suite + to OVI suite + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + + Memory full. Close some applications and try to connect USB cable again. + Memory full. Close some applications and try to connect USB cable again. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + When the selected UBS mode can't be loaded, because there is not enough memory + Not enough memory + Not enough memory + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_2_val + us + False + + + + to OVI suite + to OVI suite + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_1_val + us + False + + + + Use this phone to connect the other device to the Internet + Use this phone to connect the other device to the Internet + txt_usb_dblist_usb_connected_val_access_this_phone + usb_03 + dblist_4_val + us + False + + + + USB connected + USB connected + qtl_indimenu_pri_medium_graphic + usb_02 + dblist_1 + us + False + + + Note this is continuation from the heading. Tells which interface we show to the host device + as mass storage + as mass storage + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + Either the device uses too much power (always, nothing can be done to make it work) or the device is unsupported otherways (like wants to use interface we don't have) + Unsupported USB device. Disconnect device. + Unsupported USB device. Disconnect device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + There is only the USB cable, but no device in the other end. + Remove USB cable or connect a device. + Remove USB cable or connect a device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + + OVI suite + OVI suite + qtl_list_pri_large_graphic_add + usb_03 + dblist_1 + us + False + + + + Select connection type + Select connection type + qtl_groupbox_simple_sec + usb_03 + subhead + us + False + + + There is some parts of the USB device the phone doesn't recognize, but the device can still be used for some purposes + Partially supported USB device connected. All functionality might not work. + Partially supported USB device connected. All functionality might not work. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + The USB device can't be used this time, but there is possibility that if one reconnects the cables that the device can be used. + Error in USB connection. Disconnect device. + Error in USB connection. Disconnect device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + + Safe to remove + Safe to remove + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + + USB problem + USB problem + qtl_indimenu_pri_medium_graphic + usb_02 + dblist_2 + us + False + + + + Use this phone like a memory stick on the other device + Use this phone like a memory stick on the other device + txt_usb_dblist_usb_connected_val_access_this_phone + usb_03 + dblist_2_val + us + False + + + + as media transfer + as media transfer + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_1_val + us + False + + + Tapping this item will start the safe removal process + Click to eject + Click to eject + qtl_notifdialog_sec_medium_graphics + usb_06 + dpinfo + us + False + + + The second line contains the progress indicator + USB connecting + USB connecting + qtl_indimenu_pri_medium_graphic + usb_05 + dblist_1 + us + False + + + The file system of the other device is recognized and accepted, but the file system may be e.g. corrupted, so it can't be used. + Unable to use file system in device. Disconnect device. + Unable to use file system in device. Disconnect device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + + as mass storage + as mass storage + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_1_val + us + False + + + + USB connected + USB connected + qtl_notifdialog_pri_medium_graphics + usb_01 + dpophead + us + False + + + The name of the USB item in control panel connectivity section + USB + USB + qtl_titlebar + usb + title + us + False + + + Layout ID parent. There should be maximum of 4 lines of text and each line has the constraints same as qtl_list_sec_large_graphic + Access this phone’s information from OVI Suite + Access this phone’s information from OVI Suite + txt_usb_dblist_usb_connected_val_access_this_phone + usb_03 + dblist_1_val + us + False + + + Note this is continuation from the heading. Tells which interface we show to the host device + as media transfer + as media transfer + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + + Web connection + Web connection + qtl_list_pri_large_graphic_add + usb_03 + dblist_4 + us + False + + + %1 is the type of the USB device, only in OTG + headset in use + headset in use + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + + Use this phone as a music or image source to the other device + Use this phone as a music or image source to the other device + txt_usb_dblist_usb_connected_val_access_this_phone + usb_03 + dblist_3_val + us + False + + + The USB hubs can't be used with the phone + Hubs are not supported. Disconnect device. + Hubs are not supported. Disconnect device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + + as web connection + as web connection + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_1_val + us + False + + + When use rhas selected to eject the other device and everythign has worked well, only in OTG + USB disconnected + USB disconnected + qtl_notifdialog_pri_medium_graphics + usb_01 + dpophead + us + False + + + + Media transfer + Media transfer + qtl_list_pri_large_graphic_add + usb_03 + dblist_3 + us + False + + + The USB device uses file system that we don't support + Unknown file system. Disconnect device. + Unknown file system. Disconnect device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + When the memory can't be unmounted from the phone and shown to the other device (e.g. PC). This may be due the corruption of the memory + Unable to show a memory to other device. + Unable to show a memory to other device. + qtl_dialog_pri5_larger_graphic + usb_04 + info + us + False + + + When the host doesn't recognize the interface we are offering to it + Connection type not supported + Connection type not supported + qtl_indimenu_sec_medium_graphic + usb_02 + dblist_2_val + us + False + + + Note this is continuation from the heading. Tells which interface we show to the host device + as web connection + as web connection + qtl_notifdialog_sec_medium_graphics + usb_01 + dpinfo + us + False + + + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbuimodelactive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbuimodelactive.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "usbuimodelactive.h" +#include "usbdebug.h" + + + +/*! + Constructor. + */ +UsbUiModelActive::UsbUiModelActive( int priority, QObject *parent ) +: QObject( parent ) +{ + myDebug() << ">>> UsbUiModelActive::UsbUiModelActive"; + d = new UsbUiModelActivePrivate( this, priority ); + int err= iUsbWatcher.Connect(); + myDebug() << "iUsbWatcher.Connect() returned "; + myDebug() << err; + myDebug() << "<<< UsbUiModelActive::UsbUiModelActive"; +} + +/*! + Destructor. + */ +UsbUiModelActive::~UsbUiModelActive() +{ + myDebug() << ">>> UsbUiModelActive::~UsbUiModelActive"; + delete d; + iUsbWatcher.Close(); + myDebug() << "<<< UsbUiModelActive::~UsbUiModelActive"; +} +/*! + * emits a signal when the request is completed + */ +void UsbUiModelActive::emitRequestCompleted( int status ) +{ + myDebug() << ">>> UsbUiModelActive::emitRequestCompleted status: "; + myDebug() << status; + emit requestCompleted( status ); + myDebug() << "<<< UsbUiModelActive::emitRequestCompleted"; +} + +/*! + * Sets the the selected personality through usbwatcher + */ +void UsbUiModelActive::SetUsbPersonality(int personality) + { + myDebug() << ">>> UsbUiModelActive::SetUsbPersonality"; + myDebug() << "requested personality is "; + myDebug() << personality; + // Change the personality asynchrously, result checked in RunL() + if( IsActive() ) + { + Cancel(); + } + myDebug() << "setting new personality"; + iUsbWatcher.SetPersonality(RequestStatus(), personality); + SetActive(); + myDebug() << "<<< UsbUiModelActive::SetUsbPersonality"; + + } +/*! + * cancles the personality set in usbwatcher + */ +void UsbUiModelActive::CancelSetPersonality() + { + iUsbWatcher.CancelSetPersonality(); + } + +/*! + Constructor. + */ +UsbUiModelActivePrivate::UsbUiModelActivePrivate( + UsbUiModelActive *parent, int priority ) +: CActive( (TInt) priority ), q( parent ) +{ + myDebug() << ">>> UsbUiModelActivePrivate::UsbUiModelActivePrivate"; + CActiveScheduler::Add( this ); + myDebug() << "<<< UsbUiModelActivePrivate::UsbUiModelActivePrivate"; +} + + +/*! + Destructor. + */ +UsbUiModelActivePrivate::~UsbUiModelActivePrivate() +{ + Cancel(); +} + + +/*! + * Called by the active scheduler when the request has been completed. + */ +void UsbUiModelActivePrivate::RunL() +{ + myDebug() << ">>> UsbUiModelActivePrivate::RunL"; + q->emitRequestCompleted( iStatus.Int() ); + myDebug() << "<<< UsbUiModelActivePrivate::RunL"; +} + + +/*! + Called by the active scheduler when the request has been cancelled. + */ +void UsbUiModelActivePrivate::DoCancel() +{ + q->CancelSetPersonality(); +} + + +/*! + Called by the active scheduler when an error in RunL has occurred. + */ +TInt UsbUiModelActivePrivate::RunError( TInt aError ) +{ + q->emitRequestCompleted( aError ); + return KErrNone; +} diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbsettingsapp/src/usbuisettingmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbsettingsapp/src/usbuisettingmodel.cpp Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,322 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "usbuisettingmodel.h" +#include +#include +#include +#include +#include +#include +#include +#include "usbuimodelactive.h" +#include "usbdebug.h" + + +const QString TextIdPrefix = ("txt_usb_dblist_"); +const QString DescriptionIdPostfix = ("_val"); +const QString ModeIconNamePrefix = ("qtg_large_"); + +/*! + Constructor. + */ +UsbUiSettingModel::UsbUiSettingModel( QObject *parent ) + : QAbstractItemModel( parent), mSelectionModel(NULL) +{ + mModelActive = new UsbUiModelActive(); + mCurrentMode = currentMode(); + initializeModelData(mCurrentMode); + bool ret = mSettingsManager.startMonitoring( + XQSettingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidUsbWatcher.iUid, KUsbWatcherPersonality ) ); + myDebug() << ">>> UsbUiSettingModel::startMonitoring value=" + << ret; + + // signal: personality changed in the central repository + ret = connect( &mSettingsManager, + SIGNAL( valueChanged( const XQSettingsKey&, const QVariant& ) ), + this, + SLOT( cenrepChanged( const XQSettingsKey&, const QVariant& ) ) ); + myDebug() << ">>> UsbUiSettingModel::UsbUiSettingModel connect valueChanged=" + << ret; + + // signal: response from usbwatcher to our attempt to set the personality + ret = connect( mModelActive, + SIGNAL( requestCompleted( int ) ), + this, + SLOT( personalitySetCompleted( int ))); + myDebug() << ">>> UsbUiSettingModel::UsbUiSettingModel connect requestCompleted=" + << ret; +} + +/*! + Destructor. + */ +UsbUiSettingModel::~UsbUiSettingModel() +{ + myDebug() << ">>> UsbUiSettingModel::~UsbUiSettingModel"; + mSettingsManager.stopMonitoring( + XQSettingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidUsbWatcher.iUid, KUsbWatcherPersonality ) ); + delete mModelActive; + myDebug() << "<<< UsbUiSettingModel::~UsbUiSettingModel"; +} + +/*! + Provides notification of changes in selected usb mode + */ +void UsbUiSettingModel::cenrepChanged( const XQSettingsKey &key, + const QVariant &value ) +{ + Q_UNUSED(key); + myDebug() << ">>> UsbUiSettingModel::cenrepChanged"; + // key is not checked, as we monitor only one key + updateSelectionModel(value.toInt()); + myDebug() << "<<< UsbUiSettingModel::cenrepChanged"; +} + +/*! + * updates the selection model + * The selection model will signal the view. + */ +void UsbUiSettingModel::updateSelectionModel(int newPersonality) +{ + myDebug() << ">>> UsbUiSettingModel::updateSelectionModel value=" + << newPersonality; + + mCurrentMode = newPersonality; + mSelectionModel->clear(); + int row = mPersonalityIds.indexOf(newPersonality); + myDebug() << ">>> UsbUiSettingModel::updateSelectionModel row=" + << row; + // in case of the hidden personality , the selection model is left empty + if ( row >= 0 ) { + //set selection model for the new selection + QModelIndex selectionIndex = index(row, 0, QModelIndex()); + QItemSelection selection(selectionIndex, selectionIndex); + mSelectionModel->select(selection, QItemSelectionModel::Select); + } + myDebug() << "<<< UsbUiSettingModel::updateSelectionModel"; +} + +/*! + * Returns the index of the item in the model specified by the given row, column and parent index. + */ +QModelIndex UsbUiSettingModel::index( int row, int column, const QModelIndex &parent ) const +{ + return hasIndex( row, column, parent ) ? createIndex( row, column ) : QModelIndex(); +} + +/* + This model does not support hierarchy, so this returns an empty model index. + */ +QModelIndex UsbUiSettingModel::parent( const QModelIndex &child ) const +{ + Q_UNUSED( child ); + return QModelIndex(); +} + +/*! + * Returns the number of rows under the given parent + */ +int UsbUiSettingModel::rowCount( const QModelIndex &parent ) const +{ + Q_UNUSED( parent ); + return mSettingsList.count(); +} + +/*! + * Returns the number of columns for the children of the given parent. + * This model is one-dimensional, so this returns 1. + */ +int UsbUiSettingModel::columnCount( const QModelIndex &parent ) const +{ + Q_UNUSED( parent ); + return 1; +} + +/*! + * Returns the data stored under the given role for the item referred to by the index. + */ +QVariant UsbUiSettingModel::data( const QModelIndex &index, int role ) const +{ + return mSettingsList.value( index.row() ).value( role ); +} + +/*! + * This is called when usb selection is changed in the view (selection model). + */ +void UsbUiSettingModel::handleSelectionChange(const QItemSelection &selected, + const QItemSelection &deselected ) +{ + Q_UNUSED( deselected ); + myDebug() << ">>> UsbUiSettingModel::handleSelectionChange"; + QModelIndexList items = selected.indexes(); + if (!items.isEmpty()) { + myDebug() << " UsbUiSettingModel::handleSelectionChange item exists"; + QModelIndex index = items[0]; + int newPersonalityId = mPersonalityIds.at(index.row()); + if ( newPersonalityId != mCurrentMode ) { + myDebug() << " UsbUiSettingModel::handleSelectionChange setting personality"; + mModelActive->SetUsbPersonality(newPersonalityId); + } + } + myDebug() << "<<< UsbUiSettingModel::handleSelectionChange return"; +} + +/*! + * Getter for the source data. + */ +const QModelIndex* UsbUiSettingModel::sourceData() const +{ + return new QModelIndex( createIndex( 0, 0 ) ); +} + +void UsbUiSettingModel::setSelectionModel(QItemSelectionModel *selectionModel) + { + myDebug() << ">>> UsbUiSettingModel::setSelectionModel"; + mSelectionModel = selectionModel; + connect( mSelectionModel, + SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & ) ), + this, + SLOT( handleSelectionChange( const QItemSelection &, const QItemSelection & ) ) ); + updateSelectionModel(mCurrentMode); + myDebug() << "<<< UsbUiSettingModel::setSelectionModel return"; + } + +/*! + * Get the translated mode name for the personality friendly name. + */ +QString UsbUiSettingModel::modeName( QString &friendlyName ) +{ + myDebug() << ">>> UsbUiSettingModel::modeName"; + QString textId = TextIdPrefix + friendlyName; + QString modeName = hbTrId( textId.toAscii() ); + myDebug() << "<<< UsbUiSettingModel::modeName " << modeName; + return modeName; +} + +/*! + * Get the current USB mode (personality) ID + */ +int UsbUiSettingModel::currentMode() +{ + myDebug() << ">>> UsbUiSettingModel::CurrentMode"; + int currentMode = mSettingsManager.readItemValue( + XQSettingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidUsbWatcher.iUid, KUsbWatcherPersonality ) ).toInt(); + myDebug() << "<<< UsbUiSettingModel::CurrentMode " << currentMode; + return currentMode; +} + +void UsbUiSettingModel::initializeModelData( int aModeId ) +{ + myDebug() << ">>> UsbUiSettingModel::initializeModelData aModeId=" + << aModeId; + RUsb usbMan; + if ( usbMan.Connect() == KErrNone ) { + RArray personalityIds; + mPersonalityIds.clear(); + if ( usbMan.GetPersonalityIds( personalityIds ) == KErrNone ) { + for ( int i = 0; i < personalityIds.Count(); i++ ) { + myDebug() << ">>> UsbUiSettingModel::initializeModelData personality ID =" + << personalityIds[i]; + if ( !isPersonalityHidden(usbMan, personalityIds[i]) ) { + mPersonalityIds.append( personalityIds[i] ); + QString friendlyName = getFriendlyName(usbMan, personalityIds[i]); + + QStringList displayList; + //text-1 mode name + displayList.append( modeName( friendlyName ) ); + + //text-2 description + QString textId = TextIdPrefix + friendlyName + DescriptionIdPostfix; + displayList.append( hbTrId(textId.toAscii()) ); + + QMap< int, QVariant > dataRow; + dataRow[ Qt::DisplayRole ] = QVariant( displayList ); + + //icon-1 + QString iconName = ModeIconNamePrefix + friendlyName; + HbIcon icon(iconName); + QList icons; + icons << icon; + dataRow[ Qt::DecorationRole ] = QVariant( icons ); + + mSettingsList << dataRow; + } + } + } + personalityIds.Close(); + usbMan.Close(); + } + myDebug() << "<<< UsbUiSettingModel::initializeModelData"; +} + +/*! + * it checks the response from usbwatcher to see if the new mode change has been successful + * it will go back to the previous personality if it has not been successful + */ +void UsbUiSettingModel::personalitySetCompleted (int status ) +{ + myDebug() << ">>> UsbUiSettingModel::personalitySetCompleted status= " + << status; + // status contains Symbian error code from usbwatcher + // if the status is KErrNone, we are ready to process the next request + if (status != KErrNone) { + // changing the personality failed, so we need to set back the previous personality + // the value will be read from central repository and also updates mCurrentMode + updateSelectionModel(currentMode()); + } + + myDebug() << "<<< UsbUiSettingModel::personalitySetCompleted"; +} + +bool UsbUiSettingModel::isPersonalityHidden(RUsb &usbman, TInt personalityId) +{ + myDebug() << ">>> UsbUiSettingModel::isPersonalityHidden from USB Manager"; + bool hidden = false; + TUint32 property = 0; + TInt ret = usbman.GetPersonalityProperty(personalityId, property); + if (ret == KErrNone) { + myDebug() << "property " << property; + if (property & KUsbPersonalityPropertyHidden) { + hidden = true; + } + } + myDebug() << "<<< UsbUiSettingModel::isPersonalityHidden " << hidden; + return hidden; +} + +QString UsbUiSettingModel::getFriendlyName(RUsb &usbman, TInt personalityId) +{ + myDebug() << ">>> UsbUiSettingModel::getFriendlyName"; + QString friendlyName; + HBufC* description = NULL; + TInt err = usbman.GetDescription(personalityId, description); + if (err == KErrNone) { + friendlyName = QString::fromUtf16(description->Ptr(), description->Length()); + friendlyName.replace( QChar(' '), QChar('_') ); + delete description; + } else { + myDebug() << " UsbUiSettingModel::getFriendlyName RUsb error " + << err; + } + myDebug() << " UsbUiSettingModel::getFriendlyName friendlyName=" << friendlyName; + myDebug() << "<<< UsbUiSettingModel::getFriendlyName"; + return friendlyName; +} diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/data/102068DC.rss --- a/usbuis/usbuinotif/data/102068DC.rss Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/data/102068DC.rss Mon May 17 11:03:15 2010 +0300 @@ -17,7 +17,7 @@ */ -#include "registryinfo.rh" +#include "ecom/registryinfo.rh" #include "uikon.hrh" RESOURCE REGISTRY_INFO theInfo diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/data/usbuinotif.rss --- a/usbuis/usbuinotif/data/usbuinotif.rss Sun May 02 21:57:48 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,268 +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 file contains all the resources for the module -* USBUINotif. -* -*/ - - -NAME USBN - -#include -#include - -#include -#include -#include -#include - -#include - - -RESOURCE RSS_SIGNATURE { } - -//default document name - not used -RESOURCE TBUF { buf=""; } - -// === QUERIES ================================================================ - -//----------------------------------------------------------------------------- -// r_usb_query_with_cancel -// Query resource (with Cancel) -//----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_usb_query_with_cancel - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - animation = R_QGN_NOTE_QUERY_ANIM; - }; - } - }; - } - -//----------------------------------------------------------------------------- -// r_usb_query_without_cancel -// Query resource (without Cancel) -//----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_usb_query_without_cancel - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - animation = R_QGN_NOTE_INFO_ANIM; - }; - } - }; - } - - -//----------------------------------------------------------------------------- -// r_usb_on_connection_query -// Defines a dialog for usb mode query -//----------------------------------------------------------------------------- -// -RESOURCE AVKON_LIST_QUERY r_usb_on_connection_query - { - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSingleGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - array_id = r_usb_empty_array; - }; - heading = qtn_usb_mode_query_header; - }; - } - }; - } - - -//----------------------------------------------------------------------------- -//Prompts for message queries -//----------------------------------------------------------------------------- -// -RESOURCE TBUF r_usb_mode_msg_header { - buf=qtn_usb_mode_msg_header; } - -RESOURCE TBUF r_usb_mode_msg_mass_storage { - buf= "%U mode :\n"qtn_usb_mode_msg_mass_storage"\n"qtn_usb_mode_msg_link""; } - -RESOURCE TBUF r_usb_mode_msg_pc_suite { - buf= "%U mode :\n"qtn_usb_mode_msg_pc_suite"\n" qtn_usb_mode_msg_link""; } - -RESOURCE TBUF r_usb_mode_msg_mtp { - buf= "%U mode :\n"qtn_usb_mode_msg_mtp"\n" qtn_usb_mode_msg_link""; } - -RESOURCE TBUF r_usb_mode_msg_ptp { - buf= "%U mode :\n"qtn_usb_mode_msg_ptp"\n" qtn_usb_mode_msg_link""; } - -RESOURCE TBUF r_usb_mode_msg_link { - buf=qtn_usb_mode_msg_link; } - -//----------------------------------------------------------------------------- -// r_usb_on_connection_message_query -// Defines a dialog for ask on connection query -//----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_usb_on_connection_message_query - { - flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; - items= - { - DLG_LINE - { - type = EAknCtPopupHeadingPane; - id = EAknMessageQueryHeaderId; - control = AVKON_HEADING - { - label = header_not_defined; - }; - }, - DLG_LINE - { - type = EAknCtMessageQuery; - id = EAknMessageQueryContentId; - control = AVKON_MESSAGE_QUERY - { - }; - } - }; - } - - -//----------------------------------------------------------------------------- -// r_usb_empty_array -// Defines an empty array -//----------------------------------------------------------------------------- -RESOURCE ARRAY r_usb_empty_array - { - items= - { - LBUF { txt=""; } - }; - } - - -//----------------------------------------------------------------------------- -// Prompts for information notes -//----------------------------------------------------------------------------- -// - -//----------------------------------------------------------------------------- -// Prompts for confirmation queries -//----------------------------------------------------------------------------- -// -#ifndef RD_MULTIPLE_DRIVE -RESOURCE TBUF r_usb_memory_card_locked { - buf = qtn_usb_mode_note_memory_card_locked; } - -RESOURCE TBUF r_usb_cable_unsafely_removed { - buf = qtn_usb_mode_note_cable_unsafely_removed; } - -RESOURCE TBUF r_usb_memorycard_unsafely_removed { - buf = qtn_usb_mode_note_mmc_unsafely_removed; } -#endif - -RESOURCE TBUF r_usb_change_from_mass_storage { - buf = qtn_usb_mode_query_change_from_mass_storage; } - -RESOURCE TBUF r_usb_storage_media_failure { - buf = qtn_usb_mode_note_storage_media_failure; } - -// USB OTG Resources - -//----------------------------------------------------------------------------- -// r_usb_query_otg_error -//----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_usb_query_otg_error - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - animation = R_QGN_NOTE_ERROR_ANIM; - }; - } - }; - } - -RESOURCE TBUF r_usb_otg_error_current_limit { - buf = qtn_usb_otg_error_current_limit; } - -RESOURCE TBUF r_usb_otg_error_too_much_current_required { - buf = qtn_usb_otg_error_too_much_current_required; } - -RESOURCE TBUF r_usb_otg_error_unsupported { - buf = qtn_usb_otg_error_unsupported; } - -RESOURCE TBUF r_usb_otg_error_hub_unsupported { - buf = qtn_usb_otg_error_hub; } - -RESOURCE TBUF r_usb_otg_error_unrecoverable { - buf = qtn_usb_otg_error_unrecoverable; } - -RESOURCE TBUF r_usb_otg_warning_partial_support { - buf = qtn_usb_otg_warning_partial_support; } - -RESOURCE TBUF r_usb_no_memory_card { - buf = qtn_usb_mode_query_no_memory_card; } - -RESOURCE TBUF r_usb_otg_error_attach_timedout { - buf = qtn_usb_otg_error_cable; } - -RESOURCE TBUF r_usb_msmm_error_unknown_filesystem { - buf = qtn_usb_otg_error_unsupported_filesystem; } - -RESOURCE TBUF r_usb_msmm_error_general_mass_storage_error { - buf = qtn_usb_otg_general_mass_storage_error; } - -RESOURCE TBUF r_usb_msmm_error_out_of_memory { - buf = qtn_memlo_not_enough_memory; } - -RESOURCE TBUF r_usb_error_memory_not_enough { - buf = qtn_usb_error_memory_not_enough; } - -// End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/group/bld.inf --- a/usbuis/usbuinotif/group/bld.inf Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/group/bld.inf Mon May 17 11:03:15 2010 +0300 @@ -27,6 +27,7 @@ ../rom/usbuinotifresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(usbuinotifresources.iby) PRJ_MMPFILES +gnumakefile ../group/localization.mk usbuinotif.mmp PRJ_TESTMMPFILES diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/group/localization.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbuinotif/group/localization.mk Mon May 17 11:03:15 2010 +0300 @@ -0,0 +1,357 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +MAKE = make + +VISUAL_CFG = RELEASE +ifeq "$(CFG)" "UDEB" +VISUAL_CFG = DEBUG +endif + +do_nothing : + @rem do_nothing + +MAKMAKE: create_temps pre_targetdeps + +LIB: create_temps pre_targetdeps + +BLD: create_temps pre_targetdeps + +CLEAN: extension_clean deployment_clean + +CLEANLIB: do_nothing + +RESOURCE: create_qm + +create_qm : + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ar.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ar.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ar.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ar.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ar.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ar.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_eu.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_eu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_eu.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_eu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_eu.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_eu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_bg.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_bg.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_bg.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_bg.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_bg.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_bg.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ca.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ca.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ca.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ca.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ca.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ca.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hr.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_hr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hr.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hr.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_cs.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_cs.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_cs.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_cs.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_cs.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_cs.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_da.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_da.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_da.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_da.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_da.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_da.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_nl.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_nl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_nl.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_nl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_nl.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_nl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_en.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_en.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_en.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en_US.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_en_US.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en_US.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_en_US.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_en_US.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_en_US.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_et.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_et.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_et.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_et.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_et.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_et.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fi.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_fi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fi.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fi.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_fr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr_CA.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_fr_CA.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr_CA.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fr_CA.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_fr_CA.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fr_CA.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_gl.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_gl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_gl.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_gl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_gl.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_gl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_de.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_de.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_de.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_de.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_de.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_de.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_el.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_el.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_el.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_el.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_el.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_el.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_he.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_he.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_he.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_he.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_he.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_he.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hi.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_hi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hi.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hi.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_HK.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_zh_HK.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_HK.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh_HK.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_HK.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh_HK.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hu.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_hu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hu.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_hu.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hu.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_is.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_is.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_is.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_is.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_is.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_is.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_id.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_id.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_id.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_id.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_id.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_id.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_it.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_it.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_it.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_it.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_it.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_it.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ja.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ja.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ja.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ja.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ja.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ja.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ko.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ko.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ko.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ko.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ko.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ko.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lv.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_lv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lv.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_lv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lv.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_lv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lt.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_lt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lt.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_lt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_lt.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_lt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ms.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ms.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ms.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ms.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ms.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ms.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_no.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_no.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_no.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_no.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_no.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_no.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pl.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_pl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pl.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pl.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_pt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pt.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt_BR.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_pt_BR.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt_BR.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pt_BR.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_pt_BR.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pt_BR.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_zh.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ro.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ro.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ro.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ro.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ro.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ro.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ru.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ru.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ru.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ru.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ru.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ru.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sr.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_sr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sr.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sr.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sk.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_sk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sk.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sk.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sl.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_sl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sl.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sl.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_es.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_es.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_es.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es_419.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_es_419.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es_419.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_es_419.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_es_419.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_es_419.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sv.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_sv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sv.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_sv.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sv.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tl.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_tl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tl.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_tl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tl.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_tl.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_TW.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_zh_TW.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_TW.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh_TW.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_zh_TW.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh_TW.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_th.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_th.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_th.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_th.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_th.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_th.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tr.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_tr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tr.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_tr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_tr.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_tr.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_uk.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_uk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_uk.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_uk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_uk.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_uk.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ur.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_ur.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ur.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ur.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_ur.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ur.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_vi.ts -qm /epoc32/data/z/resource/qt/translations/usbdialogs_vi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_vi.ts -qm /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_vi.qm + lrelease -silent -idbased /epoc32/include/platform/qt/translations/usbdialogs_vi.ts -qm /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_vi.qm + +FREEZE: do_nothing + +SAVESPACE: do_nothing + +RELEASABLES: list_qm + +list_qm : + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ar.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ar.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ar.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_eu.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_eu.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_eu.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_bg.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_bg.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_bg.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ca.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ca.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ca.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_hr.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hr.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hr.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_cs.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_cs.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_cs.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_da.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_da.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_da.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_nl.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_nl.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_nl.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_en.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_en.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_en.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_en_US.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_en_US.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_en_US.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_et.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_et.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_et.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_fi.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fi.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fi.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_fr.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fr.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fr.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_fr_CA.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_fr_CA.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_fr_CA.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_gl.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_gl.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_gl.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_de.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_de.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_de.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_el.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_el.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_el.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_he.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_he.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_he.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_hi.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hi.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hi.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_zh_HK.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh_HK.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh_HK.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_hu.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_hu.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_hu.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_is.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_is.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_is.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_id.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_id.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_id.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_it.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_it.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_it.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ja.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ja.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ja.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ko.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ko.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ko.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_lv.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_lv.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_lv.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_lt.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_lt.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_lt.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ms.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ms.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ms.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_no.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_no.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_no.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_pl.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pl.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pl.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_pt.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pt.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pt.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_pt_BR.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_pt_BR.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_pt_BR.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_zh.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ro.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ro.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ro.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ru.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ru.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ru.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_sr.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sr.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sr.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_sk.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sk.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sk.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_sl.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sl.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sl.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_es.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_es.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_es.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_es_419.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_es_419.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_es_419.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_sv.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_sv.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_sv.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_tl.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_tl.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_tl.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_zh_TW.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_zh_TW.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_zh_TW.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_th.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_th.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_th.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_tr.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_tr.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_tr.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_uk.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_uk.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_uk.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_ur.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_ur.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_ur.qm + @echo /epoc32/data/z/resource/qt/translations/usbdialogs_vi.qm + @echo /epoc32/release/winscw/udeb/z/resource/qt/translations/usbdialogs_vi.qm + @echo /epoc32/release/winscw/urel/z/resource/qt/translations/usbdialogs_vi.qm + +extension_clean : + +deployment_clean : + +winscw_deployment_clean: + +pre_targetdeps : + +create_temps : + +deployment : + +finalize : + +FINAL: finalize deployment + diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/group/usbuinotif.mmp --- a/usbuis/usbuinotif/group/usbuinotif.mmp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/group/usbuinotif.mmp Mon May 17 11:03:15 2010 +0300 @@ -39,31 +39,16 @@ TARGET usbuinotif.rsc END -// Notifier resource file -START RESOURCE ../data/usbuinotif.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../inc - -SYSTEMINCLUDE ../../inc ../../../inc MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/) //for internal and private API headers -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore + MW_LAYER_SYSTEMINCLUDE - +USERINCLUDE ../inc ../../inc ../../../inc LIBRARY ECOM.LIB // Symbian E-Com Plugin definitions and types LIBRARY euser.lib cone.lib // Symbian OS frameworklibraries -LIBRARY avkon.lib // UI library LIBRARY bafl.lib // Basic Application Framework LIBRARY commonengine.lib // Series 60 common components LIBRARY eikcoctl.lib eiksrv.lib // Eikon libraries -LIBRARY eikdlg.lib // Eikon dialogs -LIBRARY estor.lib // for Cover Display UI support -LIBRARY FeatMgr.lib // for fetching if Cover Display is supported LIBRARY centralrepository.lib // Central Repository LIBRARY efsrv.lib // File server LIBRARY eikcore.lib // for icons @@ -72,11 +57,9 @@ LIBRARY aknicon.lib LIBRARY egul.lib LIBRARY usbman.lib // for personality IDs and descriptions -LIBRARY aknnotifierwrapper.lib // Avkon's notifier wrapper LIBRARY apparc.lib -LIBRARY akncapserverclient.lib // for suppressing the application key LIBRARY hbcore.lib - +LIBRARY hbwidgets.lib DEBUGLIBRARY flogger.lib // File logging services // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbnotifier.h --- a/usbuis/usbuinotif/inc/usbnotifier.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbnotifier.h Mon May 17 11:03:15 2010 +0300 @@ -20,9 +20,6 @@ #include #include #include -#include -#include -#include #include "usbuinotifdebug.h" // CONSTANTS // Literal resource filename @@ -38,7 +35,7 @@ * * @lib */ -NONSHARABLE_CLASS(CUSBUINotifierBase) : public CActive, public MEikSrvNotifierBase2 +NONSHARABLE_CLASS(CUSBUINotifierBase) : public CBase, public MEikSrvNotifierBase2 { public: // Constructors and destructor @@ -72,52 +69,25 @@ * @param aMessage Should be completed when the notifier is deactivated. * @return None. */ - virtual void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + virtual void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)=0; /** - * A function for checking the status of Apps key. - * @param aEnable A Boolean according to Apps key status - * @return None. - */ - void SuppressAppSwitching(TBool aEnable); - - /** * Check if message needs to be completed and complete it * @param aReason The completetion code */ void CompleteMessage(TInt aReason); - /* - * Check whether the keylock is on. If yes turn it off. - * @since S60 3.2 - */ - void DisableKeylock(); - - /* - * Restore the keyguard on if it has been disabled by DisableKeylock. - * @since S60 3.2 - */ - void RestoreKeylock(); - + /** + * Initialize HbTextResolrer, if not initialized before + * (checks it from TLS) + */ + void InitializeTextResolver(); + protected: // Functions from base classes /** - * From CActive Gets called when a request completes. - * @param None. - * @return None. - */ - virtual void RunL()=0; - - /** - * From CActive Gets called when a leave occurres in RunL. - * @param aError Symbian OS errorcode. - * @return error code. - */ - virtual TInt RunError(TInt aError); - - /** * From MEikSrvNotifierBase2 Called when a notifier is first loaded * to allow any initial construction that is required. * @param None. @@ -131,7 +101,7 @@ * @param None. * @return None. */ - virtual void Cancel(); + virtual void Cancel(); private: // Functions from base classes @@ -176,16 +146,8 @@ */ virtual TPtrC8 UpdateL(const TDesC8& aBuffer); - /** - * From CActive Gets called when a request is cancelled. - * @param None. - * @return None. - */ - virtual void DoCancel(); - -private: - TBool iKeylockChanged; // Flag used to restore the keylock - RAknUiServer iAknServer; + + protected: // Data @@ -196,10 +158,7 @@ TInt iResourceFileFlag; // Flag for eikon env. TNotifierInfo iInfo; // Notifier parameters structure CEikonEnv* iEikEnv; // Local eikonenv, not own - TBool iAppsKeyBlocked; // Apps key status - - TBool iCoverDisplaySupported; // Cover Display UI feature support - + TBool iTranslator ; }; #endif // USBUINOTIFIER_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuincableconnectednotifier.h --- a/usbuis/usbuinotif/inc/usbuincableconnectednotifier.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuincableconnectednotifier.h Mon May 17 11:03:15 2010 +0300 @@ -20,8 +20,8 @@ // INCLUDES -#include -#include +#include +#include #include "usbnotifier.h" // Base class // CLASS DECLARATION @@ -32,7 +32,7 @@ * @lib */ NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, - public MHbDeviceDialogObserver + public MHbDeviceNotificationDialogObserver { public: // Constructors and destructor @@ -66,13 +66,6 @@ void Cancel(); /** - * From CUSBUINotifierBase Gets called when a request completes. - * @param None. - * @return None. - */ - void RunL(); - - /** * From CUSBUINotifierBase Used in asynchronous notifier launch to * store received parameters into members variables and * make needed initializations. @@ -81,25 +74,21 @@ * @param aMessage Should be completed when the notifier is deactivated. * @return None. */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); private: - // functions from MHbDeviceDialogObserver - + // functions from MHbDeviceNotificationDialogObserver /** - * lunches the QT usb ui setting - * @param aData is a CHbSymbianVariantMap daya which contains the keys - */ - void DataReceived(CHbSymbianVariantMap& aData); - /* - * Virtual function from MHbDeviceDialogObserver - * Not implemented - */ - void DeviceDialogClosed(TInt aCompletionCode); - - + * Callback function which is called when the dialog is tapped + */ + void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog); + /** + * Callback function which is called when the dialog is closed + */ + void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, + TInt aCompletionCode); private: //New functions @@ -117,35 +106,20 @@ */ void GetPersonalityStringLC(HBufC*& aHeader,HBufC*& aDescription ); - /** - * Runs the connected discreet note - */ - void RunQueryL(); - - - /** + /** * launches the (USB) application * @param aProcessName The process name (*.exe) * @param TUidType */ void LaunchApplication(const TDesC & aProcessName,const TUidType & aUidType) const; - /** - * Adds a parameter to the dialog parameters. - */ - void AddParameterL( - CHbSymbianVariantMap* aParameters, - const TDesC& aKey, - const TAny* aData, - CHbSymbianVariant::TType aDataType); - private: /** * C++ default constructor. */ CUSBUICableConnectedNotifier(); - CHbDeviceDialogSymbian* iDialog; + CHbDeviceNotificationDialogSymbian* iDialog; }; #endif // USBUINCABLECONNECTEDNOTIFIER_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuinotifmsmmerror.h --- a/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h Mon May 17 11:03:15 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Declares USB UI Queries notifier. +* Description: Declares MSMM error notifier. * */ @@ -20,10 +20,11 @@ #define USBUINOTIFMSMMERROR_H // INCLUDES - +#include #include "usbnotifier.h" // Base class -#include // AVKON component + #define KUsbUiNotifOtgGeneralQueryGranularity 3 + // CLASS DECLARATION /** @@ -32,19 +33,21 @@ * * @lib */ -NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase +NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, + public MHbDeviceMessageBoxObserver { public: -/** - * Possible parameter values for KUsbUiNotifMSMMError - */ -enum TUsbUiNotifMSMMError - { - EUsbMSMMGeneralError, - EUsbMSMMUnknownFileSystem, - EUsbMSMMOutOfMemory - }; + /** + * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors. + */ + enum TUsbUiNotifMSMMError + { + EUsbMSMMGeneralError, + EUsbMSMMUnknownFileSystem, + EUsbMSMMOutOfMemory + }; + // Constructors and destructor /** @@ -57,6 +60,14 @@ */ virtual ~CUsbUiNotifMSMMError(); + /** + * Call back function to observe device message box closing. + * @param aMessageBox Pointer to the closing message box instance. + * @param aButton Button that was pressed. + */ + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); + protected: /** @@ -81,11 +92,6 @@ void Cancel(); /** - * From CUSBUINotifierBase Gets called when a request completes. - */ - void RunL(); - - /** * From CUSBUINotifierBase Used in asynchronous notifier launch to * store received parameters into members variables and * make needed initializations. @@ -93,7 +99,7 @@ * @param aReplySlot A reply slot. * @param aMessage Should be completed when the notifier is deactivated. */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); private: @@ -106,20 +112,9 @@ private: // New functions - /** - * Show query dialog - * @return KErrNone - accepted, KErrCancel - Cancel or End call key - */ - TInt QueryUserResponseL(); - private: // Data - /** - * Query - * Not own, destroys self when lauched. - */ - CAknQueryDialog* iQuery; - RArray iStringIds; - TInt iErrorId; - }; + CHbDeviceMessageBoxSymbian* iQuery; + CDesCArrayFlat* iStringIds; + }; #endif // USBUINOTIFMSMMERROR_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuinotifotgerror.h --- a/usbuis/usbuinotif/inc/usbuinotifotgerror.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifotgerror.h Mon May 17 11:03:15 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Declares USB UI Queries notifier. +* Description: Declares USB UI OTG Errors notifier. * */ @@ -20,19 +20,21 @@ #define USBUINOTIFOTGERROR_H // INCLUDES - +#include #include "usbnotifier.h" // Base class -#include // AVKON component + + #define KUsbUiNotifOtgGeneralQueryGranularity 3 // CLASS DECLARATION /** - * This class is used to show general USB query. + * This class is used to show general USB OTG errors * Asynchronous call is required. * * @lib */ -NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase +NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, + public MHbDeviceMessageBoxObserver { public: // Constructors and destructor @@ -46,7 +48,14 @@ * Destructor. */ virtual ~CUsbUiNotifOtgError(); - + + /** + * Call back function to observe device message box closing. + * @param aMessageBox Pointer to the closing message box instance. + * @param aButton Button that was pressed. + */ + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); protected: /** @@ -71,11 +80,6 @@ void Cancel(); /** - * From CUSBUINotifierBase Gets called when a request completes. - */ - void RunL(); - - /** * From CUSBUINotifierBase Used in asynchronous notifier launch to * store received parameters into members variables and * make needed initializations. @@ -83,7 +87,7 @@ * @param aReplySlot A reply slot. * @param aMessage Should be completed when the notifier is deactivated. */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); private: @@ -94,22 +98,12 @@ CUsbUiNotifOtgError(); private: - // New functions - - /** - * Show query dialog - * @return KErrNone - accepted, KErrCancel - Cancel or End call key - */ - TInt QueryUserResponseL(); - -private: // Data /** * Query - * Not own, destroys self when lauched. + * Owned */ - CAknQueryDialog* iQuery; - RArray iStringIds; - TInt iErrorId; + CHbDeviceMessageBoxSymbian* iQuery; + CDesCArrayFlat* iStringIds; }; #endif // USBUINOTIFOTGERROR_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuinotifotgwarning.h --- a/usbuis/usbuinotif/inc/usbuinotifotgwarning.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifotgwarning.h Mon May 17 11:03:15 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Declares USB UI connection notifier. +* Description: Declares USB OTG Warning notifier. * */ @@ -20,8 +20,9 @@ #define USBUINOTIFOTGWARNING_H // INCLUDES -#include + #include +#include #include "usbnotifier.h" // Base class #define KUsbUiNotifOtgGeneralNoteGranularity 1 @@ -32,7 +33,8 @@ * Synchronous call is enouph. * */ -NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : public CUSBUINotifierBase +NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : public CUSBUINotifierBase, + public MHbDeviceMessageBoxObserver { public: // Constructors and destructor @@ -46,6 +48,13 @@ * Destructor. */ virtual ~CUsbUiNotifOtgWarning(); + /** + * Call back function to observe device message box closing. + * @param aMessageBox Pointer to the closing message box instance. + * @param aButton Button that was pressed. + */ + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); protected: @@ -72,13 +81,6 @@ void Cancel(); /** - * From CUSBUINotifierBase. Gets called when a request completes. - * @param None. - * @return None. - */ - void RunL(); - - /** * From CUSBUINotifierBase. Used in asynchronous notifier launch to * store received parameters into members variables and * make needed initializations. @@ -87,7 +89,7 @@ * @param aMessage Should be completed when the notifier is deactivated. * @return None. */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); private: @@ -97,25 +99,12 @@ */ CUsbUiNotifOtgWarning(); - /** - * Publish the dialog to the cover UI - * The cover UI may use the personality ID or the localized - * personality name e.g. "Mass storage". - * @param aNote The dialog to be published. - * @param aPersonalityId The personality ID. - * @param aLocalizedPersonalityDescriptor The personality as a string. - */ - void - PublishToCoverUiL(CAknResourceNoteDialog* aNote, - TInt aPersonalityId, - const HBufC* aLocalizedPersonalityDescriptor); - private: // data - RArray iStringIds; + CDesCArrayFlat* iStringIds; //Own - CAknResourceNoteDialog* iNote; + CHbDeviceMessageBoxSymbian* iNote; TInt iNoteId; }; diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuinqueriesnotifier.h --- a/usbuis/usbuinotif/inc/usbuinqueriesnotifier.h Sun May 02 21:57:48 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declares USB UI Queries notifier. - * - */ - -#ifndef USBUINQUERIESNOTIFIER_H -#define USBUINQUERIESNOTIFIER_H - -// INCLUDES - -#include "usbnotifier.h" // Base class -#include // AVKON component - -// CLASS DECLARATION - -/** - * This class is used to show USB query dialogs. - * - * @lib - */ -NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase - { -public: - // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CUSBUIQueriesNotifier* NewL(); - - /** - * Destructor. - */ - virtual ~CUSBUIQueriesNotifier(); - - -private: - // Functions from base class - - /** - * From CUSBUINotifierBase Called when a notifier is first loaded. - * @param None. - * @return A structure containing priority and channel info. - */ - TNotifierInfo RegisterL(); - - /** - * From CUSBUINotifierBase The notifier has been deactivated - * so resources can be freed and outstanding messages completed. - * @param None. - * @return None. - */ - void Cancel(); - - /** - * From CUSBUINotifierBase Gets called when a request completes. - * @param None. - * @return None. - */ - void RunL(); - - /** - * From CUSBUINotifierBase Used in asynchronous notifier launch to - * store received parameters into members variables and - * make needed initializations. - * @param aBuffer A buffer containing received parameters - * @param aReplySlot A reply slot. - * @param aMessage Should be completed when the notifier is deactivated. - * @return None. - */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage); - -private: - - /** - * C++ default constructor. - */ - CUSBUIQueriesNotifier(); - -private: - // New functions - - - /** - * Show query dialog - * @param aStringHolder The string for the query. - * @param aCoverDialogId The dialog ID for the cover UI. - * @param aIsCancelKey Does the dialog show Cancel key. - * @return KErrNone - accepted, KErrCancel - Cancel or End call key - */ - TInt QueryUserResponseL(const TDesC& aStringHolder, TInt aCoverDialogId, - TBool aIsCancelKey); - - /** - * Get attributes for the query dialog - * The query type is idenfied by the member variable iQueryType. - * The caller should pop and destroy the returned heap descriptor - * when it is no longer needed. - * @param aCoverDialogId Returned dialog ID for the cover UI. - * @param aIsCancelKey Returned info about showing the Cancel key. - * @return The string holder for the query. - */ - HBufC* GetQueryAttributesLC(TInt& aCoverDialogId, TBool& aIsCancelKey); - -private: - // Data - /** - * Query - * Not own, destroys self when lauched. - */ - CAknQueryDialog* iUSBQueryDlg; - TUSBUIQueries iQueryType; // To store the type of the query - TInt iDriveLetter; // For MMC locked case - - }; -#endif // USBUINQUERIESNOTIFIER_H diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/inc/usbuinqueriesnotifiermdrv.h --- a/usbuis/usbuinotif/inc/usbuinqueriesnotifiermdrv.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinqueriesnotifiermdrv.h Mon May 17 11:03:15 2010 +0300 @@ -19,9 +19,10 @@ #define USBUINQUERIESNOTIFIER_H // INCLUDES - +#include #include "usbnotifier.h" // Base class -#include // AVKON component + + // CLASS DECLARATION /** @@ -30,7 +31,8 @@ * @lib * @since S60 3.0 */ -NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase +NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase, + public MHbDeviceMessageBoxObserver { public: // Constructors and destructor @@ -44,6 +46,14 @@ * Destructor. */ virtual ~CUSBUIQueriesNotifier(); + /** + * Call back function to observe device message box closing. + * @param aMessageBox Pointer to the closing message box instance. + * @param aButton Button that was pressed. + */ + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); + private: // Functions from base class @@ -64,13 +74,6 @@ void Cancel(); /** - * From CUSBUINotifierBase Gets called when a request completes. - * @param None. - * @return None. - */ - void RunL(); - - /** * From CUSBUINotifierBase Used in asynchronous notifier launch to * store received parameters into members variables and * make needed initializations. @@ -79,53 +82,24 @@ * @param aMessage Should be completed when the notifier is deactivated. * @return None. */ - void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, + void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); private: - /* - * From MEikSrvNotifierBase2 Synchronic notifier launch. - * @param aBuffer Received parameter data. - * @return A pointer to return value. - */ - virtual TPtrC8 StartL(const TDesC8& aBuffer); - + /** * C++ default constructor. */ CUSBUIQueriesNotifier(); -private: - // New functions - - /** - * Show query dialog - * @param aStringHolder The string for the query. - * @param aCoverDialogId The dialog ID for the cover UI. - * @param aIsCancelKey Does the dialog show Cancel key. - * @return KErrNone - accepted, KErrCancel - Cancel or End call key - */ - TInt QueryUserResponseL(const TDesC& aStringHolder, TInt aCoverDialogId, - TBool aIsCancelKey, TBool aIsErrorQuery); - - /** - * Get attributes for the query dialog - * The query type is idenfied by the member variable iQueryType. - * The caller should pop and destroy the returned heap descriptor - * when it is no longer needed. - * @param aCoverDialogId Returned dialog ID for the cover UI. - * @param aIsCancelKey Returned info about showing the Cancel key. - * @return The string holder for the query. - */ - HBufC* GetQueryAttributesLC(TInt& aCoverDialogId, TBool& aIsCancelKey, TBool& aIsErrorQuery); private: // Data /** - * Not own, destroys self when lauched. + * owned */ - CAknQueryDialog* iUSBQueryDlg; + CHbDeviceMessageBoxSymbian* iUSBQueryDlg; TUSBUIQueries iQueryType; // To store the type of the query }; diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/rom/usbuinotifresources.iby --- a/usbuis/usbuinotif/rom/usbuinotifresources.iby Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/rom/usbuinotifresources.iby Mon May 17 11:03:15 2010 +0300 @@ -19,9 +19,11 @@ REM USB UI notifiers resources +#include + #ifdef __USB_MULTIPERSONALITY -data=DATAZ_\RESOURCE_FILES_DIR\usbuinotif.rsc RESOURCE_FILES_DIR\usbuinotif.rsc +data=DATAZ_\QT_TRANSLATIONS_DIR\usbdialogs.qm QT_TRANSLATIONS_DIR\usbdialogs.qm #endif // __USB_MULTIPERSONALITY #endif // __USBUINOTIFRESOURCES_IBY__ \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbnotifier.cpp --- a/usbuis/usbuinotif/src/usbnotifier.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbnotifier.cpp Mon May 17 11:03:15 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,18 +16,15 @@ */ // INCLUDE FILES -#include // Eikon environment + #include // BAFL utils (for language file) -#include // Localisation stringloader -#include -#include #include -#include #include +#include #include "usbnotifier.h" // Own class #include "usbuinotifdebug.h" -#include "aknkeylock.h" //RAknKeyLock + // CONSTANTS // ================= MEMBER FUNCTIONS ========================================= @@ -39,11 +36,9 @@ // itself to the active scheduler stack. // ---------------------------------------------------------------------------- // -CUSBUINotifierBase::CUSBUINotifierBase() : - CActive( EPriorityStandard ) +CUSBUINotifierBase::CUSBUINotifierBase() { FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Default constructor()")); - CActiveScheduler::Add( this ); } // ---------------------------------------------------------------------------- @@ -55,27 +50,16 @@ void CUSBUINotifierBase::ConstructL() { iEikEnv = CEikonEnv::Static(); - iAppsKeyBlocked = EFalse; - iKeylockChanged = EFalse; - + FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::ConstructL()")); - TFileName filename; - - const TDriveNumber KStoreDrive = EDriveZ; - TDriveUnit driveUnit( KStoreDrive ); - TDriveName drive = driveUnit.Name(); - filename.Insert( 0, drive ); - - filename += KDC_RESOURCE_FILES_DIR; // From data_caging_path_literals.hrh - filename += KResourceFileName; - BaflUtils::NearestLanguageFile( iEikEnv->FsSession(), filename ); - iResourceFileFlag = iEikEnv->AddResourceFileL( filename ); - - FeatureManager::InitializeLibL(); - iCoverDisplaySupported = FeatureManager::FeatureSupported( - KFeatureIdCoverDisplay ); - FeatureManager::UnInitializeLib(); - + + // use TLS as a boolean, set to EFalse + TBool initialized = EFalse; + TInt error; + error = Dll::SetTls((TAny* )initialized); + error = error; // to suppress a compiler warning + FTRACE(FPrint(_L("[USBUINOTIF]\t Dll:SetTls returned %d"), error )); + FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::ConstructL() completed")); } @@ -90,19 +74,11 @@ //this virtual function call is to the local CUSBUINotifierBase::Cancel, //not to any possibly derived class implementation. Cancel(); - iEikEnv->DeleteResourceFile( iResourceFileFlag ); - + // Complete the RMessage2 if needed // CompleteMessage( KErrDied ); - // Activate apps -key again (if not previously activated yet) - SuppressAppSwitching( EFalse ); - - // Restore the keylock if not restored before (caused by Leave). - // If the Keylock is restored already, the function does nothing. - RestoreKeylock(); - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Destructor completed")); } @@ -150,7 +126,7 @@ const RMessagePtr2& aMessage) { FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::StartL()")); - TRAPD( err, GetParamsL( aBuffer, aReplySlot, aMessage )); + TRAPD( err, StartDialogL( aBuffer, aReplySlot, aMessage )); if (err) { aMessage.Complete( err ); @@ -168,8 +144,9 @@ void CUSBUINotifierBase::Cancel() { FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Cancel()")); - CActive::Cancel(); - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Cancel completed()")); + //The message box closed callback gets not run in subclass cancel calls. + CompleteMessage(KErrCancel); + FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Cancel completed")); } // ---------------------------------------------------------------------------- @@ -184,64 +161,6 @@ } // ---------------------------------------------------------------------------- -// CUSBUINotifierBase::DoCancel -// This method will be called by framework (CActive) -// if active object is still active. -// Does nothing here. -// ---------------------------------------------------------------------------- -// -void CUSBUINotifierBase::DoCancel() - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::DoCancel()")); - } - -// ---------------------------------------------------------------------------- -// CUSBUINotifierBase::RunError -// This method is called if any leaving has been occured -// during RunL. Optional method for CActive derived objects. -// ---------------------------------------------------------------------------- -// -TInt CUSBUINotifierBase::RunError(TInt aError) - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RunError()")); - - // Activate apps -key again (if not previously activated yet) - // - SuppressAppSwitching( EFalse ); - - // Write error message to caller - // - CompleteMessage( aError ); - - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RunError() completed")); - - return aError; - } - -// ---------------------------------------------------------------------------- -// CUSBUINotifierBase::SuppressAppSwitching -// -// ---------------------------------------------------------------------------- -// -void CUSBUINotifierBase::SuppressAppSwitching(TBool aEnable) - { - FTRACE(FPrint(_L("[USBUINOTIF]\t CUSBUINotifierBase::SuppressAppSwitching() %d"), aEnable)); - - if (iAppsKeyBlocked != aEnable) - { - TInt err = iAknServer.ConnectAndSendAppsKeySuppress( aEnable ); // error is stored only for logging purposes - iAppsKeyBlocked = aEnable; - FTRACE(FPrint(_L("[USBUINOTIF]\t CUSBUINotifierBase::SuppressAppSwitching() ConnectAndSendAppsKeySuppress returned %d"), err )); - } - - if (!iAppsKeyBlocked) - { - iAknServer.Close(); // close the connection once we have re-enabled swithcing - } - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::SuppressAppSwitching() completed")); - } - -// ---------------------------------------------------------------------------- // CUSBUINotifierBase::CompleteMessage // Check if message needs to be completed and complete it. // ---------------------------------------------------------------------------- @@ -258,61 +177,33 @@ FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::CompleteMessage() completed")); } -// ---------------------------------------------------------------------------- -// CUSBUINotifierBase::DisableKeylock -// ---------------------------------------------------------------------------- -// Turn off the keyguard if it was on. -// -void CUSBUINotifierBase::DisableKeylock() +void CUSBUINotifierBase::InitializeTextResolver() { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::DisableKeylock()")); - RAknKeylock2 keylock; - iKeylockChanged = EFalse; - if (KErrNone == keylock.Connect()) + _LIT(KFileName, "usbdialogs_"); + _LIT(KPath, "z:/resource/qt/translations/"); + TInt error; + + iTranslator = (TBool )Dll::Tls(); + + FTRACE(FPrint(_L("[USBUINOTIF]\t Dll:Tls returned %d"), iTranslator )); + + if (!iTranslator) { - if (keylock.IsKeyLockEnabled()) //Check and save the keylock status + iTranslator = HbTextResolverSymbian::Init(KFileName, KPath); + FTRACE(FPrint(_L("[USBUINOTIF]\t HbTextResolverSymbian::Init returned %d"), iTranslator )); + if (iTranslator) { - keylock.DisableWithoutNote();// Unlock - iKeylockChanged = ETrue; + error = Dll::SetTls((TAny* )iTranslator); } - keylock.Close(); - } - else - { - FLOG( _L( "[USBUINOTIF]\t CUSBUINotifierBase::DisableKeylock() fail caused by RAknKeylock2::Connect()") ); - } - - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::DisableKeylock() completed")); + FTRACE(FPrint(_L("[USBUINOTIF]\t Dll:SetTls returned %d"), error )); + } + + error = error; // to suppress a compiler warning + FTRACE( FPrint( + _L( "[USBUINOTIF]\t CUSBUINotifierBase::InitializeTextResolver result = %d" ), + iTranslator ) ); + } -// ---------------------------------------------------------------------------- -// CUSBUINotifierBase::RestoreKeylock -// ---------------------------------------------------------------------------- -// Restore the keyguard on. -// -void CUSBUINotifierBase::RestoreKeylock() - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock()")); - if (iKeylockChanged) - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock(): iKeylockChanged true")); - RAknKeylock2 keylock; - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock(): RAknKeyLock2 initialized")); - if (KErrNone == keylock.Connect()) - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock(): RAknKeyLock2::Connect() complete")); - keylock.EnableWithoutNote();// Lock back - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock(): RAknKeyLock2::EnableWithoutNote() complete")); - keylock.Close(); - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock(): RAknKeyLock2::Close() complete")); - iKeylockChanged = EFalse; - } - else - { - FLOG( _L( "[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock() fail caused by RAknKeylock2::Connect()") ); - } - } - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::RestoreKeylock() completed")); - } // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp --- a/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Mon May 17 11:03:15 2010 +0300 @@ -15,17 +15,13 @@ * */ // INCLUDE FILES -#include // Eikon environment -#include // BAFL utils (for language file) -#include -#include -#include // Localisation stringloader #include // Unicode character conversion utilities #include -#include // Own resources #include #include #include // KExecutableImageUid +#include +#include #include "usbuincableconnectednotifier.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros #include "UsbWatcherInternalCRKeys.h" @@ -33,10 +29,11 @@ // Literals -_LIT(KUSBExe, "usbapplication.exe"); -const TInt KUSBUIUid = 0x2002BCA3; -_LIT(KFileDrive,"z:"); -_LIT(KUSBUIconFileName, "usbui.mif"); +_LIT(KUSBExe, "USBSettingsApp"); +const TInt KUSBUIUid = 0x2002E70C; +const TInt KTextIdLength = 40; + +_LIT(KUSBUIconFileName, "qtg_large_usb"); // ================= MEMBER FUNCTIONS ========================================= @@ -79,8 +76,7 @@ //this virtual function call is to the local CUSBUICableConnectedNotifier:: //Cancel, not to any possibly derived class implementation. Cancel(); - delete iDialog; - + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::destructor completed")); } @@ -101,48 +97,39 @@ } // ---------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::GetParamsL +// CUSBUICableConnectedNotifier::StartDialogL // Jump to RunL as soon as possible. // ---------------------------------------------------------------------------- // -void CUSBUICableConnectedNotifier::GetParamsL(const TDesC8& /*aBuffer*/, +void CUSBUICableConnectedNotifier::StartDialogL(const TDesC8& /*aBuffer*/, TInt aReplySlot, const RMessagePtr2& aMessage) { - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetParamsL")); + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::StartDialogL")); if ( iReplySlot != 0 || iNeedToCompleteMessage) { User::Leave(KErrInUse); } + InitializeTextResolver(); + iMessage = aMessage; iNeedToCompleteMessage = ETrue; iReplySlot = aReplySlot; - - // Call SetActive() so RunL() will be called by the active scheduler - // - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - SetActive(); - User::RequestComplete(stat, KErrNone); - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetParamsL() completed")); - } - -// ---------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::RunL -// Ask user response and return it to caller. -// ---------------------------------------------------------------------------- -// -void CUSBUICableConnectedNotifier::RunL() - { - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunL")); - - DisableKeylock(); - SuppressAppSwitching(ETrue); - RunQueryL(); - SuppressAppSwitching(EFalse); - RestoreKeylock(); - - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunL() completed")); + iDialog = CHbDeviceNotificationDialogSymbian::NewL(this); + + HBufC* header = NULL; + HBufC* description =NULL; + GetPersonalityStringLC(header, description); + + iDialog->SetTitleL(*header); + iDialog->SetTextL(*description); + iDialog->SetIconNameL(KUSBUIconFileName ); + iDialog->EnableTouchActivation(ETrue); + iDialog->ShowL(); + + CleanupStack::PopAndDestroy(header); + CleanupStack::PopAndDestroy(description); + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::StartDialogL completed")); } // ---------------------------------------------------------------------------- @@ -153,8 +140,12 @@ void CUSBUICableConnectedNotifier::Cancel() { FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::Cancel() ")); - - iDialog->Cancel(); // cancel the dialog, if it is active + if (iDialog) + { + iDialog->Close(); + delete iDialog; + iDialog = NULL; + } CompleteMessage(KErrCancel); CUSBUINotifierBase::Cancel(); @@ -170,69 +161,50 @@ HBufC*& aHeader,HBufC*& aDescription ) { FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetPersonalityStringL")); + _LIT(KFixedPart, "txt_usb_dpinfo_"); + _LIT(KSpace, " "); + _LIT(KUnderline, "_"); + _LIT(KUsbConnected, "txt_usb_dpophead_usb_connected"); TInt CurrentPersonalityID = 0; // The ID of current USB mode GetCurrentIdL(CurrentPersonalityID); RUsb usbman; User::LeaveIfError(usbman.Connect()); + FLOG(_L("[USBUINOTIF]\t usbman connect called")); CleanupClosePushL(usbman); + HBufC* description = NULL; User::LeaveIfError(usbman.GetDescription(CurrentPersonalityID, - aDescription)); + description)); + FLOG(_L("[USBUINOTIF]\t get description called")); CleanupStack::PopAndDestroy(&usbman); + + CleanupStack::PushL(description); + TPtr descriptionPtr = description->Des(); + TInt position = descriptionPtr.Find(KSpace); + while (position != KErrNotFound) + { + descriptionPtr.Replace(position, 1, KUnderline); + position = descriptionPtr.Find(KSpace); + } + HBufC* textId = HBufC::NewL( KTextIdLength ); + CleanupStack::PushL(textId); + TPtr textIdPtr = textId->Des(); + textIdPtr.Append(KFixedPart); + textIdPtr.Append(descriptionPtr); + + aDescription = HbTextResolverSymbian::LoadL(textIdPtr); + CleanupStack::PopAndDestroy(textId); + CleanupStack::PopAndDestroy(description); CleanupStack::PushL(aDescription); - aHeader = StringLoader::LoadL(R_USB_MODE_MSG_HEADER); + + FLOG(_L("[USBUINOTIF]\t get description called")); + aHeader = HbTextResolverSymbian::LoadL(KUsbConnected); + FLOG(_L("[USBUINOTIF]\t get header called")); + CleanupStack::PushL(aHeader); + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetPersonalityStringL completed")); } -// ----------------------------------------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::RunQueryL -// Run the ask on connection message query -// ----------------------------------------------------------------------------------------------------------- -// -void CUSBUICableConnectedNotifier::RunQueryL() - { - FLOG( _L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunQueryL()")); - - _LIT(KNotificationType,"com.nokia.hb.devicenotificationdialog/1.0"); - _LIT(KTouchActivation, "touchActivation"); - _LIT(KIconName, "iconName"); - _LIT(KTitle, "title"); - _LIT(KText, "text"); - - HBufC* header = NULL; - HBufC* description =NULL; - GetPersonalityStringLC(header, description); - - TFileName usbUiIconFilename( KFileDrive ); - usbUiIconFilename += KDC_APP_BITMAP_DIR; - usbUiIconFilename += KUSBUIconFileName; - if( iDialog ) - { - delete iDialog; - iDialog = NULL; - } - iDialog = CHbDeviceDialogSymbian::NewL(); - CHbSymbianVariantMap *parameters =CHbSymbianVariantMap::NewL(); - CleanupStack::PushL(parameters); - - AddParameterL(parameters, KTitle, header, CHbSymbianVariant::EDes); - AddParameterL(parameters, KText, description, CHbSymbianVariant::EDes); - AddParameterL(parameters, KIconName, &usbUiIconFilename, CHbSymbianVariant::EDes); - TBool activation=ETrue; - AddParameterL(parameters, KTouchActivation, &activation, CHbSymbianVariant::EBool); - - FLOG( _L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunQueryL() show") ); - TBool error = iDialog->Show(KNotificationType ,*parameters, this); - FTRACE( FPrint( - _L( "[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunQueryL() error = %d" ), - error ) ); - - CleanupStack::PopAndDestroy(parameters); - CleanupStack::PopAndDestroy(header); - CleanupStack::PopAndDestroy(description); - - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunQueryL completed")); - } // ---------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::GetCurrentIdL // get the current personality id @@ -253,54 +225,28 @@ FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetCurrentIdL completed")); } -// ---------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::DataReceived -// launches the QT usb ui setting -// ---------------------------------------------------------------------------- -// -void CUSBUICableConnectedNotifier::DataReceived(CHbSymbianVariantMap& aData) - { - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::DataReceived")); - _LIT(KResult, "result"); - _LIT(KActivated, "activated"); - TInt result = 0; - MDesCArray& keys = aData.Keys(); - HBufC* key = NULL; - for(TInt i = 0; i < keys.MdcaCount(); i++) - { - result = keys.MdcaPoint(i).Compare(KResult); - if (result == 0) - { - key = HBufC::New(KResult().Length()); - if (key) - { - *key = KResult; - const CHbSymbianVariant* variant = aData.Get(*key); - delete key; - HBufC* value = static_cast(variant->Data()); - result = value->Des().Compare(KActivated); - if (result == 0) - { - TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), - TUid::Uid(KUSBUIUid)); - LaunchApplication(KUSBExe(), uidtype); - } - break; - } - } - } - } + -// ---------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::DeviceDialogClosed -// ---------------------------------------------------------------------------- -// - void CUSBUICableConnectedNotifier::DeviceDialogClosed(TInt aCompletionCode) - { - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::DeviceDialogClosed()")); - CompleteMessage(aCompletionCode); - } - +void CUSBUICableConnectedNotifier::NotificationDialogActivated( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/) + { + + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::NotificationDialogActivated()")); + TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), + TUid::Uid(KUSBUIUid)); + iDialog->Close(); + LaunchApplication(KUSBExe(), uidtype); + + } + +void CUSBUICableConnectedNotifier::NotificationDialogClosed( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/, TInt /*aCompletionCode*/) + { + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::NotificationDialogClosed()")); + CompleteMessage( KErrCancel ); + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::NotificationDialogClosed() complete")); + + } // --------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::LaunchApplication() // launches the application @@ -319,26 +265,5 @@ usbUiProcess.Close(); FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::LaunchApplication() completed")); } - -// --------------------------------------------------------------------------- -// CUSBUICableConnectedNotifier::AddParameter() -// Adds a string parameter to the dialog parameters. -// --------------------------------------------------------------------------- -// -void CUSBUICableConnectedNotifier::AddParameterL( - CHbSymbianVariantMap* aParameters, - const TDesC& aKey, - const TAny* aData, - CHbSymbianVariant::TType aDataType) - { - FLOG( _L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::AddStringParameter()") ); - FTRACE( FPrint( - _L( "[USBWATCHER]\t CUSBUICableConnectedNotifier::RunQueryL() aKey = %S" ), - &aKey ) ); - CHbSymbianVariant* variant = CHbSymbianVariant::NewL(aData, aDataType); - //aParameters takes variant ownership - User::LeaveIfError(aParameters->Add(aKey, variant)); - FLOG( _L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::AddStringParameter() completed") ); - } // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuinmain.cpp --- a/usbuis/usbuinotif/src/usbuinmain.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinmain.cpp Mon May 17 11:03:15 2010 +0300 @@ -19,10 +19,9 @@ #include #include #include -#include #include "usbuincableconnectednotifier.h" -#include "usbuinqueriesnotifier.h" +#include "usbuinqueriesnotifiermdrv.h" #include "usbuinotifdebug.h" #include "usbuinotifotgwarning.h" #include "usbuinotifotgerror.h" @@ -115,9 +114,9 @@ // ---------------------------------------------------------------------------- const TImplementationProxy ImplementationTable[] = - { +{ IMPLEMENTATION_PROXY_ENTRY( 0x10281F23, NotifierArray ) - }; +}; EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount) diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Mon May 17 11:03:15 2010 +0300 @@ -11,25 +11,24 @@ * * Contributors: * -* Description: USB UI queries notifier class. +* Description: USB UI MSMM Error notifier class. * */ // INCLUDE FILES -#include // Eikon environment -#include // BAFL utils (for language file) -#include // Unicode character conversion utilities -#include // Localisation stringloader -#include -#include -#include +#include // dialog +#include +#include +#include // pck +#include "usbuinotifmsmmerror.h" // Own class definition +#include "usbuinotifdebug.h" // Debugging macros -#include // pck -#include // Own resources -#include "usbuinotifmsmmerror.h" // Own class definition -#include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI + +// CONSTANTS +/** granularity for allocating error strings */ +const TInt KUsbMsmmErrorGranularity = 3; + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- @@ -53,7 +52,7 @@ // ---------------------------------------------------------------------------- // CUsbUiNotifMSMMError::CUsbUiNotifMSMMError() : - iStringIds( KUsbUiNotifOtgGeneralQueryGranularity) + iStringIds(NULL) { } @@ -66,15 +65,21 @@ //Make sure that the request is completed. Note that inside the destructor, //this virtual function call is to local CUsbUiNotifMSMMError::Cancel, //not to any possibly derived class implementation. + delete iStringIds; Cancel(); } void CUsbUiNotifMSMMError::ConstructL() { CUSBUINotifierBase::ConstructL(); - iStringIds.AppendL( R_USB_MSMM_ERROR_GENERAL_MASS_STORAGE_ERROR); - iStringIds.AppendL( R_USB_MSMM_ERROR_UNKNOWN_FILESYSTEM); - iStringIds.AppendL( R_USB_MSMM_ERROR_OUT_OF_MEMORY); + iStringIds = new (ELeave) CDesCArrayFlat(KUsbMsmmErrorGranularity); + _LIT(KGeneralError,"txt_usb_info_error_in_usb_connection_disconnect_d"); + _LIT(KUnknownFileSys, "txt_usb_info_unknown_file_system_disconnect_devic"); + _LIT(KOutOfMemory, "txt_usb_info_disk_full_remove_some_files_and_try"); + + iStringIds->AppendL(KGeneralError); + iStringIds->AppendL(KUnknownFileSys); + iStringIds->AppendL(KOutOfMemory); } // ---------------------------------------------------------------------------- @@ -95,15 +100,17 @@ // Jump to RunL as soon as possible. // ---------------------------------------------------------------------------- // -void CUsbUiNotifMSMMError::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, +void CUsbUiNotifMSMMError::StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::GetParamsL")); - if (iQuery || iReplySlot != 0 || iNeedToCompleteMessage) + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::StartDialogL")); + if (iReplySlot != 0 || iNeedToCompleteMessage) { User::Leave( KErrInUse ); } + InitializeTextResolver(); + iMessage = aMessage; iNeedToCompleteMessage = ETrue; iReplySlot = aReplySlot; @@ -111,51 +118,43 @@ // Get parameters // THostMsErrData error; - TPckgC pckg( error); + TPckgC pckg( error ); pckg.Set( aBuffer ); + int errorId = EUsbMSMMGeneralError; switch (pckg().iError) { case EHostMsErrUnknownFileSystem: - iErrorId = EUsbMSMMUnknownFileSystem; + errorId = EUsbMSMMUnknownFileSystem; break; case EHostMsErrOutOfMemory: - iErrorId = EUsbMSMMOutOfMemory; + errorId = EUsbMSMMOutOfMemory; break; default: - iErrorId = EUsbMSMMGeneralError; + errorId = EUsbMSMMGeneralError; + } + + //Delete the query in case the client didn't cancel the notifier + //or close the session after the previous query. + if (iQuery) + { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::GetParamsL() deleting previous dialog")); + delete iQuery; + iQuery = NULL; } - - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); + + iQuery = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning, this); + iQuery->SetTimeout(0); + + HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(errorId)); + iQuery->SetTextL(*stringHolder); + iQuery->ShowL(); + CleanupStack::PopAndDestroy( stringHolder ); + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::GetParamsL() completed")); } // ---------------------------------------------------------------------------- -// CUsbUiNotifMSMMError::RunL -// Ask user response and return it to caller. -// ---------------------------------------------------------------------------- -// -void CUsbUiNotifMSMMError::RunL() - { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::RunL")); - TInt returnValue = KErrNone; - - DisableKeylock(); - SuppressAppSwitching( ETrue ); - - //Excute dialog and check return value - returnValue = QueryUserResponseL(); - - SuppressAppSwitching( EFalse ); - RestoreKeylock(); - CompleteMessage( returnValue ); - - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::RunL() completed")); - } - -// ---------------------------------------------------------------------------- // CUsbUiNotifMSMMError::Cancel // Release all own resources (member variables) // ---------------------------------------------------------------------------- @@ -165,43 +164,43 @@ FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel")); if (iQuery) { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel closing iQuery")); + iQuery->Close(); + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel iQuery closed")); delete iQuery; + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel iQuery deleted")); iQuery = NULL; } - CompleteMessage( KErrCancel ); - + CUSBUINotifierBase::Cancel(); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel() completed")); } // ---------------------------------------------------------------------------- -// CUsbUiNotifMSMMError::QueryUserResponseL -// Show query dialog. +// Call back function to observe device message box closing. // ---------------------------------------------------------------------------- // -TInt CUsbUiNotifMSMMError::QueryUserResponseL() +void CUsbUiNotifMSMMError::MessageBoxClosed( + const CHbDeviceMessageBoxSymbian* /*aMessageBox*/, + CHbDeviceMessageBoxSymbian::TButtonId aButton) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::QueryUserResponseL")); - TInt returnValue = KErrNone; - TInt resourceId = R_USB_QUERY_OTG_ERROR; + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed")); + int returnValue = KErrNone; + + //iQuery will be deleted in Cancel. If Cancel is not called, it will be + //deleted next time the query is shown. - iQuery = CAknQueryDialog::NewL( CAknQueryDialog::EErrorTone ); - - if (iCoverDisplaySupported) + if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) { - iQuery->PublishDialogL( iErrorId, KUsbUiNotifMsmmError ); + returnValue = KErrNone; + } + else + { + returnValue = KErrCancel; } - HBufC *stringHolder = StringLoader::LoadLC( iStringIds[iErrorId] ); - TInt keypress = iQuery->ExecuteLD( resourceId, *stringHolder ); - - CleanupStack::PopAndDestroy( stringHolder ); - - iQuery = NULL; // Dialog destroyed - - returnValue = keypress ? KErrNone : KErrCancel; //OK? - - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::QueryUserResponseL completed")); - return returnValue; + CompleteMessage( returnValue ); + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed")); } // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuinotifotgerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Mon May 17 11:03:15 2010 +0300 @@ -17,18 +17,17 @@ // INCLUDE FILES -#include // Eikon environment -#include // BAFL utils (for language file) -#include // Unicode character conversion utilities -#include // Localisation stringloader -#include -#include - +#include // dialog +#include #include // pck -#include // Own resources #include "usbuinotifotgerror.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI + +// CONSTANTS +/** granularity for allocating error strings */ +const TInt KUsbOtgErrorGranularity = 7; + + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- @@ -52,7 +51,7 @@ // ---------------------------------------------------------------------------- // CUsbUiNotifOtgError::CUsbUiNotifOtgError() : - iStringIds( KUsbUiNotifOtgGeneralQueryGranularity) + iStringIds(NULL) { } @@ -65,19 +64,29 @@ //Make sure that the request is completed. Note that inside the destructor, //this virtual function call is to local CUsbUiNotifOtgError::Cancel, //not to any possibly derived class implementation. + delete iStringIds; Cancel(); } void CUsbUiNotifOtgError::ConstructL() { CUSBUINotifierBase::ConstructL(); - iStringIds.AppendL( R_USB_OTG_ERROR_CURRENT_LIMIT); - iStringIds.AppendL( R_USB_OTG_ERROR_TOO_MUCH_CURRENT_REQUIRED); - iStringIds.AppendL( R_USB_OTG_ERROR_UNSUPPORTED); - iStringIds.AppendL( R_USB_OTG_ERROR_HUB_UNSUPPORTED); - iStringIds.AppendL( R_USB_OTG_ERROR_UNRECOVERABLE); - iStringIds.AppendL( R_USB_OTG_ERROR_ATTACH_TIMEDOUT); - iStringIds.AppendL( R_USB_ERROR_MEMORY_NOT_ENOUGH); + iStringIds = new (ELeave) CDesCArrayFlat(KUsbOtgErrorGranularity); + _LIT(KCurrentLimit, "txt_usb_info_error_in_usb_connection_disconnect_d"); + _LIT(KTooMuchCurrent, "txt_usb_info_unsupported_usb_device_disconnect_de"); + _LIT(KUnsupported, "txt_usb_info_unsupported_usb_device_disconnect_de"); + _LIT(KHubUnsupported, "txt_usb_info_hubs_are_not_supported_disconnect_us"); + _LIT(KUnRecoverable, "txt_usb_info_error_in_usb_connection_disconnect_d"); + _LIT(KAttachTimeOut, "txt_usb_info_remove_usb_cable_or_connect_a_device"); + _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications"); + iStringIds->AppendL( KCurrentLimit); + iStringIds->AppendL( KTooMuchCurrent); + iStringIds->AppendL( KUnsupported); + iStringIds->AppendL( KHubUnsupported); + iStringIds->AppendL( KUnRecoverable); + iStringIds->AppendL( KAttachTimeOut); + iStringIds->AppendL( KNotEnoughMemory); + } // ---------------------------------------------------------------------------- @@ -98,60 +107,47 @@ // Jump to RunL as soon as possible. // ---------------------------------------------------------------------------- // -void CUsbUiNotifOtgError::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, +void CUsbUiNotifOtgError::StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL")); - if (iQuery || iReplySlot != 0 || iNeedToCompleteMessage) + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::StartDialogL")); + if (iReplySlot != 0 || iNeedToCompleteMessage) { User::Leave( KErrInUse ); } - - // Get parameters - // + + InitializeTextResolver(); - TPckgC pckg( iErrorId ); + TInt errorId = 0; + TPckgC pckg( errorId ); pckg.Set( aBuffer ); - iErrorId = pckg(); + errorId = pckg(); - FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL iErrorId: %d"), iErrorId )); - if ( iErrorId < 0 || iErrorId >= iStringIds.Count() ) + FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL iErrorId: %d"), errorId )); + if ( errorId < 0 || errorId >= iStringIds->MdcaCount()) { User::Leave( KErrArgument); } - iMessage = aMessage; iNeedToCompleteMessage = ETrue; - iReplySlot = aReplySlot; - - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL() completed")); - } - -// ---------------------------------------------------------------------------- -// CUsbUiNotifOtgError::RunL -// Ask user response and return it to caller. -// ---------------------------------------------------------------------------- -// -void CUsbUiNotifOtgError::RunL() - { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::RunL")); - TInt returnValue = KErrNone; - - DisableKeylock(); - SuppressAppSwitching( ETrue ); - - //Excute dialog and check return value - returnValue = QueryUserResponseL(); - - SuppressAppSwitching( EFalse ); - RestoreKeylock(); - CompleteMessage( returnValue ); - - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::RunL() completed")); + iReplySlot = aReplySlot; + + if (iQuery) + { + delete iQuery; + iQuery = NULL; + } + + iQuery = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning, this); + iQuery->SetTimeout(0); + HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(errorId) ); + iQuery->SetTextL(*stringHolder); + iQuery->ShowL(); + CleanupStack::PopAndDestroy( stringHolder ); + + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::StartDialogL completed")); } // ---------------------------------------------------------------------------- @@ -164,43 +160,41 @@ FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel")); if (iQuery) { + iQuery->Close(); delete iQuery; iQuery = NULL; } - CompleteMessage( KErrCancel ); + CUSBUINotifierBase::Cancel(); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel() completed")); } - // ---------------------------------------------------------------------------- -// CUsbUiNotifOtgError::QueryUserResponseL -// Show query dialog. +// Call back function to observe device message box closing. // ---------------------------------------------------------------------------- // -TInt CUsbUiNotifOtgError::QueryUserResponseL() +void CUsbUiNotifOtgError::MessageBoxClosed( + const CHbDeviceMessageBoxSymbian* /*aMessageBox*/, + CHbDeviceMessageBoxSymbian::TButtonId aButton) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::QueryUserResponseL")); - TInt returnValue = KErrNone; - TInt resourceId = R_USB_QUERY_OTG_ERROR; + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed")); + int returnValue = KErrNone; + + //iQuery will be deleted in Cancel. If Cancel is not called, it will be + //deleted next time the query is shown. - iQuery = CAknQueryDialog::NewL( CAknQueryDialog::EErrorTone ); - - if (iCoverDisplaySupported) + if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) { - iQuery->PublishDialogL( iErrorId, KUsbUiNotifOtgError ); + returnValue = KErrNone; + } + else + { + returnValue = KErrCancel; } - HBufC *stringHolder = StringLoader::LoadLC( iStringIds[iErrorId] ); - TInt keypress = iQuery->ExecuteLD( resourceId, *stringHolder ); - - CleanupStack::PopAndDestroy( stringHolder ); - - iQuery = NULL; // Dialog destroyed - - returnValue = keypress ? KErrNone : KErrCancel; //OK? - - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::QueryUserResponseL completed")); - return returnValue; + CompleteMessage( returnValue ); + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed")); } + // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuinotifotgwarning.cpp --- a/usbuis/usbuinotif/src/usbuinotifotgwarning.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifotgwarning.cpp Mon May 17 11:03:15 2010 +0300 @@ -17,15 +17,16 @@ // INCLUDE FILES -#include // Eikon environment -#include -#include // BAFL utils (for language file) -#include // Localisation stringloader -#include // for cover display support -#include // Own resources +#include +#include #include "usbuinotifotgwarning.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI + + +// CONSTANTS +/** granularity for allocating warning strings */ +const TInt KUsbOtgWarningGranularity = 1; + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- @@ -51,7 +52,7 @@ // ---------------------------------------------------------------------------- // CUsbUiNotifOtgWarning::CUsbUiNotifOtgWarning() : - iStringIds( KUsbUiNotifOtgGeneralNoteGranularity), iNote( NULL) + iStringIds(NULL), iNote( NULL) { FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::constructor()")); } @@ -66,6 +67,7 @@ //Make sure that the request is completed. Note that inside the destructor, //this virtual function call is to local CUsbUiNotifOtgWarning::Cancel, //not to any possibly derived class implementation. + delete iStringIds; Cancel(); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::destructor completed()")); } @@ -73,7 +75,9 @@ void CUsbUiNotifOtgWarning::ConstructL() { CUSBUINotifierBase::ConstructL(); - iStringIds.AppendL( R_USB_OTG_WARNING_PARTIAL_SUPPORT); + iStringIds = new (ELeave) CDesCArrayFlat(KUsbOtgWarningGranularity); + _LIT(KPartiallySupported, "txt_usb_info_partially_supported_usb_device_connec"); + iStringIds->AppendL( KPartiallySupported); } // ---------------------------------------------------------------------------- @@ -102,10 +106,11 @@ if (iNote) { FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::Cancel - delete iNote")); + iNote->Close(); delete iNote; iNote = NULL; } - CompleteMessage( KErrNone ); + CUSBUINotifierBase::Cancel(); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::Cancel() completed")); } @@ -116,67 +121,73 @@ // This notifier is synchronous so this function is not used. // ---------------------------------------------------------------------------- // -void CUsbUiNotifOtgWarning::GetParamsL(const TDesC8& aBuffer, +void CUsbUiNotifOtgWarning::StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::GetParamsL")); - if (iNote || iReplySlot != 0 || iNeedToCompleteMessage) + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::StartDialogL")); + if (iReplySlot != 0 || iNeedToCompleteMessage) { User::Leave( KErrInUse ); - } + } + + InitializeTextResolver(); + + iMessage = aMessage; + iNeedToCompleteMessage = ETrue; + iReplySlot = aReplySlot; // Get parameters // TPckgC pckg( iNoteId ); pckg.Set( aBuffer ); iNoteId = pckg(); - - FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::GetParamsL iNoteId: %d"), iNoteId )); - if ( iNoteId < 0 || iNoteId >= iStringIds.Count() ) + FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::GetParamsL iNoteId: %d"), iNoteId )); + if ( iNoteId < 0 || iNoteId >= iStringIds->MdcaCount()) { User::Leave( KErrArgument); } - - iMessage = aMessage; - iNeedToCompleteMessage = ETrue; - iReplySlot = aReplySlot; - - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::GetParamsL() completed")); + if (iNote) + { + delete iNote; + iNote = NULL; + } + + iNote = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning, this); + HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(iNoteId) ); + iNote->SetTextL(*stringHolder); + iNote->ShowL(); + CleanupStack::PopAndDestroy( stringHolder ); + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::StartDialogL completed")); } // ---------------------------------------------------------------------------- -// CUsbUiNotifOtgWarning::RunL -// Mandatory for Active Objects. This notifier is synchronous -// so this function is not used. +// Call back function to observe device message box closing. // ---------------------------------------------------------------------------- // -void CUsbUiNotifOtgWarning::RunL() +void CUsbUiNotifOtgWarning::MessageBoxClosed( + const CHbDeviceMessageBoxSymbian* /*aMessageBox*/, + CHbDeviceMessageBoxSymbian::TButtonId aButton) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::RunL")); + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed")); + int returnValue = KErrNone; + + //iQuery will be deleted in Cancel. If Cancel is not called, it will be + //deleted next time the query is shown. - // Create confirmation note - // - HBufC* str = StringLoader::LoadL( iStringIds[iNoteId] ); - CleanupStack::PushL( str ); - iNote = new (ELeave) CAknWarningNote( ETrue ); - - iNote->SetTimeout( CAknNoteDialog::ENoTimeout ); - - if (iCoverDisplaySupported) + if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) { - iNote->PublishDialogL( iNoteId, KUsbUiNotifOtgWarning ); + returnValue = KErrNone; + } + else + { + returnValue = KErrCancel; } - TInt t = iNote->ExecuteLD( *str ); - iNote = NULL; - CleanupStack::PopAndDestroy( str ); - - CompleteMessage( KErrNone ); - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgWarning::RunL() completed")); + CompleteMessage( returnValue ); + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed")); } // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp --- a/usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp Mon May 17 11:03:15 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,18 +16,12 @@ */ // INCLUDE FILES -#include // Eikon environment -#include // BAFL utils (for language file) -#include // Unicode character conversion utilities -#include // Localisation stringloader -#include -#include +#include +#include #include // pck -#include // Own resources #include "usbuinqueriesnotifiermdrv.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include // Dialog index for cover UI // ================= MEMBER FUNCTIONS ========================================= @@ -84,49 +78,21 @@ return iInfo; } -// ---------------------------------------------------------------------------- -// CUSBUIQueriesNotifier::StartL -// Synchronic notifier launch. -// ---------------------------------------------------------------------------- -// -TPtrC8 CUSBUIQueriesNotifier::StartL(const TDesC8& aBuffer) - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartL()")); - - TUSBQueriesNotiferParams params; //stores parameters from aBuffef - TPckgC pckg( params ); - pckg.Set( aBuffer ); - // Save the type of the query for later use (dialog selection) - // - - if (pckg().iQuery == EUSBNoMemoryCard) - { - TRAPD( err, GetParamsL( aBuffer, 0, iMessage )); - if (err) - { - iNeedToCompleteMessage = EFalse; - User::Leave( err ); - } - } - - TPtrC8 ret( KNullDesC8 ); - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartL() completed")); - return (ret); - } // ---------------------------------------------------------------------------- // CUSBUIQueriesNotifier::GetParamsL -// Jump to RunL as soon as possible. // ---------------------------------------------------------------------------- // -void CUSBUIQueriesNotifier::GetParamsL(const TDesC8& aBuffer, +void CUSBUIQueriesNotifier::StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::GetParamsL")); - if (iUSBQueryDlg || iReplySlot != 0 || iNeedToCompleteMessage) + FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL")); + if ( iReplySlot != 0 || iNeedToCompleteMessage) { User::Leave( KErrInUse ); } + + InitializeTextResolver(); iMessage = aMessage; iNeedToCompleteMessage = ETrue; @@ -140,59 +106,54 @@ // Save the type of the query for later use (dialog selection) // iQueryType = pckg().iQuery; - if (iQueryType == EUSBNoMemoryCard) + + if (iUSBQueryDlg) { - iNeedToCompleteMessage = EFalse; + delete iUSBQueryDlg; + iUSBQueryDlg = NULL; } - // Call SetActive() so RunL() will be called by the active scheduler - // - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::GetParamsL() completed")); - } - -// ---------------------------------------------------------------------------- -// CUSBUIQueriesNotifier::RunL -// Ask user response and return it to caller. -// ---------------------------------------------------------------------------- -// -void CUSBUIQueriesNotifier::RunL() - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::RunL")); - - TBool isCancelKey = EFalse; - TBool isErrorQuery = EFalse; - TInt returnValue = KErrNone; - // for cover display support - TInt coverDialogId = EUSBCoverInvalidDialogId; - - // Choose text and other query attributes - // - HBufC* stringHolder = GetQueryAttributesLC( coverDialogId, isCancelKey, isErrorQuery ); - - //check if query text string loading was successful - if (NULL != stringHolder) + iUSBQueryDlg = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning, this); + iUSBQueryDlg->SetTimeout(0); + HBufC* stringHolder = NULL; + switch (iQueryType) + { + case EUSBStorageMediaFailure: + { + _LIT(KMassStorageFail, "txt_usb_info_unable_to_show_a_memory_to_other_devi"); + stringHolder = HbTextResolverSymbian::LoadLC( KMassStorageFail ); + break; + } + case EUSBDiskFull: + { + _LIT(KDiskFull, "txt_usb_info_disk_full_remove_some_files_and_try"); + stringHolder = HbTextResolverSymbian::LoadLC( KDiskFull ); + break; + } + case EUSBNotEnoughRam: + { + _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications"); + stringHolder = HbTextResolverSymbian::LoadLC( KNotEnoughMemory ); + break; + } + default: + { + FTRACE( FPrint( _L( "[USBUINOTIF]\t CUSBUIQueriesNotifier::ERROR! Unknown query type: %d" ),iQueryType ) ); + } + } + + if (stringHolder) { - DisableKeylock(); - SuppressAppSwitching( ETrue ); - returnValue = QueryUserResponseL( *stringHolder, coverDialogId, - isCancelKey, isErrorQuery ); - SuppressAppSwitching( EFalse ); - RestoreKeylock(); - CleanupStack::PopAndDestroy( stringHolder ); + iUSBQueryDlg->SetTextL(*stringHolder); } - else - { - returnValue = KErrUnknown; - } - - CompleteMessage( returnValue ); - // cancelling the notifier so that next one on the queue can be displayed. - // it may be that the client calls cancel too, but it is ok - iManager->CancelNotifier( iInfo.iUid ); - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::RunL() completed")); + + iUSBQueryDlg->ShowL(); + FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL() ShowL returned")); + + CleanupStack::PopAndDestroy( stringHolder ); + + + FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL completed")); } // ---------------------------------------------------------------------------- @@ -205,127 +166,40 @@ FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::Cancel")); if (iUSBQueryDlg) { + iUSBQueryDlg->Close(); delete iUSBQueryDlg; iUSBQueryDlg = NULL; } - CompleteMessage( KErrCancel ); - + CUSBUINotifierBase::Cancel(); FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::Cancel() completed")); } -// ---------------------------------------------------------------------------- -// CUSBUIQueriesNotifier::QueryUserResponseL -// Show query dialog. -// ---------------------------------------------------------------------------- -// -TInt CUSBUIQueriesNotifier::QueryUserResponseL(const TDesC& aStringHolder, - TInt aCoverDialogId, TBool aIsCancelKey, TBool aIsErrorQuery) - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::QueryUserResponseL")); - TInt returnValue = KErrNone; - - iUSBQueryDlg = CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone ); - // Show dialog with or without the Cancel - // - if (aIsErrorQuery) +void CUSBUIQueriesNotifier::MessageBoxClosed( + const CHbDeviceMessageBoxSymbian* /*aMessageBox*/, + CHbDeviceMessageBoxSymbian::TButtonId aButton) + { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed")); + int returnValue = KErrNone; + + //iQuery will be deleted in Cancel. If Cancel is not called, it will be + //deleted next time the query is shown. + + if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) { - // aIsErrorQuery flag is set in GetQueryAttributesLC() - // there is no defined QueryDialogError in resources so QueryOTGerror is used (contains Stop icon) - iUSBQueryDlg->PrepareLC( R_USB_QUERY_OTG_ERROR ); - } - else if (aIsCancelKey) + returnValue = KErrNone; + } + else { - iUSBQueryDlg->PrepareLC( R_USB_QUERY_WITH_CANCEL ); - } - else - { - iUSBQueryDlg->PrepareLC( R_USB_QUERY_WITHOUT_CANCEL ); + returnValue = KErrCancel; } - if (iCoverDisplaySupported) - { - iUSBQueryDlg->PublishDialogL( aCoverDialogId, KUSBUINotifCategory ); - } - - iUSBQueryDlg->SetPromptL( aStringHolder ); - iUSBQueryDlg->SetFocus( ETrue ); - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::QueryUserResponseL calling RunLD")); - TInt keypress = iUSBQueryDlg->RunLD(); - - iUSBQueryDlg = NULL; - - if (keypress) // User has accepted the dialog - { - returnValue = KErrNone; - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::QueryUserResponseL keypress")); - } - else - { - returnValue = KErrCancel; - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::QueryUserResponseL NO keypress")); - } - - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::QueryUserResponseL completed")); - return returnValue; + CompleteMessage( returnValue ); + + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed")); } -// ---------------------------------------------------------------------------- -// CUSBUIQueriesNotifier::GetQueryAttributesLC -// Get query text and the other attributes for the query dialog. -// ---------------------------------------------------------------------------- -// -HBufC* CUSBUIQueriesNotifier::GetQueryAttributesLC(TInt& aCoverDialogId, - TBool& aIsCancelKey, TBool& aIsErrorQuery) - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::GetQueryAttributesLC")); - HBufC* stringHolder = NULL; // The text for the query - aIsCancelKey = EFalse; - aIsErrorQuery = EFalse; - switch (iQueryType) - { - case EUSBStorageMediaFailure: - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::EUSBStorageMediaFailure")); - stringHolder = StringLoader::LoadLC( R_USB_STORAGE_MEDIA_FAILURE ); - aCoverDialogId = EUSBCoverStorageMediaFailure; - break; - } - case EUSBChangeFromMassStorage: - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::EUSBChangeFromMassStorage")); - stringHolder = StringLoader::LoadLC( - R_USB_CHANGE_FROM_MASS_STORAGE ); - aIsCancelKey = ETrue; - aCoverDialogId = EUSBCoverChangeFromMassStorage; - break; - } - case EUSBNoMemoryCard: - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::EUSBNoMemoryCard")); - stringHolder = StringLoader::LoadLC( R_USB_NO_MEMORY_CARD ); - aCoverDialogId = EUSBCoverNoMemoryCard; - break; - } - case EUSBNotEnoughRam: - { - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::EUSBNotEnoughRam")); - stringHolder = StringLoader::LoadLC( R_USB_ERROR_MEMORY_NOT_ENOUGH ); - aCoverDialogId = EUSBCoverNoMemoryCard; - //set flag to change the icon of querydialog (see QueryUserResponseL()) - aIsErrorQuery = ETrue; - break; - } - default: - { - FTRACE( FPrint( - _L( "[USBUINOTIF]\t CUSBUIQueriesNotifier::ERROR! Unknown query type: %d" ), - iQueryType ) ); - } - } - FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::GetQueryAttributesLC completed")); - return stringHolder; - } + // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg Mon May 17 11:03:15 2010 +0300 @@ -1,230 +1,375 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Test script config file -* -*/ + // USB UI Notif tests - total 33 tc + +[Define] +//Message box OK button coordinates +OK_X 180 +OK_Y 397 + +//Message box pause before OK +OK_PAUSE 1500 -// UsbUiNotifApiTest Module - total 21 tc +//Message box pause before dismiss (enter key) +DISMISS_PAUSE 1500 + +//Device notification dialog touch coordinates +DEVICENOTIF_X 141 +DEVICENOTIF_Y 47 -// UsbUiNotifApiTest Api Tests (... tc) +//Device notification dialog pause before touch +DEVICENOTIF_PAUSE 1000 +[Enddefine] -// Cable connected notifier tests (3) + +// Cable connected notifier tests [Test] -title USB Ovi Suite Personality Info (Cable Connected Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock CableConnectedNotifierTest PCSUITEMTP -pause 4000 -delete tester -[Endtest] - -[Test] -title USB MS Personality Info (Cable Connected Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock CableConnectedNotifierTest MS -pause 4000 -delete tester -[Endtest] - -[Test] -title USB MTP Personality Info (Cable Connected Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock CableConnectedNotifierTest MTP -pause 4000 +title USB Cable Connected (Cable Connected Notifier Test) +create USBUiNotifApiTest tester +tester CableConnectedNotifierTest PCSUITEMTP +tester FinishCableConnectedQuery CANCEL delete tester [Endtest] - [Test] -title USB No Memory Card Query Accepted (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBNoMemoryCard -tester ExecuteApiTestBlock FinishQuery ACCEPT +title USB Cable Connected cancel (Cable Connected Notifier Test) +create USBUiNotifApiTest tester +tester CableConnectedNotifierTest PCSUITEMTP +pause 500 +tester CancelCableConnectedNotifier +tester FinishCableConnectedQuery CANCEL delete tester [Endtest] [Test] -title USB Storage Media Failure Query Accepted/Device Key Enter Pressed (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBStorageMediaFailure -pause 3000 -presskey global EKeyEnter -tester ExecuteApiTestBlock FinishQuery ACCEPT +title USB Cable Connected touch (Cable Connected Notifier Test) +create USBUiNotifApiTest tester +tester CableConnectedNotifierTest PCSUITEMTP +pause DEVICENOTIF_PAUSE +sendpointerevent global EButton1 DEVICENOTIF_X DEVICENOTIF_Y +tester FinishCableConnectedQuery ACCEPT +delete tester +[Endtest] + + +// Queries + +[Test] +title USB Query Storage Media Failure OK (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBStorageMediaFailure +pause OK_PAUSE +sendpointerevent global EButton1 OK_X OK_Y +tester FinishQuery ACCEPT delete tester [Endtest] [Test] -title USB Storage Media Failure Query Accepted/Device Key 0 Pressed (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBStorageMediaFailure -pause 1000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title USB Query Storage Media Failure dismiss (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBStorageMediaFailure +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title USB Query Not Enough RAM dismiss (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBNotEnoughRam +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title USB Query Disk Full dismiss (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBDiskFull +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] -title USB Change From Mass Storage Query Accepted/Device Key Enter Pressed (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBChangeFromMassStorage -pause 3000 +title USB Query cancel (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBStorageMediaFailure +tester CancelQueryNotifier +tester FinishQuery CANCEL +delete tester +[Endtest] + +//Test launching query without cancelling the previous. +[Test] +title USB Query no cancel (USB Queries Notifier Test) +create USBUiNotifApiTest tester +tester UsbQueriesNotifierTest EUSBStorageMediaFailure +pause DISMISS_PAUSE presskey global EKeyEnter -tester ExecuteApiTestBlock FinishQuery ACCEPT +tester WaitForRequest +tester UsbQueriesNotifierTest EUSBStorageMediaFailure +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] + +// OTG Errors + [Test] -title USB Change From Mass Storage Query Accepted/Device Key 0 Pressed (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBChangeFromMassStorage -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title OTG Error too much power (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgTooMuchPower +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] -title USB Change From Mass Storage Query Cancelled (USB Queries Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbQueriesNotifierTest EUSBChangeFromMassStorage -pause 3000 -presskey global EKeyDevice1 -tester ExecuteApiTestBlock FinishQuery CANCEL -delete tester -[Endtest] - - -[Test] -title OTG Error too much power (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgTooMuchPower -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT -delete tester -[Endtest] - -[Test] -title OTG Error too much power (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgTooMuchPowerRequired -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title OTG Error too much power req (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgTooMuchPowerRequired +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] title OTG Error unsupported device (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgUnsupportedDevice -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgUnsupportedDevice +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] title OTG Error Hub not supported device (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgHubUnsupported -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgHubUnsupported +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] title OTG Error error in connection (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgErrorInConnection -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgErrorInConnection +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] title OTG Attach timed out (Otg Error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGErrorNotifierTests EUsbOtgErrorAttachTimedOut -pause 3000 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgErrorAttachTimedOut +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] -title OTG Partially supported device (Otg Warning Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice -pause 500 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title OTG Error no memory (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgErrorNoMemory +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] [Test] -title Load and Unload notifiers -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock LoadNotifiers -pause 500 -tester ExecuteApiTestBlock UnLoadNotifiers +title OTG Error OK (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgUnsupportedDevice +pause OK_PAUSE +sendpointerevent global EButton1 OK_X OK_Y +tester FinishQuery ACCEPT delete tester [Endtest] [Test] -title MSMM error test (MSMM error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbMSMMNotifierTests EUsbMSMMGeneralError -pause 500 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title OTG Error cancel (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgUnsupportedDevice +tester CancelOtgErrorNotifier +tester FinishQuery CANCEL +delete tester +[Endtest] + +//Test launching OTG error without cancelling the previous. +[Test] +title OTG Error no cancel (Otg Error Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGErrorNotifierTests EUsbOtgUnsupportedDevice +pause DISMISS_PAUSE +presskey global EKeyEnter +tester WaitForRequest +tester UsbOTGErrorNotifierTests EUsbOtgErrorInConnection +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] + +// OTG Warnings + [Test] -title MSMM error test (MSMM error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbMSMMNotifierTests EUsbMSMMUnknownFileSystem -pause 500 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title OTG Partially supported device (Otg Warning Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +//let the dialog time out +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title OTG Partially supported device OK (Otg Warning Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +pause OK_PAUSE +sendpointerevent global EButton1 OK_X OK_Y +tester FinishQuery ACCEPT +delete tester +[Endtest] + +[Test] +title OTG Partially supported device dismiss(Otg Warning Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title OTG Partially supported device cancel(Otg Warning Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +pause DISMISS_PAUSE +tester CancelOtgWarningNotifier +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title OTG Partially supported device no cancel(Otg Warning Notifier Test) +create USBUiNotifApiTest tester +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +pause DISMISS_PAUSE +presskey global EKeyEnter +tester WaitForRequest +tester UsbOTGWarningNotifierTests EUsbOtgPartiallySupportedDevice +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + + +// MSMM Errors + +[Test] +title MSMM error OK (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMGeneralError +pause OK_PAUSE +sendpointerevent global EButton1 OK_X OK_Y +tester FinishQuery ACCEPT delete tester [Endtest] [Test] -title MSMM error test (MSMM error Notifier Test) -create UsbUiNotifApiTest tester -tester ExecuteApiTestBlock UsbMSMMNotifierTests EUsbMSMMOutOfMemory -pause 500 -presskey global EKeyDevice0 -tester ExecuteApiTestBlock FinishQuery ACCEPT +title MSMM error dismiss (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMGeneralError +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title MSMM error cancel (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMGeneralError +tester CancelMsmmNotifier +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title MSMM error Unknown file system (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMUnknownFileSystem +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL delete tester [Endtest] -// Add new api tests here -// ... +[Test] +title MSMM error Out of memory (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMOutOfMemory +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] + +//Test launching MSMM error without cancelling the previous. +[Test] +title MSMM error no cancel (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMUnknownFileSystem +pause DISMISS_PAUSE +presskey global EKeyEnter +tester WaitForRequest +tester UsbMSMMNotifierTests EUsbMSMMOutOfMemory +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] -// UsbUiNotifApiTest Module Tests (... tc) +//MEikSrvNotifierBase2 API -// Add new module tests here -// ... +[Test] +title Load and Unload notifiers +create USBUiNotifApiTest tester +tester LoadNotifiers +pause 500 +//the destructors of the notifier classes will be called +tester UnLoadNotifiers +delete tester +[Endtest] - -// UsbUiNotifApiTest Branch Tests (... tc) +[Test] +title Synchronous Start +create USBUiNotifApiTest tester +tester SynchStart EUsbOtgPartiallySupportedDevice +delete tester +[Endtest] -// Add new branch tests here -// ... +[Test] +title Update +create USBUiNotifApiTest tester +tester Update +delete tester +[Endtest] \ No newline at end of file diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/group/usbuinotifapitest.mmp --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/group/usbuinotifapitest.mmp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/group/usbuinotifapitest.mmp Mon May 17 11:03:15 2010 +0300 @@ -41,10 +41,10 @@ LIBRARY euser.lib LIBRARY stiftestinterface.lib LIBRARY stiftestengine.lib -LIBRARY centralrepository.lib -LIBRARY usbman.lib -LIBRARY usbwatcher.lib -LIBRARY ecom.lib +LIBRARY centralrepository.lib +LIBRARY usbman.lib +LIBRARY usbwatcher.lib +LIBRARY ecom.lib LANG SC diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h Mon May 17 11:03:15 2010 +0300 @@ -15,9 +15,6 @@ * */ - - - #ifndef USBUINOTIFAPITEST_H #define USBUINOTIFAPITEST_H @@ -35,98 +32,57 @@ #include #include // CONSTANTS -//const ?type ?constant_var = ?constant; // MACROS -//#define ?macro ?macro_def #define TEST_CLASS_VERSION_MAJOR 0 #define TEST_CLASS_VERSION_MINOR 0 #define TEST_CLASS_VERSION_BUILD 0 // Logging path -//_LIT( KUsbUiNotifApiTestLogPath, "\\logs\\testframework\\UsbUiNotifApiTest\\" ); - -// Logging path for ATS - for phone builds comment this line -_LIT( KUsbUiNotifApiTestLogPath, "e:\\testing\\stiflogs\\" ); +_LIT( KUSBUiNotifApiTestLogPath, "e:\\testing\\stiflogs\\" ); // Log file -_LIT( KUsbUiNotifApiTestLogFile, "UsbUiNotifApiTest.txt" ); -_LIT( KUsbUiNotifApiTestLogFileWithTitle, "UsbUiNotifApiTest_[%S].txt" ); +_LIT( KUSBUiNotifApiTestLogFile, "USBUiNotifApiTest.txt" ); +_LIT( KUSBUiNotifApiTestLogFileWithTitle, "USBUiNotifApiTest_[%S].txt" ); // FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); // FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CUsbUiNotifApiTest; +class CUSBUiNotifApiTest; // DATA TYPES -//enum ?declaration - -enum TUsbUiNotifApiTestResult - { - ETestCasePassed, - ETestCaseFailed - }; - enum TTestOption { EQueryDiscarded = 0, EQueryAccepted, EQueryCanceled }; -//typedef ?declaration -//extern ?data_type; // CLASS DECLARATION -NONSHARABLE_CLASS( TUsbUiNotifApiTestBlockParams ) - { - public: - TPtrC iTestBlockName; - - TPtrC iTestOption1; - TPtrC iTestOption2; - TPtrC iTestOption3; - - TInt iTestIntOption1; - TInt iTestIntOption2; - - TChar iTestCharOption1; - TChar iTestCharOption2; - }; - /** -* CUsbUiNotifApiTest test class for STIF Test Framework TestScripter. +* CUSBUiNotifApiTest test class for STIF Test Framework TestScripter. * ?other_description_lines * * @lib ?library * @since ?Series60_version */ -NONSHARABLE_CLASS( CUsbUiNotifApiTest ) : public CScriptBase +NONSHARABLE_CLASS(CUSBUiNotifApiTest) : public CScriptBase { public: // Constructors and destructor /** * Two-phased constructor. */ - static CUsbUiNotifApiTest* NewL( CTestModuleIf& aTestModuleIf ); + static CUSBUiNotifApiTest* NewL( CTestModuleIf& aTestModuleIf ); /** * Destructor. */ - virtual ~CUsbUiNotifApiTest(); + virtual ~CUSBUiNotifApiTest(); public: // New functions - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - public: // Functions from base classes /** @@ -139,14 +95,6 @@ protected: // New functions - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - protected: // Functions from base classes /** @@ -159,18 +107,13 @@ /** * C++ default constructor. */ - CUsbUiNotifApiTest( CTestModuleIf& aTestModuleIf ); + CUSBUiNotifApiTest( CTestModuleIf& aTestModuleIf ); /** * By default Symbian 2nd phase constructor is private. */ void ConstructL(); - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - /** * Frees all resources allocated from test methods. * @since ?Series60_version @@ -180,13 +123,23 @@ /** * Test methods are listed below. */ - - virtual TInt ExecuteApiTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteModuleTestBlock( CStifItemParser& aItem ); - virtual TInt ExecuteBranchTestBlock( CStifItemParser& aItem ); - - - + virtual TInt CableConnectedNotifierTest( CStifItemParser& aItem ); + virtual TInt FinishCableConnectedQuery( CStifItemParser& aItem ); + virtual TInt UsbQueriesNotifierTest( CStifItemParser& aItem ); + virtual TInt UsbOTGErrorNotifierTests( CStifItemParser& aItem ); + virtual TInt UsbOTGWarningNotifierTests( CStifItemParser& aItem ); + virtual TInt FinishQuery( CStifItemParser& aItem ); + virtual TInt LoadNotifiersL( CStifItemParser& aItem ); + virtual TInt UnLoadNotifiers ( CStifItemParser& aItem ); + virtual TInt UsbMSMMNotifierTests ( CStifItemParser& aItem ); + virtual TInt CancelMsmmNotifier( CStifItemParser& aItem ); + virtual TInt CancelQueryNotifier( CStifItemParser& aItem ); + virtual TInt CancelOtgErrorNotifier( CStifItemParser& aItem ); + virtual TInt CancelOtgWarningNotifier( CStifItemParser& aItem ); + virtual TInt CancelCableConnectedNotifier( CStifItemParser& aItem ); + virtual TInt WaitForRequest( CStifItemParser& aItem ); + virtual TInt SynchStart( CStifItemParser& aItem ); + virtual TInt Update( CStifItemParser& aItem ); /** * Method used to log version of test class */ @@ -194,52 +147,22 @@ //ADD NEW METHOD DEC HERE //[TestMethods] - Do not remove - - void GetTestBlockParamsL( CStifItemParser& aItem ); - - void DoExecuteApiTestBlockL( CStifItemParser& aItem, TUsbUiNotifApiTestResult& aTestResult ); - void DoExecuteModuleTestBlockL( CStifItemParser& aItem, TUsbUiNotifApiTestResult& aTestResult ); - void DoExecuteBranchTestBlockL( CStifItemParser& aItem, TUsbUiNotifApiTestResult& aTestResult ); - - void ExampleTestL( TPtrC aTestOption, TPtrC aTestSubOption, - TInt aTestIntOption, TInt aTestCharOption, TUsbUiNotifApiTestResult& aTestResult ); - - void CableConnectedNotifierTest( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void ConnectionNotifierTest( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void UsbQueriesNotifierTest( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void UsbOTGErrorNotifierTests( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void UsbOTGWarningNotifierTests( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - TInt FinishQuery( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void LoadNotifiersL( TUsbUiNotifApiTestResult& aTestResult ); - void UnLoadNotifiers ( TUsbUiNotifApiTestResult& aTestResult ); - void Update( TUsbUiNotifApiTestResult& aTestResult ); - //void Cancelnotifier( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void Notifierstart( TUsbUiNotifApiTestResult& aTestResult ); - //void AsyncConnectionNotifier ( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - void UsbMSMMNotifierTests ( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ); - TInt GetTestOption( TPtrC aOptionString, TTestOption& aOption ); TInt GetPersonalityIdFromString( TPtrC aOptionString, TInt& aPersonalityId ); TInt GetQueryType( TPtrC aTypeString, TUSBUIQueries& aQueryType ); TInt GetOTGErrorType( TPtrC aTypeString, TUsbUiNotifOtgError& aQueryType ); TInt GetOTGWarningType( TPtrC aTypeString, TUsbUiNotifOtgWarning& aQueryType ); TInt GetMSMMrrorType( TPtrC aTypeString, THostMsErrCode& aQueryType ); + TInt FindAndKillProcess(const TDesC& aProcessName); - inline void Trace(TRefByValue aFmt, ...); - inline void Trace(TRefByValue aFmt, ...); - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; private: // Data - TUsbUiNotifApiTestBlockParams iTestBlockParams; - + RNotifier *iNotifier; + TBool iNotifierConnected; RUsbWatcher* iUsbWatcher; CRepository* iRepository; @@ -254,20 +177,15 @@ THostMsErrData iErrData; THostMsErrorDataPckg iErrPckg ; - // Reserved pointer for future extension - //TAny* iReserved; - public: // Friend classes //?friend_class_declaration; protected: // Friend classes //?friend_class_declaration; private: // Friend classes //?friend_class_declaration; - + }; -#include "UsbUiNotifApiTestDebug.inl" - #endif // USBUINOTIFAPITEST_H // End of File diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitestdebug.inl --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitestdebug.inl Sun May 02 21:57:48 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include - -NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow - { -public: - void Overflow(TDes8& /*aDes*/) {} - }; - -NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow - { -public: - void Overflow(TDes16& /*aDes*/) {} - }; - - -_LIT8(KStifTestPrefix8, "[STIF_LOG] "); -_LIT(KStifTestPrefix, "[STIF_LOG] "); - -const TInt KMaxLogLineLength = 512; - -#define TRACE_INFO(p) { Trace p; } - -void CUsbUiNotifApiTest::Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list, aFmt); - TOverflowTruncate8 overflow; - RBuf8 buf8; - buf8.Create( KMaxLogLineLength ); - buf8.Append( KStifTestPrefix8 ); - buf8.AppendFormatList(aFmt, list, &overflow); - - RBuf16 buf16; - buf16.Create( KMaxLogLineLength ); - buf16.Copy(buf8); - TRefByValue tmpFmt(_L("%S")); - RDebug::Print(tmpFmt, &buf16); - iLog->Log(tmpFmt, &buf16); - buf8.Close(); - buf16.Close(); - }; - -void CUsbUiNotifApiTest::Trace(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - RBuf16 theFinalString; - theFinalString.Create( KMaxLogLineLength ); - theFinalString.Append( KStifTestPrefix ); - TOverflowTruncate16 overflow; - theFinalString.AppendFormatList(aFmt,list,&overflow); - RDebug::Print(theFinalString); - iLog->Log(theFinalString); - theFinalString.Close(); - }; diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest.ini --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest.ini Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest.ini Mon May 17 11:03:15 2010 +0300 @@ -110,7 +110,7 @@ [New_Module] ModuleName= testscripter -TestCaseFile= e:\testing\conf\ui_USBUiNotifApiTest.cfg +TestCaseFile= e:\testing\conf\ui_usbuinotifapitest.cfg [End_Module] diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest_phone.ini --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest_phone.ini Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/init/usbuinotifapitest_phone.ini Mon May 17 11:03:15 2010 +0300 @@ -65,7 +65,7 @@ CreateTestReport= YES # Possible values: YES or NO -TestReportFilePath= c:\logs\testframework\UsbUiNotifApiTest\ +TestReportFilePath= c:\logs\testframework\usbuinotifapitest\ TestReportFileName= testreport TestReportFormat= TXT # Possible values: TXT, HTML or XML @@ -110,7 +110,7 @@ [New_Module] ModuleName= testscripter -TestCaseFile= c:\testframework\ui_UsbUiNotifApiTest.cfg +TestCaseFile= c:\testframework\ui_usbuinotifapitest.cfg [End_Module] diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitest.cpp --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitest.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitest.cpp Mon May 17 11:03:15 2010 +0300 @@ -15,88 +15,57 @@ * */ - - - // INCLUDE FILES #include -#include "UsbUiNotifApiTest.h" +#include "usbuinotifapitest.h" #include // EXTERNAL DATA STRUCTURES -//extern ?external_data; // EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); // CONSTANTS -//const ?type ?constant_var = ?constant; // MACROS -//#define ?macro ?macro_def // LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def // MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration // LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); // FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; // ============================= LOCAL FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::CUsbUiNotifApiTest +// CUSBUiNotifApiTest::CUSBUiNotifApiTest // C++ default constructor can NOT contain any code, that // might leave. // ----------------------------------------------------------------------------- // -CUsbUiNotifApiTest::CUsbUiNotifApiTest( +CUSBUiNotifApiTest::CUSBUiNotifApiTest( CTestModuleIf& aTestModuleIf ): CScriptBase( aTestModuleIf ), iRes(0) + { } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::ConstructL +// CUSBUiNotifApiTest::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // -void CUsbUiNotifApiTest::ConstructL() +void CUSBUiNotifApiTest::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. + RSettingServer settingServer; + CleanupClosePushL(settingServer); TInt ret = settingServer.Connect(); if(ret != KErrNone) { @@ -111,7 +80,7 @@ User::Leave(ret); } // Close Setting server session - settingServer.Close(); + CleanupStack::PopAndDestroy(&settingServer); TFileName logFileName; @@ -119,46 +88,48 @@ { TName title; TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KUsbUiNotifApiTestLogFileWithTitle, &title); + logFileName.Format(KUSBUiNotifApiTestLogFileWithTitle, &title); } else { - logFileName.Copy(KUsbUiNotifApiTestLogFile); + logFileName.Copy(KUSBUiNotifApiTestLogFile); } - iLog = CStifLogger::NewL( KUsbUiNotifApiTestLogPath, + iLog = CStifLogger::NewL( KUSBUiNotifApiTestLogPath, logFileName, CStifLogger::ETxt, CStifLogger::EFile, EFalse ); SendTestClassVersion(); - + iNotifier = new ( ELeave ) RNotifier(); + /* iUsbWatcher = new ( ELeave ) RUsbWatcher(); iRepository = CRepository::NewL( KCRUidUsbWatcher ); + */ } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::NewL +// CUSBUiNotifApiTest::NewL // Two-phased constructor. // ----------------------------------------------------------------------------- // -CUsbUiNotifApiTest* CUsbUiNotifApiTest::NewL( +CUSBUiNotifApiTest* CUSBUiNotifApiTest::NewL( CTestModuleIf& aTestModuleIf ) { - CUsbUiNotifApiTest* self = new (ELeave) CUsbUiNotifApiTest( aTestModuleIf ); + CUSBUiNotifApiTest* self = new (ELeave) CUSBUiNotifApiTest( aTestModuleIf ); CleanupStack::PushL( self ); self->ConstructL(); - CleanupStack::Pop(); + CleanupStack::Pop( self ); return self; } // Destructor -CUsbUiNotifApiTest::~CUsbUiNotifApiTest() +CUSBUiNotifApiTest::~CUSBUiNotifApiTest() { // Delete resources allocated from test methods @@ -170,11 +141,11 @@ } //----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::SendTestClassVersion +// CUSBUiNotifApiTest::SendTestClassVersion // Method used to send version of test class //----------------------------------------------------------------------------- // -void CUsbUiNotifApiTest::SendTestClassVersion() +void CUSBUiNotifApiTest::SendTestClassVersion() { TVersion moduleVersion; moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; @@ -182,7 +153,7 @@ moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; TFileName moduleName; - moduleName = _L("UsbUiNotifApiTest.dll"); + moduleName = _L("USBUiNotifApiTest.dll"); TBool newVersionOfMethod = ETrue; TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); @@ -199,7 +170,7 @@ CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework { - return ( CScriptBase* ) CUsbUiNotifApiTest::NewL( aTestModuleIf ); + return ( CScriptBase* ) CUSBUiNotifApiTest::NewL( aTestModuleIf ); } diff -r e7f64b6bf69e -r 831068540b07 usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp Sun May 02 21:57:48 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp Mon May 17 11:03:15 2010 +0300 @@ -15,101 +15,85 @@ * */ - - - // [INCLUDE FILES] - do not remove #include #include #include #include -#include "UsbUiNotifApiTest.h" +#include "usbuinotifapitest.h" // EXTERNAL DATA STRUCTURES -//extern ?external_data; // EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); // CONSTANTS -//const ?type ?constant_var = ?constant; +#ifdef __WINS__ +_LIT( KUsbAppProcPattern, "usb[*" ); +#else +_LIT( KUsbAppProcPattern, "#USBSettingsApp*" ); +#endif // MACROS -//#define ?macro ?macro_def // LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def // MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration // LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); // FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; // ============================= LOCAL FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::Delete +// CUSBUiNotifApiTest::Delete // Delete here all resources allocated and opened from test methods. // Called from destructor. // ----------------------------------------------------------------------------- // -void CUsbUiNotifApiTest::Delete() - { +void CUSBUiNotifApiTest::Delete() + { iNotifier -> Close(); delete iNotifier; iNotifier = NULL; - iUsbWatcher -> Close(); - delete iUsbWatcher; - iUsbWatcher = NULL; - delete iRepository; - iRepository = NULL; } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::RunMethodL +// CUSBUiNotifApiTest::RunMethodL // Run specified method. Contains also table of test mothods and their names. // ----------------------------------------------------------------------------- // -TInt CUsbUiNotifApiTest::RunMethodL( +TInt CUSBUiNotifApiTest::RunMethodL( CStifItemParser& aItem ) { static TStifFunctionInfo const KFunctions[] = { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "CableConnectedNotifierTest", CUSBUiNotifApiTest::CableConnectedNotifierTest ), + ENTRY( "FinishCableConnectedQuery", CUSBUiNotifApiTest::FinishCableConnectedQuery ), + ENTRY( "UsbQueriesNotifierTest", CUSBUiNotifApiTest::UsbQueriesNotifierTest ), + ENTRY( "FinishQuery", CUSBUiNotifApiTest::FinishQuery ), + ENTRY( "UsbOTGErrorNotifierTests", CUSBUiNotifApiTest::UsbOTGErrorNotifierTests ), + ENTRY( "UsbOTGWarningNotifierTests", CUSBUiNotifApiTest::UsbOTGWarningNotifierTests ), + ENTRY( "LoadNotifiers", CUSBUiNotifApiTest::LoadNotifiersL ), + ENTRY( "UnLoadNotifiers", CUSBUiNotifApiTest::UnLoadNotifiers ), + ENTRY( "UsbMSMMNotifierTests", CUSBUiNotifApiTest::UsbMSMMNotifierTests ), + ENTRY( "CancelMsmmNotifier", CUSBUiNotifApiTest::CancelMsmmNotifier ), + ENTRY( "CancelQueryNotifier", CUSBUiNotifApiTest::CancelQueryNotifier ), + ENTRY( "CancelOtgErrorNotifier", CUSBUiNotifApiTest::CancelOtgErrorNotifier ), + ENTRY( "CancelOtgWarningNotifier", CUSBUiNotifApiTest::CancelOtgWarningNotifier ), + ENTRY( "CancelCableConnectedNotifier", CUSBUiNotifApiTest::CancelCableConnectedNotifier ), + ENTRY( "WaitForRequest", CUSBUiNotifApiTest::WaitForRequest ), + ENTRY( "SynchStart", CUSBUiNotifApiTest::SynchStart ), + ENTRY( "Update", CUSBUiNotifApiTest::Update ) //ADD NEW ENTRY HERE // [test cases entries] - Do not remove - ENTRY( "ExecuteApiTestBlock", CUsbUiNotifApiTest::ExecuteApiTestBlock ), - ENTRY( "ExecuteModuleTestBlock", CUsbUiNotifApiTest::ExecuteModuleTestBlock ), - ENTRY( "ExecuteBranchTestBlock", CUsbUiNotifApiTest::ExecuteBranchTestBlock ), + }; const TInt count = sizeof( KFunctions ) / @@ -120,374 +104,128 @@ } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::GetTestBlockParamsL -// ----------------------------------------------------------------------------- - -void CUsbUiNotifApiTest::GetTestBlockParamsL( CStifItemParser& aItem ) - { - TRACE_INFO( _L(">>> GetTestBlockParamsL") ); - - // Add new test block branches below, get all required test parameters - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); - User::LeaveIfError( aItem.GetNextChar( iTestBlockParams.iTestCharOption1 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CableConnectedNotifierTest" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FinishQuery" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGErrorNotifierTests" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGWarningNotifierTests" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "LoadNotifiers" ) ) ) - { - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UnLoadNotifiers" ) ) ) - { - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbMSMMNotifierTests" ) ) ) - { - User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); - } - else - { - TRACE_INFO( _L("GetTestBlockParamsL() Test type: not found") ); - User::Leave( KErrNotFound ); - } - TRACE_INFO( _L("<<< GetTestBlockParamsL") ); - } - -// ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::ExecuteApiTestBlock +// CUSBUiNotifApiTest::CableConnectedNotifierTests // ----------------------------------------------------------------------------- -TInt CUsbUiNotifApiTest::ExecuteApiTestBlock( CStifItemParser& aItem ) - { - TRACE_INFO( _L(">>> ExecuteApiTestBlock") ); - - TInt res; - TUsbUiNotifApiTestResult testResult = ETestCaseFailed; - - TRAP( res, DoExecuteApiTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("DoExecuteApiTestBlockL error: %d"), res) ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - TRACE_INFO( _L("Test case passed") ); - - TRACE_INFO( _L("<<< ExecuteApiTestBlock") ); - - return KErrNone; - } - - -void CUsbUiNotifApiTest::DoExecuteApiTestBlockL( CStifItemParser& aItem, TUsbUiNotifApiTestResult& aTestResult ) - { - TRACE_INFO( _L(">>>DoExecuteApiTestBlockL") ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteApiTestBlock" ), iTestBlockParams.iTestBlockName ) ); - TRACE_INFO( (_L("Api test type: %S"), &iTestBlockParams.iTestBlockName) ); - - GetTestBlockParamsL( aItem ); - - // Add new API test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CableConnectedNotifierTest" ) ) ) - { - CableConnectedNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) - { - UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FinishQuery" ) ) ) - { - FinishQuery( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) - { - UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) - { - UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) - { - UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGErrorNotifierTests" ) ) ) - { - UsbOTGErrorNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGWarningNotifierTests" ) ) ) - { - UsbOTGWarningNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "LoadNotifiers" ) ) ) - { - LoadNotifiersL( aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UnLoadNotifiers" ) ) ) - { - UnLoadNotifiers( aTestResult ); - } - else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbMSMMNotifierTests" ) ) ) - { - UsbMSMMNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); - } - else - { - TRACE_INFO( _L("DoExecuteApiTestBlockL() Test type: not found") ); - User::Leave( KErrNotFound ); - } - - TRACE_INFO( _L("<<>>ExecuteModuleTestBlock") ); - - TInt res; - TUsbUiNotifApiTestResult testResult; - - TRAP( res, DoExecuteModuleTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("DoExecuteModuleTestBlockL error: %d"), res) ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - TRACE_INFO( _L("Test case passed") ); - TRACE_INFO( _L("<<>>DoExecuteModuleTestBlockL") ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteModuleTestBlock" ), iTestBlockParams.iTestBlockName ) ); - TRACE_INFO( (_L("Module test type: %S"), &iTestBlockParams.iTestBlockName) ); - - GetTestBlockParamsL( aItem ); - - // Add new module test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - TRACE_INFO( _L("DoExecuteModuleTestBlockL() Test type: not found") ); - User::Leave( KErrNotFound ); - } - - TRACE_INFO( _L("<<>>ExecuteBranchTestBlock") ); - TInt res; - TUsbUiNotifApiTestResult testResult; - - TRAP( res, DoExecuteBranchTestBlockL( aItem, testResult ) ); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("DoExecuteBranchTestBlockL error: %d"), res) ); - return res; - } - - STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); - TRACE_INFO( _L("Test case passed") ); - TRACE_INFO( _L("<<>>DoExecuteBranchTestBlockL") ); - - User::LeaveIfError( aItem.GetString( _L( "ExecuteBranchTestBlock" ), iTestBlockParams.iTestBlockName ) ); - TRACE_INFO( (_L("Branch test type: %S"), &iTestBlockParams.iTestBlockName) ); - - GetTestBlockParamsL( aItem ); - - // Add new branch test block branches with optional test parameters here - if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) - { - ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, - iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); - } - else - { - TRACE_INFO( _L("DoExecuteBranchTestBlockL() Test type: not found") ); - User::Leave( KErrNotFound ); - } - - TRACE_INFO( _L("<<>>ExampleTestL") ); - - if ( !aTestOption.Compare( _L( "API" ) ) ) - { - TRACE_INFO( (_L("Api test option: %S"), &aTestOption) ); - TRACE_INFO( (_L("Api test sub-option: %S"), &aTestSubOption) ); - TRACE_INFO( (_L("Api test int option: %d"), aTestIntOption) ); - TRACE_INFO( (_L("Api test char option: %c"), aTestCharOption) ); - } - else if ( !aTestOption.Compare( _L( "MODULE" ) ) ) - { - TRACE_INFO( (_L("Module test option: %S"), &aTestOption) ); - TRACE_INFO( (_L("Module test sub-option: %S"), &aTestSubOption) ); - TRACE_INFO( (_L("Module test int option: %d"), aTestIntOption) ); - TRACE_INFO( (_L("Module test char option: %c"), aTestCharOption) ); - } - else if ( !aTestOption.Compare( _L( "BRANCH" ) ) ) - { - TRACE_INFO( (_L("Branch test option: %S"), &aTestOption) ); - TRACE_INFO( (_L("Branch test sub-option: %S"), &aTestSubOption) ); - TRACE_INFO( (_L("Branch test int option: %d"), aTestIntOption) ); - TRACE_INFO( (_L("Branch test char option: %c"), aTestCharOption) ); - } - else - { - TRACE_INFO( _L("Invalid test parameter") ); - User::Leave( KErrNotFound ); - } - - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<>>CableConnectedNotifierTest") ); - - TInt res; - TUSBConnectionNotifierParamsPckg emptyNotifierInputPckg; - TPtrC displayedUsbPersonalityName( KNullDesC ); - TInt displayedUsbPersonalityId; - - res = GetPersonalityIdFromString( aTestSubOption, displayedUsbPersonalityId ); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("GetPersonalityIdFromString failed with value: %d"), res) ); - return; - } - - res = iRepository -> Get( KUsbWatcherPersonality, iPersonalityIdBackup ); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("Personality backup failed with value (cenrep): %d"), res) ); - return; - } - - res = iUsbWatcher -> Connect(); - if ( res != KErrNone ) - { - TRACE_INFO( (_L("Failed to connect UsbWatcher with value: %d"), res) ); - return; - } - TRACE_INFO( _L("UsbWatcher connected") ); - - iUsbWatcher -> SetPersonality( iReqStatus, displayedUsbPersonalityId, ETrue, ETrue ); - User::WaitForRequest( iReqStatus ); - if ( iReqStatus.Int() != KErrNone ) - { - TRACE_INFO( (_L("Failed to set usb personality with value: %d"), iReqStatus.Int()) ); - iUsbWatcher -> Close(); - return; - } + TPtrC8 dummyPckg; //no parameters used res = iNotifier -> Connect(); if ( res != KErrNone ) { - TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); - iUsbWatcher -> Close(); - return; + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; } - TRACE_INFO( _L("RNotifier connected") ); + iLog -> Log( _L("RNotifier connected") ); + + //kill the possibly running usb application + FindAndKillProcess(KUsbAppProcPattern); + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KCableConnectedNotifierUid, + dummyPckg, iConnectionNotifierResponseParamsPckg ); + + return KErrNone; + + } + + +TInt CUSBUiNotifApiTest::FinishCableConnectedQuery( CStifItemParser& aItem ) + { + //give time for application to start, in microseconds + const TInt KAppLaunchDelay = 5000000; + TInt res; + TPtrC optionName( KNullDesC ); + TTestOption option; + TPtrC expectedUsbPersonalityName( KNullDesC ); + TInt expectedErrorCode; - iNotifier -> StartNotifierAndGetResponse( iReqStatus, KCableConnectedNotifierUid, emptyNotifierInputPckg, iConnectionNotifierResponseParamsPckg ); + iLog -> Log( _L("FinishCableConnectedQuery") ); + + res = aItem.GetString( _L( "FinishCableConnectedQuery" ), optionName ); + + if ( res != KErrNone ) + { + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + iLog -> Log( _L("FinishCableConnectedQuery getting option") ); + res = GetTestOption( optionName, option ); + if ( res != KErrNone ) + { + iLog -> Log( _L("GetTestOption failed with value: %d"), res ); + iUsbWatcher -> Close(); + iNotifier -> Close(); + return res; + } + + iLog -> Log( _L("FinishCableConnectedQuery wait for request") ); User::WaitForRequest( iReqStatus ); + expectedErrorCode = iReqStatus.Int(); + + iLog -> Log( _L("FinishCableConnectedQuery request complete") ); - TRACE_INFO((_L("StartNotifierAndGetResponse Status: %d, expected: %d"), iReqStatus.Int(), KErrCancel)); - if(iReqStatus.Int() == KErrCancel) - aTestResult = ETestCasePassed; + iNotifier -> Close(); + + iLog -> Log( _L("FinishCableConnectedQuery close") ); - TRACE_INFO( _L("<< Log( _L("EQueryAccepted")); + User::After(KAppLaunchDelay); //let the app start and let the tester person to see that + ret = FindAndKillProcess(KUsbAppProcPattern); + if (ret != KErrNone) + { + iLog -> Log( _L("Process start failed: %d"), ret ); + return ret; + } + iLog -> Log( _L("Request status value: %d, expected: %d"), expectedErrorCode, KErrCancel ); + //the notifier returns KErrCancel when clicked + STIF_ASSERT_EQUALS( KErrCancel, expectedErrorCode ); + break; + case EQueryCanceled: + iLog -> Log( _L("FinishCableConnectedQuery canceled") ); + iLog -> Log( _L("Request status value: %d, expected: %d"), expectedErrorCode, KErrCancel ); + STIF_ASSERT_EQUALS( KErrCancel, expectedErrorCode ); + break; + default: + iLog -> Log( _L("FinishCableConnectedQuery default - not found") ); + return KErrNotFound; + } + + iLog -> Log( _L("Test case passed!") ); + return KErrNone; } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::UsbQueriesNotifierTest +// CBtNotifApiTest::UsbQueriesNotifierTests // ----------------------------------------------------------------------------- -void CUsbUiNotifApiTest::UsbQueriesNotifierTest( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ) +TInt CUSBUiNotifApiTest::UsbQueriesNotifierTest( CStifItemParser& aItem ) { - TRACE_INFO( _L(">>>UsbQueriesNotifierTest") ); TInt res; + TPtrC usbQueryName( KNullDesC ); TUSBUIQueries usbQueryType; - - res = GetQueryType( aTestSubOption, usbQueryType ); + res = aItem.GetString( _L( "UsbQueriesNotifierTest" ), usbQueryName ); if ( res != KErrNone ) { - TRACE_INFO( (_L("GetQueryType failed with value: %d"), res) ); - return; + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + res = GetQueryType( usbQueryName, usbQueryType ); + if ( res != KErrNone ) + { + iLog -> Log( _L("GetQueryType failed with value: %d"), res ); + return res; } TUSBQueriesNotiferParams notifierParams; @@ -496,13 +234,17 @@ TUSBQueriesNotifierParamsPckg notifierParamsPckg( notifierParams ); TPckgBuf output; - res = iNotifier -> Connect(); + if (!iNotifierConnected) + { + res = iNotifier -> Connect(); + iNotifierConnected = ETrue; + } if ( res != KErrNone ) { - TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); - return; + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; } - TRACE_INFO( _L("RNotifier connected") ); + iLog -> Log( _L("RNotifier connected") ); switch( usbQueryType ) { @@ -517,200 +259,329 @@ break; } - iNotifier -> StartNotifierAndGetResponse( iReqStatus, KQueriesNotifier, notifierParamsPckg, output ); - - aTestResult = ETestCasePassed; + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KQueriesNotifier, + notifierParamsPckg, output ); + iLog -> Log( _L("StartNotifierAndGetResponse ready") ); - TRACE_INFO( _L("<<>>UsbOTGErrorNotifierTests") ); + TInt res; + TPtrC usbQueryName( KNullDesC ); + TUsbUiNotifOtgError usbOTGErrorType; - TInt res; - TUsbUiNotifOtgError usbOTGErrorType; - - res = GetOTGErrorType( aTestSubOption, usbOTGErrorType ); + res = aItem.GetString( _L( "UsbOTGErrorNotifierTests" ), usbQueryName ); if ( res != KErrNone ) { - TRACE_INFO( (_L("usbOTGErrorType failed with value: %d"), res) ); - return; + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + res = GetOTGErrorType( usbQueryName, usbOTGErrorType ); + if ( res != KErrNone ) + { + iLog -> Log( _L("usbOTGErrorType failed with value: %d"), res ); + return res; } - res = iNotifier -> Connect(); + if (!iNotifierConnected) + { + res = iNotifier -> Connect(); + iNotifierConnected = ETrue; + } if ( res != KErrNone ) { - TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); - return; + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; } - TRACE_INFO( _L("RNotifier connected") ); + iLog -> Log( _L("RNotifier connected") ); TPckgBuf notifierParamsPckg; notifierParamsPckg() = usbOTGErrorType; iCompleteQuery = EFalse; - iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifOtgError, notifierParamsPckg, iRes ); - - aTestResult = ETestCasePassed; + iNotifier -> StartNotifierAndGetResponse( iReqStatus, + KUsbUiNotifOtgError, notifierParamsPckg, iRes ); - TRACE_INFO( _L("<<>>UsbOTGWarningNotifierTests") ); - TInt res; + TPtrC usbQueryName( KNullDesC ); TUsbUiNotifOtgWarning usbOTGWarningType; - - res = GetOTGWarningType( aTestSubOption, usbOTGWarningType ); + res = aItem.GetString( _L( "UsbOTGWarningNotifierTests" ), usbQueryName ); if ( res != KErrNone ) { - TRACE_INFO( (_L("usbOTGErrorType failed with value: %d"), res) ); - return; + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + res = GetOTGWarningType( usbQueryName, usbOTGWarningType ); + if ( res != KErrNone ) + { + iLog -> Log( _L("usbOTGErrorType failed with value: %d"), res ); + return res; } - res = iNotifier -> Connect(); + if (!iNotifierConnected) + { + res = iNotifier -> Connect(); + iNotifierConnected = ETrue; + } if ( res != KErrNone ) { - TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); - return; + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; } - TRACE_INFO( _L("RNotifier connected") ); + iLog -> Log( _L("RNotifier connected") ); TPckgBuf notifierParamsPckg; notifierParamsPckg() = usbOTGWarningType; iCompleteQuery = EFalse; - iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifOtgWarning, notifierParamsPckg, iRes ); - - aTestResult = ETestCasePassed; + iNotifier -> StartNotifierAndGetResponse( iReqStatus, + KUsbUiNotifOtgWarning, notifierParamsPckg, iRes ); - TRACE_INFO( _L("<<>>UsbMSMMNotifierTests") ); - TInt res; + TPtrC usbQueryName( KNullDesC ); THostMsErrCode usbMSMMNErrorType; - res = GetMSMMrrorType( aTestSubOption, usbMSMMNErrorType ); + iLog -> Log( _L("------msmm------") ); + + res = aItem.GetString( _L( "UsbMSMMNotifierTests" ), usbQueryName ); if ( res != KErrNone ) { - TRACE_INFO( (_L("MSMMrrorType failed with value: %d"), res) ); - return; + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + res = GetMSMMrrorType( usbQueryName, usbMSMMNErrorType ); + if ( res != KErrNone ) + { + iLog -> Log( _L("MSMMrrorType failed with value: %d"), res ); + return res; } iErrData.iError=usbMSMMNErrorType; iErrPckg = iErrData; - res = iNotifier -> Connect(); + if (!iNotifierConnected) + { + res = iNotifier -> Connect(); + iNotifierConnected = ETrue; + } if ( res != KErrNone ) { - TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); - return; + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; } - TRACE_INFO( _L("RNotifier connected") ); + iLog -> Log( _L("RNotifier connected") ); TPckgBuf notifierParamsPckg; notifierParamsPckg() = usbMSMMNErrorType; iCompleteQuery = EFalse; iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifMsmmError, iErrPckg, iRes ); + + return KErrNone; + } - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<CancelNotifier(KUsbUiNotifMsmmError) ); + } + + +TInt CUSBUiNotifApiTest::CancelQueryNotifier( CStifItemParser& /*aItem*/ ) + { + iLog -> Log( _L("CancelQueryNotifier") ); + return ( iNotifier->CancelNotifier(KQueriesNotifier) ); } -// ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::FinishQuery -// ----------------------------------------------------------------------------- +TInt CUSBUiNotifApiTest::CancelOtgErrorNotifier( CStifItemParser& /*aItem*/ ) + { + return ( iNotifier->CancelNotifier(KUsbUiNotifOtgError) ); + } + +TInt CUSBUiNotifApiTest::CancelOtgWarningNotifier( CStifItemParser& /*aItem*/ ) + { + return ( iNotifier->CancelNotifier(KUsbUiNotifOtgWarning) ); + } + +TInt CUSBUiNotifApiTest::CancelCableConnectedNotifier( CStifItemParser& /*aItem*/ ) + { + return ( iNotifier->CancelNotifier(KCableConnectedNotifierUid) ); + } + +TInt CUSBUiNotifApiTest::WaitForRequest( CStifItemParser& /*aItem*/ ) + { + User::WaitForRequest( iReqStatus ); + return KErrNone; + } -TInt CUsbUiNotifApiTest::FinishQuery( TPtrC aTestSubOption, TUsbUiNotifApiTestResult& aTestResult ) +TInt CUSBUiNotifApiTest::SynchStart(CStifItemParser& aItem ) +{ + TInt res; + TPtrC usbQueryName( KNullDesC ); + TUsbUiNotifOtgWarning usbOTGWarningType; + + res = aItem.GetString( _L( "SynchStart" ), usbQueryName ); + if ( res != KErrNone ) + { + iLog -> Log( _L("GetString failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + res = GetOTGWarningType( usbQueryName, usbOTGWarningType ); + if ( res != KErrNone ) + { + iLog -> Log( _L("usbOTGErrorType failed with value: %d"), res ); + return res; + } + + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; + } + iLog -> Log( _L("RNotifier connected") ); + + TPckgBuf notifierParamsPckg; + notifierParamsPckg() = usbOTGWarningType; + iCompleteQuery = EFalse; + + TInt retVal = iNotifier -> StartNotifier( KUsbUiNotifOtgWarning, notifierParamsPckg ); + iLog -> Log( _L("StartNotifier returned with value: %d"), retVal ); + + iNotifier->Close(); + return retVal; +} + +TInt CUSBUiNotifApiTest::Update(CStifItemParser& /*aItem*/ ) +{ + //delay in microseconds before updating the notifier + const TInt KUpdateDelay = 2000000; + TInt res; + TPtrC usbQueryName( KNullDesC ); + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + iLog -> Log( _L("Failed to connect RNotifier with value: %d"), res ); + return res; + } + iLog -> Log( _L("RNotifier connected") ); + + TPckgBuf notifierParamsPckg; + notifierParamsPckg() = EUsbOtgUnsupportedDevice; + iCompleteQuery = EFalse; + TPckgBuf response ; + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifOtgError, + notifierParamsPckg, iRes ); + + User::After(KUpdateDelay); //simulate update after a delay + TPckgBuf notifierParamsPckgUpdate; + notifierParamsPckgUpdate() = EUsbOtgErrorNoMemory; + TInt retVal = iNotifier -> UpdateNotifier( KUsbUiNotifOtgError, + notifierParamsPckgUpdate, response); + + iNotifier->Close(); + return retVal; +} + + +TInt CUSBUiNotifApiTest::FinishQuery( CStifItemParser& aItem ) { - TRACE_INFO( _L(">>>FinishQuery") ); - + iLog -> Log( _L("FinishQuery") ); TInt res; + TPtrC optionName( KNullDesC ); TTestOption option; if ( iCompleteQuery ) { + iLog -> Log( _L("FinishQuery completing request") ); TRequestStatus* statPtr = &iReqStatus; User::RequestComplete( statPtr, KErrNone ); - } + } - res = GetTestOption( aTestSubOption, option ); + iLog -> Log( _L("FinishQuery getting options") ); + res = aItem.GetString( _L( "FinishQuery" ), optionName ); if ( res != KErrNone ) { - TRACE_INFO( (_L("GetTestOption failed with value: %d"), res) ); + iLog -> Log( _L("GetString failed with value: %d"), res ); iNotifier -> Close(); return res; } - User::WaitForRequest( iReqStatus ); + res = GetTestOption( optionName, option ); + if ( res != KErrNone ) + { + iLog -> Log( _L("GetTestOption failed with value: %d"), res ); + iNotifier -> Close(); + return res; + } + + iLog -> Log( _L("FinishQuery waiting for request") ); + User::WaitForRequest( iReqStatus ); + iLog -> Log( _L("FinishQuery closing notifier") ); iNotifier -> Close(); + iNotifierConnected = EFalse; switch( option ) { case EQueryAccepted: - TRACE_INFO( (_L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone) ); + iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone ); STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() ); break; case EQueryCanceled: - TRACE_INFO( (_L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel) ); + iLog -> Log( _L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel ); STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() ); break; default: return KErrNotFound; } - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<< Log( _L("Test case passed!") ); return KErrNone; } -// ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::LoadNotifiersL -// ----------------------------------------------------------------------------- - -void CUsbUiNotifApiTest::LoadNotifiersL( TUsbUiNotifApiTestResult& aTestResult ) +TInt CUSBUiNotifApiTest::LoadNotifiersL( CStifItemParser& /*aItem*/ ) { - TRACE_INFO( _L(">>>LoadNotifiersL") ); - iNotifierArray = reinterpret_cast*>( REComSession::CreateImplementationL(TUid::Uid(0x10281F23), iInstanceUid)); - - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<>>UnLoadNotifiers") ); - TInt count = iNotifierArray->Count(); TInt i=0; for (i=0; iReset(); delete iNotifierArray; + iNotifierArray = NULL; REComSession::DestroyedImplementation(iInstanceUid); - - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<>>Update") ); - TInt count = iNotifierArray->Count(); - TInt i=0; - _LIT8(test, "test"); - TBuf8<32> buf(test); - for (i=0; iAt(i)->UpdateL(buf); - } - - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<>>Notifierstart") ); - TInt count = iNotifierArray->Count(); - TInt i=0; - _LIT8(test, "test"); - TBuf8<32> buf(test); - for (i=0; iAt(i)->StartL(buf); - } - - aTestResult = ETestCasePassed; - - TRACE_INFO( _L("<<>>GetQueryType") ); if ( !aTypeString.Compare( _L( "EUSBNoMemoryCard" ) ) ) { aQueryType = EUSBNoMemoryCard; - TRACE_INFO( _L("Query type: EUSBNoMemoryCard") ); + iLog -> Log( _L("Query type: EUSBNoMemoryCard") ); } else if ( !aTypeString.Compare( _L( "EUSBStorageMediaFailure" ) ) ) { aQueryType = EUSBStorageMediaFailure; - TRACE_INFO( _L("Query type: EUSBStorageMediaFailure") ); + iLog -> Log( _L("Query type: EUSBStorageMediaFailure") ); } - else if ( !aTypeString.Compare( _L( "EUSBChangeFromMassStorage" ) ) ) + else if ( !aTypeString.Compare( _L( "EUSBDiskFull" ) ) ) { - aQueryType = EUSBChangeFromMassStorage; - TRACE_INFO( _L("Query type: EUSBChangeFromMassStorage") ); + aQueryType = EUSBDiskFull; + iLog -> Log( _L("Query type: EUSBDiskFull") ); + } + else if ( !aTypeString.Compare( _L( "EUSBNotEnoughRam" ) ) ) + { + aQueryType = EUSBNotEnoughRam; + iLog -> Log( _L("Query type: EUSBNotEnoughRam") ); } else { - TRACE_INFO( _L("Query type: not supported") ); + iLog -> Log( _L("Query type: not supported") ); return KErrNotFound; } - TRACE_INFO( _L("<<>>GetOTGErrorType") ); - if ( !aTypeString.Compare( _L( "EUsbOtgTooMuchPower" ) ) ) { aQueryType = EUsbOtgTooMuchPower; - TRACE_INFO( _L("Query type: EUsbOtgTooMuchPower") ); + iLog -> Log( _L("Query type: EUsbOtgTooMuchPower") ); } else if ( !aTypeString.Compare( _L( "EUsbOtgTooMuchPowerRequired" ) ) ) { aQueryType = EUsbOtgTooMuchPowerRequired; - TRACE_INFO( _L("Query type: EUsbOtgTooMuchPowerRequired") ); + iLog -> Log( _L("Query type: EUsbOtgTooMuchPowerRequired") ); } else if ( !aTypeString.Compare( _L( "EUsbOtgUnsupportedDevice" ) ) ) { aQueryType = EUsbOtgUnsupportedDevice; - TRACE_INFO( _L("Query type: EUsbOtgUnsupportedDevice") ); + iLog -> Log( _L("Query type: EUsbOtgUnsupportedDevice") ); } else if ( !aTypeString.Compare( _L( "EUsbOtgHubUnsupported" ) ) ) { aQueryType = EUsbOtgHubUnsupported; - TRACE_INFO( _L("Query type: EUsbOtgHubUnsupported") ); + iLog -> Log( _L("Query type: EUsbOtgHubUnsupported") ); } else if ( !aTypeString.Compare( _L( "EUsbOtgErrorInConnection" ) ) ) { aQueryType = EUsbOtgErrorInConnection; - TRACE_INFO( _L("Query type: EUsbOtgErrorInConnection") ); + iLog -> Log( _L("Query type: EUsbOtgErrorInConnection") ); } else if ( !aTypeString.Compare( _L( "EUsbOtgErrorAttachTimedOut" ) ) ) { aQueryType = EUsbOtgErrorAttachTimedOut; - TRACE_INFO( _L("Query type: EUsbOtgErrorAttachTimedOut") ); + iLog -> Log( _L("Query type: EUsbOtgErrorAttachTimedOut") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgErrorNoMemory" ) ) ) + { + aQueryType = EUsbOtgErrorNoMemory; + iLog -> Log( _L("Query type: EUsbOtgErrorNoMemory") ); } else { - TRACE_INFO( _L("Query type: not supported") ); + iLog -> Log( _L("Query type: not supported") ); return KErrNotFound; } - - TRACE_INFO( _L("<<>>GetOTGWarningType") ); - if ( !aTypeString.Compare( _L( "EUsbOtgPartiallySupportedDevice" ) ) ) { aQueryType = EUsbOtgPartiallySupportedDevice; - TRACE_INFO( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); + iLog -> Log( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); } else { - TRACE_INFO( _L("Query type: not supported") ); + iLog -> Log( _L("Query type: not supported") ); return KErrNotFound; } - - TRACE_INFO( _L("<<>>GetMSMMrrorType") ); if ( !aTypeString.Compare( _L( "EUsbMSMMGeneralError" ) ) ) { aQueryType = EHostMsErrGeneral; - TRACE_INFO( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); + iLog -> Log( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); } else if ( !aTypeString.Compare( _L( "EUsbMSMMUnknownFileSystem" ) ) ) { aQueryType = EHostMsErrUnknownFileSystem; - TRACE_INFO( _L("Query type: EUsbMSMMUnknownFileSystem") ); + iLog -> Log( _L("Query type: EUsbMSMMUnknownFileSystem") ); } else if ( !aTypeString.Compare( _L( "EUsbMSMMOutOfMemory" ) ) ) { aQueryType = EHostMsErrOutOfMemory; - TRACE_INFO( _L("Query type: EUsbMSMMOutOfMemory") ); + iLog -> Log( _L("Query type: EUsbMSMMOutOfMemory") ); } else { - TRACE_INFO( _L("Query type: not supported") ); + iLog -> Log( _L("Query type: not supported") ); return KErrNotFound; } - - TRACE_INFO( _L("<< Log( _L("Test type: EQueryDiscarded") ); } else if ( !aOptionString.Compare( _L( "ACCEPT" ) ) ) { aOption = EQueryAccepted; - TRACE_INFO( _L("Test type: EQueryAccepted") ); + iLog -> Log( _L("Test type: EQueryAccepted") ); } else if ( !aOptionString.Compare( _L( "CANCEL" ) ) ) { aOption = EQueryCanceled; - TRACE_INFO( _L("Test type: EQueryCanceled") ); + iLog -> Log( _L("Test type: EQueryCanceled") ); } else { - TRACE_INFO( _L("Test type: not supported") ); + iLog -> Log( _L("Test type: not supported") ); return KErrNotFound; } @@ -936,40 +745,64 @@ } // ----------------------------------------------------------------------------- -// CUsbUiNotifApiTest::GetPersonalityIdFromString +// CBtNotifApiTest::GetPersonalityIdFromString // ----------------------------------------------------------------------------- -TInt CUsbUiNotifApiTest::GetPersonalityIdFromString( TPtrC aOptionString, TInt& aPersonalityId ) +TInt CUSBUiNotifApiTest::GetPersonalityIdFromString( TPtrC aOptionString, TInt& aPersonalityId ) { if ( !aOptionString.Compare( _L( "MS" ) ) ) { aPersonalityId = KUsbPersonalityIdMS; - TRACE_INFO( _L("Usb personality type: KUsbPersonalityIdMS") ); + iLog -> Log( _L("Usb personality type: KUsbPersonalityIdMS") ); } - else if ( !aOptionString.Compare( _L( "PCSUITE" ) ) ) + else if ( !aOptionString.Compare( _L( "PTP" ) ) ) { - aPersonalityId = KUsbPersonalityIdPCSuite; - TRACE_INFO( _L("Usb personality type: KUsbPersonalityIdPCSuite") ); + aPersonalityId = KUsbPersonalityIdPTP; + iLog -> Log( _L("Usb personality type: KUsbPersonalityIdPTP") ); } else if ( !aOptionString.Compare( _L( "MTP" ) ) ) { aPersonalityId = KUsbPersonalityIdMTP; - TRACE_INFO( _L("Usb personality type: KUsbPersonalityIdMTP") ); + iLog -> Log( _L("Usb personality type: KUsbPersonalityIdMTP") ); } else if ( !aOptionString.Compare( _L( "PCSUITEMTP" ) ) ) { aPersonalityId = KUsbPersonalityIdPCSuiteMTP; - TRACE_INFO( _L("Usb personality type: KUsbPersonalityIdPCSuiteMTP") ); + iLog -> Log( _L("Usb personality type: KUsbPersonalityIdPCSuiteMTP") ); } else { - TRACE_INFO( _L("Usb personality type: not found") ); + iLog -> Log( _L("Usb personality type: not found") ); return KErrNotFound; } return KErrNone; } + +TInt CUSBUiNotifApiTest::FindAndKillProcess(const TDesC& aProcessName) + { + iLog -> Log( _L("FindAndKillProcess") ); + TInt ret = KErrNotFound; + RProcess process; + TFindProcess findProc; + findProc.Find(aProcessName); + TFullName procName; + ret = findProc.Next(procName); + iLog -> Log( _L("FindAndKillProcess findProc returned: %d"), ret ); + if (ret == KErrNone) + { + ret = process.Open(procName, EOwnerThread); + iLog -> Log( _L("FindAndKillProcess process open returned: %d"), ret ); + if (ret == KErrNone) + { + process.Terminate(KErrNone); + process.Close(); + } + } + return ret; + } + // ========================== OTHER EXPORTED FUNCTIONS ========================= // None