# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272879071 -10800 # Node ID 2f8f8080a020cbea98163f0d22ed075704e2eaed # Parent 6bb1b21d24844531c689dcb80e1856ec77241d8b Revision: 201015 Kit: 201018 diff -r 6bb1b21d2484 -r 2f8f8080a020 phone.pro --- a/phone.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phone.pro Mon May 03 12:31:11 2010 +0300 @@ -24,13 +24,16 @@ SUBDIRS += phoneengine/phoneservices SUBDIRS += phoneengine/parserrecognizer SUBDIRS += phoneengine/phonemodel +SUBDIRS += phoneengine/networkhandlingstarter SUBDIRS += phoneuis/bubblemanager2 +SUBDIRS += phoneplugins/phoneindicatorplugin SUBDIRS += phoneapp/phoneuiview2 SUBDIRS += phoneapp/phoneuiqtviewadapter SUBDIRS += phoneapp/phonestringloader SUBDIRS += phoneapp/phoneui2 SUBDIRS += phonesettings/cpphonesettingsplugins -SUBDIRS += phoneplugins/hsdialerwidgetplugin +#SUBDIRS += phoneplugins/hsdialerwidgetplugin SUBDIRS += phoneplugins/infowidgetplugin +SUBDIRS += phoneuis/ussdeditor } \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh --- a/phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh Fri Apr 16 14:58:25 2010 +0300 +++ b/phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh Mon May 03 12:31:11 2010 +0300 @@ -140,6 +140,7 @@ EPhoneInCallCmdPrivate, EPhoneInCallCmdCbaJoin, // NOT IN MENU! EPhoneInCallCmdDialer, + EPhoneInCallCmdContacts, // Enable video EPhoneInCallCmdEnableVideo, diff -r 6bb1b21d2484 -r 2f8f8080a020 phone_plat/telephony_information_api/inc/telinformationpskeys.h --- a/phone_plat/telephony_information_api/inc/telinformationpskeys.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phone_plat/telephony_information_api/inc/telinformationpskeys.h Mon May 03 12:31:11 2010 +0300 @@ -42,6 +42,26 @@ const TUint32 KTelDisplayInfo = 0x00000002; +/***************************************************************************** +* Telephony Car Mode API +* This can be used for setting and requesting +* Car Mode status. +*****************************************************************************/ +const TUid KPSUidTelCarMode = {0x102029A8}; + +/** +* Indicates the car mode setting +* This key has two special values, see EPSCarModeSetting. +* +* @type RProperty::EInt +*/ +const TUint32 KTelCarMode = 0x00000001; +enum EPSTelCarModeSetting + { + EPSCarModeOff = 0, + EPSCarModeOn + }; + #endif // TELINFORMATIONPSKEYS_H // End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phonestringloader/tsrc/ut_phonestringloader/ut_phonestringloader.pro --- a/phoneapp/phonestringloader/tsrc/ut_phonestringloader/ut_phonestringloader.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phonestringloader/tsrc/ut_phonestringloader/ut_phonestringloader.pro Mon May 03 12:31:11 2010 +0300 @@ -32,7 +32,7 @@ ../../../../inc \ ../../../phoneui2/srcdata - LIBS += -lphoneqtview + LIBS += -lphoneuiqtview LIBS += -lbafl TARGET.CAPABILITY = ALL -TCB diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/inc/phoneuikeyeventadapter.h --- a/phoneapp/phoneui2/inc/phoneuikeyeventadapter.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneui2/inc/phoneuikeyeventadapter.h Mon May 03 12:31:11 2010 +0300 @@ -58,14 +58,6 @@ is emitted from view. */ void keyReleased (QKeyEvent *event); - - /*! - \fn void endKeyLongPress() - - This method is called when end key is pressed for 0.6 seconds. - */ - void endKeyLongPress(); - private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/phoneui2.qrc --- a/phoneapp/phoneui2/phoneui2.qrc Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneui2/phoneui2.qrc Mon May 03 12:31:11 2010 +0300 @@ -13,9 +13,9 @@ themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg themes/icons/hbdefault/scalable/qtg_mono_dialer.svg - themes/icons/hbdefault/scalable/qtg_mono_loudspeaker.svg + themes/icons/hbdefault/scalable/qtg_mono_speaker.svg themes/icons/hbdefault/scalable/qtg_mono_contacts.svg - themes/icons/hbdefault/scalable/qtg_mono_mute.svg + themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg themes/icons/hbdefault/scalable/qtg_mono_mobile.svg diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/src/phoneuihousehold_p.cpp --- a/phoneapp/phoneui2/src/phoneuihousehold_p.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneui2/src/phoneuihousehold_p.cpp Mon May 03 12:31:11 2010 +0300 @@ -210,6 +210,12 @@ translator3 = 0; } + CEikonEnv* env = CEikonEnv::Static(); + if ( env ) { + env->SetSystem(ETrue); + } + + PhoneUIQtView *view = new PhoneUIQtView(m_window); iViewAdapter = new PhoneUIQtViewAdapter(*view); iPhoneUIController = CPhoneUIController::NewL(iViewAdapter); @@ -224,7 +230,6 @@ QObject::connect(view, SIGNAL(keyReleased(QKeyEvent *)), iViewAdapter, SLOT(keyReleased (QKeyEvent *))); QObject::connect(view, SIGNAL(keyPressed (QKeyEvent *)), iKeyEventAdapter, SLOT(keyPressed (QKeyEvent *))); QObject::connect(view, SIGNAL(keyReleased (QKeyEvent *)), iKeyEventAdapter, SLOT(keyReleased (QKeyEvent *))); - QObject::connect(view, SIGNAL(endKeyLongPress()), iKeyEventAdapter, SLOT(endKeyLongPress())); QObject::connect(view, SIGNAL(command (int)), iCommandAdapter, SLOT(handleCommand (int)), Qt::QueuedConnection); // async to enable deletion of widget during signal handling diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/src/phoneuikeyeventadapter.cpp --- a/phoneapp/phoneui2/src/phoneuikeyeventadapter.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneui2/src/phoneuikeyeventadapter.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,7 +17,7 @@ */ #include // must be before e32base.h so uncaught_exception gets defined -#include +#include #include "phoneuikeyeventadapter.h" #include "phoneconstants.h" @@ -47,6 +47,10 @@ TKeyEvent symbianKeyEvent; symbianKeyEvent.iCode = convertKeyCode(event); symbianKeyEvent.iRepeats = 0; + + if (event->isAutoRepeat()) { + symbianEventCode = (TEventCode)EEventLongPress; + } symbianKeyEvent.iScanCode = convertKeyCode(event); TRAP_IGNORE(mHandler.HandleKeyEventL (symbianKeyEvent, symbianEventCode)); @@ -77,12 +81,4 @@ return code; } -void PhoneUIKeyEventAdapter::endKeyLongPress() -{ - TKeyEvent symbianKeyEvent; - symbianKeyEvent.iCode = EKeyNo; - symbianKeyEvent.iRepeats = 0; - symbianKeyEvent.iScanCode = EKeyNo; - - TRAP_IGNORE(mHandler.HandleKeyEventL (symbianKeyEvent, (TEventCode)EEventLongPress)); -} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_loudspeaker.svg --- a/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_loudspeaker.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mute.svg --- a/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mute.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp --- a/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 @@ -63,7 +63,6 @@ void testKeyReleaseEvents(); void testKeyPressEventsByQtKeys(); void testLeave(); - void testEndKeyLongPress(); @@ -201,14 +200,5 @@ delete keyEvent; } -void TestPhoneKeyEventAdapter::testEndKeyLongPress() -{ - m_keyadapter->endKeyLongPress(); - QCOMPARE((int)m_eventCode, EEventLongPress); - QCOMPARE(m_scan_code, (int)EKeyNo); - QCOMPARE(m_code, (int)EKeyNo); - QCOMPARE(m_repeats, 0); -} - PHONE_QT_TEST_MAIN(TestPhoneKeyEventAdapter) #include "unit_tests.moc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuicontrol/src/cphonestate.cpp --- a/phoneapp/phoneuicontrol/src/cphonestate.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuicontrol/src/cphonestate.cpp Mon May 03 12:31:11 2010 +0300 @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -1661,6 +1661,10 @@ OpenSoftRejectMessageEditorL(); break; + case EPhoneInCallCmdContacts: + iViewCommandHandle->ExecuteCommand( EPhoneViewOpenContacts ); + break; + default: /*if ( IsOnScreenDialerSupported() ) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuicontrol/src/cphoneuicontroller.cpp --- a/phoneapp/phoneuicontrol/src/cphoneuicontroller.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuicontrol/src/cphoneuicontroller.cpp Mon May 03 12:31:11 2010 +0300 @@ -216,6 +216,8 @@ iStateMachine->State()->HandleKeyMessageL( MPhoneKeyEvents::EPhoneKeyShortPress, TKeyCode( aKeyEvent.iCode ) ); + + iStateMachine->State()->HandleDtmfKeyToneL( aKeyEvent, aEventCode ); } else if ( aEventCode == EEventLongPress ) { @@ -223,8 +225,12 @@ MPhoneKeyEvents::EPhoneKeyLongPress, TKeyCode( aKeyEvent.iCode ) ); } + else + { + iStateMachine->State()->HandleDtmfKeyToneL( aKeyEvent, aEventCode ); + } - iStateMachine->State()->HandleDtmfKeyToneL( aKeyEvent, aEventCode ); + return EKeyWasNotConsumed; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def --- a/phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def Mon May 03 12:31:11 2010 +0300 @@ -89,4 +89,8 @@ ?convertDuration@PhoneUIQtViewAdapter@@AAE?AVQString@@H@Z @ 88 NONAME ; class QString PhoneUIQtViewAdapter::convertDuration(int) ?setBubbleSelectionFlag@PhoneUIQtViewAdapter@@AAEXXZ @ 89 NONAME ; void PhoneUIQtViewAdapter::setBubbleSelectionFlag(void) ?handleCipheringInfoChange@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 90 NONAME ; void PhoneUIQtViewAdapter::handleCipheringInfoChange(int, class TPhoneCommandParam *) + ?HandlePropertyChangedL@PhoneUIQtViewAdapter@@UAEXABVTUid@@IH@Z @ 91 NONAME ; void PhoneUIQtViewAdapter::HandlePropertyChangedL(class TUid const &, unsigned int, int) + ?setHidden@PhoneUIQtViewAdapter@@AAEX_N@Z @ 92 NONAME ; void PhoneUIQtViewAdapter::setHidden(bool) + ?SetHiddenL@PhoneUIQtViewAdapter@@AAEX_N@Z @ 93 NONAME ; void PhoneUIQtViewAdapter::SetHiddenL(bool) + ?openContacts@PhoneUIQtViewAdapter@@AAEXXZ @ 94 NONAME ; void PhoneUIQtViewAdapter::openContacts(void) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def --- a/phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def Mon May 03 12:31:11 2010 +0300 @@ -101,4 +101,9 @@ _ZN20PhoneUIQtViewAdapter15convertDurationEi @ 100 NONAME _ZN20PhoneUIQtViewAdapter22setBubbleSelectionFlagEv @ 101 NONAME _ZN20PhoneUIQtViewAdapter25handleCipheringInfoChangeEiP18TPhoneCommandParam @ 102 NONAME + _ZN20PhoneUIQtViewAdapter22HandlePropertyChangedLERK4TUidji @ 103 NONAME + _ZThn12_N20PhoneUIQtViewAdapter22HandlePropertyChangedLERK4TUidji @ 104 NONAME + _ZN20PhoneUIQtViewAdapter10SetHiddenLEb @ 105 NONAME + _ZN20PhoneUIQtViewAdapter9setHiddenEb @ 106 NONAME + _ZN20PhoneUIQtViewAdapter12openContactsEv @ 107 NONAME diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,46 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles phone indicators. +*/ + +#ifndef PHONEINDICATORCONTROLLER_H_ +#define PHONEINDICATORCONTROLLER_H_ + + +#include +#include +#include + +// FORWARD DECLARATION +class LogsModel; +class LogsFilter; +class PhoneIndicatorController : public QObject + { + Q_OBJECT +public: + PhoneIndicatorController(QObject *parent = 0); + virtual ~PhoneIndicatorController(); + +private slots: + void updateMissedCallIndicator(const XQSettingsKey &key, const QVariant &value); + void setMissedallIndicatorData(); + +private: + HbIndicator m_indicator; + LogsModel *m_logsModel; + LogsFilter *m_missedCallsFilter; + XQSettingsManager * m_setManager; + }; + +#endif /* PHONEINDICATORCONTROLLER_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h --- a/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h Mon May 03 12:31:11 2010 +0300 @@ -26,7 +26,9 @@ #include #include +#include #include "mphoneviewcommandhandle.h" +#include "mphonepubsubobserver.h" #include "phoneaction.h" class PhoneUIQtViewIF; @@ -39,10 +41,12 @@ class PhoneUiCommandController; class TelephonyService; class QKeyEvent; +class PhoneIndicatorController; class PHONEUIQTVIEWADAPTER_EXPORT PhoneUIQtViewAdapter : public QObject, - public MPhoneViewCommandHandle + public MPhoneViewCommandHandle, + public MPhonePubSubObserver { Q_OBJECT @@ -145,6 +149,20 @@ */ PhoneNoteController* noteController() const; +public: // from MPhonePubSubObserver + + /** + * This function is called when there is property value change. + * @param aCategory Category of the property + * @param aKey Property key that is changed + * @param aValue New property value + */ + void HandlePropertyChangedL( + const TUid& aCategory, + const TUint aKey, + const TInt aValue); + + private slots: /*! @@ -488,6 +506,24 @@ */ void setBubbleSelectionFlag(); + /*! + /fn void setHidden() + This method sets hidden status. + */ + void setHidden(bool hidden); + + /*! + /fn void SetHiddenL() + This method sets hidden status. + */ + void SetHiddenL(bool hidden); + + /*! + /fn void openContacts() + This method opens contacts application. + */ + void openContacts(); + private: PhoneUIQtViewIF &m_view; @@ -499,8 +535,10 @@ TelephonyService *m_telephonyService; PhoneUiCommandController *m_uiCommandController; PhoneMessageController *m_messageController; + PhoneIndicatorController *m_indicatorController; bool m_dialpadAboutToClose; bool m_homeScreenToForeground; + bool m_carModeEnabled; }; #endif // PHONEUIQTVIEWADAPTER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/inc/phoneviewcommanddefinitions.h --- a/phoneapp/phoneuiqtviewadapter/inc/phoneviewcommanddefinitions.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/inc/phoneviewcommanddefinitions.h Mon May 03 12:31:11 2010 +0300 @@ -234,6 +234,7 @@ EPhoneAppShutDown, EPhoneViewBackButtonActive, EPhoneViewHsToForegroundAfterCall, + EPhoneViewOpenContacts, EPhoneAmountOfCommands, // Don't remove this, this should always be the last in list. }; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pri --- a/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pri Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pri Mon May 03 12:31:11 2010 +0300 @@ -25,6 +25,8 @@ HEADERS += ./inc/phoneuicommandcontroller.h HEADERS += ./inc/phonecommandextensionwrapper.h HEADERS += ./inc/phonemessagecontroller.h +HEADERS += ./inc/phoneindicatorcontroller.h + SOURCES += ./src/phoneuiqtviewadapter.cpp SOURCES += ./src/phoneuiqtbuttonscontroller.cpp @@ -35,3 +37,4 @@ SOURCES += ./src/phoneuicommandcontroller.cpp SOURCES += ./src/phonecommandextensionwrapper.cpp SOURCES += ./src/phonemessagecontroller.cpp +SOURCES += ./src/phoneindicatorcontroller.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pro --- a/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pro Mon May 03 12:31:11 2010 +0300 @@ -35,18 +35,19 @@ ../phonemediatorcenter/inc LIBS += -lphoneuiutils \ - -lbubblemanager2 \ - -lphoneringingtoneplayer \ - -lphoneuiqtview \ - -lphonemediatorcenter \ - -lxqservice \ - -lxqserviceutil \ - -lserviceprovidersettings \ - -lxqplugins - - defFiles = \ - "$${LITERAL_HASH}ifdef WINS" \ - "DEFFILE bwins/phoneuiqtviewadapter.def" \ + -lbubblemanager2 \ + -lphoneringingtoneplayer \ + -lphoneuiqtview \ + -lphonemediatorcenter \ + -lxqservice \ + -lxqserviceutil \ + -lserviceprovidersettings \ + -lxqsettingsmanager \ + -llogsengine \ + -lxqplugins \ + -lakncapserverclient + defFiles = "$${LITERAL_HASH}ifdef WINS" \ + "DEFFILE bwins/phoneuiqtviewadapter.def" \ "$${LITERAL_HASH}else" \ "DEFFILE eabi/phoneuiqtviewadapter.def" \ "$${LITERAL_HASH}endif" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,153 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles phone indicators. +* +*/ + +#include "phoneindicatorcontroller.h" +#include "phoneindicators.h" + +#include +#include + +#ifdef Q_OS_SYMBIAN +#include +#include +#include +#include +#endif + +PhoneIndicatorController::PhoneIndicatorController(QObject *parent): + QObject(parent), m_missedCallsFilter(0), m_logsModel(0) +{ +#ifdef Q_OS_SYMBIAN + m_setManager = new XQSettingsManager(this); + + XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidLogs.iUid, KLogsNewMissedCalls ); + + bool ok = connect( m_setManager, + SIGNAL( valueChanged(const XQSettingsKey & ,const QVariant &)), + this, SLOT(updateMissedCallIndicator(XQSettingsKey, + QVariant))); + ASSERT( ok ); + ok = false; + ok = m_setManager->startMonitoring( settingsKey ); + ASSERT(ok); + + qRegisterMetaType("PhoneIndicatorInfo"); + +#endif +} + +PhoneIndicatorController::~PhoneIndicatorController() +{ +#ifdef Q_OS_SYMBIAN + XQPublishAndSubscribeSettingsKey missedCallCountKey( + (qint32)KCRUidLogs.iUid, (quint32)KLogsNewMissedCalls ); + m_setManager->stopMonitoring(missedCallCountKey); + delete m_setManager; + delete m_missedCallsFilter; + delete m_logsModel; +#endif +} + +void PhoneIndicatorController::updateMissedCallIndicator( + const XQSettingsKey &key, const QVariant &value) +{ +#ifdef Q_OS_SYMBIAN + if ( key.key() == (quint32)KLogsNewMissedCalls ){ + if ( value.toInt() == 0 ){ + QString indicatorType(indicatorName(PhoneMissedCallIndicator)); + m_indicator.deactivate(indicatorType); + delete m_missedCallsFilter; + m_missedCallsFilter = NULL; + delete m_logsModel; + m_logsModel = NULL; + } else { + m_logsModel = new LogsModel(LogsModel::LogsFullModel); + m_missedCallsFilter = new LogsFilter(LogsFilter::Missed); + connect( m_missedCallsFilter, + SIGNAL(rowsInserted(const QModelIndex &, int, int )), + this, SLOT(setMissedallIndicatorData())); + m_missedCallsFilter->setMaxSize(value.toInt() + 1); + m_missedCallsFilter->setSourceModel(m_logsModel); + } + } +#endif +} + +void PhoneIndicatorController::setMissedallIndicatorData() +{ +#ifdef Q_OS_SYMBIAN + + XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidLogs.iUid, KLogsNewMissedCalls ); + QString indicatorType(indicatorName(PhoneMissedCallIndicator)); + + int missedCallCount = m_setManager->readItemValue( settingsKey, + XQSettingsManager::TypeInt ).toInt(); + + if ( missedCallCount > 0 ) { + QVariantMap parameters; + QString lastMissedCallFrom; + int repeatedMissedCalls(0); + + if ( m_missedCallsFilter->rowCount() > 0 ){ + lastMissedCallFrom = m_missedCallsFilter->data( + m_missedCallsFilter->index(0,0), + Qt::DisplayRole).toStringList().takeFirst(); + repeatedMissedCalls = 1; + } + for( int i = 1; i < missedCallCount && i + < m_missedCallsFilter->rowCount(); i++ ){ + QStringList displayData = m_missedCallsFilter->data( + m_missedCallsFilter->index(i,0), + Qt::DisplayRole).toStringList(); + if ( lastMissedCallFrom == displayData.at(0) ){ + repeatedMissedCalls++; + } else { + i = missedCallCount; // Break + } + } + // First row + parameters.insert( + QVariant( HbIndicatorInterface::PrimaryTextRole ).toString(), + ( hbTrId("txt_phone_dblist_ln_missed_calls", + missedCallCount))); + + // Second row + if ( missedCallCount >= repeatedMissedCalls ) + { + parameters.insert( + QVariant( HbIndicatorInterface::SecondaryTextRole ).toString(), + lastMissedCallFrom ); + } + + // icon + //QList icons = m_missedCallsFilter->data( + // m_missedCallsFilter->index(0,0), + // Qt::DecorationRole).value >(); + //QString iconName = icons.first().value().iconName(); + QString iconName = "qtg_mono_missed_call_unseen"; + parameters.insert( + QVariant( HbIndicatorInterface::DecorationNameRole ).toString(), + iconName ); + + m_indicator.activate(indicatorType, parameters); + } else { + m_indicator.deactivate( indicatorType ); + } +#endif +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp Mon May 03 12:31:11 2010 +0300 @@ -73,16 +73,29 @@ HbDeviceMessageBox messageBox(noteString, type); messageBox.setTimeout(HbDialog::StandardTimeout); messageBox.exec(); - } else { - HbDeviceMessageBox *messageBox = new HbDeviceMessageBox( - noteString, type); - messageBox->setTimeout(HbDialog::StandardTimeout); - m_messageBoxList.append(messageBox); + } else { + bool showNote(true); + for (int i = 0;itext()) { + showNote = false; + break; + } + } - if (1 == m_messageBoxList.size()) { - QObject::connect(messageBox, SIGNAL(aboutToClose()), - this, SLOT(destroyDialog())); - messageBox->show(); + if (showNote) { + HbDeviceMessageBox *messageBox = new HbDeviceMessageBox( + noteString, type); + messageBox->setTimeout(HbDialog::StandardTimeout); + m_messageBoxList.append(messageBox); + + if (1 == m_messageBoxList.size()) { + QObject::connect(messageBox, SIGNAL(aboutToClose()), + this, SLOT(destroyDialog())); + messageBox->show(); + } } } } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp Mon May 03 12:31:11 2010 +0300 @@ -74,7 +74,7 @@ translatedActions [PhoneAction::ToolbarButton1] = leftButton; PhoneAction *rightButton = new PhoneAction; - rightButton->setIcon (HbIcon("qtg_mono_mute")); + rightButton->setIcon (HbIcon("qtg_mono_speaker_off")); rightButton->setCommand (EPhoneCallComingCmdSilent); translatedActions [PhoneAction::ToolbarButton2] = rightButton; } @@ -102,7 +102,7 @@ translatedActions [PhoneAction::ToolbarButton1] = leftButton; PhoneAction *rightButton = new PhoneAction; - rightButton->setIcon (HbIcon("qtg_mono_mute")); + rightButton->setIcon (HbIcon("qtg_mono_speaker_off")); rightButton->setDisabled(true); translatedActions [PhoneAction::ToolbarButton2] = rightButton; } @@ -141,7 +141,7 @@ PhoneAction *centerButton2 = new PhoneAction; if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf)) { - centerButton2->setIcon (HbIcon("qtg_mono_loudspeaker")); + centerButton2->setIcon (HbIcon("qtg_mono_speaker")); centerButton2->setCommand (EPhoneInCallCmdActivateIhf); } else @@ -155,7 +155,8 @@ rightButton->setIcon(HbIcon("qtg_mono_contacts")); rightButton->setDisabled( (symbianResourceId== - R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA)); + R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA)); + rightButton->setCommand(EPhoneInCallCmdContacts); translatedActions[PhoneAction::ToolbarButton4] = rightButton; } @@ -171,7 +172,7 @@ PhoneAction *rightButton = new PhoneAction; if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf)) { - rightButton->setIcon (HbIcon("qtg_mono_loudspeaker")); + rightButton->setIcon (HbIcon("qtg_mono_speaker")); rightButton->setCommand (EPhoneInCallCmdActivateIhf); } else @@ -198,7 +199,7 @@ PhoneAction *centerButton2 = new PhoneAction; if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf)) { - centerButton2->setIcon (HbIcon("qtg_mono_loudspeaker")); + centerButton2->setIcon (HbIcon("qtg_mono_speaker")); centerButton2->setCommand (EPhoneInCallCmdActivateIhf); } else @@ -210,6 +211,7 @@ PhoneAction *rightButton = new PhoneAction; rightButton->setIcon(HbIcon("qtg_mono_contacts")); + rightButton->setCommand(EPhoneInCallCmdContacts); translatedActions[PhoneAction::ToolbarButton4] = rightButton; } break; @@ -241,6 +243,7 @@ PhoneAction *rightButton = new PhoneAction; rightButton->setIcon(HbIcon("qtg_mono_contacts")); + rightButton->setCommand(EPhoneInCallCmdContacts); translatedActions[PhoneAction::ToolbarButton4] = rightButton; } break; @@ -380,7 +383,7 @@ VA_END (list); } break; - + default: break; } @@ -395,13 +398,13 @@ switch (symbianResourceId) { case R_PHONE_ERROR_CALL_NOT_ALLOWED: { - ret = hbTrId("Call not allowed"); + ret = hbTrId("txt_phone_dpopinfo_not_allowed"); } break; case R_ERROR_NOTE_NOT_ALLOWED: { - ret = hbTrId("Not allowed"); + ret = hbTrId("txt_phone_dpopinfo_not_allowed"); } break; @@ -457,6 +460,41 @@ ret = hbTrId("txt_phone_info_no_network_support_for_video_call"); } break; + case R_PHONE_ERROR_EMERGENCY_CALLS_ONLY: + { + ret = hbTrId("txt_phone_info_emergency_calls_only"); + } + break; + case R_NOTETEXT_NUMBER_NOT_IN_USE: + { + ret = hbTrId("txt_phone_info_number_not_in_use"); + } + break; + case R_NOTETEXT_NETWORK_BUSY: + { + ret = hbTrId("txt_phone_info_network_busy"); + } + break; + case R_NOTETEXT_ERROR_IN_CONNECTION: + { + ret = hbTrId("txt_phone_info_error_in_connection"); + } + break; + case R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED: + { + ret = hbTrId("txt_phone_info_emergency_call_failed"); + } + break; + case R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT: + { + ret = hbTrId("txt_phone_info_transferred"); + } + break; + case R_PHONE_ERROR_NO_SERVICE: + { + ret = hbTrId("txt_phone_dpopinfo_no_network_coverage"); + } + break; default: break; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp Mon May 03 12:31:11 2010 +0300 @@ -144,7 +144,8 @@ break; case 2: { if (!callStates.values().contains(EPEStateRinging) && - !callStates.values().contains(EPEStateDisconnecting)) { + !callStates.values().contains(EPEStateDisconnecting) && + !callStates.values().contains(EPEStateDialing)) { commands.append(PhoneInCallCmdEndAllCalls); } if (callStates.values().contains(EPEStateConnected) && diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp Mon May 03 12:31:11 2010 +0300 @@ -39,6 +39,7 @@ #include "telephonyservice.h" #include "phoneuicommandcontroller.h" #include "phonemessagecontroller.h" +#include "phoneindicatorcontroller.h" #include "qtphonelog.h" #include #include @@ -55,13 +56,18 @@ #include #include #include +#include +#include +#include + //CONSTANTS static const int PHONE_CALL_NOT_FOUND = -1; PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) : QObject (parent), m_view (view), m_idleUid(-1), - m_dialpadAboutToClose(false), m_homeScreenToForeground(false) + m_dialpadAboutToClose(false), m_homeScreenToForeground(false), + m_carModeEnabled(false) { m_bubbleWrapper = new PhoneBubbleWrapper(m_view.bubbleManager (), this); m_noteController = new PhoneNoteController(this); @@ -78,6 +84,21 @@ setToolbarButtons(&intParam); m_telephonyService = new TelephonyService (this, this); + m_indicatorController = new PhoneIndicatorController(this); + + // Define car mode pub sub key + int err = RProperty::Define( + KPSUidTelCarMode, + KTelCarMode, + RProperty::EInt, + KPhoneReadPolicy, + KPhoneWritePolicy); + + // Start listening to car mode changes + if(err == KErrNone) { + CPhonePubSubProxy::Instance()->NotifyChangeL(KPSUidTelCarMode, + KTelCarMode, this); + } } PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter () @@ -114,14 +135,6 @@ m_ringingtonecontroller->MuteRingingTone(); break; - case EPhoneViewBeginUpdate: - m_bubbleWrapper->bubbleManager ().startChanges (); - break; - - case EPhoneViewEndUpdate: - m_bubbleWrapper->bubbleManager ().endChanges (); - break; - case EPhoneViewHideNaviPaneAudioVolume: m_view.removeVolumeSlider (); break; @@ -176,7 +189,9 @@ case EPhoneViewRemoveGlobalWaitNote: m_noteController->removeGlobalWaitNote(); break; - + case EPhoneViewUpdateFSW: + setHidden(true); + break; default: break; } @@ -309,7 +324,11 @@ TPhoneCmdParamInteger *time = static_cast(aCommandParam); QString duration = convertDuration(time->Integer()); PHONE_DEBUG2("call duration:", duration); - m_bubbleWrapper->bubbleManager ().updateCallTime (m_bubbleWrapper->bubbleId (aCallId), duration); + int bubbleId = m_bubbleWrapper->bubbleId(aCallId); + + if (-1 != bubbleId) { + m_bubbleWrapper->bubbleManager().updateCallTime(bubbleId, duration); + } break; } @@ -397,6 +416,15 @@ m_bubbleWrapper->conferenceCallList().size()); m_bubbleWrapper->bubbleManager ().endChanges (); break; + case EPhoneViewBeginUpdate: + m_bubbleWrapper->bubbleManager ().startChanges (); + break; + case EPhoneViewEndUpdate: + m_bubbleWrapper->bubbleManager ().endChanges (); + break; + case EPhoneViewOpenContacts: + openContacts(); + break; default: break; } @@ -516,6 +544,10 @@ m_bubbleWrapper->bubbleManager().setCallObjectFromTheme(bubble); } m_bubbleWrapper->bubbleManager ().endChanges (); + + if (1 == m_bubbleWrapper->bubbles().keys().count()) { + setHidden(false); + } } void PhoneUIQtViewAdapter::createEmergencyCallHeader( @@ -599,11 +631,15 @@ { TPhoneCmdParamCallHeaderData *param = static_cast(commandParam); - m_bubbleWrapper->bubbleManager().startChanges(); - m_bubbleWrapper->setCiphering(m_bubbleWrapper->bubbleId(callId), - param->CipheringIndicatorAllowed(), - param->Ciphering()); - m_bubbleWrapper->bubbleManager().endChanges(); + + int bubble = m_bubbleWrapper->bubbleId(callId); + if ( -1 != bubble ) { + m_bubbleWrapper->bubbleManager().startChanges(); + m_bubbleWrapper->setCiphering(m_bubbleWrapper->bubbleId(callId), + param->CipheringIndicatorAllowed(), + param->Ciphering()); + m_bubbleWrapper->bubbleManager().endChanges(); + } } TPhoneViewResponseId PhoneUIQtViewAdapter::callIdByState (TPhoneCommandParam *commandParam) @@ -947,7 +983,9 @@ void PhoneUIQtViewAdapter::bringToForeground() { - m_view.bringToForeground(); + if(!m_carModeEnabled) { + m_view.bringToForeground(); + } } void PhoneUIQtViewAdapter::showGlobalNote( @@ -1078,3 +1116,51 @@ m_bubbleWrapper->bubbleManager().setBubbleSelectionDisabled(selectionFlag); } +void PhoneUIQtViewAdapter::HandlePropertyChangedL(const TUid& aCategory, + const TUint aKey, const TInt aValue) +{ + if((aCategory == KPSUidTelCarMode) && (aKey == KTelCarMode)) { + if(aValue == EPSCarModeOff) { + m_carModeEnabled = false; + } else if(aValue == EPSCarModeOn) { + m_carModeEnabled = true; + } else { + Q_ASSERT(false); + } + } +} + +void PhoneUIQtViewAdapter::setHidden(bool hidden) +{ + TRAP_IGNORE(SetHiddenL(hidden)); +} + +void PhoneUIQtViewAdapter::SetHiddenL(bool hidden) +{ + CEikonEnv* env = CEikonEnv::Static(); + + if (env) { + CApaWindowGroupName* windowGroupName = + CApaWindowGroupName::NewLC( + env->WsSession(), + env->RootWin().Identifier() ); + + windowGroupName->SetHidden( hidden ); + User::LeaveIfError( + windowGroupName->SetWindowGroupName( + env->RootWin() ) ); + + CleanupStack::PopAndDestroy( windowGroupName ); + + CAknSgcClient::AknSrv()->UpdateTaskList(); + } +} + +void PhoneUIQtViewAdapter::openContacts() +{ + XQServiceRequest snd("com.nokia.services.phonebookappservices.Launch","launch()", false); + int retValue; + snd.send(retValue); +} + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/main.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include +#include +#include +#include +#include "cphonepubsubproxy.h" + +class CarModeTester : public HbWidget +{ + Q_OBJECT + +public: + CarModeTester(); + +private slots: + void setCarModeOn(); + void setCarModeOff(); +}; + +int main(int argc, char *argv[]) +{ + // Initialization + HbApplication app(argc, argv); + + // Main window widget. + // Includes decorators such as signal strength and battery life indicator. + HbMainWindow mainWindow; + + CarModeTester* cmt = new CarModeTester; + mainWindow.addView(cmt); + + // Show widget + mainWindow.show(); + + // Enter event loop + return app.exec(); +} + +CarModeTester::CarModeTester() { + HbPushButton* button = new HbPushButton("Set Car Mode ON", this); + button->setMaximumHeight(50); + connect(button,SIGNAL(clicked()),SLOT(setCarModeOn())); + + HbPushButton* button2 = new HbPushButton("Set Car Mode OFF", this); + button2->setMaximumHeight(50); + connect(button2,SIGNAL(clicked()),SLOT(setCarModeOff())); + + QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); + layout->addItem(button); + layout->addItem(button2); + setLayout(layout); +} + +void CarModeTester::setCarModeOn() +{ + CPhonePubSubProxy::Instance()->ChangePropertyValue(KPSUidTelCarMode, KTelCarMode, EPSCarModeOn); +} + +void CarModeTester::setCarModeOff() +{ + CPhonePubSubProxy::Instance()->ChangePropertyValue(KPSUidTelCarMode, KTelCarMode, EPSCarModeOff); +} + +#include "main.moc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/u_carmodetester.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/u_carmodetester.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,49 @@ +# +# 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: Project file for building unit test component +# +# + +TEMPLATE = app +TARGET = +TARGET.UID3 = 0xEFF8FEA8 +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb +CONFIG += qtestlib + +symbian { + + INCLUDEPATH += \epoc32\include\platform\mw \ + \epoc32\include\platform \ + \epoc32\include\platform\app \ + \epoc32\include\mw \ + \sf\app\phone\inc \ + ../../../phoneuiutils/inc/ \ + ../../../phonemediatorcenter/inc/ \ + ../../../phoneuiview2/inc \ + ../../../../inc \ + ../../../phoneringingtoneplayer/inc \ + ../../../phoneui2/srcdata + + + LIBS += -lphoneuiutils + + TARGET.CAPABILITY = ALL -TCB + DEFINES += FT_SYMBIAN_INTEGRATION +} + +# Input +SOURCES += main.cpp + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.h --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.h Mon May 03 12:31:11 2010 +0300 @@ -3,7 +3,7 @@ * Name : * Part of : * Description : -* Version : %version: 1 % +* Version : %version: 2 % * * Copyright 2008 Nokia. All rights reserved. * This material, including documentation and any related computer diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 @@ -112,7 +112,7 @@ action = map [PhoneAction::ToolbarButton1]; QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); action = map [PhoneAction::ToolbarButton2]; - QCOMPARE (action->icon (), HbIcon("qtg_mono_mute")); + QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off")); QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent); map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA); @@ -129,7 +129,7 @@ action = map [PhoneAction::ToolbarButton1]; QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); action = map [PhoneAction::ToolbarButton2]; - QCOMPARE (action->icon (), HbIcon("qtg_mono_mute")); + QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off")); //Command is disabled //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); @@ -214,7 +214,7 @@ action = map [PhoneAction::ToolbarButton1]; QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer")); action = map [PhoneAction::ToolbarButton2]; - QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); + QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker")); QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL); @@ -277,8 +277,29 @@ QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); QVERIFY( false == testString11.isEmpty() ); - QString testString12 = m_resourceAdapter->convertToString(0); - QCOMPARE( testString12, QString ("") ); + QString testString12 = m_resourceAdapter->convertToString(R_PHONE_ERROR_EMERGENCY_CALLS_ONLY); + QVERIFY( false == testString12.isEmpty() ); + + QString testString13 = m_resourceAdapter->convertToString(R_NOTETEXT_NUMBER_NOT_IN_USE); + QVERIFY( false == testString13.isEmpty() ); + + QString testString14 = m_resourceAdapter->convertToString(R_NOTETEXT_NETWORK_BUSY); + QVERIFY( false == testString14.isEmpty() ); + + QString testString15 = m_resourceAdapter->convertToString(R_NOTETEXT_ERROR_IN_CONNECTION); + QVERIFY( false == testString15.isEmpty() ); + + QString testString16 = m_resourceAdapter->convertToString(R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED); + QVERIFY( false == testString16.isEmpty() ); + + QString testString17 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT); + QVERIFY( false == testString17.isEmpty() ); + + QString testString18 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NO_SERVICE); + QVERIFY( false == testString18.isEmpty() ); + + QString testString99 = m_resourceAdapter->convertToString(0); + QCOMPARE( testString99, QString ("") ); } void TestPhoneResourceAdapter::testConvertToString2 () @@ -309,7 +330,7 @@ QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_unmute")); QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute); action = map [PhoneAction::ToolbarButton3]; - QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); + QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker")); QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); break; default: @@ -319,7 +340,7 @@ QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_mute")); QCOMPARE (action->command (), (int)EPhoneInCallCmdMute); action = map [PhoneAction::ToolbarButton3]; - QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); + QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker")); QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); break; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/unit_tests.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/unit_tests.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 @@ -232,6 +232,8 @@ void testNoteController(); void testHsToForegroundAfterCall(); void testCipheringInfoChange(); + void testSetHidden(); + void testBeginEndUiUpdate(); private: PhoneUIQtViewAdapter *m_adapter; // class under test @@ -640,13 +642,7 @@ void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdId () { // Default - m_adapter->ExecuteCommandL (0); - - m_adapter->ExecuteCommandL (EPhoneViewBeginUpdate); - QVERIFY (m_startChangesCalled == true); - - m_adapter->ExecuteCommandL (EPhoneViewEndUpdate); - QVERIFY (m_endChangesCalled == true); + m_adapter->ExecuteCommandL (0); } void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdIdAndCallId () @@ -1245,6 +1241,7 @@ void TestPhoneUIQtViewAdapter::testCipheringInfoChange() { + m_bubble_id = 1; TPhoneCmdParamCallHeaderData callHeader; callHeader.SetCipheringIndicatorAllowed(true); callHeader.SetCiphering(false); @@ -1252,6 +1249,24 @@ QVERIFY (m_startChangesCalled == true); QVERIFY (m_setCipheringCalled == true); QVERIFY (m_endChangesCalled == true); + m_setCipheringCalled = false; + m_bubble_id = -1; + m_adapter->ExecuteCommandL (EPhoneViewCipheringInfoChange, -1, &callHeader); + QVERIFY (m_setCipheringCalled == false); +} + +void TestPhoneUIQtViewAdapter::testSetHidden() +{ + m_adapter->ExecuteCommandL(EPhoneViewUpdateFSW); +} + +void TestPhoneUIQtViewAdapter::testBeginEndUiUpdate() +{ + m_adapter->ExecuteCommand(EPhoneViewBeginUpdate); + QVERIFY (m_startChangesCalled == true); + + m_adapter->ExecuteCommand(EPhoneViewEndUpdate); + QVERIFY (m_endChangesCalled == true); } PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUIQtViewAdapter) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/ut_phoneuiqtviewadapter.pro --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/ut_phoneuiqtviewadapter.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/ut_phoneuiqtviewadapter.pro Mon May 03 12:31:11 2010 +0300 @@ -45,7 +45,10 @@ LIBS += -lxqserviceutil LIBS += -lxqplugins LIBS += -lserviceprovidersettings - + LIBS += -lakncapserverclient + LIBS += -lxqsettingsmanager + LIBS += -llogsengine + TARGET.CAPABILITY = ALL -TCB DEFINES += FT_SYMBIAN_INTEGRATION DEFINES += BUILD_PHONEUIQTVIEWADAPTER @@ -66,6 +69,8 @@ SOURCES += ../../src/phonecommandextensionwrapper.cpp HEADERS += ../../inc/phonemessagecontroller.h SOURCES += ../../src/phonemessagecontroller.cpp +HEADERS += ../../inc/phoneindicatorcontroller.h +SOURCES += ../../src/phoneindicatorcontroller.cpp SOURCES += phoneuiqtbuttonscontroller_stub.cpp HEADERS += phonebubblewrapper.h SOURCES += phonebubblewrapper_stub.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/phoneuiqtviewadapter_stub.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/phoneuiqtviewadapter_stub.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/phoneuiqtviewadapter_stub.cpp Mon May 03 12:31:11 2010 +0300 @@ -167,3 +167,8 @@ void PhoneUIQtViewAdapter::keyReleased(QKeyEvent */*event*/) {} +void PhoneUIQtViewAdapter::HandlePropertyChangedL( + const TUid& aCategory, + const TUint aKey, + const TInt aValue) +{} \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuistates/src/cphonesingleandcallsetup.cpp --- a/phoneapp/phoneuistates/src/cphonesingleandcallsetup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetup.cpp Mon May 03 12:31:11 2010 +0300 @@ -237,6 +237,8 @@ holdFlag.SetBoolean( EFalse ); iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); + SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons ); + // Go to alerting state UpdateCbaL( EPhoneCallHandlingInCallCBA ); iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp --- a/phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp Mon May 03 12:31:11 2010 +0300 @@ -440,7 +440,7 @@ } else { - iCbaManager->SetCbaL( EPhoneCallHandlingIncomingSoftRejectCBA ); + iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA ); } } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def --- a/phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def Mon May 03 12:31:11 2010 +0300 @@ -1,5 +1,4 @@ -EXPORTS - ?setExpandAction@PhoneUIQtView@@UAEXHH@Z @ 1 NONAME ; void PhoneUIQtView::setExpandAction(int, int) +EXPORTS ?setExpandAction@PhoneUIQtView@@UAEXHH@Z @ 1 NONAME ; void PhoneUIQtView::setExpandAction(int, int) ?keyPressed@PhoneUIQtView@@IAEXPAVQKeyEvent@@@Z @ 2 NONAME ; void PhoneUIQtView::keyPressed(class QKeyEvent *) ?volumeSliderChanged@PhoneUIQtView@@QAEXH@Z @ 3 NONAME ; void PhoneUIQtView::volumeSliderChanged(int) ?menuReference@PhoneUIQtView@@UAEAAVHbMenu@@XZ @ 4 NONAME ; class HbMenu & PhoneUIQtView::menuReference(void) @@ -60,6 +59,4 @@ ?setVolumeSliderValue@PhoneUIQtView@@UAEXHHHH@Z @ 59 NONAME ; void PhoneUIQtView::setVolumeSliderValue(int, int, int, int) ?clearAndHideDialpad@PhoneUIQtView@@UAEXXZ @ 60 NONAME ; void PhoneUIQtView::clearAndHideDialpad(void) ?isDisabled@PhoneAction@@QBE_NXZ @ 61 NONAME ; bool PhoneAction::isDisabled(void) const - ?endKeyLongPress@PhoneUIQtView@@IAEXXZ @ 62 NONAME ; void PhoneUIQtView::endKeyLongPress(void) - ?longEndKeyPressEvent@PhoneUIQtView@@QAEXXZ @ 63 NONAME ; void PhoneUIQtView::longEndKeyPressEvent(void) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def --- a/phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def Mon May 03 12:31:11 2010 +0300 @@ -89,6 +89,4 @@ _ZThn28_N13PhoneUIQtView27clearParticipantListActionsEv @ 88 NONAME _ZThn8_N13PhoneUIQtViewD0Ev @ 89 NONAME _ZThn8_N13PhoneUIQtViewD1Ev @ 90 NONAME - _ZN13PhoneUIQtView15endKeyLongPressEv @ 91 NONAME - _ZN13PhoneUIQtView20longEndKeyPressEventEv @ 92 NONAME diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/inc/phoneuiqtview.h --- a/phoneapp/phoneuiview2/inc/phoneuiqtview.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/inc/phoneuiqtview.h Mon May 03 12:31:11 2010 +0300 @@ -29,7 +29,7 @@ class HbToolBar; class HbVolumeSliderPopup; class Dialpad; -class QTimer; +class XqKeyCapture; #ifdef BUILD_PHONEUIQTVIEW #define PHONEUIQTVIEW_EXPORT Q_DECL_EXPORT @@ -265,12 +265,6 @@ */ void shutdownPhoneApp(); - /*! - \fn void PhoneUIQtView::longEndKeyPressEvent() - - This is called when end key's long press timer times out. - */ - void longEndKeyPressEvent(); signals: @@ -287,8 +281,6 @@ This signal is emitted when key is released. */ void keyReleased (QKeyEvent *event); - - void endKeyLongPress(); /*! \fn void command(int command) @@ -353,7 +345,7 @@ HbAction *m_backAction; Dialpad *m_dialpad; QSignalMapper *m_menuSignalMapper; - QTimer *m_longPressTimer; + XqKeyCapture *m_keyCapture; }; #endif // PHONEUIQTVIEW_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/phoneuiview2.pro --- a/phoneapp/phoneuiview2/phoneuiview2.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/phoneuiview2.pro Mon May 03 12:31:11 2010 +0300 @@ -33,7 +33,8 @@ LIBS += -lphoneuiutils \ -lbubblemanager2 \ -lxqserviceutil \ - -ldialpad + -ldialpad \ + -lxqkeycapture defFiles = \ "$${LITERAL_HASH}ifdef WINS" \ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/src/phoneuiqtview.cpp --- a/phoneapp/phoneuiview2/src/phoneuiqtview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/src/phoneuiqtview.cpp Mon May 03 12:31:11 2010 +0300 @@ -15,8 +15,7 @@ * */ #include -#include -#include +#include #include #include #include @@ -26,12 +25,12 @@ #include #include +#include #include #include "phoneuiqtview.h" #include "phoneaction.h" #include "qtphonelog.h" -const int LongKeyPressTimeOut(600); PhoneUIQtView::PhoneUIQtView (HbMainWindow &window, QGraphicsItem *parent) : HbView (parent), @@ -40,19 +39,15 @@ m_expandSignalMapper(0), m_participantListSignalMapper(0), m_volumeCommandId(0), - m_longPressTimer(0) + m_keyCapture(0) { setTitle(hbTrId("txt_phone_title_telephone")); - // Call handling widget - m_bubbleManager = new BubbleManager (this); - setWidget(m_bubbleManager); - - // Long press timer - m_longPressTimer = new QTimer(this); - m_longPressTimer->setSingleShot(true); - connect(m_longPressTimer, SIGNAL(timeout()), this, SLOT(longEndKeyPressEvent())); - + // Capturing long press of end key + m_keyCapture = new XqKeyCapture(); + m_keyCapture->captureLongKey(Qt::Key_No); + m_keyCapture->captureKey(Qt::Key_No); + // Dialpad m_dialpad = new Dialpad(m_window); m_dialpad->setCallButtonEnabled(false); @@ -61,6 +56,10 @@ SLOT(onEditorContentChanged())); connect(m_dialpad,SIGNAL(aboutToClose()),this, SLOT(dialpadClosed())); + + // Call handling widget + m_bubbleManager = new BubbleManager (this); + setWidget(m_bubbleManager); // Set event filter m_window.installEventFilter(this); @@ -76,7 +75,7 @@ m_bubbleManager->handleOrientationChange(m_window.orientation()); // change exit softkey to back button - m_backAction = new HbAction(Hb::BackAction, this); + m_backAction = new HbAction(Hb::BackNaviAction, this); connect(m_backAction, SIGNAL(triggered()), this, SLOT(backButtonClicked())); setNavigationAction(m_backAction); @@ -424,20 +423,21 @@ bool PhoneUIQtView::eventFilter(QObject * /*watched*/, QEvent * event) { - if (event->type() == QEvent::KeyPress) { + PHONE_DEBUG2("PhoneUIQtView::eventFilter event type:", event->type()); + if(event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); PHONE_DEBUG2("PhoneUIQtView::eventFilter pressed key:", keyEvent->key()); - if(keyEvent->key() == Qt::Key_No) { - m_longPressTimer->stop(); - m_longPressTimer->start(LongKeyPressTimeOut); - } - emit keyPressed(keyEvent); + PHONE_DEBUG2("PhoneUIQtView::eventFilter isAutoRepeat:", keyEvent->isAutoRepeat()); + emit keyPressed(keyEvent); + keyEvent->accept(); + return false; - } else if (event->type() == QEvent::KeyRelease) { - m_longPressTimer->stop(); + } else if(event->type() == QEvent::KeyRelease) { QKeyEvent *keyEvent = static_cast(event); PHONE_DEBUG2("PhoneUIQtView::eventFilter released key:", keyEvent->key()); emit keyReleased(keyEvent); + keyEvent->accept(); + return false; } else { return false; @@ -446,8 +446,11 @@ void PhoneUIQtView::setDialpadPosition() { - QRectF screenRect = m_window.layoutRect(); - + // workaround to tsw error JMKN-83NAPU (fix coming in MCL wk14) + // QRectF screenRect(m_window.layoutRect()); + QRectF screenRect = (m_window.orientation() == Qt::Horizontal) ? + QRectF(0,0,640,360) : QRectF(0,0,360,640); + if (m_window.orientation() == Qt::Horizontal) { // dialpad takes half of the screen m_dialpad->setPos(QPointF(screenRect.width()/2, @@ -497,10 +500,3 @@ setNavigationAction(0); } } - -void PhoneUIQtView::longEndKeyPressEvent() -{ - Q_ASSERT(m_longPressTimer); - m_longPressTimer->stop(); - emit endKeyLongPress(); -} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.h --- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.h Mon May 03 12:31:11 2010 +0300 @@ -19,7 +19,7 @@ #define HBVOLUMESLIDERPOPUP_H #include -#include +#include extern bool m_volumeSliderContructorCalled; extern bool m_volumeSliderDesctructorCalled; @@ -49,7 +49,7 @@ void setTimeout (int time); void show(); void hide(); - void setDismissPolicy( HbPopupBase::DismissPolicy value ) {;}; + void setDismissPolicy( HbPopup::DismissPolicy value ) {;}; int minimum() {return m_sliderRangeMin;}; int maximum() {return m_sliderRangeMax;}; bool isVisible() {return m_isVisible;}; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp --- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 @@ -20,13 +20,16 @@ #include #include #include +#include +#include #include -#include #include #include #include #include +#define protected public #include "phoneuiqtview.h" +#undef public #include "phoneaction.h" #include #include @@ -89,7 +92,7 @@ void testShowDialpad(); void testDialpadText(); void testSetMenuActions(); - void testLongEndKeyPressEvent(); + void testLongEndKeyPressEventOutsideTelephony(); private: int createCallHeader(); @@ -387,12 +390,15 @@ return bubble; } -void TestPhoneUIQtView::testLongEndKeyPressEvent() +void TestPhoneUIQtView::testLongEndKeyPressEventOutsideTelephony() { - QSignalSpy spy(m_view, SIGNAL(endKeyLongPress())); - m_view->longEndKeyPressEvent(); - QVERIFY(m_qtimer_stop_called == true); - QCOMPARE(spy.count(), 1); + /*QSignalSpy spy(m_view, SIGNAL(endKeyLongPress())); + QKeyEvent* event = new QKeyEvent(QEvent::ShortcutOverride, Qt::Key_No, Qt::NoModifier); + + bool returnValue = m_view->eventFilter(new QObject(), event); + + QVERIFY(returnValue == true); + QCOMPARE(spy.count(), 1);*/ } PHONE_QT_VIEW_TEST_MAIN(TestPhoneUIQtView) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro --- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro Mon May 03 12:31:11 2010 +0300 @@ -34,7 +34,8 @@ LIBS += -lbubblemanager2 \ -lxqserviceutil \ - -ldialpad + -ldialpad \ + -lxqkeycapture DEFINES += FT_SYMBIAN_INTEGRATION } else:win32 { diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/bwins/audiohandlingu.def --- a/phoneengine/audiohandling/bwins/audiohandlingu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/bwins/audiohandlingu.def Mon May 03 12:31:11 2010 +0300 @@ -13,14 +13,13 @@ ?PlayDtmfTone@CPEGsmAudioData@@QBEXABVTChar@@@Z @ 12 NONAME ; void CPEGsmAudioData::PlayDtmfTone(class TChar const &) const ?CreateAudioToneUtilityL@CPEAudioFactory@@UAEPAVCPEAudioToneUtility@@AAVMMdaAudioToneObserver@@@Z @ 13 NONAME ; class CPEAudioToneUtility * CPEAudioFactory::CreateAudioToneUtilityL(class MMdaAudioToneObserver &) ?CallAudioRoutePreferenceChanged@CPEAudioData@@UAEHXZ @ 14 NONAME ; int CPEAudioData::CallAudioRoutePreferenceChanged(void) - ?SetDefaultVolume@CPEAudioData@@QAEXXZ @ 15 NONAME ; void CPEAudioData::SetDefaultVolume(void) - ?HandleCallEnding@CPEAudioData@@UAEXXZ @ 16 NONAME ; void CPEAudioData::HandleCallEnding(void) - ?NewLC@CPEAudioFactory@@SAPAV1@XZ @ 17 NONAME ; class CPEAudioFactory * CPEAudioFactory::NewLC(void) - ?StartUp@CPEAudioData@@UAEXXZ @ 18 NONAME ; void CPEAudioData::StartUp(void) - ?GetAudioMuteSync@CPEAudioData@@UBEXAAH@Z @ 19 NONAME ; void CPEAudioData::GetAudioMuteSync(int &) const - ?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 20 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &) - ?StopDtmfTonePlay@CPEGsmAudioData@@UAEXXZ @ 21 NONAME ; void CPEGsmAudioData::StopDtmfTonePlay(void) - ?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@AAVCPEAudioFactory@@@Z @ 22 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &, class CPEAudioFactory &) - ?SetAudioVolumeSync@CPEAudioData@@UAEXH@Z @ 23 NONAME ; void CPEAudioData::SetAudioVolumeSync(int) - ?PlayInbandTone@CPEGsmAudioData@@QAEXXZ @ 24 NONAME ; void CPEGsmAudioData::PlayInbandTone(void) + ?HandleCallEnding@CPEAudioData@@UAEXXZ @ 15 NONAME ; void CPEAudioData::HandleCallEnding(void) + ?NewLC@CPEAudioFactory@@SAPAV1@XZ @ 16 NONAME ; class CPEAudioFactory * CPEAudioFactory::NewLC(void) + ?StartUp@CPEAudioData@@UAEXXZ @ 17 NONAME ; void CPEAudioData::StartUp(void) + ?GetAudioMuteSync@CPEAudioData@@UBEXAAH@Z @ 18 NONAME ; void CPEAudioData::GetAudioMuteSync(int &) const + ?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 19 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &) + ?StopDtmfTonePlay@CPEGsmAudioData@@UAEXXZ @ 20 NONAME ; void CPEGsmAudioData::StopDtmfTonePlay(void) + ?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@AAVCPEAudioFactory@@@Z @ 21 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &, class CPEAudioFactory &) + ?SetAudioVolumeSync@CPEAudioData@@UAEXH@Z @ 22 NONAME ; void CPEAudioData::SetAudioVolumeSync(int) + ?PlayInbandTone@CPEGsmAudioData@@QAEXXZ @ 23 NONAME ; void CPEGsmAudioData::PlayInbandTone(void) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/eabi/audiohandlingu.def --- a/phoneengine/audiohandling/eabi/audiohandlingu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/eabi/audiohandlingu.def Mon May 03 12:31:11 2010 +0300 @@ -2,54 +2,53 @@ _ZN12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 1 NONAME _ZN12CPEAudioData16HandleCallEndingEv @ 2 NONAME _ZN12CPEAudioData16SetAudioMuteSyncEi @ 3 NONAME - _ZN12CPEAudioData16SetDefaultVolumeEv @ 4 NONAME - _ZN12CPEAudioData18HandleCallStartingEi @ 5 NONAME - _ZN12CPEAudioData18SetAudioVolumeSyncEi @ 6 NONAME - _ZN12CPEAudioData27HandleEnergencyCallStartingEv @ 7 NONAME - _ZN12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 8 NONAME - _ZN12CPEAudioData7StartUpEv @ 9 NONAME - _ZN12CPEAudioDataD0Ev @ 10 NONAME - _ZN12CPEAudioDataD1Ev @ 11 NONAME - _ZN12CPEAudioDataD2Ev @ 12 NONAME - _ZN15CPEAudioFactory23CreateAudioToneUtilityLER21MMdaAudioToneObserver @ 13 NONAME - _ZN15CPEAudioFactory28CreateTelephonyAudioRoutingLER30MTelephonyAudioRoutingObserver @ 14 NONAME - _ZN15CPEAudioFactory5NewLCEv @ 15 NONAME - _ZN15CPEAudioFactoryC1Ev @ 16 NONAME - _ZN15CPEAudioFactoryC2Ev @ 17 NONAME - _ZN15CPEGsmAudioData14PlayInbandToneEv @ 18 NONAME - _ZN15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 19 NONAME - _ZN15CPEGsmAudioData16StopDtmfTonePlayEv @ 20 NONAME - _ZN15CPEGsmAudioData18StopInbandTonePlayEv @ 21 NONAME - _ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFs @ 22 NONAME - _ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFsR15CPEAudioFactory @ 23 NONAME - _ZN15CPEGsmAudioDataD0Ev @ 24 NONAME - _ZN15CPEGsmAudioDataD1Ev @ 25 NONAME - _ZN15CPEGsmAudioDataD2Ev @ 26 NONAME - _ZNK12CPEAudioData16GetAudioMuteSyncERi @ 27 NONAME - _ZNK12CPEAudioData18GetAudioVolumeSyncERi @ 28 NONAME - _ZNK15CPEGsmAudioData12PlayDtmfToneERK5TChar @ 29 NONAME - _ZTI12CPEAudioData @ 30 NONAME ; ## - _ZTI15CPEGsmAudioData @ 31 NONAME ; ## - _ZTI22CPEAudioDtmfTonePlayer @ 32 NONAME ; ## - _ZTI22CPEAudioRoutingMonitor @ 33 NONAME ; ## - _ZTI24CPEAudioInbandTonePlayer @ 34 NONAME ; ## - _ZTI26CPECallAudioRoutingHandler @ 35 NONAME ; ## - _ZTV12CPEAudioData @ 36 NONAME ; ## - _ZTV15CPEGsmAudioData @ 37 NONAME ; ## - _ZTV22CPEAudioDtmfTonePlayer @ 38 NONAME ; ## - _ZTV22CPEAudioRoutingMonitor @ 39 NONAME ; ## - _ZTV24CPEAudioInbandTonePlayer @ 40 NONAME ; ## - _ZTV26CPECallAudioRoutingHandler @ 41 NONAME ; ## - _ZThn4_N12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 42 NONAME ; ## - _ZThn4_N12CPEAudioData16HandleCallEndingEv @ 43 NONAME ; ## - _ZThn4_N12CPEAudioData16SetAudioMuteSyncEi @ 44 NONAME ; ## - _ZThn4_N12CPEAudioData18HandleCallStartingEi @ 45 NONAME ; ## - _ZThn4_N12CPEAudioData18SetAudioVolumeSyncEi @ 46 NONAME ; ## - _ZThn4_N12CPEAudioData27HandleEnergencyCallStartingEv @ 47 NONAME ; ## - _ZThn4_N12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 48 NONAME ; ## - _ZThn4_N12CPEAudioData7StartUpEv @ 49 NONAME ; ## - _ZThn4_N15CPEGsmAudioData16StopDtmfTonePlayEv @ 50 NONAME ; ## - _ZThn4_NK12CPEAudioData16GetAudioMuteSyncERi @ 51 NONAME ; ## - _ZThn4_NK12CPEAudioData18GetAudioVolumeSyncERi @ 52 NONAME ; ## - _ZThn72_N15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 53 NONAME ; ## + _ZN12CPEAudioData18HandleCallStartingEi @ 4 NONAME + _ZN12CPEAudioData18SetAudioVolumeSyncEi @ 5 NONAME + _ZN12CPEAudioData27HandleEnergencyCallStartingEv @ 6 NONAME + _ZN12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 7 NONAME + _ZN12CPEAudioData7StartUpEv @ 8 NONAME + _ZN12CPEAudioDataD0Ev @ 9 NONAME + _ZN12CPEAudioDataD1Ev @ 10 NONAME + _ZN12CPEAudioDataD2Ev @ 11 NONAME + _ZN15CPEAudioFactory23CreateAudioToneUtilityLER21MMdaAudioToneObserver @ 12 NONAME + _ZN15CPEAudioFactory28CreateTelephonyAudioRoutingLER30MTelephonyAudioRoutingObserver @ 13 NONAME + _ZN15CPEAudioFactory5NewLCEv @ 14 NONAME + _ZN15CPEAudioFactoryC1Ev @ 15 NONAME + _ZN15CPEAudioFactoryC2Ev @ 16 NONAME + _ZN15CPEGsmAudioData14PlayInbandToneEv @ 17 NONAME + _ZN15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 18 NONAME + _ZN15CPEGsmAudioData16StopDtmfTonePlayEv @ 19 NONAME + _ZN15CPEGsmAudioData18StopInbandTonePlayEv @ 20 NONAME + _ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFs @ 21 NONAME + _ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFsR15CPEAudioFactory @ 22 NONAME + _ZN15CPEGsmAudioDataD0Ev @ 23 NONAME + _ZN15CPEGsmAudioDataD1Ev @ 24 NONAME + _ZN15CPEGsmAudioDataD2Ev @ 25 NONAME + _ZNK12CPEAudioData16GetAudioMuteSyncERi @ 26 NONAME + _ZNK12CPEAudioData18GetAudioVolumeSyncERi @ 27 NONAME + _ZNK15CPEGsmAudioData12PlayDtmfToneERK5TChar @ 28 NONAME + _ZTI12CPEAudioData @ 29 NONAME + _ZTI15CPEGsmAudioData @ 30 NONAME + _ZTI22CPEAudioDtmfTonePlayer @ 31 NONAME + _ZTI22CPEAudioRoutingMonitor @ 32 NONAME + _ZTI24CPEAudioInbandTonePlayer @ 33 NONAME + _ZTI26CPECallAudioRoutingHandler @ 34 NONAME + _ZTV12CPEAudioData @ 35 NONAME + _ZTV15CPEGsmAudioData @ 36 NONAME + _ZTV22CPEAudioDtmfTonePlayer @ 37 NONAME + _ZTV22CPEAudioRoutingMonitor @ 38 NONAME + _ZTV24CPEAudioInbandTonePlayer @ 39 NONAME + _ZTV26CPECallAudioRoutingHandler @ 40 NONAME + _ZThn4_N12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 41 NONAME + _ZThn4_N12CPEAudioData16HandleCallEndingEv @ 42 NONAME + _ZThn4_N12CPEAudioData16SetAudioMuteSyncEi @ 43 NONAME + _ZThn4_N12CPEAudioData18HandleCallStartingEi @ 44 NONAME + _ZThn4_N12CPEAudioData18SetAudioVolumeSyncEi @ 45 NONAME + _ZThn4_N12CPEAudioData27HandleEnergencyCallStartingEv @ 46 NONAME + _ZThn4_N12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 47 NONAME + _ZThn4_N12CPEAudioData7StartUpEv @ 48 NONAME + _ZThn4_N15CPEGsmAudioData16StopDtmfTonePlayEv @ 49 NONAME + _ZThn4_NK12CPEAudioData16GetAudioMuteSyncERi @ 50 NONAME + _ZThn4_NK12CPEAudioData18GetAudioVolumeSyncERi @ 51 NONAME + _ZThn68_N15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 52 NONAME diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/group/audiohandling.mmp --- a/phoneengine/audiohandling/group/audiohandling.mmp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/group/audiohandling.mmp Mon May 03 12:31:11 2010 +0300 @@ -25,6 +25,12 @@ CAPABILITY CAP_GENERAL_DLL + +#ifndef WINSCW +EpocAllowDllData +#endif + + //MACRO UNIT_TESTING //defined if running T_AudoHandlingMT tests SOURCEPATH ../src @@ -36,7 +42,8 @@ SOURCE peaudiohandlingpanic.cpp SOURCE cpecallaudioroutinghandler.cpp SOURCE cpeaudiofactory.cpp -SOURCE cpeaudiotoneutilityimpl.cpp +SOURCE cpeaudiotoneutilityimpl.cpp +SOURCE cpeaudioeffect.cpp START RESOURCE ../data/defaultbeep.rss TARGETPATH RESOURCE_FILES_DIR @@ -52,6 +59,12 @@ SYSTEMINCLUDE /epoc32/include/mmf/server SYSTEMINCLUDE /epoc32/include/mmf/common + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_GLIB_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/stdapis/stlport + LIBRARY bafl.lib LIBRARY cce.lib LIBRARY telephonyaudiorouting.lib @@ -63,4 +76,8 @@ LIBRARY mediaclientaudio.lib LIBRARY mmfdevsound.lib +LIBRARY tmsfactory.lib +LIBRARY tmsapi.lib +LIBRARY libglib.lib + LANG SC \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/inc/cpeaudiodata.h --- a/phoneengine/audiohandling/inc/cpeaudiodata.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/inc/cpeaudiodata.h Mon May 03 12:31:11 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-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" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: This file contains the header file of the class CPEAudioData +* Description: This file contains the header file of the class CPEAudioData * which is the interface class for Audio Handling Module * */ @@ -23,8 +23,12 @@ // INCLUDES #include "mpeaudiodata.h" #include - + #include +#include +#include + + // CONSTANTS // None. @@ -37,6 +41,8 @@ // FUNCTION PROTOTYPES // None. +using namespace TMS; + // FORWARD DECLARATIONS class MPEPhoneModelInternal; class CPEAudioDtmfTonePlayer; @@ -44,22 +50,23 @@ class CPECallAudioRoutingHandler; class CPEAudioFactory; class CTelephonyAudioRouting; +class CPEAudioEffect; // CLASS DECLARATION /** -* This file contains the header file of the class CPEAudioData, -* which is an interface class to audio +* This file contains the header file of the class CPEAudioData, +* which is an interface class to audio * properties of the system * * @lib audiohandling.lib * @since S60_5.0 */ -class CPEAudioData: - public CBase, - public MPEAudioData +class CPEAudioData : public CBase, + public MPEAudioData, + public TMSEffectObserver { - + public: /** @@ -75,7 +82,7 @@ CPEAudioData( MPEPhoneModelInternal& aPhoneModel ); public: // from MPEAudioData - + /** * Retrieves Audio mute synchronously. * @param aAudioMute, audio mute is returned in this parameter. @@ -87,7 +94,7 @@ * @param aAudioVolume, audio volume is returned in this parameter. */ IMPORT_C void GetAudioVolumeSync( TInt& aAudioVolume ) const; - + /** * Makes synchronous request to set Audio Mute. * @param aAudioMute, mute to be set. @@ -106,47 +113,42 @@ * @param aShowNote, audio note status * @return KErrNone or possible errorcode. */ - IMPORT_C TInt SetAudioOutput( + IMPORT_C TInt SetAudioOutput( const TPEAudioOutput aOutput, TBool aShowNote ); - + /** - * Gets volume levels, audio mute, audio mode and audio volume + * Gets volume levels, audio mute, audio mode and audio volume * at startup and starts monitors. * @param None. * @return None. */ IMPORT_C void StartUp(); - - /** - * Sets default volume level if muted when call ended - */ - IMPORT_C void SetDefaultVolume(); - + /** * Handles call audio route preference changed */ IMPORT_C TInt CallAudioRoutePreferenceChanged(); - + /** * Initialises call audio route when call is alerting or answered */ IMPORT_C TInt HandleCallStarting( TBool aVideoCall ); - + /** * Initialises energency call audio route */ IMPORT_C TInt HandleEnergencyCallStarting(); - + /** * Ends call audio route when call disconnected */ IMPORT_C void HandleCallEnding(); - + public: // new - + /** - * Sends AudioHandlingError message to PhoneEngine and saves + * Sends AudioHandlingError message to PhoneEngine and saves * errorcode to member variable. * @param aErrorCode, errorcode that is saved to member variable. * @return None. @@ -158,7 +160,7 @@ * @param aMessage, message to be forwarded. * @return None. */ - void SendMessage( + void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ); /** @@ -167,7 +169,7 @@ * @param aOutput, audio output path that is saved in member variable. * @return None. */ - void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, + void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, const CTelephonyAudioRouting::TAudioOutput aOutput ); /** @@ -176,82 +178,87 @@ * @param aOutput, audio output path that is saved in member variable. * @return None. */ - void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, + void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, CTelephonyAudioRouting& aTelephonyAudioRouting ); /** * Sets value of audio routing preference - */ + */ void SetRoutePreference( TBool aShowNote ); /** * Return value of audio routing preference */ CTelephonyAudioRouting::TAudioOutput RoutePreference(); - + /** * Return value of previous output - */ + */ CTelephonyAudioRouting::TAudioOutput PreviousOutput(); - + /** * Return value of current output - */ + */ CTelephonyAudioRouting::TAudioOutput Output(); - + /** * Return status of wired accessory availability */ TBool IsWiredAvailable(); - + /** * Return status of BT accessory availability - */ + */ TBool IsBTAvailable(); /** * Return status of TTY accessory availability - */ + */ TBool IsTTYAvailable(); - + /** * Set new audio route to TAR */ void SetTAROutput( CTelephonyAudioRouting::TAudioOutput aOutput, TBool aShowNote ); - + + /** + * From TMSEffectObserver + */ + void EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent event); protected: /** - * By default Symbian 2nd phase constructor is private, but we use + * By default Symbian 2nd phase constructor is private, but we use * it at generalized class. */ - void ConstructL( CPEAudioFactory& aAudioFactory ); + void ConstructL( CPEAudioFactory& aAudioFactory ); protected: // New functions - + /** - * Protected function for derived classes to implement for - * extended volume handling. Default implementation is empty. + * Updates volume on DataStore and if aSendMsg==ETrue sends + * notification to engine monitor. * @since S60 v5.0 * @param aVolume New volume value. + * @param aSendMsg ETrue will send notification. */ - virtual void DoHandleVolumeChange( TInt aVolume ); - + virtual void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse ); + private: - + /** - * Gets all audio volume values from reporitory and update member variables + * Gets all audio volume value and update member variable */ - void InitializeAudioVolumes(); - - + void InitializeAudioVolume(); + + /** * Makes request to Telephony Audio Routing to get available audio outputs * @return list of available outputs */ - TArray< TPEAudioOutput> GetAvailableOutputs( + TArray< TPEAudioOutput> GetAvailableOutputs( CTelephonyAudioRouting& aTelephonyAudioRouting ); /** @@ -261,15 +268,11 @@ /** * Converts PE route value to TAR value - */ + */ CTelephonyAudioRouting::TAudioOutput ConvertToTAR( TPEAudioOutput aOutput ); - /** - * Return status of mic mute - */ - TBool IsMuted() const; protected: - // CPhoneModel object which owns this object. + // CPhoneModel object which owns this object. MPEPhoneModelInternal& iPhoneModel; // Audio Routing Monitor CPEAudioRoutingMonitor* iAudioRoutingMonitor; @@ -281,19 +284,10 @@ RArray iPEavailableOutputs; //Flag to indicate whether is Call audio route initialized TBool iRouteInitialized; - #ifdef __WINSCW__ - // dummy implementation for WINSCW - TInt iVolume; - TBool iMute; - #endif - // HeadSet Mode Audio volume - TInt iHeadSetVolume; - // Loudspeaker Mode Audio volume - TInt iLoudspeakerVolume; - // ETrue when audio output changed - TBool iAudioOutputChanged; + + CPEAudioEffect* iAudioEffect; }; -#endif // CPEAUDIODATA_H - +#endif // CPEAUDIODATA_H + // End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/inc/cpeaudioeffect.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/audiohandling/inc/cpeaudioeffect.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,93 @@ +/* + * 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: Audio Effects handler + * + */ + +#ifndef CPEAUDIOEFFECT_H +#define CPEAUDIOEFFECT_H + +#include +#include + +namespace TMS { +//FORWARD DECLARATIONS +class TMSFactory; +} //namespace TMS + +using namespace TMS; + +/** + * Starts and stops TMS audio streams. + * If the activation fails then there is a retry timer which + * will try the activation later. + */ +NONSHARABLE_CLASS(CPEAudioEffect) : public CBase + { +public: + + /** + * Two-phased constructing. + */ + static CPEAudioEffect* NewL(TMSEffectObserver& aObserver); + + /** + * Two-phased constructing. + */ + static CPEAudioEffect* NewLC(TMSEffectObserver& aObserver); + + /** + * C++ default destructor. + */ + virtual ~CPEAudioEffect(); + + /** + * Set muted. + */ + TInt SetMuteState(TBool aMute); + /** + * Get mute. + */ + TBool MuteState() const; + + /** + * Set volume. + */ + void SetVolume(TInt aVolume); + + /** + * Get volume. + */ + TInt Volume() const; + +public: + // Functions from base classes + +private: + + /** + * C++ default constructor. + */ + CPEAudioEffect(); + + void ConstructL(TMSEffectObserver& aObserver); + +private: + // data + TMSFactory* iFactory; + TMSEffect* iGlobalVol; + TMSEffect* iGlobalGain; + }; + +#endif // CPEAUDIOEFFECT_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/inc/cpegsmaudiodata.h --- a/phoneengine/audiohandling/inc/cpegsmaudiodata.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/inc/cpegsmaudiodata.h Mon May 03 12:31:11 2010 +0300 @@ -130,7 +130,7 @@ protected: // From CPEAudioData - void DoHandleVolumeChange( TInt aVolume ); + void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse ); private: /** diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/src/cpeaudiodata.cpp --- a/phoneengine/audiohandling/src/cpeaudiodata.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/src/cpeaudiodata.cpp Mon May 03 12:31:11 2010 +0300 @@ -1,21 +1,20 @@ /* -* 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: This module contains the implementation of AudioData class -* member functions -* -*/ - + * Copyright (c) 2002-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 module contains the implementation of AudioData class + * member functions + * + */ // INCLUDE FILES #include "cpeaudiodata.h" @@ -27,16 +26,20 @@ #include #include #include - +#include +#include +#include #include "pepanic.pan" #include "cpeaudiodtmftoneplayer.h" #include "cpeaudioroutingmonitor.h" #include "cpecallaudioroutinghandler.h" -#include "cpeaudiofactory.h" +#include "cpeaudiofactory.h" +#include "cpeaudioeffect.h" + #include + // CONSTANTS //Mute Value for volume -const TInt KPEDefaultVolume = 4; const TInt KPEMaxVolume = 10; // ================= MEMBER FUNCTIONS ======================= @@ -47,12 +50,10 @@ // might leave. // ----------------------------------------------------------------------------- // -CPEAudioData::CPEAudioData( - MPEPhoneModelInternal& aPhoneModel - ) : iPhoneModel( aPhoneModel ) +CPEAudioData::CPEAudioData(MPEPhoneModelInternal& aPhoneModel) : + iPhoneModel(aPhoneModel) { iRouteInitialized = EFalse; - iAudioOutputChanged = EFalse; } // ----------------------------------------------------------------------------- @@ -60,66 +61,47 @@ // Symbian 2nd phase constructor can leave // ----------------------------------------------------------------------------- // -void CPEAudioData::ConstructL( CPEAudioFactory& aAudioFactory ) +void CPEAudioData::ConstructL(CPEAudioFactory& aAudioFactory) { TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioData::ConstructL start" ); - iAudioRoutingMonitor = CPEAudioRoutingMonitor::NewL( *this ); - iAudioRouting = aAudioFactory.CreateTelephonyAudioRoutingL(*iAudioRoutingMonitor); - iAudioRoutingHandler = CPECallAudioRoutingHandler::NewL( *this ); - - //Gets audio volumes from repository - InitializeAudioVolumes(); - - RProperty::TType type( RProperty::EInt ); - TSecurityPolicy readPolicy( ECapability_None ); - TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); - - RProperty::Define( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - type, - readPolicy, - writePolicy ); - - TEFLOGSTRING( KTAINT, "AUD CPEAudioData::ConstructL complete" ); + iAudioRoutingMonitor = CPEAudioRoutingMonitor::NewL(*this); + iAudioRouting = aAudioFactory.CreateTelephonyAudioRoutingL( + *iAudioRoutingMonitor); + iAudioRoutingHandler = CPECallAudioRoutingHandler::NewL(*this); + iAudioEffect = CPEAudioEffect::NewL(*this); + + InitializeAudioVolume(); + + TEFLOGSTRING( KTAINT, "AUD CPEAudioData::ConstructL complete" ); } // Destructor EXPORT_C CPEAudioData::~CPEAudioData() { TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioData::~CPEAudioData" ); - + delete iAudioRouting; delete iAudioRoutingMonitor; delete iAudioRoutingHandler; - + iPEavailableOutputs.Close(); + delete iAudioEffect; } // ----------------------------------------------------------------------------- -// CPEAudioData::InitializeAudioVolumes -// Gets audio volume values from reporitory +// CPEAudioData::InitializeAudioVolume +// Gets audio volume value // ----------------------------------------------------------------------------- -// -void CPEAudioData::InitializeAudioVolumes() +// +void CPEAudioData::InitializeAudioVolume() { -// Connect to CPEGsmExternalDataHandler missing from TEPhoneEngineTestUtils wrapper !!! - TInt volume; - - iPhoneModel.DataStoreExt()->Get( - EPEIncallLoudspeakerVolumeSetting, volume ); - iLoudspeakerVolume = volume; - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::CPEAudioData, DataStoreExt()->Get, iLoudspeakerVolume = %d", - iLoudspeakerVolume ); - - iPhoneModel.DataStoreExt()->Get( - EPEIncallEarVolumeSetting, volume ); - iHeadSetVolume = volume; - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::CPEAudioData, DataStoreExt()->Get, iLoudspeakerVolume = %d", - iHeadSetVolume ); + TInt volume = iAudioEffect->Volume(); + iPhoneModel.DataStore()->SetAudioVolume(volume); + TEFLOGSTRING2( KTAINT, + "AUD CPEAudioData::InitializeAudioVolumes, volume = %d", + volume ); } // ----------------------------------------------------------------------------- @@ -128,19 +110,14 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -EXPORT_C void CPEAudioData::GetAudioMuteSync( - TBool& aAudioMute ) const +EXPORT_C void CPEAudioData::GetAudioMuteSync(TBool& aAudioMute) const { - TEFLOGSTRING( KTAINT, "AUD CPEAudioData::GetAudioMuteSync" ); - if ( IsMuted() ) - { - //mute is on - aAudioMute = ETrue; - } - else - { - aAudioMute = EFalse; - } + aAudioMute = iAudioEffect->MuteState(); + TEFLOGSTRING2( + KTAREQIN, + "AUD CPEAudioData::GetAudioMuteSync: value = %d", + aAudioMute); + } // ----------------------------------------------------------------------------- @@ -148,25 +125,10 @@ // Creates synchronous request to get audio volume. // ----------------------------------------------------------------------------- // -EXPORT_C void CPEAudioData::GetAudioVolumeSync( - TInt& aAudioVolume ) const +EXPORT_C void CPEAudioData::GetAudioVolumeSync(TInt& aAudioVolume) const { TEFLOGSTRING( KTAINT, "AUD CPEAudioData::GetAudioVolumeSync" ); - - if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker ) - { - iPhoneModel.DataStoreExt()->Get( - EPEIncallLoudspeakerVolumeSetting, aAudioVolume ); - TEFLOGSTRING( KTAINT, - "AUD CPEAudioData::GetAudioVolumeSync: EPEIncallLoudspeakerVolumeSetting"); - } - else - { - iPhoneModel.DataStoreExt()->Get( - EPEIncallEarVolumeSetting, aAudioVolume ); - TEFLOGSTRING( KTAINT, - "AUD CPEAudioData::GetAudioVolumeSync: EPEIncallEarVolumeSetting"); - } + aAudioVolume = iAudioEffect->Volume(); } // ----------------------------------------------------------------------------- @@ -174,14 +136,13 @@ // Saves errorcode to member variable and sends error notification to PhoneEngine. // ----------------------------------------------------------------------------- // -void CPEAudioData::SendErrorMessage( - const TInt aErrorCode ) +void CPEAudioData::SendErrorMessage(const TInt aErrorCode) { - iPhoneModel.DataStore()->SetErrorCode( aErrorCode ); - TEFLOGSTRING( - KTAREQOUT, - "AUD CPEAudioData::SendErrorMessage: iPhoneModel.SendMessage( MEngineMonitor::EPEMessageAudioHandlingError )" ); - iPhoneModel.SendMessage( MEngineMonitor::EPEMessageAudioHandlingError ); + iPhoneModel.DataStore()->SetErrorCode(aErrorCode); + TEFLOGSTRING( + KTAREQOUT, + "AUD CPEAudioData::SendErrorMessage: iPhoneModel.SendMessage( MEngineMonitor::EPEMessageAudioHandlingError )" ); + iPhoneModel.SendMessage(MEngineMonitor::EPEMessageAudioHandlingError); } // ----------------------------------------------------------------------------- @@ -189,41 +150,22 @@ // Forwards message to PhoneEngine. // ----------------------------------------------------------------------------- // -void CPEAudioData::SendMessage( - const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) +void CPEAudioData::SendMessage( + const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage) { - TEFLOGSTRING2( KTAREQIN, - "AUD CPEAudioData::SendMessage: aMessage = %d", aMessage ); - - if ( aMessage == MEngineMonitor::EPEMessageAudioVolumeChanged ) - { + TEFLOGSTRING2( KTAREQIN, + "AUD CPEAudioData::SendMessage: aMessage = %d", aMessage ); + + if (aMessage == MEngineMonitor::EPEMessageAudioVolumeChanged) + { // update volume - if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker ) - { - iLoudspeakerVolume = iPhoneModel.DataStore()->AudioVolume(); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: iLoudspeakerVolume = %d", - iLoudspeakerVolume ); - } - else - { - iHeadSetVolume = iPhoneModel.DataStore()->AudioVolume(); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: iHeadSetVolume = %d", - iHeadSetVolume ); - } - - if ( !iAudioOutputChanged ) - { - // EPEMessageAudioVolumeChanged message must not be sent - // while audio output change is being processed - iPhoneModel.SendMessage( aMessage ); - } - } - else - { - iPhoneModel.SendMessage( aMessage ); - } + TInt volume = iPhoneModel.DataStore()->AudioVolume(); + TEFLOGSTRING2( KTAINT, + "AUD CPEAudioData::SendMessage: volume = %d", + volume ); + } + + iPhoneModel.SendMessage(aMessage); } // ----------------------------------------------------------------------------- @@ -231,75 +173,30 @@ // Forwards message to PhoneEngine. Output mode is saved. // ----------------------------------------------------------------------------- // -void CPEAudioData::SendMessage( +void CPEAudioData::SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, - const CTelephonyAudioRouting::TAudioOutput aOutput ) + const CTelephonyAudioRouting::TAudioOutput aOutput) { - TEFLOGSTRING3( - KTAREQIN, - "AUD CPEAudioData::SendMessage: aMessage = %d, aOutput = %d", - aMessage, aOutput ); - + TEFLOGSTRING3( + KTAREQIN, + "AUD CPEAudioData::SendMessage: aMessage = %d, aOutput = %d", + aMessage, aOutput ); + // BT long key press requires manual re-route to handset or loudspeaker - if ( aOutput == CTelephonyAudioRouting::ENone && - iAudioRouting->PreviousOutput() == CTelephonyAudioRouting::EBTAudioAccessory ) + if (aOutput == CTelephonyAudioRouting::ENone + && iAudioRouting->PreviousOutput() + == CTelephonyAudioRouting::EBTAudioAccessory) { - SetRoutePreference( ETrue ); + SetRoutePreference(ETrue); } else { - // store the old audio path volume - if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker ) - { - iLoudspeakerVolume = iPhoneModel.DataStore()->AudioVolume(); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: iLoudspeakerVolume = %d", - iLoudspeakerVolume ); - } - else - { - iHeadSetVolume = iPhoneModel.DataStore()->AudioVolume(); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: iHeadSetVolume = %d", - iHeadSetVolume ); - } - // update the audio values in engineinfo TBool status; - iAudioRouting->GetShowNote( status ); - iPhoneModel.DataStore()->SetAudioOutput( ConvertToPE( aOutput ), ConvertToPE( PreviousOutput() ), status ); - - // Set audio output change flag - iAudioOutputChanged = ( MEngineMonitor::EPEMessageAudioOutputChanged == aMessage ); - - // restore the stored volume for the new path - if ( aOutput == CTelephonyAudioRouting::ELoudspeaker ) - { - // restore the stored volume for the new path - SetAudioVolumeSync( iLoudspeakerVolume ); - iPhoneModel.DataStore()->SetAudioVolume( iLoudspeakerVolume ); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: DataStoreExt()->Set, iLoudspeakerVolume = %d", - iLoudspeakerVolume ); - iPhoneModel.DataStoreExt()->Set( EPEIncallLoudspeakerVolumeSetting, - iLoudspeakerVolume ); - } - else - { - // restore the stored volume for the new path - SetAudioVolumeSync( iHeadSetVolume ); - iPhoneModel.DataStore()->SetAudioVolume( iHeadSetVolume ); - TEFLOGSTRING2( KTAINT, - "AUD CPEAudioData::SendMessage: DataStoreExt()->Set, iHeadSetVolume = %d", - iHeadSetVolume ); - iPhoneModel.DataStoreExt()->Set( EPEIncallEarVolumeSetting, - iHeadSetVolume ); - } - - // Reset audio output change flag - iAudioOutputChanged = EFalse; - - iPhoneModel.SendMessage( aMessage ); + iAudioRouting->GetShowNote(status); + iPhoneModel.DataStore()->SetAudioOutput(ConvertToPE(aOutput), + ConvertToPE(PreviousOutput()), status); + iPhoneModel.SendMessage(aMessage); } } @@ -307,24 +204,24 @@ // CPEAudioData::SendMessage // Forwards message to PhoneEngine. // ----------------------------------------------------------------------------- -// -void CPEAudioData::SendMessage( - const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, - CTelephonyAudioRouting& aTelephonyAudioRouting ) +// +void CPEAudioData::SendMessage( + const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, + CTelephonyAudioRouting& aTelephonyAudioRouting) { - TEFLOGSTRING2( - KTAREQIN, - "AUD CPEAudioData::SendMessage: aMessage = %d, available outputs changed ", aMessage ); - iPhoneModel.DataStore()->SetAvailableAudioOutputs( - GetAvailableOutputs( aTelephonyAudioRouting ) ); - - if ( iRouteInitialized && - aMessage == MEngineMonitor::EPEMessageAvailableAudioOutputsChanged ) + TEFLOGSTRING2( + KTAREQIN, + "AUD CPEAudioData::SendMessage: aMessage = %d, available outputs changed ", aMessage ); + iPhoneModel.DataStore()->SetAvailableAudioOutputs(GetAvailableOutputs( + aTelephonyAudioRouting)); + + if (iRouteInitialized && aMessage + == MEngineMonitor::EPEMessageAvailableAudioOutputsChanged) { iAudioRoutingHandler->HandleAudioRoutingAvailableChanged(); } - - iPhoneModel.SendMessage( aMessage ); + + iPhoneModel.SendMessage(aMessage); } // ----------------------------------------------------------------------------- @@ -333,37 +230,29 @@ // EPEMessageAudioMuteChanged message is sent when gain is changed // ----------------------------------------------------------------------------- // -EXPORT_C void CPEAudioData::SetAudioMuteSync( - const TBool aAudioMute ) // Mute value to be set +EXPORT_C void CPEAudioData::SetAudioMuteSync(const TBool aAudioMute) // Mute value to be set { TEFLOGSTRING( KTAINT, "AUD CPEAudioData::SetAudioMuteSync" ); - - if ( aAudioMute ) + + if (aAudioMute) { - iPhoneModel.DataStore()->SetAudioMute( aAudioMute ); - SendMessage( MEngineMonitor::EPEMessageAudioMuteChanged ); - // Inform VoIP/PE Videocallmanager mute state. Error code not handled. - TInt err = RProperty::Set( - KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - EPSTelMicMuteOn ); - TEFLOGSTRING2( - KTAREQOUT, - "AUD CPEAudioData::SetAudioMuteSync: EPSTelephonyMicMuteOn , error = %d", - err ); + iPhoneModel.DataStore()->SetAudioMute(aAudioMute); + SendMessage(MEngineMonitor::EPEMessageAudioMuteChanged); + TInt err = iAudioEffect->SetMuteState(ETrue); + TEFLOGSTRING2( + KTAREQOUT, + "AUD CPEAudioData::SetAudioMuteSync: error = %d", + err ); } else { - iPhoneModel.DataStore()->SetAudioMute( aAudioMute ); - SendMessage( MEngineMonitor::EPEMessageAudioMuteChanged ); - TInt err = RProperty::Set( - KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - EPSTelMicMuteOff ); - TEFLOGSTRING2( - KTAREQOUT, - "AUD CPEAudioData::SetAudioMuteSync: EPSTelephonyMicMuteOff, error = %d", - err ); + iPhoneModel.DataStore()->SetAudioMute(aAudioMute); + SendMessage(MEngineMonitor::EPEMessageAudioMuteChanged); + TInt err = iAudioEffect->SetMuteState(EFalse); + TEFLOGSTRING2( + KTAREQOUT, + "AUD CPEAudioData::SetAudioMuteSync: error = %d", + err ); } } @@ -372,43 +261,22 @@ // Creates synchronous request to set audio volume. // ----------------------------------------------------------------------------- // -EXPORT_C void CPEAudioData::SetAudioVolumeSync( - const TInt aAudioVolume ) // Volume to be set +EXPORT_C void CPEAudioData::SetAudioVolumeSync(const TInt aAudioVolume) // Volume to be set { - TEFLOGSTRING2( - KTAREQIN, - "AUD CPEAudioData::SetAudioVolumeSync, aAudioVolume = %d", - aAudioVolume ); - - if ( aAudioVolume <= KPEMaxVolume ) - { - TEFLOGSTRING2( KTAINT, + TEFLOGSTRING2( + KTAREQIN, "AUD CPEAudioData::SetAudioVolumeSync, aAudioVolume = %d", aAudioVolume ); - - if ( iPhoneModel.DataStore()->AudioOutput() == EPELoudspeaker ) - { - iPhoneModel.DataStoreExt()->Set( - EPEIncallLoudspeakerVolumeSetting, + + if (aAudioVolume <= KPEMaxVolume) + { + TEFLOGSTRING2( KTAINT, + "AUD CPEAudioData::SetAudioVolumeSync, aAudioVolume = %d", aAudioVolume ); - TEFLOGSTRING( KTAINT, - "AUD CPEAudioData::SetAudioVolumeSync: EPEIncallLoudspeakerVolumeSetting"); - } - else - { - iPhoneModel.DataStoreExt()->Set( - EPEIncallEarVolumeSetting, - aAudioVolume ); - TEFLOGSTRING( KTAINT, - "AUD CPEAudioData::SetAudioVolumeSync: EPEIncallEarVolumeSetting"); - } - } - - iPhoneModel.DataStore()->SetAudioVolume( aAudioVolume ); - DoHandleVolumeChange( aAudioVolume ); - - SendMessage( MEngineMonitor::EPEMessageAudioVolumeChanged ); + iAudioEffect->SetVolume(aAudioVolume); + } + DoHandleVolumeChange(aAudioVolume, ETrue); } // ----------------------------------------------------------------------------- @@ -416,97 +284,95 @@ // Makes request to Telephony Audio Routing to set audio output path // ----------------------------------------------------------------------------- // -EXPORT_C TInt CPEAudioData::SetAudioOutput( - const TPEAudioOutput aOutput, - TBool aShowNote ) +EXPORT_C TInt CPEAudioData::SetAudioOutput(const TPEAudioOutput aOutput, + TBool aShowNote) { - TEFLOGSTRING2( - KTAREQIN, - "AUD CPEAudioData::SetAudioOutput: aOutput = %d", - aOutput ); - - TInt error( KErrNone ); - - TEFLOGSTRING2( KTAERROR, - "AUD CPEAudioData::SetAudioOutput: iRouteInitialized (%d)" - , iRouteInitialized ); + TEFLOGSTRING2( + KTAREQIN, + "AUD CPEAudioData::SetAudioOutput: aOutput = %d", + aOutput ); + + TInt error(KErrNone); - if ( iRouteInitialized && iPhoneModel.DataStore()->AudioOutputAvailable( aOutput ) ) + TEFLOGSTRING2( KTAERROR, + "AUD CPEAudioData::SetAudioOutput: iRouteInitialized (%d)" + , iRouteInitialized ); + + if (iRouteInitialized && iPhoneModel.DataStore()->AudioOutputAvailable( + aOutput)) { - SetTAROutput( ConvertToTAR( aOutput), aShowNote ); + SetTAROutput(ConvertToTAR(aOutput), aShowNote); } else { - if ( aOutput == EPEHandset ) + if (aOutput == EPEHandset) { - iAudioRoutingHandler->SetAnswerToHandset( ETrue ); + iAudioRoutingHandler->SetAnswerToHandset(ETrue); } else { TEFLOGSTRING2( KTAERROR, - "AUD CPEAudioData::SetAudioOutput: Requested audio path not available (%d)" - , aOutput ); - error = KErrArgument; + "AUD CPEAudioData::SetAudioOutput: Requested audio path not available (%d)" + , aOutput ); + error = KErrArgument; } } - + return error; } - // ----------------------------------------------------------------------------- // CPEAudioData::SetTAROutput // ----------------------------------------------------------------------------- // -void CPEAudioData::SetTAROutput( - CTelephonyAudioRouting::TAudioOutput aOutput, - TBool aShowNote ) +void CPEAudioData::SetTAROutput(CTelephonyAudioRouting::TAudioOutput aOutput, + TBool aShowNote) { - TEFLOGSTRING2( - KTAREQIN, - "AUD CPEAudioData::SetTAROutput: aOutput = %d", - aOutput ); + TEFLOGSTRING2( + KTAREQIN, + "AUD CPEAudioData::SetTAROutput: aOutput = %d", + aOutput ); #if defined(__WINSCW__ ) && !defined(UNIT_TESTING) - iAudioRouting->SetShowNote( aShowNote ); - SendMessage( MEngineMonitor::EPEMessageAudioOutputChanged, aOutput); -#else - CTelephonyAudioRouting::TAudioOutput output = iAudioRouting->Output(); - - if ( output == aOutput ) + iAudioRouting->SetShowNote(aShowNote); + SendMessage(MEngineMonitor::EPEMessageAudioOutputChanged, aOutput); +#else + CTelephonyAudioRouting::TAudioOutput output = iAudioRouting->Output(); + + if ( output == aOutput ) { // audio routing cannot changed - TEFLOGSTRING2( KTAERROR, - "AUD CPEAudioData::SetTAROutput: audio path already (%d)" - , aOutput ); + TEFLOGSTRING2( KTAERROR, + "AUD CPEAudioData::SetTAROutput: audio path already (%d)" + , aOutput ); return; } - iAudioRouting->SetShowNote( aShowNote ); + iAudioRouting->SetShowNote( aShowNote ); TRAPD( err, iAudioRouting->SetOutputL( aOutput ) ); - + if( err ) { - TEFLOGSTRING2( KTAERROR, - "AUD CPEAudioData::SetTAROutput:Leave.1 (%d)", err ); + TEFLOGSTRING2( KTAERROR, + "AUD CPEAudioData::SetTAROutput:Leave.1 (%d)", err ); switch ( aOutput ) { case CTelephonyAudioRouting::ELoudspeaker: - case CTelephonyAudioRouting::EWiredAudioAccessory: + case CTelephonyAudioRouting::EWiredAudioAccessory: case CTelephonyAudioRouting::EBTAudioAccessory: // if leave try handset TRAPD( err2, iAudioRouting->SetOutputL( CTelephonyAudioRouting::EHandset ) ); if( err2 ) { - TEFLOGSTRING2( KTAERROR, - "AUD CPEAudioData::SetTAROutput:Leave.2 (%d)", err ); - } + TEFLOGSTRING2( KTAERROR, + "AUD CPEAudioData::SetTAROutput:Leave.2 (%d)", err ); + } break; default: // None - break; + break; } } -#endif +#endif } // ----------------------------------------------------------------------------- @@ -519,8 +385,11 @@ { TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData::StartUp" ); // get available audio output paths and current audio output - iPhoneModel.DataStore()->SetAvailableAudioOutputs( GetAvailableOutputs( *iAudioRouting ) ); - iPhoneModel.DataStore()->SetAudioOutput( ConvertToPE( iAudioRouting->Output() ), ConvertToPE( iAudioRouting->PreviousOutput() ), EFalse ); + iPhoneModel.DataStore()->SetAvailableAudioOutputs(GetAvailableOutputs( + *iAudioRouting)); + iPhoneModel.DataStore()->SetAudioOutput(ConvertToPE( + iAudioRouting->Output()), ConvertToPE( + iAudioRouting->PreviousOutput()), EFalse); } // ----------------------------------------------------------------------------- @@ -529,125 +398,98 @@ // Return list of available outputs // ----------------------------------------------------------------------------- // -TArray CPEAudioData::GetAvailableOutputs( - CTelephonyAudioRouting& aTelephonyAudioRouting ) +TArray CPEAudioData::GetAvailableOutputs( + CTelephonyAudioRouting& aTelephonyAudioRouting) { - TEFLOGSTRING( KTAREQOUT, - "AUD CPEAudioData::GetAvailableOutputs > CTelephonyAudioRouting::AvailableOutputs()" ); - TArray availableOutputs = - aTelephonyAudioRouting.AvailableOutputs(); - + TEFLOGSTRING( KTAREQOUT, + "AUD CPEAudioData::GetAvailableOutputs > CTelephonyAudioRouting::AvailableOutputs()" ); + TArray availableOutputs = + aTelephonyAudioRouting.AvailableOutputs(); + iPEavailableOutputs.Reset(); - for ( TInt j = 0; j < availableOutputs.Count(); j++ ) + for (TInt j = 0; j < availableOutputs.Count(); j++) { - iPEavailableOutputs.Append( ConvertToPE( availableOutputs[j] ) ); - TEFLOGSTRING3( KTAINT, - "AUD CPEAudioData::GetAvailableOutputs, index: %d, available: %d", - j, - availableOutputs[j] ); - } - - return iPEavailableOutputs.Array(); + iPEavailableOutputs.Append(ConvertToPE(availableOutputs[j])); + TEFLOGSTRING3( KTAINT, + "AUD CPEAudioData::GetAvailableOutputs, index: %d, available: %d", + j, + availableOutputs[j] ); + } + + return iPEavailableOutputs.Array(); } - + // ----------------------------------------------------------------------------- -// CPEAudioData::SetDefaultVolume +// CPEAudioData::HandleCallStarting // ----------------------------------------------------------------------------- // -EXPORT_C void CPEAudioData::SetDefaultVolume() +EXPORT_C TInt CPEAudioData::HandleCallStarting(TBool aVideoCall) { - TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData::SetDefaultVolume" ); - if ( !iLoudspeakerVolume ) - { - TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData->SetDefaultLoudspeakerVolume" ); - iLoudspeakerVolume = KPEDefaultVolume; - iPhoneModel.DataStore()->SetAudioVolume( iLoudspeakerVolume ); - iPhoneModel.DataStoreExt()->Set( EPEIncallLoudspeakerVolumeSetting, - iLoudspeakerVolume ); - } - if ( !iHeadSetVolume ) - { - TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData->SetDefaultHeadSetVolume" ); - iHeadSetVolume = KPEDefaultVolume; - iPhoneModel.DataStore()->SetAudioVolume( iHeadSetVolume ); - iPhoneModel.DataStoreExt()->Set( EPEIncallEarVolumeSetting, - iHeadSetVolume ); + TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallStarting()" ); + TInt ret(KErrNone); + + if (!iRouteInitialized) // if route not already initialized + { // Not new route init for multi calls + iRouteInitialized = ETrue; + ret = iAudioRoutingHandler->HandleAudioRoutingCallInit(aVideoCall); } - DoHandleVolumeChange( KPEDefaultVolume ); - } - -// ----------------------------------------------------------------------------- -// CPEAudioData::HandleCallStarting -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CPEAudioData::HandleCallStarting( TBool aVideoCall ) - { - TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallStarting()" ); - TInt ret( KErrNone ); - - if ( !iRouteInitialized ) // if route not already initialized - { // Not new route init for multi calls - iRouteInitialized = ETrue; - ret = iAudioRoutingHandler->HandleAudioRoutingCallInit( aVideoCall ); - } - - return ret; + return ret; } // ----------------------------------------------------------------------------- // CPEAudioData::HandleEnergencyCallStarting // Can be called, if new call is created before previous call is idle state -// One used situation is that emergency call is dialed during the video call or +// One used situation is that emergency call is dialed during the video call or // voice call. Audio routing have to initialized when emergency is dialing state // even previous call(voice or video) haven't got idle yet. // ----------------------------------------------------------------------------- -// +// EXPORT_C TInt CPEAudioData::HandleEnergencyCallStarting() { TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallSwitching()" ); - TInt ret( KErrNone ); - + TInt ret(KErrNone); + // Always new route init - ret = iAudioRoutingHandler->HandleAudioRoutingCallInit( EFalse ); + ret = iAudioRoutingHandler->HandleAudioRoutingCallInit(EFalse); iRouteInitialized = ETrue; - - return ret; + + return ret; } // ----------------------------------------------------------------------------- // CPEAudioData::HandleCallEnding() // ----------------------------------------------------------------------------- -// +// EXPORT_C void CPEAudioData::HandleCallEnding() { TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallEnding()" ); - - if ( iRouteInitialized ) + + if (iRouteInitialized) { iRouteInitialized = EFalse; - TEFLOGSTRING( KTAMESINT, - "AUD CPEAudioData::HandleCallEnding() > CTelephonyAudioRouting::ENotActive" ); - SetTAROutput( CTelephonyAudioRouting::ENotActive, EFalse ); + TEFLOGSTRING( KTAMESINT, + "AUD CPEAudioData::HandleCallEnding() > CTelephonyAudioRouting::ENotActive" ); + SetTAROutput(CTelephonyAudioRouting::ENotActive, EFalse); } } - + // ----------------------------------------------------------------------------- // CPEAudioData::CallAudioRoutePreferenceChanged() -// +// // ----------------------------------------------------------------------------- -// +// EXPORT_C TInt CPEAudioData::CallAudioRoutePreferenceChanged() { TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::CallAudioRoutePreferenceChanged()" ); - if ( iRouteInitialized ) + if (iRouteInitialized) { - return iAudioRoutingHandler->HandleAudioRoutePreferenceChanged(); + return iAudioRoutingHandler->HandleAudioRoutePreferenceChanged(); } return KErrNotReady; - } - + } + // ----------------------------------------------------------------------------- // CPEAudioData::PreviousOutput // ----------------------------------------------------------------------------- @@ -656,7 +498,7 @@ { return iAudioRouting->PreviousOutput(); } - + // ----------------------------------------------------------------------------- // CPEAudioData::Output // ----------------------------------------------------------------------------- @@ -665,62 +507,64 @@ { return iAudioRouting->Output(); } - + // ----------------------------------------------------------------------------- // CPEAudioData::SetRoutePreference // ----------------------------------------------------------------------------- -// -void CPEAudioData::SetRoutePreference( TBool aShowNote ) +// +void CPEAudioData::SetRoutePreference(TBool aShowNote) { TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::SetRoutePreference()" ); - CTelephonyAudioRouting::TAudioOutput output = CTelephonyAudioRouting::EHandset; - - const TInt outputPreference = iPhoneModel.DataStore()->AudioOutputPreference(); - if ( outputPreference == EPSAudioPublic ) + CTelephonyAudioRouting::TAudioOutput output = + CTelephonyAudioRouting::EHandset; + + const TInt outputPreference = + iPhoneModel.DataStore()->AudioOutputPreference(); + if (outputPreference == EPSAudioPublic) { output = CTelephonyAudioRouting::ELoudspeaker; } TInt error; - iAudioRouting->SetShowNote( aShowNote ); + iAudioRouting->SetShowNote(aShowNote); TRAP( error, iAudioRouting->SetOutputL( output ) ); TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::SetRoutePreference() err %d", error ); - } - + } + // ----------------------------------------------------------------------------- // CPEAudioData::RoutePreference // ----------------------------------------------------------------------------- -// +// CTelephonyAudioRouting::TAudioOutput CPEAudioData::RoutePreference() { - CTelephonyAudioRouting::TAudioOutput output = CTelephonyAudioRouting::EHandset; - - const TInt outputPreference = iPhoneModel.DataStore()->AudioOutputPreference(); - if ( outputPreference == EPSAudioPublic ) + CTelephonyAudioRouting::TAudioOutput output = + CTelephonyAudioRouting::EHandset; + + const TInt outputPreference = + iPhoneModel.DataStore()->AudioOutputPreference(); + if (outputPreference == EPSAudioPublic) { output = CTelephonyAudioRouting::ELoudspeaker; } TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::RoutePreference() output %d", output ); return output; - } + } // ----------------------------------------------------------------------------- // CPEAudioData::IsWiredAvailable // ----------------------------------------------------------------------------- // TBool CPEAudioData::IsWiredAvailable() { - return iPhoneModel.DataStore()->AudioOutputAvailable( - EPEWiredAudioAccessory ); + return iPhoneModel.DataStore()->AudioOutputAvailable( + EPEWiredAudioAccessory); } - // ----------------------------------------------------------------------------- // CPEAudioData::IsBTAvailable // ----------------------------------------------------------------------------- // TBool CPEAudioData::IsBTAvailable() { - return iPhoneModel.DataStore()->AudioOutputAvailable( - EPEBTAudioAccessory ); + return iPhoneModel.DataStore()->AudioOutputAvailable(EPEBTAudioAccessory); } // ----------------------------------------------------------------------------- @@ -729,39 +573,20 @@ // TBool CPEAudioData::IsTTYAvailable() { - return iPhoneModel.DataStore()->AudioOutputAvailable( - EPETTY ); + return iPhoneModel.DataStore()->AudioOutputAvailable(EPETTY); } - // ----------------------------------------------------------------------------- -// CPEAudioData::IsMuted -// ----------------------------------------------------------------------------- -// -TBool CPEAudioData::IsMuted() const - { - TInt value; - TInt err = RProperty::Get( - KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - value ); - - TEFLOGSTRING3( - KTAREQIN, - "AUD CPEAudioData::IsMuted: value = %d, error = %d", - value, err ); - return ( value == EPSTelMicMuteOn ) ? ETrue : EFalse; - } - // ----------------------------------------------------------------------------- // CPEAudioData::ConvertToPE // ----------------------------------------------------------------------------- // -TPEAudioOutput CPEAudioData::ConvertToPE( CTelephonyAudioRouting::TAudioOutput aOutput ) +TPEAudioOutput CPEAudioData::ConvertToPE( + CTelephonyAudioRouting::TAudioOutput aOutput) { TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::ConvertToPE, aOutput %d", aOutput ); - TPEAudioOutput newOutput( EPENotActive ); - - switch( aOutput ) + TPEAudioOutput newOutput(EPENotActive); + + switch (aOutput) { case CTelephonyAudioRouting::ENotActive: newOutput = EPENotActive; @@ -782,9 +607,9 @@ newOutput = EPETTY; break; default: - break; + break; } - + return newOutput; } @@ -792,13 +617,15 @@ // CPEAudioData::ConvertToTAR // ----------------------------------------------------------------------------- // -CTelephonyAudioRouting::TAudioOutput CPEAudioData::ConvertToTAR( TPEAudioOutput aOutput ) +CTelephonyAudioRouting::TAudioOutput CPEAudioData::ConvertToTAR( + TPEAudioOutput aOutput) { TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::ConvertToTAR, aOutput %d", aOutput ); - - CTelephonyAudioRouting::TAudioOutput newOutput ( CTelephonyAudioRouting::ENotActive ); - - switch( aOutput ) + + CTelephonyAudioRouting::TAudioOutput newOutput( + CTelephonyAudioRouting::ENotActive); + + switch (aOutput) { case EPENotActive: newOutput = CTelephonyAudioRouting::ENotActive; @@ -819,7 +646,7 @@ newOutput = CTelephonyAudioRouting::ETTY; break; default: - break; + break; } return newOutput; } @@ -828,9 +655,43 @@ // CPEAudioData::DoHandleVolumeChange // ----------------------------------------------------------------------------- // -void CPEAudioData::DoHandleVolumeChange( TInt /*aVolume*/ ) +void CPEAudioData::DoHandleVolumeChange(TInt aVolume, TBool aSendMsg) { - + iPhoneModel.DataStore()->SetAudioVolume(aVolume); + + if (aSendMsg) + { + SendMessage(MEngineMonitor::EPEMessageAudioVolumeChanged); + } } -// End of File +// ----------------------------------------------------------------------------- +// CPEAudioData::EffectsEvent +// ----------------------------------------------------------------------------- +// +void CPEAudioData::EffectsEvent(const TMSEffect& tmseffect, + TMSSignalEvent event) + { + TMSEffectType effecttype; + const_cast(tmseffect).GetType(effecttype); + + if (effecttype == TMS_EFFECT_GLOBAL_VOL && + event.type == TMS_EVENT_EFFECT_VOL_CHANGED) + { + TMSVolumeEventChangeData* vd; + vd = static_cast(event.event_data); + + // If volume change event has been triggered by routing change, we + // do not want to send EPEMessageAudioVolumeChanged message. + if (!vd->output_changed) + { + DoHandleVolumeChange(iAudioEffect->Volume(), ETrue); + } + else + { + DoHandleVolumeChange(iAudioEffect->Volume(), EFalse); + } + } + } + +// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/src/cpeaudioeffect.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/audiohandling/src/cpeaudioeffect.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,153 @@ +/* + * 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: TMS AudioEffect. + * + */ + +#include +#include +#include +#include +#include +#include "cpeaudioeffect.h" +#include "pepanic.pan" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Static constructor +// --------------------------------------------------------------------------- +// +CPEAudioEffect* CPEAudioEffect::NewL(TMSEffectObserver& aObserver) + { + CPEAudioEffect* self = CPEAudioEffect::NewLC(aObserver); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// Static constructor +// --------------------------------------------------------------------------- +// +CPEAudioEffect* CPEAudioEffect::NewLC(TMSEffectObserver& aObserver) + { + CPEAudioEffect* self = new (ELeave) CPEAudioEffect(); + CleanupStack::PushL(self); + self->ConstructL(aObserver); + return self; + } + +// --------------------------------------------------------------------------- +// CPEAudioEffect::CPEAudioEffect +// --------------------------------------------------------------------------- +// +CPEAudioEffect::CPEAudioEffect() + { + } + +// --------------------------------------------------------------------------- +// Second phase constructor +// --------------------------------------------------------------------------- +// +void CPEAudioEffect::ConstructL(TMSEffectObserver& aObserver) + { + TMSVer* v = NULL; + TInt err(KErrNotFound); + TMSFactory::CreateFactory(iFactory, *v); + if (iFactory) + { + err = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain); + err |= iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol); + } + if (err) + { + User::Leave(KErrNotFound); + } + err = static_cast(iGlobalVol)->AddObserver(aObserver, + NULL); + User::LeaveIfError(err); + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CPEAudioEffect::~CPEAudioEffect() + { + iFactory->DeleteEffect(iGlobalGain); + iFactory->DeleteEffect(iGlobalVol); + delete iFactory; + } + +// --------------------------------------------------------------------------- +// CPEAudioEffect::SetMuteState(TBool aMute) +// --------------------------------------------------------------------------- +// +TInt CPEAudioEffect::SetMuteState(TBool aMute) + { + __ASSERT_DEBUG(iGlobalGain, Panic(EPEPanicBadHandle)); + guint value(0); + TInt err(KErrNotFound); + if (aMute) + { + err = static_cast(iGlobalGain)->SetLevel(0); + } + else + { + err = static_cast(iGlobalGain)->GetMaxLevel( + value); + if (err == TMS_RESULT_SUCCESS) + { + err = static_cast(iGlobalGain)->SetLevel( + value); + } + } + return err; + } + +// --------------------------------------------------------------------------- +// CPEAudioEffect::SetUnmuted +// --------------------------------------------------------------------------- +// +TBool CPEAudioEffect::MuteState() const + { + __ASSERT_DEBUG(iGlobalGain, Panic(EPEPanicBadHandle)); + guint value; + static_cast(iGlobalGain)->GetLevel(value); + return (value == 0) ? ETrue : EFalse; + } + +// --------------------------------------------------------------------------- +// CPEAudioEffect::SetVolume +// --------------------------------------------------------------------------- +// +void CPEAudioEffect::SetVolume(TInt aVolume) + { + __ASSERT_DEBUG(iGlobalVol, Panic(EPEPanicBadHandle)); + static_cast(iGlobalVol)->SetLevel(aVolume); + } + +// --------------------------------------------------------------------------- +// CPEAudioEffect::Volume +// --------------------------------------------------------------------------- +// +TInt CPEAudioEffect::Volume() const + { + __ASSERT_DEBUG(iGlobalVol, Panic(EPEPanicBadHandle)); + guint value(0); + static_cast(iGlobalVol)->GetLevel(value); + return value; + } + +// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/audiohandling/src/cpegsmaudiodata.cpp --- a/phoneengine/audiohandling/src/cpegsmaudiodata.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/audiohandling/src/cpegsmaudiodata.cpp Mon May 03 12:31:11 2010 +0300 @@ -83,6 +83,9 @@ iInbandTonePlayer = CPEAudioInbandTonePlayer::NewL( *this, iFsSession, aAudioFactory ); + TInt volume = iPhoneModel.DataStore()->AudioVolume(); + iInbandTonePlayer->SetVolume( volume ); + iDtmfTonePlayer = CPEAudioDtmfTonePlayer::NewL(); } @@ -295,10 +298,11 @@ // CPEGsmAudioData::DoHandleVolumeChange // ----------------------------------------------------------------------------- // -void CPEGsmAudioData::DoHandleVolumeChange( TInt aVolume ) +void CPEGsmAudioData::DoHandleVolumeChange( TInt aVolume, TBool aSendMsg) { iInbandTonePlayer->SetVolume( aVolume ); + CPEAudioData::DoHandleVolumeChange(aVolume , aSendMsg); } // ================= OTHER EXPORTED FUNCTIONS =============================== diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/contacthandling2/src/cpecontactmatch.cpp --- a/phoneengine/contacthandling2/src/cpecontactmatch.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/contacthandling2/src/cpecontactmatch.cpp Mon May 03 12:31:11 2010 +0300 @@ -367,11 +367,6 @@ iDataStore.SetRemoteTextToSpeechText( aMatch.TextToSpeechTextL(), aCallId ); - if ( aMatch.Number().Length() > 0 ) - { - iDataStore.SetRemotePhoneNumber( aMatch.Number(), aCallId ); - } - TInt phcntfinderNumberType = aMatch.NumberType(); switch ( phcntfinderNumberType ) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/contacthandling2/tsrc/run_auto_tests.bat --- a/phoneengine/contacthandling2/tsrc/run_auto_tests.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/contacthandling2/tsrc/run_auto_tests.bat Mon May 03 12:31:11 2010 +0300 @@ -56,7 +56,7 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld test build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb.test --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_MOVE_DLL=\epoc32\release\winscw\udeb\z\sys\bin set PATH_TO_COVERAGE_DATA=\coverage_data @@ -147,12 +147,11 @@ pushd . call cd %1\group -call bldmake bldfiles -call abld test clean winscw udeb +call sbs --config winscw_udeb.test --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/loghandling/tsrc/run_auto_tests.bat --- a/phoneengine/loghandling/tsrc/run_auto_tests.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/loghandling/tsrc/run_auto_tests.bat Mon May 03 12:31:11 2010 +0300 @@ -56,7 +56,7 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld test build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb.test --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_MOVE_DLL=\epoc32\release\winscw\udeb\z\sys\bin set PATH_TO_COVERAGE_DATA=\coverage_data @@ -147,12 +147,11 @@ pushd . call cd %1\group -call bldmake bldfiles -call abld test clean winscw udeb +call sbs --config winscw_udeb.test --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i m -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i m -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/inc/cnetworklistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/inc/cnetworklistener.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Network info listener. +* +*/ + + +#ifndef CNETWORKLISTENER_H +#define CNETWORKLISTENER_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CNWSession; +class CRepository; +class MNetworkListenerObserver; + +/** + * Network info listener. + */ +NONSHARABLE_CLASS( CNetworkListener ) : public CBase, + public MNWMessageObserver + { +public: + + /** + * Get pointer to network info listener. + * @return pointer to network info listener. + */ + static CNetworkListener* NewL( MNetworkListenerObserver& aObserver ); + + ~CNetworkListener(); + + // from base class MNWMessageObserver + + /** + * From MNWMessageObserver. + * Called by network handling engine when network info changes. + * @param aMessage is type of the change. + */ + void HandleNetworkMessage( const TNWMessages aMessage ); + + /** + * From MNWMessageObserver. + * Called fi network handling engine fails. + * @param aOperation is failed operation. + * @param aErrorCode is fail reason. + */ + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + + static TInt NWLostDelayCallBack(TAny* aParam); + +private: + + CNetworkListener( MNetworkListenerObserver& aObserver ); + + void ConstructL(); + + void HandleNetworkFound(); + + void HandleNetworkLost(); + + /** + * Tests if offline mode is engaged. + * @return ETrue if offline mode is currently active + */ + TBool IsOffLineMode() const; + + /** + * Tests if Bluetooth SAP is in connected mode. + * @return ETrue if Bluetooth SAP is active. + */ + TBool IsBluetoothSAPConnected() const; + + /** + * Tests if SIM is in OK state. + * @return ETrue if SIM is in OK state. + */ + TBool IsSimOk() const; + +private: // data + + /** + * Session to network handling engine. + * Own. + */ + CNWSession* iSession; + + /** + * Cached network info structure. + */ + TNWInfo iInfo; + + /** + * Timer to delay the showing of the notification if needed + * Own + */ + CPeriodic *iTimer; + + /** + * A true value if registered to network. + */ + TBool iRegistered; + + /** + * Profile API. + */ + CRepository* iProfileApi; + + /** + * Observer. + */ + MNetworkListenerObserver& iObserver; + + }; + +#endif // CNETWORKLISTENER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/inc/mnetworklistenerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/inc/mnetworklistenerobserver.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef MNETWORKLISTENEROBSERVER_H +#define MNETWORKLISTENEROBSERVER_H + +/*! + \class NetworkStatusObserver + */ +class MNetworkListenerObserver +{ +public: + + virtual void ShowNote() = 0; + + virtual void RemoveNote() = 0; + +}; + +#endif // MNETWORKLISTENEROBSERVER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/inc/networkhandlingstarter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarter.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef NETWORKHANDLINGSTARTER_H +#define NETWORKHANDLINGSTARTER_H + +#include + +#ifdef BUILD_NETWORKHANDLINGSTARTER +#define NETWORKHANDLINGSTARTER_EXPORT Q_DECL_EXPORT +#else +#define NETWORKHANDLINGSTARTER_EXPORT Q_DECL_IMPORT +#endif + +class NetworkHandlingStarterPrivate; + +/*! + \class NetworkStatusObserver + */ +class NETWORKHANDLINGSTARTER_EXPORT NetworkHandlingStarter + : public XQServiceProvider +{ + Q_OBJECT + +public: + + NetworkHandlingStarter(QObject *parent = 0); + + ~NetworkHandlingStarter(); + +public slots: + /*! + \fn start() + + This method start networkhandling. It is intended to be used via Qt Highway. + + Usage example: + XQServiceRequest snd("com.nokia.services.networkhandling","start()"); + */ + void start(); + +private: + + NetworkHandlingStarterPrivate* m_privateImpl; + +}; + +#endif // NETWORKHANDLINGSTARTER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/inc/networkhandlingstarter_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarter_p.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef NETWORKHANDLINGSTARTERPRIVATE_H +#define NETWORKHANDLINGSTARTERPRIVATE_H + +#include +#include "mnetworklistenerobserver.h" + +class CNetworkListener; +class HbDeviceMessageBox; +class HbMainWindow; + +/*! + \class NetworkHandlingStarterPrivate + */ +class NetworkHandlingStarterPrivate + : public QObject, + public MNetworkListenerObserver +{ + Q_OBJECT + +public: + + NetworkHandlingStarterPrivate(QObject *parent = NULL); + + ~NetworkHandlingStarterPrivate(); + +public slots: + + void LaunchCpNetworkPluginView(); + + void ViewDone(); + +signals: + + void SearchAvailableNetworks(); + +public: // From MNetworkListenerObserver + + void ShowNote(); + + void RemoveNote(); + +private: + + HbMainWindow * MainWindow(); + + void InitaliseCpNetworkPluginView(); + +private: + + CNetworkListener* m_networkListener; + HbDeviceMessageBox *m_note; + +}; + +#endif // NETWORKHANDLINGSTARTERPRIVATE_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/inc/networkhandlingstarterlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarterlogging.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef NETWORKHANDLINGSTARTERSLOGGING_H +#define NETWORKHANDLINGSTARTERSLOGGING_H + +#include + + +/*! + Define MSG_OUTPUT_RDEBUG + for enabling RDebug prints in development tracing. + Shouldn't be used in release code. + */ +#define MSG_OUTPUT_RDEBUG + + + +#ifdef MSG_OUTPUT_RDEBUG +#ifdef Q_OS_SYMBIAN +#include + +static void networkHandlingStarterMsgOutput(QtMsgType type, const char *msg) +{ + switch (type) { + + case QtDebugMsg: + RDebug::Printf("networkhandlingstarter Debug: %s\n", msg); + break; + + case QtWarningMsg: + RDebug::Printf("networkhandlingstarter Warning: %s\n", msg); + break; + + case QtCriticalMsg: + RDebug::Printf("networkhandlingstarter Critical: %s\n", msg); + break; + + case QtFatalMsg: + RDebug::Printf("networkhandlingstarter Fatal: %s\n", msg); + abort(); + } +} + + #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(networkHandlingStarterMsgOutput) + #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0) +#else //Q_OS_SYMBIAN + #define INSTALL_TRACE_MSG_HANDLER + #define UNINSTALL_TRACE_MSG_HANDLER +#endif +#else + #define INSTALL_TRACE_MSG_HANDLER + #define UNINSTALL_TRACE_MSG_HANDLER +#endif //MSG_OUTPUT_RDEBUG + +/*! + Debug macros + */ +#define DPRINT qDebug() << __PRETTY_FUNCTION__ + + +#endif // NETWORKHANDLINGSTARTERSLOGGING_H + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/networkhandlingstarter.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/networkhandlingstarter.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,54 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += hb +TEMPLATE = app +TARGET = networkhandlingstarter +TRANSLATIONS = telephone_cp.ts + +INCLUDEPATH += ./inc/ +DEFINES += BUILD_NETWORKHANDLINGSTARTER +MOC_DIR = moc + +symbian: { + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0x2002E67A + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + LIBS += -lnetworkhandling + LIBS += -lcentralrepository + LIBS += -lxqservice + LIBS += -lxqserviceutil + LIBS += -lcpframework + + BLD_INF_RULES.prj_exports += \ + "./rom/networkhandlingstarter.iby CORE_APP_LAYER_IBY_EXPORT_PATH(networkhandlingstarter.iby)" +} + +HEADERS += ./inc/networkhandlingstarter.h +HEADERS += ./inc/networkhandlingstarter_p.h +HEADERS += ./inc/cnetworklistener.h + +SOURCES += ./src/main.cpp +SOURCES += ./src/networkhandlingstarter.cpp +SOURCES += ./src/networkhandlingstarter_p.cpp +SOURCES += ./src/cnetworklistener.cpp + +CONFIG += service +SERVICE.FILE = service_conf.xml +SERVICE.OPTIONS = embeddable + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/rom/networkhandlingstarter.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/rom/networkhandlingstarter.iby Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __NETWORKHANDLINGSTARTER_IBY__ +#define __NETWORKHANDLINGSTARTER_IBY__ + +#include + +file=ABI_DIR\UREL\networkhandlingstarter.exe PROGRAMS_DIR\networkhandlingstarter.exe +data=DATAZ_\private\10003a3f\import\apps\networkhandlingstarter_reg.rsc \private\10003a3f\import\apps\networkhandlingstarter_reg.rsc +data=DATAZ_\resource\apps\networkhandlingstarter.rsc \resource\apps\networkhandlingstarter.rsc + +#endif diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/service_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/service_conf.xml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,7 @@ + + + Networkhandling services + + Networkhandling starter interface + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/src/cnetworklistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/src/cnetworklistener.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include +#include +#include +#include +#include +#include +#include + +#include "cnetworklistener.h" +#include "mnetworklistenerobserver.h" +#include "networkhandlingstarterlogging.h" + +// Constants + +// 1-minute timeout before showing soft notification +const TInt KNetworkLostTimeout = 60*1000000; + +// Offline profile, from ProfileEngineSDKCRKeys.h +const TInt KOfflineProfileId = 5; + + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor of CNetworkListener. + */ +CNetworkListener::CNetworkListener(MNetworkListenerObserver& aObserver) : + iRegistered(ETrue), + iObserver(aObserver) +{ + DPRINT << ": IN"; + + DPRINT << ": OUT"; +} + +/*! + Constructor of CNetworkListener. + */ +void CNetworkListener::ConstructL() +{ + DPRINT << ": IN"; + + //Create network handling engine session. + iSession = CreateL(*this, iInfo); + iTimer = CPeriodic::NewL(CActive::EPriorityStandard); + iProfileApi = CRepository::NewL(KCRUidProfileEngine); + + DPRINT << ": OUT"; +} + +/*! + Constructor of CNetworkListener. + */ +CNetworkListener* CNetworkListener::NewL(MNetworkListenerObserver& aObserver) +{ + DPRINT << ": IN"; + + CNetworkListener* self = new(ELeave) CNetworkListener(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + DPRINT << ": OUT"; + return self; + } + +/*! + Destructor of CNetworkListener. + */ +CNetworkListener::~CNetworkListener() +{ + DPRINT << ": IN"; + + delete iSession; + delete iTimer; + delete iProfileApi; + + DPRINT << ": OUT"; +} + +/*! + CNetworkListener::HandleNetworkMessage. + */ +void CNetworkListener::HandleNetworkMessage(const TNWMessages aMessage) +{ + DPRINT << ": IN"; + + if(aMessage == ENWMessageNetworkRegistrationStatusChange) { + switch(iInfo.iRegistrationStatus) { + case ENWNotRegisteredNoService: + // Fall-through + case ENWNotRegisteredEmergencyOnly: + // Fall-through + case ENWNotRegisteredSearching: + // Fall-through + case ENWRegistrationDenied: + HandleNetworkLost(); + break; + + case ENWRegisteredBusy: + // Fall-through + case ENWRegisteredOnHomeNetwork: + // Fall-through + case ENWRegisteredRoaming: + HandleNetworkFound(); + break; + + case ENWRegistrationUnknown: + // Take no action + default: + break; + } + } + + DPRINT << ": OUT"; +} + +/*! + CNetworkListener::HandleNetworkError. + */ +void CNetworkListener::HandleNetworkError( + const TNWOperation /*aOperation*/, TInt /*aErrorCode*/) + { + DPRINT << ": IN"; + } + +/*! + CNetworkListener::NWLostDelayCallBack. + */ +TInt CNetworkListener::NWLostDelayCallBack(TAny* aParam) +{ + DPRINT << ": IN"; + + CNetworkListener* self = + reinterpret_cast< CNetworkListener* >( aParam ); + + if ( self ) { + self->iTimer->Cancel(); + self->iObserver.ShowNote(); + } + + DPRINT << ": OUT"; + return KErrNone; +} + +/*! + CNetworkListener::HandleNetworkFound + */ +void CNetworkListener::HandleNetworkFound() +{ + DPRINT << ": IN"; + + if (!iRegistered) { + iTimer->Cancel(); + iObserver.RemoveNote(); + } + iRegistered = ETrue; + + DPRINT << ": OUT"; +} + +/*! + CNetworkListener::HandleNetworkLost + */ +void CNetworkListener::HandleNetworkLost() +{ + DPRINT << ": IN"; + + if (iInfo.iSelectionSetting == ENWNetworkSelectionManual) { + // See if we were registered before + if (iRegistered) { + iRegistered = EFalse; + + if (!IsOffLineMode() && + !IsBluetoothSAPConnected() && + IsSimOk()) { + // Start 60 second timer and when expired show the + // notifier + iTimer->Cancel(); + iTimer->Start(KNetworkLostTimeout, + KNetworkLostTimeout, + TCallBack( NWLostDelayCallBack, this )); + } + } + } + + DPRINT << ": OUT"; +} + +/*! + CNetworkListener::IsOffLineMode + */ +TBool CNetworkListener::IsOffLineMode() const +{ + DPRINT << ": IN"; + + TInt profileId; + TInt err = iProfileApi->Get(KProEngActiveProfile, profileId); + + DPRINT << ": OUT"; + + return profileId == KOfflineProfileId && err == KErrNone; + } + +/*! + CNetworkListener::IsBluetoothSAPConnected + */ +TBool CNetworkListener::IsBluetoothSAPConnected() const +{ + DPRINT << ": IN"; + + TInt btSapState( EBTSapNotConnected ); + TInt err = RProperty::Get(KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + btSapState ); + + DPRINT << ": OUT"; + + return btSapState != EBTSapNotConnected && err == KErrNone; +} + +/*! + CNetworkListener::IsSimOk + */ +TBool CNetworkListener::IsSimOk() const +{ + DPRINT << ": IN"; + + TInt simState(ESimStatusUninitialized); + TInt err = RProperty::Get(KPSUidStartup, + KPSSimStatus, + simState ); + + DPRINT << ": OUT"; + + return simState == ESimUsable && err == KErrNone; +} + +// End of file + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/src/main.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include +#include +#include +#include +#include + +/*! + main. + */ +int main(int argc, char **argv) +{ + HbApplication app(argc, argv); + + // Load telephone_cp translator + QTranslator translator; + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); + if (translatorLoaded) { + app.installTranslator(&translator); + } + // Load common translator + QTranslator commontranslator; + translatorLoaded = commontranslator.load( path + "common_" + lang); + if (translatorLoaded) { + app.installTranslator(&commontranslator); + } + + HbMainWindow mainWindow; + NetworkHandlingStarter service; + return app.exec(); +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/src/networkhandlingstarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/src/networkhandlingstarter.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include +#include +#include + +/*! + Constructor of NetworkHandlingStarter. + */ +NetworkHandlingStarter::NetworkHandlingStarter(QObject *parent) : + XQServiceProvider(QLatin1String("com.nokia.services.networkhandling"), parent), + m_privateImpl(NULL) +{ + // Install plugin specific msg handler + INSTALL_TRACE_MSG_HANDLER; + + publishAll(); + + DPRINT; +} + +/*! + Destructor of NetworkHandlingStarter. + */ +NetworkHandlingStarter::~NetworkHandlingStarter() +{ + DPRINT; + delete m_privateImpl; + // Uninstall plugin specific msg handler + UNINSTALL_TRACE_MSG_HANDLER; +} + +void NetworkHandlingStarter::start() +{ + DPRINT; + + if(!m_privateImpl) { + m_privateImpl = new NetworkHandlingStarterPrivate(); + } +} + +// End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include + +#include "networkhandlingstarter_p.h" +#include "networkhandlingstarterlogging.h" +#include "cnetworklistener.h" + +/*! + Constructor of NetworkHandlingStarterPrivate. + */ +NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate(QObject *parent) : + QObject(parent), m_note(NULL) +{ + DPRINT << ": IN"; + + QT_TRAP_THROWING(m_networkListener = CNetworkListener::NewL(*this)); + + DPRINT << ": OUT"; +} + +/*! + Destructor of NetworkHandlingStarterPrivate. + */ +NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate() +{ + DPRINT << ": IN"; + + delete m_networkListener; + if (m_note) { + delete m_note; + } + + DPRINT << ": OUT"; +} + +/*! + NetworkHandlingStarterPrivate::ShowNote() + */ +void NetworkHandlingStarterPrivate::ShowNote() +{ + DPRINT << ": IN"; + + if (m_note) { + m_note->close(); + delete m_note; + m_note = NULL; + } + m_note = new HbDeviceMessageBox( + hbTrId("txt_phone_info_network_lost_select_network"), + HbMessageBox::MessageTypeQuestion); + HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_yes"), m_note); + m_note->setPrimaryAction(primaryAction); + HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_no"), m_note); + m_note->setSecondaryAction(secondaryAction); + QObject::connect( + primaryAction, SIGNAL(triggered()), + this, SLOT(LaunchCpNetworkPluginView())); + m_note->setTimeout(0); + m_note->show(); + + DPRINT << ": OUT"; +} + +/*! + NetworkHandlingStarterPrivate::RemoveNote() + */ +void NetworkHandlingStarterPrivate::RemoveNote() +{ + DPRINT << ": IN"; + + if (m_note) { + m_note->close(); + delete m_note; + m_note = NULL; + } + + DPRINT << ": OUT"; +} + +/*! + NetworkHandlingStarterPrivate::InitaliseCpNetworkPluginView() + */ +void NetworkHandlingStarterPrivate::InitaliseCpNetworkPluginView() +{ + DPRINT << ": IN"; + + HbMainWindow *mainWnd = MainWindow(); + if (mainWnd) { + if (CpPluginLauncher::launchCpPluginView( + "resource\\qt\\plugins\\controlpanel\\cpnetworkplugin.qtplugin")) { + foreach (HbView *view, mainWnd->views()) { + if (QString(view->metaObject()->className()) == + QString("CpNetworkPluginView")) { + QObject::connect( + view, SIGNAL(aboutToClose()), + this, SLOT(ViewDone())); + QObject::connect( + this, SIGNAL(SearchAvailableNetworks()), + view, SLOT(SearchAvailableNetworks())); + } + } + } + } + + DPRINT << ": OUT"; +} + +/*! + NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView() + */ +void NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView() +{ + DPRINT << ": IN"; + + InitaliseCpNetworkPluginView(); + HbMainWindow *mainWnd = MainWindow(); + if (mainWnd) { + mainWnd->show(); + XQServiceUtil::toBackground(false); + } + emit SearchAvailableNetworks(); + + DPRINT << ": OUT"; +} + +/*! + NetworkHandlingStarterPrivate::ViewDone() + */ +void NetworkHandlingStarterPrivate::ViewDone() +{ + HbMainWindow *mainWnd = MainWindow(); + if (mainWnd) { + mainWnd->hide(); + } + XQServiceUtil::toBackground(true); +} + +/*! + NetworkHandlingStarterPrivate::MainWindow() + */ + +HbMainWindow * NetworkHandlingStarterPrivate::MainWindow() +{ + HbMainWindow *window(NULL); + QList mainWindows = hbInstance->allMainWindows(); + if (!mainWindows.isEmpty()) { + window = mainWindows.front(); + } + return window; +} + +// End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/common/qtestmains60.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/common/qtestmains60.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef QTESTMAINS60 +#define QTESTMAINS60 + +#define QTEST_MAIN_S60(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ +char *new_argv[3]; \ +QCoreApplication app(argc, argv); \ +\ +QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ +QByteArray bytes = str.toAscii(); \ +\ +char arg1[] = "-o"; \ +\ +new_argv[0] = argv[0]; \ +new_argv[1] = arg1; \ +new_argv[2] = bytes.data(); \ +\ +TestObject tc; \ +return QTest::qExec(&tc, 3, new_argv); \ +} + +#endif \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_centralrepository.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_centralrepository.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,628 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CRepository::NewL +// ----------------------------------------------------------------------------- +// +CRepository * CRepository::NewL( + TUid aRepositoryUid ) + { + SMC_MOCK_NEWL1( CRepository *, TUid, aRepositoryUid ) + + CRepository* self = new( ELeave ) CRepository; + CleanupStack::PushL( self ); + //self->ConstructL() + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CRepository::NewLC +// ----------------------------------------------------------------------------- +// +CRepository * CRepository::NewLC( + TUid aRepositoryUid ) + { + SMC_MOCK_NEWLC1( CRepository *, TUid, aRepositoryUid ) + + CRepository* self = new( ELeave ) CRepository; + CleanupStack::PushL( self ); + //self->ConstructL() + return self; + } + + +// ----------------------------------------------------------------------------- +// CRepository::~CRepository +// ----------------------------------------------------------------------------- +// +CRepository::~CRepository( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CRepository::Create +// ----------------------------------------------------------------------------- +// +TInt CRepository::Create( + TUint32 aKey, + TInt aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TInt, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Create +// ----------------------------------------------------------------------------- +// +TInt CRepository::Create( + TUint32 aKey, + const TReal & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TReal &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Create +// ----------------------------------------------------------------------------- +// +TInt CRepository::Create( + TUint32 aKey, + const TDesC8 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TDesC8 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Create +// ----------------------------------------------------------------------------- +// +TInt CRepository::Create( + TUint32 aKey, + const TDesC16 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TDesC16 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Delete +// ----------------------------------------------------------------------------- +// +TInt CRepository::Delete( + TUint32 aKey ) + { + SMC_MOCK_METHOD1( TInt, TUint32, aKey ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Delete +// ----------------------------------------------------------------------------- +// +TInt CRepository::Delete( + TUint32 aPartialKey, + TUint32 aMask, + TUint32 & aErrorKey ) + { + SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, + TUint32, aMask, + TUint32 &, aErrorKey ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aKey, + TInt & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TInt &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Set +// ----------------------------------------------------------------------------- +// +TInt CRepository::Set( + TUint32 aKey, + TInt aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TInt, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aKey, + TReal & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TReal &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Set +// ----------------------------------------------------------------------------- +// +TInt CRepository::Set( + TUint32 aKey, + const TReal & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TReal &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aKey, + TDes8 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TDes8 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aId, + TDes8 & aValue, + TInt & aActualLength ) + { + SMC_MOCK_METHOD3( TInt, TUint32, aId, + TDes8 &, aValue, + TInt &, aActualLength ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Set +// ----------------------------------------------------------------------------- +// +TInt CRepository::Set( + TUint32 aKey, + const TDesC8 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TDesC8 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aKey, + TDes16 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TDes16 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Get +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get( + TUint32 aId, + TDes16 & aValue, + TInt & aActualLength ) + { + SMC_MOCK_METHOD3( TInt, TUint32, aId, + TDes16 &, aValue, + TInt &, aActualLength ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Set +// ----------------------------------------------------------------------------- +// +TInt CRepository::Set( + TUint32 aKey, + const TDesC16 & aValue ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + const TDesC16 &, aValue ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::GetMeta +// ----------------------------------------------------------------------------- +// +TInt CRepository::GetMeta( + TUint32 aKey, + TUint32 & aMeta ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TUint32 &, aMeta ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Move +// ----------------------------------------------------------------------------- +// +TInt CRepository::Move( + TUint32 aSourcePartialKey, + TUint32 aTargetPartialKey, + TUint32 aMask, + TUint32 & aErrorKey ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aSourcePartialKey, + TUint32, aTargetPartialKey, + TUint32, aMask, + TUint32 &, aErrorKey ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindL( + TUint32 aPartialKey, + TUint32 aMask, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, + TUint32, aMask, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindEqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindEqL( + TUint32 aPartialKey, + TUint32 aMask, + TInt aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + TInt, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindEqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindEqL( + TUint32 aPartialKey, + TUint32 aMask, + const TReal & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TReal &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindEqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindEqL( + TUint32 aPartialKey, + TUint32 aMask, + const TDesC8 & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TDesC8 &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindEqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindEqL( + TUint32 aPartialKey, + TUint32 aMask, + const TDesC16 & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TDesC16 &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindNeqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindNeqL( + TUint32 aPartialKey, + TUint32 aMask, + TInt aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + TInt, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindNeqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindNeqL( + TUint32 aPartialKey, + TUint32 aMask, + const TReal & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TReal &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindNeqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindNeqL( + TUint32 aPartialKey, + TUint32 aMask, + const TDesC8 & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TDesC8 &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FindNeqL +// ----------------------------------------------------------------------------- +// +TInt CRepository::FindNeqL( + TUint32 aPartialKey, + TUint32 aMask, + const TDesC16 & aValue, + RArray & aFoundKeys ) + { + SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, + TUint32, aMask, + const TDesC16 &, aValue, + RArray &, aFoundKeys ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::NotifyRequest +// ----------------------------------------------------------------------------- +// +TInt CRepository::NotifyRequest( + TUint32 aKey, + TRequestStatus & aStatus ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aKey, + TRequestStatus &, aStatus ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::NotifyRequest +// ----------------------------------------------------------------------------- +// +TInt CRepository::NotifyRequest( + TUint32 aPartialKey, + TUint32 aMask, + TRequestStatus & aStatus ) + { + SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, + TUint32, aMask, + TRequestStatus &, aStatus ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::NotifyCancel +// ----------------------------------------------------------------------------- +// +TInt CRepository::NotifyCancel( + TUint32 aKey ) + { + SMC_MOCK_METHOD1( TInt, TUint32, aKey ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::NotifyCancel +// ----------------------------------------------------------------------------- +// +TInt CRepository::NotifyCancel( + TUint32 aPartialKey, + TUint32 aMask ) + { + SMC_MOCK_METHOD2( TInt, TUint32, aPartialKey, + TUint32, aMask ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::NotifyCancelAll +// ----------------------------------------------------------------------------- +// +TInt CRepository::NotifyCancelAll( ) + { + SMC_MOCK_METHOD0( TInt ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Reset +// ----------------------------------------------------------------------------- +// +TInt CRepository::Reset( ) + { + SMC_MOCK_METHOD0( TInt ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::Reset +// ----------------------------------------------------------------------------- +// +TInt CRepository::Reset( + TUint32 aKey ) + { + SMC_MOCK_METHOD1( TInt, TUint32, aKey ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::StartTransaction +// ----------------------------------------------------------------------------- +// +TInt CRepository::StartTransaction( + TTransactionMode aMode ) + { + SMC_MOCK_METHOD1( TInt, TTransactionMode, aMode ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::StartTransaction +// ----------------------------------------------------------------------------- +// +void CRepository::StartTransaction( + TTransactionMode aMode, + TRequestStatus & aStatus ) + { + SMC_MOCK_METHOD2( void, TTransactionMode, aMode, + TRequestStatus &, aStatus ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::CommitTransaction +// ----------------------------------------------------------------------------- +// +TInt CRepository::CommitTransaction( + TUint32 & aKeyInfo ) + { + SMC_MOCK_METHOD1( TInt, TUint32 &, aKeyInfo ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::CommitTransaction +// ----------------------------------------------------------------------------- +// +void CRepository::CommitTransaction( + TDes8 & aKeyInfo, + TRequestStatus & aStatus ) + { + SMC_MOCK_METHOD2( void, TDes8 &, aKeyInfo, + TRequestStatus &, aStatus ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::CancelTransaction +// ----------------------------------------------------------------------------- +// +void CRepository::CancelTransaction( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::CleanupCancelTransactionPushL +// ----------------------------------------------------------------------------- +// +void CRepository::CleanupCancelTransactionPushL( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::FailTransaction +// ----------------------------------------------------------------------------- +// +void CRepository::FailTransaction( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// CRepository::CleanupFailTransactionPushL +// ----------------------------------------------------------------------------- +// +void CRepository::CleanupFailTransactionPushL( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnetworklistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnetworklistener.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CNetworkListener::CNetworkListener +// ----------------------------------------------------------------------------- +// +CNetworkListener::CNetworkListener( + MNetworkListenerObserver & aObserver ) : + iRegistered( ETrue ), + iObserver( aObserver ) + { + + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::ConstructL +// ----------------------------------------------------------------------------- +// +void CNetworkListener::ConstructL( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::NewL +// ----------------------------------------------------------------------------- +// +CNetworkListener * CNetworkListener::NewL( + MNetworkListenerObserver & aObserver ) + { + //SMC_MOCK_NEWL1( CNetworkListener *, MNetworkListenerObserver &, aObserver ) + + CNetworkListener* self = new( ELeave ) CNetworkListener( aObserver ); + CleanupStack::PushL( self ); + //self->ConstructL() + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::~CNetworkListener +// ----------------------------------------------------------------------------- +// +CNetworkListener::~CNetworkListener( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::HandleNetworkMessage +// ----------------------------------------------------------------------------- +// +void CNetworkListener::HandleNetworkMessage( + const TNWMessages aMessage ) + { + SMC_MOCK_METHOD1( void, const TNWMessages, aMessage ) + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::HandleNetworkError +// ----------------------------------------------------------------------------- +// +void CNetworkListener::HandleNetworkError( + const TNWOperation aOperation, + TInt aErrorCode ) + { + SMC_MOCK_METHOD2( void, const TNWOperation, aOperation, + TInt, aErrorCode ) + } + + +// ----------------------------------------------------------------------------- +// CNetworkListener::NWLostDelayCallBack +// ----------------------------------------------------------------------------- +// +TInt CNetworkListener::NWLostDelayCallBack( + TAny * aParam ) + { + //SMC_MOCK_METHOD1( TInt, TAny *, aParam ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnwsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnwsession.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CNWSession::CNWSession +// ----------------------------------------------------------------------------- +// +CNWSession::CNWSession( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CNWSession::~CNWSession +// ----------------------------------------------------------------------------- +// +CNWSession::~CNWSession( ) + { + + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_cppluginlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cppluginlauncher.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "cppluginlauncher.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CpPluginLauncher::launchCpPluginView +// ----------------------------------------------------------------------------- +// +bool CpPluginLauncher::launchCpPluginView( + const QString & pluginFile, + int index ) + { + SMC_MOCK_METHOD2( bool, const QString &, pluginFile, + int, index ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbaction.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction( + const QString & text, + QObject * parent ) + : QAction( parent ), d_ptr(NULL) + { + + } + + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction( + const HbIcon & icon, + const QString & text, + QObject * parent ) + : QAction( parent ), d_ptr(NULL) + { + + } + + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction( + Hb::SoftKeyAction action, + QObject * parent ) + : QAction( parent ), d_ptr(NULL) + { + + } + + +// ----------------------------------------------------------------------------- +// HbAction::~HbAction +// ----------------------------------------------------------------------------- +// +HbAction::~HbAction( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbAction::setIcon +// ----------------------------------------------------------------------------- +// +void HbAction::setIcon( + const HbIcon & icon ) + { + // SMC_MOCK_METHOD1( void, const HbIcon &, icon ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::icon +// ----------------------------------------------------------------------------- +// +HbIcon HbAction::icon( ) const + { + // SMC_MOCK_METHOD0( HbIcon ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::setMenu +// ----------------------------------------------------------------------------- +// +void HbAction::setMenu( + HbMenu * menu ) + { + // SMC_MOCK_METHOD1( void, HbMenu *, menu ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::menu +// ----------------------------------------------------------------------------- +// +HbMenu * HbAction::menu( ) const + { + // SMC_MOCK_METHOD0( HbMenu * ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::setToolBarExtension +// ----------------------------------------------------------------------------- +// +void HbAction::setToolBarExtension( + HbToolBarExtension * extension ) + { +// SMC_MOCK_METHOD1( void, HbToolBarExtension *, extension ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::toolBarExtension +// ----------------------------------------------------------------------------- +// +HbToolBarExtension * HbAction::toolBarExtension( ) const + { +// SMC_MOCK_METHOD0( HbToolBarExtension * ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::setCommandRole +// ----------------------------------------------------------------------------- +// +void HbAction::setCommandRole( + HbAction::CommandRole commandRole ) + { + // SMC_MOCK_METHOD1( void, CommandRole, commandRole ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::commandRole +// ----------------------------------------------------------------------------- +// +HbAction::CommandRole HbAction::commandRole( ) const + { + // SMC_MOCK_METHOD0( CommandRole ) + } + + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction( + HbActionPrivate & dd, + QObject * parent ) + : QAction( parent ), d_ptr(NULL) + { + + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbdevicemessagebox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbdevicemessagebox.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::HbDeviceMessageBox +// ----------------------------------------------------------------------------- +// +HbDeviceMessageBox::HbDeviceMessageBox( + const QString & text, + HbMessageBox::MessageBoxType type, + QObject * parent ) + //: + //QObject( /*text, type, parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::~HbDeviceMessageBox +// ----------------------------------------------------------------------------- +// +HbDeviceMessageBox::~HbDeviceMessageBox( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::question +// ----------------------------------------------------------------------------- +// +bool HbDeviceMessageBox::question( + const QString & text, + const QString & primaryButtonText, + const QString & secondaryButtonText ) + { + SMC_MOCK_METHOD3( bool, const QString &, text, + const QString &, primaryButtonText, + const QString &, secondaryButtonText ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::information +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::information( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::warning +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::warning( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::show +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::show( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::close +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::close( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::exec +// ----------------------------------------------------------------------------- +// +HbAction * HbDeviceMessageBox::exec( ) + { + SMC_MOCK_METHOD0( HbAction * ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setText +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setText( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::text +// ----------------------------------------------------------------------------- +// +QString HbDeviceMessageBox::text( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setIconName +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setIconName( + const QString & iconName ) + { + SMC_MOCK_METHOD1( void, const QString &, iconName ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::iconName +// ----------------------------------------------------------------------------- +// +QString HbDeviceMessageBox::iconName( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setIconAlignment +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setIconAlignment( + Qt::Alignment align ) + { + // SMC_MOCK_METHOD1( void, Qt::Alignment, align ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::iconAlignment +// ----------------------------------------------------------------------------- +// +Qt::Alignment HbDeviceMessageBox::iconAlignment( ) const + { + // SMC_MOCK_METHOD0( Qt::Alignment ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setTimeout +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setTimeout( + int timeout ) + { + SMC_MOCK_METHOD1( void, int, timeout ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setTimeout +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setTimeout( + HbPopup::DefaultTimeout timeout ) + { + // SMC_MOCK_METHOD1( void, HbPopup::DefaultTimeout, timeout ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::timeout +// ----------------------------------------------------------------------------- +// +int HbDeviceMessageBox::timeout( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setDismissPolicy +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setDismissPolicy( + HbPopup::DismissPolicy dismissPolicy ) + { + // SMC_MOCK_METHOD1( void, HbPopup::DismissPolicy, dismissPolicy ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::dismissPolicy +// ----------------------------------------------------------------------------- +// +HbPopup::DismissPolicy HbDeviceMessageBox::dismissPolicy( ) const + { + // SMC_MOCK_METHOD0( HbPopup::DismissPolicy ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::primaryAction +// ----------------------------------------------------------------------------- +// +HbAction * HbDeviceMessageBox::primaryAction( ) const + { + SMC_MOCK_METHOD0( HbAction * ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setPrimaryAction +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setPrimaryAction( + HbAction * action ) + { + // SMC_MOCK_METHOD1( void, HbAction *, action ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::secondaryAction +// ----------------------------------------------------------------------------- +// +HbAction * HbDeviceMessageBox::secondaryAction( ) const + { + SMC_MOCK_METHOD0( HbAction * ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setSecondaryAction +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setSecondaryAction( + HbAction * action ) + { + // SMC_MOCK_METHOD1( void, HbAction *, action ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::setAnimationDefinition +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::setAnimationDefinition( + QString & animationDefinition ) + { + SMC_MOCK_METHOD1( void, QString &, animationDefinition ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::animationDefinition +// ----------------------------------------------------------------------------- +// +QString HbDeviceMessageBox::animationDefinition( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbDeviceMessageBox::aboutToClose +// ----------------------------------------------------------------------------- +// +void HbDeviceMessageBox::aboutToClose( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbinstance.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbinstance.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbInstance::instance +// ----------------------------------------------------------------------------- +// +HbInstance * HbInstance::instance( ) + { + SMC_MOCK_METHOD0( HbInstance * ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::allMainWindows +// ----------------------------------------------------------------------------- +// +QList HbInstance::allMainWindows( ) const + { + SMC_MOCK_METHOD0( QList ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::orientation +// ----------------------------------------------------------------------------- +// +Qt::Orientation HbInstance::orientation( ) const + { + SMC_MOCK_METHOD0( Qt::Orientation ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::setOrientation +// ----------------------------------------------------------------------------- +// +void HbInstance::setOrientation( + Qt::Orientation orientation, + bool animate ) + { + SMC_MOCK_METHOD2( void, Qt::Orientation, orientation, + bool, animate ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::style +// ----------------------------------------------------------------------------- +// +HbStyle * HbInstance::style( ) const + { + SMC_MOCK_METHOD0( HbStyle * ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::theme +// ----------------------------------------------------------------------------- +// +HbTheme * HbInstance::theme( ) const + { + SMC_MOCK_METHOD0( HbTheme * ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::typefaceInfo +// ----------------------------------------------------------------------------- +// +HbTypefaceInfo * HbInstance::typefaceInfo( ) const + { + SMC_MOCK_METHOD0( HbTypefaceInfo * ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::addLibraryPath +// ----------------------------------------------------------------------------- +// +void HbInstance::addLibraryPath( + const QString & path ) + { + SMC_MOCK_METHOD1( void, const QString &, path ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::removeLibraryPath +// ----------------------------------------------------------------------------- +// +void HbInstance::removeLibraryPath( + const QString & path ) + { + SMC_MOCK_METHOD1( void, const QString &, path ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::libraryPaths +// ----------------------------------------------------------------------------- +// +QStringList HbInstance::libraryPaths( ) const + { + SMC_MOCK_METHOD0( QStringList ) + } + + +// ----------------------------------------------------------------------------- +// HbInstance::setLibraryPaths +// ----------------------------------------------------------------------------- +// +void HbInstance::setLibraryPaths( + const QStringList & paths ) + { + SMC_MOCK_METHOD1( void, const QStringList &, paths ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbmainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbmainwindow.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,565 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbMainWindow::HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::HbMainWindow( + QWidget * parent, + Hb::WindowFlags windowFlags ) + : d_ptr(NULL) + //QGraphicsView( /*parent, windowFlags*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// HbMainWindow::~HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::~HbMainWindow( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::insertView +// ----------------------------------------------------------------------------- +// +HbView * HbMainWindow::insertView( + int index, + QGraphicsWidget * widget ) + { + //SMC_MOCK_METHOD2( HbView *, int, index, + // QGraphicsWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::removeView +// ----------------------------------------------------------------------------- +// +QGraphicsWidget * HbMainWindow::removeView( + int index ) + { + SMC_MOCK_METHOD1( QGraphicsWidget *, int, index ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::currentViewIndex +// ----------------------------------------------------------------------------- +// +int HbMainWindow::currentViewIndex( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewCount +// ----------------------------------------------------------------------------- +// +int HbMainWindow::viewCount( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::indexOfView +// ----------------------------------------------------------------------------- +// +int HbMainWindow::indexOfView( + HbView * view ) const + { + //SMC_MOCK_METHOD1( int, HbView *, view ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewAt +// ----------------------------------------------------------------------------- +// +HbView * HbMainWindow::viewAt( + int index ) const + { + SMC_MOCK_METHOD1( HbView *, int, index ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::addView +// ----------------------------------------------------------------------------- +// +HbView * HbMainWindow::addView( + QGraphicsWidget * widget ) + { + //SMC_MOCK_METHOD1( HbView *, QGraphicsWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::removeView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::removeView( + QGraphicsWidget * widget ) + { + //SMC_MOCK_METHOD1( void, QGraphicsWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::views +// ----------------------------------------------------------------------------- +// +QList HbMainWindow::views( ) const + { + //SMC_MOCK_METHOD0( QList ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::currentView +// ----------------------------------------------------------------------------- +// +HbView * HbMainWindow::currentView( ) const + { + SMC_MOCK_METHOD0( HbView * ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::setCurrentView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setCurrentView( + HbView * view, + bool animate, + Hb::ViewSwitchFlags flags ) + { + //SMC_MOCK_METHOD3( void, HbView *, view, + // bool, animate, + // Hb::ViewSwitchFlags, flags ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::element +// ----------------------------------------------------------------------------- +// +QGraphicsWidget * HbMainWindow::element( + HbMainWindow::Element element ) const + { + //SMC_MOCK_METHOD1( QGraphicsWidget *, HbMainWindow::Element, element ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::setViewSwitchingEnabled +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setViewSwitchingEnabled( + bool enabled ) + { + SMC_MOCK_METHOD1( void, bool, enabled ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::isViewSwitchingEnabled +// ----------------------------------------------------------------------------- +// +bool HbMainWindow::isViewSwitchingEnabled( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::softKeyAction +// ----------------------------------------------------------------------------- +// +HbAction * HbMainWindow::softKeyAction( + Hb::SoftKeyId key ) const + { + //SMC_MOCK_METHOD1( HbAction *, Hb::SoftKeyId, key ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::addSoftKeyAction +// ----------------------------------------------------------------------------- +// +void HbMainWindow::addSoftKeyAction( + Hb::SoftKeyId key, + HbAction * action ) + { + //SMC_MOCK_METHOD2( void, Hb::SoftKeyId, key, + // HbAction *, action ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::removeSoftKeyAction +// ----------------------------------------------------------------------------- +// +void HbMainWindow::removeSoftKeyAction( + Hb::SoftKeyId key, + HbAction * action ) + { + //SMC_MOCK_METHOD2( void, Hb::SoftKeyId, key, + // HbAction *, action ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::orientation +// ----------------------------------------------------------------------------- +// +Qt::Orientation HbMainWindow::orientation( ) const + { + SMC_MOCK_METHOD0( Qt::Orientation ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::setOrientation +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setOrientation( + Qt::Orientation orientation, + bool animate ) + { + //SMC_MOCK_METHOD2( void, Qt::Orientation, orientation, + // bool, animate ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::unsetOrientation +// ----------------------------------------------------------------------------- +// +void HbMainWindow::unsetOrientation( + bool animate ) + { + SMC_MOCK_METHOD1( void, bool, animate ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::showItems +// ----------------------------------------------------------------------------- +// +void HbMainWindow::showItems( + Hb::SceneItems items ) + { + //SMC_MOCK_METHOD1( void, Hb::SceneItems, items ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::hideItems +// ----------------------------------------------------------------------------- +// +void HbMainWindow::hideItems( + Hb::SceneItems items ) + { + //SMC_MOCK_METHOD1( void, Hb::SceneItems, items ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::visibleItems +// ----------------------------------------------------------------------------- +// +Hb::SceneItems HbMainWindow::visibleItems( ) const + { + SMC_MOCK_METHOD0( Hb::SceneItems ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::isItemVisible +// ----------------------------------------------------------------------------- +// +bool HbMainWindow::isItemVisible( + Hb::SceneItem item ) const + { + //SMC_MOCK_METHOD1( bool, Hb::SceneItem, item ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::setItemVisible +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setItemVisible( + Hb::SceneItem item, + bool visible ) + { + //SMC_MOCK_METHOD2( void, Hb::SceneItem, item, + // bool, visible ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::nativeBackgroundWindow +// ----------------------------------------------------------------------------- +// +WId HbMainWindow::nativeBackgroundWindow( ) + { + SMC_MOCK_METHOD0( WId ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::resetNativeBackgroundWindow +// ----------------------------------------------------------------------------- +// +void HbMainWindow::resetNativeBackgroundWindow( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::layoutRect +// ----------------------------------------------------------------------------- +// +QRectF HbMainWindow::layoutRect( ) const + { + SMC_MOCK_METHOD0( QRectF ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::setCurrentViewIndex +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setCurrentViewIndex( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::nextView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::nextView( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::previousView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::previousView( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::broadcastEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::broadcastEvent( + int eventType ) + { + SMC_MOCK_METHOD1( void, int, eventType ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::toggleOrientation +// ----------------------------------------------------------------------------- +// +void HbMainWindow::toggleOrientation( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::currentViewIndexChanged +// ----------------------------------------------------------------------------- +// +void HbMainWindow::currentViewIndexChanged( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewReady +// ----------------------------------------------------------------------------- +// +void HbMainWindow::viewReady( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::currentViewChanged +// ----------------------------------------------------------------------------- +// +void HbMainWindow::currentViewChanged( + HbView * view ) + { + //SMC_MOCK_METHOD1( void, HbView *, view ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::aboutToChangeOrientation +// ----------------------------------------------------------------------------- +// +void HbMainWindow::aboutToChangeOrientation( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::aboutToChangeOrientation +// ----------------------------------------------------------------------------- +// +void HbMainWindow::aboutToChangeOrientation( + Qt::Orientation newOrientation, + bool animated ) + { + //SMC_MOCK_METHOD2( void, Qt::Orientation, newOrientation, + // bool, animated ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::orientationChanged +// ----------------------------------------------------------------------------- +// +void HbMainWindow::orientationChanged( + Qt::Orientation orientation ) + { + //SMC_MOCK_METHOD1( void, Qt::Orientation, orientation ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::changeEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::changeEvent( + QEvent * event ) + { + //SMC_MOCK_METHOD1( void, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::closeEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::closeEvent( + QCloseEvent * event ) + { + //SMC_MOCK_METHOD1( void, QCloseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::keyPressEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::keyPressEvent( + QKeyEvent * event ) + { + //SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::keyReleaseEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::keyReleaseEvent( + QKeyEvent * event ) + { + //SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::resizeEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::resizeEvent( + QResizeEvent * event ) + { + //SMC_MOCK_METHOD1( void, QResizeEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::customEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::customEvent( + QEvent * event ) + { + //SMC_MOCK_METHOD1( void, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::scrollContentsBy +// ----------------------------------------------------------------------------- +// +void HbMainWindow::scrollContentsBy( + int dx, + int dy ) + { + SMC_MOCK_METHOD2( void, int, dx, + int, dy ) + } + + +// ----------------------------------------------------------------------------- +// HbMainWindow::paintEvent +// ----------------------------------------------------------------------------- +// +void HbMainWindow::paintEvent( + QPaintEvent * event ) + { + //SMC_MOCK_METHOD1( void, QPaintEvent *, event ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_mnetworklistenerobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_mnetworklistenerobserver.cpp Mon May 03 12:31:11 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 "mnetworklistenerobserver.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// MNetworkListenerObserver::ShowNote +// ----------------------------------------------------------------------------- +// +void MNetworkListenerObserver::ShowNote( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// MNetworkListenerObserver::RemoveNote +// ----------------------------------------------------------------------------- +// +void MNetworkListenerObserver::RemoveNote( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarter::NetworkHandlingStarter +// ----------------------------------------------------------------------------- +// +NetworkHandlingStarter::NetworkHandlingStarter( + QObject * parent ) + //: + //XQServiceProvider( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarter::~NetworkHandlingStarter +// ----------------------------------------------------------------------------- +// +NetworkHandlingStarter::~NetworkHandlingStarter( ) + { + + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarter::start +// ----------------------------------------------------------------------------- +// +void NetworkHandlingStarter::start( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter_p.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate +// ----------------------------------------------------------------------------- +// +NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate( + QObject * ) + //: + //QObject( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate +// ----------------------------------------------------------------------------- +// +NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate( ) + { + + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView +// ----------------------------------------------------------------------------- +// +void NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarterPrivate::ShowNote +// ----------------------------------------------------------------------------- +// +void NetworkHandlingStarterPrivate::ShowNote( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// NetworkHandlingStarterPrivate::RemoveNote +// ----------------------------------------------------------------------------- +// +void NetworkHandlingStarterPrivate::RemoveNote( ) + { + SMC_MOCK_METHOD0( void ) + } +/*! + NetworkHandlingStarterPrivate::ViewDone() + */ +void NetworkHandlingStarterPrivate::ViewDone() +{ + +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_qabstractscrollarea.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qabstractscrollarea.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,447 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::QAbstractScrollArea +// ----------------------------------------------------------------------------- +// +QAbstractScrollArea::QAbstractScrollArea( + QAbstractScrollAreaPrivate & dd, + QWidget * parent ) + //: + //QFrame( /*dd, parent*/ ) + { + + } + +QAbstractScrollArea::QAbstractScrollArea(QWidget *parent) +{ + +} + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::~QAbstractScrollArea +// ----------------------------------------------------------------------------- +// +QAbstractScrollArea::~QAbstractScrollArea( ) + { + + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::verticalScrollBarPolicy +// ----------------------------------------------------------------------------- +// +Qt::ScrollBarPolicy QAbstractScrollArea::verticalScrollBarPolicy( ) const + { + SMC_MOCK_METHOD0( Qt::ScrollBarPolicy ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setVerticalScrollBarPolicy +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setVerticalScrollBarPolicy( + Qt::ScrollBarPolicy ) + { + // SMC_MOCK_METHOD1( void, Qt::, ScrollBarPolicy ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::verticalScrollBar +// ----------------------------------------------------------------------------- +// +QScrollBar * QAbstractScrollArea::verticalScrollBar( ) const + { + SMC_MOCK_METHOD0( QScrollBar * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setVerticalScrollBar +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setVerticalScrollBar( + QScrollBar * scrollbar ) + { + //SMC_MOCK_METHOD1( void, QScrollBar *, scrollbar ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::horizontalScrollBarPolicy +// ----------------------------------------------------------------------------- +// +Qt::ScrollBarPolicy QAbstractScrollArea::horizontalScrollBarPolicy( ) const + { + SMC_MOCK_METHOD0( Qt::ScrollBarPolicy ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setHorizontalScrollBarPolicy +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setHorizontalScrollBarPolicy( + Qt:: ScrollBarPolicy ) + { + //SMC_MOCK_METHOD1( void, Qt::, ScrollBarPolicy ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::horizontalScrollBar +// ----------------------------------------------------------------------------- +// +QScrollBar * QAbstractScrollArea::horizontalScrollBar( ) const + { + SMC_MOCK_METHOD0( QScrollBar * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setHorizontalScrollBar +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setHorizontalScrollBar( + QScrollBar * scrollbar ) + { + //SMC_MOCK_METHOD1( void, QScrollBar *, scrollbar ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::cornerWidget +// ----------------------------------------------------------------------------- +// +QWidget * QAbstractScrollArea::cornerWidget( ) const + { + SMC_MOCK_METHOD0( QWidget * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setCornerWidget +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setCornerWidget( + QWidget * widget ) + { + //SMC_MOCK_METHOD1( void, QWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::addScrollBarWidget +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::addScrollBarWidget( + QWidget * widget, + Qt::Alignment alignment ) + { + //SMC_MOCK_METHOD2( void, QWidget *, widget, + // Qt::Alignment, alignment ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::scrollBarWidgets +// ----------------------------------------------------------------------------- +// +QWidgetList QAbstractScrollArea::scrollBarWidgets( + Qt::Alignment alignment ) + { + //SMC_MOCK_METHOD1( QWidgetList, Qt::Alignment, alignment ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::viewport +// ----------------------------------------------------------------------------- +// +QWidget * QAbstractScrollArea::viewport( ) const + { + SMC_MOCK_METHOD0( QWidget * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setViewport +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setViewport( + QWidget * widget ) + { + //SMC_MOCK_METHOD1( void, QWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::maximumViewportSize +// ----------------------------------------------------------------------------- +// +QSize QAbstractScrollArea::maximumViewportSize( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::minimumSizeHint +// ----------------------------------------------------------------------------- +// +QSize QAbstractScrollArea::minimumSizeHint( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::sizeHint +// ----------------------------------------------------------------------------- +// +QSize QAbstractScrollArea::sizeHint( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setupViewport +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setupViewport( + QWidget * viewport ) + { + //SMC_MOCK_METHOD1( Q_SLOTS : void, QWidget *, viewport ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setViewportMargins +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setViewportMargins( + int left, + int top, + int right, + int bottom ) + { + //SMC_MOCK_METHOD4( void, int, left, + // int, top, + // int, right, + // int, bottom ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::setViewportMargins +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::setViewportMargins( + const QMargins & margins ) + { + //SMC_MOCK_METHOD1( void, const QMargins &, margins ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::event +// ----------------------------------------------------------------------------- +// +bool QAbstractScrollArea::event( + QEvent * ) + { + //SMC_MOCK_METHOD1( bool, QEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::viewportEvent +// ----------------------------------------------------------------------------- +// +bool QAbstractScrollArea::viewportEvent( + QEvent * ) + { + //SMC_MOCK_METHOD1( bool, QEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::resizeEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::resizeEvent( + QResizeEvent * ) + { + //SMC_MOCK_METHOD1( void, QResizeEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::paintEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::paintEvent( + QPaintEvent * ) + { + //SMC_MOCK_METHOD1( void, QPaintEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::mousePressEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::mousePressEvent( + QMouseEvent * ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::mouseReleaseEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::mouseReleaseEvent( + QMouseEvent * ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::mouseDoubleClickEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::mouseDoubleClickEvent( + QMouseEvent * ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::mouseMoveEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::mouseMoveEvent( + QMouseEvent * ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::wheelEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::wheelEvent( + QWheelEvent * ) + { + //SMC_MOCK_METHOD1( void, QWheelEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::contextMenuEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::contextMenuEvent( + QContextMenuEvent * ) + { + //SMC_MOCK_METHOD1( void, QContextMenuEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::dragEnterEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::dragEnterEvent( + QDragEnterEvent * ) + { + //SMC_MOCK_METHOD1( void, QDragEnterEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::dragMoveEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::dragMoveEvent( + QDragMoveEvent * ) + { + //SMC_MOCK_METHOD1( void, QDragMoveEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::dragLeaveEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::dragLeaveEvent( + QDragLeaveEvent * ) + { + //SMC_MOCK_METHOD1( void, QDragLeaveEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::dropEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::dropEvent( + QDropEvent * ) + { + //SMC_MOCK_METHOD1( void, QDropEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::keyPressEvent +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::keyPressEvent( + QKeyEvent * ) + { + //SMC_MOCK_METHOD1( void, QKeyEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QAbstractScrollArea::scrollContentsBy +// ----------------------------------------------------------------------------- +// +void QAbstractScrollArea::scrollContentsBy( + int dx, + int dy ) + { + SMC_MOCK_METHOD2( void, int, dx, + int, dy ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_qframe.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qframe.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + + +QWidget::QWidget(QWidget* parent, Qt::WindowFlags f) + {}; + +QWidget::~QWidget() + {}; + +void QWidget::setVisible(bool visible) + {}; + +inline bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const +{ + return true; +} + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QFrame::QFrame +// ----------------------------------------------------------------------------- +// +QFrame::QFrame( + QWidget * parent, + Qt::WindowFlags f ) + { + + } + + +// ----------------------------------------------------------------------------- +// QFrame::~QFrame +// ----------------------------------------------------------------------------- +// +QFrame::~QFrame( ) + { + + } + + +// ----------------------------------------------------------------------------- +// QFrame::frameStyle +// ----------------------------------------------------------------------------- +// +int QFrame::frameStyle( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::setFrameStyle +// ----------------------------------------------------------------------------- +// +void QFrame::setFrameStyle( int ) + { + } + + +// ----------------------------------------------------------------------------- +// QFrame::frameWidth +// ----------------------------------------------------------------------------- +// +int QFrame::frameWidth( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::sizeHint +// ----------------------------------------------------------------------------- +// +QSize QFrame::sizeHint( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::frameShape +// ----------------------------------------------------------------------------- +// +QFrame::Shape QFrame::frameShape( ) const + { + } + + +// ----------------------------------------------------------------------------- +// QFrame::setFrameShape +// ----------------------------------------------------------------------------- +// +void QFrame::setFrameShape( Shape ) + { + } + + +// ----------------------------------------------------------------------------- +// QFrame::frameShadow +// ----------------------------------------------------------------------------- +// +QFrame::Shadow QFrame::frameShadow( ) const + { + } + + +// ----------------------------------------------------------------------------- +// QFrame::setFrameShadow +// ----------------------------------------------------------------------------- +// +void QFrame::setFrameShadow( Shadow ) + { + } + + +// ----------------------------------------------------------------------------- +// QFrame::lineWidth +// ----------------------------------------------------------------------------- +// +int QFrame::lineWidth( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::setLineWidth +// ----------------------------------------------------------------------------- +// +void QFrame::setLineWidth( int ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::midLineWidth +// ----------------------------------------------------------------------------- +// +int QFrame::midLineWidth( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::setMidLineWidth +// ----------------------------------------------------------------------------- +// +void QFrame::setMidLineWidth( int ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::frameRect +// ----------------------------------------------------------------------------- +// +QRect QFrame::frameRect( ) const + { + SMC_MOCK_METHOD0( QRect ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::setFrameRect +// ----------------------------------------------------------------------------- +// +void QFrame::setFrameRect( + const QRect & ) + { + //SMC_MOCK_METHOD1( void, const QRect, & ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::event +// ----------------------------------------------------------------------------- +// +bool QFrame::event( + QEvent * e ) + { + //SMC_MOCK_METHOD1( bool, QEvent *, e ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::paintEvent +// ----------------------------------------------------------------------------- +// +void QFrame::paintEvent( + QPaintEvent * ) + { + //SMC_MOCK_METHOD1( void, QPaintEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::changeEvent +// ----------------------------------------------------------------------------- +// +void QFrame::changeEvent( + QEvent * ) + { + //SMC_MOCK_METHOD1( void, QEvent, * ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::drawFrame +// ----------------------------------------------------------------------------- +// +void QFrame::drawFrame( + QPainter * ) + { + //SMC_MOCK_METHOD1( void, QPainter, * ) + } + + +// ----------------------------------------------------------------------------- +// QFrame::QFrame +// ----------------------------------------------------------------------------- +// +QFrame::QFrame( + QFramePrivate & dd, + QWidget * parent, + Qt::WindowFlags f ) + //: + //QWidget( /*dd, parent, f*/ ) + { + + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/mocks/mock_qgraphicsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qgraphicsview.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,1150 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QGraphicsView::QGraphicsView +// ----------------------------------------------------------------------------- +// +QGraphicsView::QGraphicsView( + QWidget * parent ) + //: + //QAbstractScrollArea( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::QGraphicsView +// ----------------------------------------------------------------------------- +// +QGraphicsView::QGraphicsView( + QGraphicsScene * scene, + QWidget * parent ) + //: + //QAbstractScrollArea( /*scene, parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::~QGraphicsView +// ----------------------------------------------------------------------------- +// +QGraphicsView::~QGraphicsView( ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::sizeHint +// ----------------------------------------------------------------------------- +// +QSize QGraphicsView::sizeHint( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::renderHints +// ----------------------------------------------------------------------------- +// +QPainter::RenderHints QGraphicsView::renderHints( ) const + { + SMC_MOCK_METHOD0( QPainter::RenderHints ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setRenderHint +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setRenderHint( + QPainter::RenderHint hint, + bool enabled ) + { + //SMC_MOCK_METHOD2( void, QPainter::RenderHint, hint, + // bool, enabled ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setRenderHints +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setRenderHints( + QPainter::RenderHints hints ) + { + //SMC_MOCK_METHOD1( void, QPainter::RenderHints, hints ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::alignment +// ----------------------------------------------------------------------------- +// +Qt::Alignment QGraphicsView::alignment( ) const + { + SMC_MOCK_METHOD0( Qt::Alignment ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setAlignment +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setAlignment( + Qt::Alignment alignment ) + { + //SMC_MOCK_METHOD1( void, Qt::Alignment, alignment ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::transformationAnchor +// ----------------------------------------------------------------------------- +// +QGraphicsView::ViewportAnchor QGraphicsView::transformationAnchor( ) const + { + SMC_MOCK_METHOD0( ViewportAnchor ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setTransformationAnchor +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setTransformationAnchor( + ViewportAnchor anchor ) + { + //SMC_MOCK_METHOD1( void, ViewportAnchor, anchor ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::resizeAnchor +// ----------------------------------------------------------------------------- +// +/* +ViewportAnchor QGraphicsView::resizeAnchor( ) const + { + SMC_MOCK_METHOD0( ViewportAnchor ) + } +*/ + +// ----------------------------------------------------------------------------- +// QGraphicsView::setResizeAnchor +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setResizeAnchor( + QGraphicsView::ViewportAnchor anchor ) + { + //SMC_MOCK_METHOD1( void, ViewportAnchor, anchor ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::viewportUpdateMode +// ----------------------------------------------------------------------------- +// +QGraphicsView::ViewportUpdateMode QGraphicsView::viewportUpdateMode( ) const + { + SMC_MOCK_METHOD0( ViewportUpdateMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setViewportUpdateMode +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setViewportUpdateMode( + QGraphicsView::ViewportUpdateMode mode ) + { + //SMC_MOCK_METHOD1( void, ViewportUpdateMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::optimizationFlags +// ----------------------------------------------------------------------------- +// +QGraphicsView::OptimizationFlags QGraphicsView::optimizationFlags( ) const + { + SMC_MOCK_METHOD0( OptimizationFlags ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setOptimizationFlag +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setOptimizationFlag( + QGraphicsView::OptimizationFlag flag, + bool enabled ) + { + SMC_MOCK_METHOD2( void, OptimizationFlag, flag, + bool, enabled ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setOptimizationFlags +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setOptimizationFlags( + OptimizationFlags flags ) + { + //SMC_MOCK_METHOD1( void, OptimizationFlags, flags ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::dragMode +// ----------------------------------------------------------------------------- +// +QGraphicsView::DragMode QGraphicsView::dragMode( ) const + { + SMC_MOCK_METHOD0( DragMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setDragMode +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setDragMode( + DragMode mode ) + { + //SMC_MOCK_METHOD1( void, DragMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::rubberBandSelectionMode +// ----------------------------------------------------------------------------- +// +Qt::ItemSelectionMode QGraphicsView::rubberBandSelectionMode( ) const + { + SMC_MOCK_METHOD0( Qt::ItemSelectionMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setRubberBandSelectionMode +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setRubberBandSelectionMode( + Qt::ItemSelectionMode mode ) + { + //SMC_MOCK_METHOD1( void, Qt::ItemSelectionMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::cacheMode +// ----------------------------------------------------------------------------- +// +QGraphicsView::CacheMode QGraphicsView::cacheMode( ) const + { + SMC_MOCK_METHOD0( CacheMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setCacheMode +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setCacheMode( + CacheMode mode ) + { + //SMC_MOCK_METHOD1( void, CacheMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::resetCachedContent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::resetCachedContent( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::isInteractive +// ----------------------------------------------------------------------------- +// +bool QGraphicsView::isInteractive( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setInteractive +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setInteractive( + bool allowed ) + { + SMC_MOCK_METHOD1( void, bool, allowed ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::scene +// ----------------------------------------------------------------------------- +// +QGraphicsScene * QGraphicsView::scene( ) const + { + SMC_MOCK_METHOD0( QGraphicsScene * ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setScene +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setScene( + QGraphicsScene * scene ) + { + //SMC_MOCK_METHOD1( void, QGraphicsScene *, scene ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::sceneRect +// ----------------------------------------------------------------------------- +// +QRectF QGraphicsView::sceneRect( ) const + { + SMC_MOCK_METHOD0( QRectF ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setSceneRect +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setSceneRect( + const QRectF & rect ) + { + //SMC_MOCK_METHOD1( void, const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::matrix +// ----------------------------------------------------------------------------- +// +QMatrix QGraphicsView::matrix( ) const + { + SMC_MOCK_METHOD0( QMatrix ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setMatrix +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setMatrix( + const QMatrix & matrix, + bool combine ) + { + //SMC_MOCK_METHOD2( void, const QMatrix &, matrix, + // bool, combine ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::resetMatrix +// ----------------------------------------------------------------------------- +// +void QGraphicsView::resetMatrix( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::transform +// ----------------------------------------------------------------------------- +// +QTransform QGraphicsView::transform( ) const + { + SMC_MOCK_METHOD0( QTransform ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::viewportTransform +// ----------------------------------------------------------------------------- +// +QTransform QGraphicsView::viewportTransform( ) const + { + SMC_MOCK_METHOD0( QTransform ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::isTransformed +// ----------------------------------------------------------------------------- +// +bool QGraphicsView::isTransformed( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setTransform +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setTransform( + const QTransform & matrix, + bool combine ) + { + //SMC_MOCK_METHOD2( void, const QTransform &, matrix, + // bool, combine ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::resetTransform +// ----------------------------------------------------------------------------- +// +void QGraphicsView::resetTransform( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::rotate +// ----------------------------------------------------------------------------- +// +void QGraphicsView::rotate( + qreal angle ) + { + //SMC_MOCK_METHOD1( void, qreal, angle ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::scale +// ----------------------------------------------------------------------------- +// +void QGraphicsView::scale( + qreal sx, + qreal sy ) + { + //SMC_MOCK_METHOD2( void, qreal, sx, + // qreal, sy ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::shear +// ----------------------------------------------------------------------------- +// +void QGraphicsView::shear( + qreal sh, + qreal sv ) + { + //SMC_MOCK_METHOD2( void, qreal, sh, + // qreal, sv ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::translate +// ----------------------------------------------------------------------------- +// +void QGraphicsView::translate( + qreal dx, + qreal dy ) + { + SMC_MOCK_METHOD2( void, qreal, dx, + qreal, dy ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::centerOn +// ----------------------------------------------------------------------------- +// +void QGraphicsView::centerOn( + const QPointF & pos ) + { + //SMC_MOCK_METHOD1( void, const QPointF &, pos ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::centerOn +// ----------------------------------------------------------------------------- +// +void QGraphicsView::centerOn( + const QGraphicsItem * item ) + { + //SMC_MOCK_METHOD1( void, const QGraphicsItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::ensureVisible +// ----------------------------------------------------------------------------- +// +void QGraphicsView::ensureVisible( + const QRectF & rect, + int xmargin, + int ymargin ) + { + //SMC_MOCK_METHOD3( void, const QRectF &, rect, + // int, xmargin, + // int, ymargin ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::ensureVisible +// ----------------------------------------------------------------------------- +// +void QGraphicsView::ensureVisible( + const QGraphicsItem * item, + int xmargin, + int ymargin ) + { + //SMC_MOCK_METHOD3( void, const QGraphicsItem *, item, + // int, xmargin, + // int, ymargin ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::fitInView +// ----------------------------------------------------------------------------- +// +void QGraphicsView::fitInView( + const QRectF & rect, + Qt::AspectRatioMode aspectRadioMode ) + { + //SMC_MOCK_METHOD2( void, const QRectF &, rect, + // Qt::AspectRatioMode, aspectRadioMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::fitInView +// ----------------------------------------------------------------------------- +// +void QGraphicsView::fitInView( + const QGraphicsItem * item, + Qt::AspectRatioMode aspectRadioMode ) + { + //SMC_MOCK_METHOD2( void, const QGraphicsItem *, item, + // Qt::AspectRatioMode, aspectRadioMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::render +// ----------------------------------------------------------------------------- +// +void QGraphicsView::render( + QPainter * painter, + const QRectF & target, + const QRect & source, + Qt::AspectRatioMode aspectRatioMode ) + { + //SMC_MOCK_METHOD4( void, QPainter *, painter, + // const QRectF &, target, + // const QRect &, source, + // Qt::AspectRatioMode, aspectRatioMode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::items +// ----------------------------------------------------------------------------- +// +QList QGraphicsView::items( ) const + { + SMC_MOCK_METHOD0( QList ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::items +// ----------------------------------------------------------------------------- +// +QList QGraphicsView::items( + const QPoint & pos ) const + { + //SMC_MOCK_METHOD1( QList , const QPoint &, pos ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::items +// ----------------------------------------------------------------------------- +// +QList QGraphicsView::items( + const QRect & rect, + Qt::ItemSelectionMode mode ) const + { + //SMC_MOCK_METHOD2( QList , const QRect &, rect, + // Qt::ItemSelectionMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::items +// ----------------------------------------------------------------------------- +// +QList QGraphicsView::items( + const QPolygon & polygon, + Qt::ItemSelectionMode mode ) const + { + //SMC_MOCK_METHOD2( QList , const QPolygon &, polygon, + // Qt::ItemSelectionMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::items +// ----------------------------------------------------------------------------- +// +QList QGraphicsView::items( + const QPainterPath & path, + Qt::ItemSelectionMode mode ) const + { + //SMC_MOCK_METHOD2( QList , const QPainterPath &, path, + // Qt::ItemSelectionMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::itemAt +// ----------------------------------------------------------------------------- +// +QGraphicsItem * QGraphicsView::itemAt( + const QPoint & pos ) const + { + //SMC_MOCK_METHOD1( QGraphicsItem *, const QPoint &, pos ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapToScene +// ----------------------------------------------------------------------------- +// +QPointF QGraphicsView::mapToScene( + const QPoint & point ) const + { + //SMC_MOCK_METHOD1( QPointF, const QPoint &, point ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapToScene +// ----------------------------------------------------------------------------- +// +QPolygonF QGraphicsView::mapToScene( + const QRect & rect ) const + { + //SMC_MOCK_METHOD1( QPolygonF, const QRect &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapToScene +// ----------------------------------------------------------------------------- +// +QPolygonF QGraphicsView::mapToScene( + const QPolygon & polygon ) const + { + //SMC_MOCK_METHOD1( QPolygonF, const QPolygon &, polygon ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapToScene +// ----------------------------------------------------------------------------- +// +QPainterPath QGraphicsView::mapToScene( + const QPainterPath & path ) const + { + //SMC_MOCK_METHOD1( QPainterPath, const QPainterPath &, path ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapFromScene +// ----------------------------------------------------------------------------- +// +QPoint QGraphicsView::mapFromScene( + const QPointF & point ) const + { + SMC_MOCK_METHOD1( QPoint, const QPointF &, point ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapFromScene +// ----------------------------------------------------------------------------- +// +QPolygon QGraphicsView::mapFromScene( + const QRectF & rect ) const + { + //SMC_MOCK_METHOD1( QPolygon, const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapFromScene +// ----------------------------------------------------------------------------- +// +QPolygon QGraphicsView::mapFromScene( + const QPolygonF & polygon ) const + { + //SMC_MOCK_METHOD1( QPolygon, const QPolygonF &, polygon ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mapFromScene +// ----------------------------------------------------------------------------- +// +QPainterPath QGraphicsView::mapFromScene( + const QPainterPath & path ) const + { + //SMC_MOCK_METHOD1( QPainterPath, const QPainterPath &, path ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::inputMethodQuery +// ----------------------------------------------------------------------------- +// +QVariant QGraphicsView::inputMethodQuery( + Qt::InputMethodQuery query ) const + { + //SMC_MOCK_METHOD1( QVariant, Qt::InputMethodQuery, query ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::backgroundBrush +// ----------------------------------------------------------------------------- +// +QBrush QGraphicsView::backgroundBrush( ) const + { + SMC_MOCK_METHOD0( QBrush ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setBackgroundBrush +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setBackgroundBrush( + const QBrush & brush ) + { + //SMC_MOCK_METHOD1( void, const QBrush &, brush ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::foregroundBrush +// ----------------------------------------------------------------------------- +// +QBrush QGraphicsView::foregroundBrush( ) const + { + SMC_MOCK_METHOD0( QBrush ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setForegroundBrush +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setForegroundBrush( + const QBrush & brush ) + { + //SMC_MOCK_METHOD1( void, const QBrush &, brush ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::updateScene +// ----------------------------------------------------------------------------- +// +void QGraphicsView::updateScene( + const QList & rects ) + { + //SMC_MOCK_METHOD1( Q_SLOTS : void, const QList &, rects ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::invalidateScene +// ----------------------------------------------------------------------------- +// +void QGraphicsView::invalidateScene( + const QRectF & rect, + QGraphicsScene::SceneLayers layers ) + { + //SMC_MOCK_METHOD2( void, const QRectF &, rect, + // QGraphicsScene::SceneLayers, layers ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::updateSceneRect +// ----------------------------------------------------------------------------- +// +void QGraphicsView::updateSceneRect( + const QRectF & rect ) + { + //SMC_MOCK_METHOD1( void, const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::setupViewport +// ----------------------------------------------------------------------------- +// +void QGraphicsView::setupViewport( + QWidget * widget ) + { + //SMC_MOCK_METHOD1( Q_SLOTS : void, QWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::QGraphicsView +// ----------------------------------------------------------------------------- +// +QGraphicsView::QGraphicsView( + QGraphicsViewPrivate &, + QWidget * parent ) + //: + //QAbstractScrollArea( /*&, parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::event +// ----------------------------------------------------------------------------- +// +bool QGraphicsView::event( + QEvent * event ) + { + //SMC_MOCK_METHOD1( bool, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::viewportEvent +// ----------------------------------------------------------------------------- +// +bool QGraphicsView::viewportEvent( + QEvent * event ) + { + //SMC_MOCK_METHOD1( bool, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::contextMenuEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::contextMenuEvent( + QContextMenuEvent * event ) + { + //SMC_MOCK_METHOD1( void, QContextMenuEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::dragEnterEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::dragEnterEvent( + QDragEnterEvent * event ) + { + //SMC_MOCK_METHOD1( void, QDragEnterEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::dragLeaveEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::dragLeaveEvent( + QDragLeaveEvent * event ) + { + //SMC_MOCK_METHOD1( void, QDragLeaveEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::dragMoveEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::dragMoveEvent( + QDragMoveEvent * event ) + { + //SMC_MOCK_METHOD1( void, QDragMoveEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::dropEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::dropEvent( + QDropEvent * event ) + { + //SMC_MOCK_METHOD1( void, QDropEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::focusInEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::focusInEvent( + QFocusEvent * event ) + { + //SMC_MOCK_METHOD1( void, QFocusEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::focusNextPrevChild +// ----------------------------------------------------------------------------- +// +bool QGraphicsView::focusNextPrevChild( + bool next ) + { + //SMC_MOCK_METHOD1( bool, bool, next ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::focusOutEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::focusOutEvent( + QFocusEvent * event ) + { + //SMC_MOCK_METHOD1( void, QFocusEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::keyPressEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::keyPressEvent( + QKeyEvent * event ) + { + //SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::keyReleaseEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::keyReleaseEvent( + QKeyEvent * event ) + { + //SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mouseDoubleClickEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::mouseDoubleClickEvent( + QMouseEvent * event ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mousePressEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::mousePressEvent( + QMouseEvent * event ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mouseMoveEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::mouseMoveEvent( + QMouseEvent * event ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::mouseReleaseEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::mouseReleaseEvent( + QMouseEvent * event ) + { + //SMC_MOCK_METHOD1( void, QMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::wheelEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::wheelEvent( + QWheelEvent * event ) + { + //SMC_MOCK_METHOD1( void, QWheelEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::paintEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::paintEvent( + QPaintEvent * event ) + { + //SMC_MOCK_METHOD1( void, QPaintEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::resizeEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::resizeEvent( + QResizeEvent * event ) + { + //SMC_MOCK_METHOD1( void, QResizeEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::scrollContentsBy +// ----------------------------------------------------------------------------- +// +void QGraphicsView::scrollContentsBy( + int dx, + int dy ) + { + //SMC_MOCK_METHOD2( void, int, dx, + // int, dy ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::showEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::showEvent( + QShowEvent * event ) + { + //SMC_MOCK_METHOD1( void, QShowEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::inputMethodEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsView::inputMethodEvent( + QInputMethodEvent * event ) + { + //SMC_MOCK_METHOD1( void, QInputMethodEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::drawBackground +// ----------------------------------------------------------------------------- +// +void QGraphicsView::drawBackground( + QPainter * painter, + const QRectF & rect ) + { + //SMC_MOCK_METHOD2( void, QPainter *, painter, + // const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::drawForeground +// ----------------------------------------------------------------------------- +// +void QGraphicsView::drawForeground( + QPainter * painter, + const QRectF & rect ) + { + //SMC_MOCK_METHOD2( void, QPainter *, painter, + // const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsView::drawItems +// ----------------------------------------------------------------------------- +// +/* +void QGraphicsView::drawItems( + QPainter * painter, + int numItems, + QGraphicsItem * items, + const QStyleOptionGraphicsItem options ) + { + //SMC_MOCK_METHOD4( void, QPainter *, painter, + // int, numItems, + // QGraphicsItem *, items, + // const QStyleOptionGraphicsItem, options ) + } + +*/ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/run_auto_tests_qt.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,194 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo off +setlocal +goto :startup + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function DEFAULT +:: +:: Modify this function +:: - TESTED_SRC can be changed to match tested code. +:: Specifies path from testcode group directory to +:: tested code +:: - Add test directories to be runned +:: ie. "call :build ut_projectdirectory" or use +:: "for /f %%a in ('dir /b ut_*') do call :build %%a" +:: which compiles, instruments and runs all test directories +:: starting with "ut_". +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:DEFAULT +set TESTED_SRC=..\..\src\*.cpp + +for /f %%a in ('dir /b ut_*') do call :build %%a +if [%DOMODULESTESTS%] EQU [TRUE] ( +for /f %%a in ('dir /b mt_*') do call :build %%a +) + +call :finish +goto :END + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function STARTUP +:: +:: Initializing script +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:STARTUP + +set BUILDTESTS=TRUE +set RUNTESTS=TRUE +set INSTRUMENT=TRUE +set REMOVEINSTRUMENT=TRUE +set DOMODULESTESTS=TRUE +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD +set PATH_TO_DLL=\epoc32\release\winscw\udeb +set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result + +if not exist %PATH_TO_COVERAGE_DATA% ( +mkdir %PATH_TO_COVERAGE_DATA% +) + +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + +if [%1] EQU [] ( goto default ) + +call :%1 +call :%2 +call :%3 +call :%4 +call :%5 +echo Running tests = %RUNTESTS% +echo Instrumenting tests = %INSTRUMENT% +goto default + +:/NOCLEANUP +set REMOVEINSTRUMENT=FALSE +goto end + +:/NORUN +set RUNTESTS=FALSE +set REMOVEINSTRUMENT=FALSE +goto end + +:/NOINSTRUMENT +set INSTRUMENT=FALSE +goto end + +:/NOBUILD +set BUILDTESTS=FALSE +goto end + +:/ONLYUNITTESTS +set DOMODULESTESTS=FALSE +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function FINISH +:: +:: Finishes run_auto_tests.bat +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:FINISH + +if [%RUNTESTS%] EQU [TRUE] ( +call :runtests +) + +if [%INSTRUMENT%] EQU [TRUE] ( +call :calculatecoverage +) + +if [%REMOVEINSTRUMENT%] EQU [TRUE] ( +call :removecoverage +) +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function BUILD +:: param directory +:: +:: builds test from given directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:BUILD +setlocal +if [%BUILDTESTS%] EQU [FALSE] ( goto end ) +echo Building %1 +if not exist %1 ( +echo %1 Not found! +goto end +) + +pushd . +call cd %1 +call qmake +call sbs --config winscw_udeb --keepgoing CLEAN +if [%INSTRUMENT%] EQU [TRUE] ( +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" +) else ( +call %SBS_CALL% +) + +popd +endlocal +goto end + + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function RUNTESTS +:: +:: NOTE! Function assumes that test binary is named according to test directory. +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:RUNTESTS +echo Running tests +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe -dtextshell -- + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function CALCULATECOVERAGE +:: +:: Calculates test coverage. Generates html +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:CALCULATECOVERAGE +echo Calculating coverage +ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt +call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function REMOVECOVERAGE +:: +:: Removes data from coverage directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:REMOVECOVERAGE +echo Removing deleting coverage data +call del %PATH_TO_COVERAGE_DATA%\*.sym +call del %PATH_TO_COVERAGE_DATA%\*.dat +call del profile.txt +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function END +:: +:: Prints done +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:END +echo Done! \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/inc/ut_cnetworklistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/inc/ut_cnetworklistener.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_CNETWORKLISTENER_H +#define UT_CNETWORKLISTENER_H + +#include +#include +#include + +class CNetworkListener; + +class ut_cnetworklistener : public QObject, public MockService, public MNetworkListenerObserver +{ + Q_OBJECT + +public: + + ut_cnetworklistener(); + ~ut_cnetworklistener(); + +public: + // From MNetworkListenerObserver + void ShowNote(); + void RemoveNote(); + +private slots: + + void init(); + void cleanup(); + + void t_HandleNetworkMessage(); + void t_HandleNetworkError(); + void t_NWLostDelayCallBack(); + + +private: + + CNetworkListener *m_networkListener; + +}; + +#endif // UT_CNETWORKLISTENER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/src/ut_cnetworklistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/src/ut_cnetworklistener.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include +#include +#include + +TNWInfo* PoiterNWInfo; + +CNWSession* CreateL( MNWMessageObserver& /*aMessage*/, TNWInfo& aTNWInfo ) +{ + PoiterNWInfo = &aTNWInfo; + aTNWInfo.iSelectionSetting = ENWNetworkSelectionManual; + aTNWInfo.iRegistrationStatus = ENWRegistrationDenied; + CNWSession* nullPointer(NULL); + return nullPointer; +} + +/*! + ut_cnetworklistener::ut_cnetworklistener + */ +ut_cnetworklistener::ut_cnetworklistener() + : m_networkListener(0) +{ +} + +/*! + ut_cnetworklistener::~ut_cnetworklistener + */ +ut_cnetworklistener::~ut_cnetworklistener() +{ + delete m_networkListener; +} + +/*! + ut_cnetworklistener::init + */ +void ut_cnetworklistener::init() +{ + initialize(); + + m_networkListener = CNetworkListener::NewL(*this); + + QVERIFY(verify()); +} + +/*! + ut_cnetworklistener::cleanup + */ +void ut_cnetworklistener::cleanup() +{ + delete m_networkListener; + m_networkListener = 0; + + reset(); +} + +/*! + From MNetworkListenerObserver + */ +void ut_cnetworklistener::ShowNote() +{ +} + +/*! + From MNetworkListenerObserver + */ +void ut_cnetworklistener::RemoveNote() +{ +} + +/*! + ut_cnetworklistener::t_HandleNetworkMessage + */ +void ut_cnetworklistener::t_HandleNetworkMessage() +{ + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredNoService; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredEmergencyOnly; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredSearching; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWRegisteredBusy; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWRegisteredOnHomeNetwork; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWRegisteredRoaming; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iRegistrationStatus = ENWRegistrationUnknown; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + PoiterNWInfo->iSelectionSetting = ENWNetworkSelectionAutomatic; + PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredNoService; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + PoiterNWInfo->iRegistrationStatus = ENWRegisteredOnHomeNetwork; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); + + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkModeChange); + + PoiterNWInfo->iRegistrationStatus = (TNWRegistrationStatus)123456789; + m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange); +} + +/*! + ut_cnetworklistener::t_HandleNetworkError + */ +void ut_cnetworklistener::t_HandleNetworkError() +{ + m_networkListener->HandleNetworkError( + MNWMessageObserver::ENWGetServiceProviderName, KErrGeneral ); +} + +/*! + ut_cnetworklistener::t_NWLostDelayCallBack + */ +void ut_cnetworklistener::t_NWLostDelayCallBack() +{ + TAny* pointer(NULL); + m_networkListener->NWLostDelayCallBack(pointer); + + CNetworkListener* networklistener = CNetworkListener::NewL(*this);; + m_networkListener->NWLostDelayCallBack( networklistener ); + delete networklistener; +} + +QTEST_MAIN_S60(ut_cnetworklistener) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/ut_cnetworklistener.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/ut_cnetworklistener.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,48 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += qtestlib hb +TEMPLATE = app +TARGET = + +INCLUDEPATH += ./inc +INCLUDEPATH += ../../inc +INCLUDEPATH += ../common +DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib \ + -lsymbianmock +} + +# test code +HEADERS += ./inc/ut_cnetworklistener.h +SOURCES += ./src/ut_cnetworklistener.cpp + +# code to be tested +HEADERS += ../../inc/cnetworklistener.h +SOURCES += ../../src/cnetworklistener.cpp + +# mocks needed for testing +SOURCES += ../mocks/mock_cnwsession.cpp +SOURCES += ../mocks/mock_centralrepository.cpp + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/inc/ut_networkhandlingstarter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/inc/ut_networkhandlingstarter.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_NETWORKHANDLINGSTARTER_H +#define UT_NETWORKHANDLINGSTARTER_H + +#include +#include + +class NetworkHandlingStarter; + +class ut_networkhandlingstarter : public QObject, public MockService +{ + Q_OBJECT + +public: + + ut_networkhandlingstarter(); + ~ut_networkhandlingstarter(); + +private slots: + + void init(); + void cleanup(); + + void t_test(); + + +private: + + NetworkHandlingStarter *m_NetworkHandlingStarter; + +}; + +#endif // UT_NETWORKHANDLINGSTARTER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/src/ut_networkhandlingstarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/src/ut_networkhandlingstarter.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +/*! + ut_networkhandlingstarter::ut_networkhandlingstarter + */ +ut_networkhandlingstarter::ut_networkhandlingstarter() + : m_NetworkHandlingStarter(0) +{ +} + +/*! + ut_networkhandlingstarter::~ut_networkhandlingstarter + */ +ut_networkhandlingstarter::~ut_networkhandlingstarter() +{ +} + +/*! + ut_networkhandlingstarter::init + */ +void ut_networkhandlingstarter::init() +{ + initialize(); + + m_NetworkHandlingStarter = new NetworkHandlingStarter(); + + QVERIFY(verify()); +} + +/*! + ut_networkhandlingstarter::cleanup + */ +void ut_networkhandlingstarter::cleanup() +{ + delete m_NetworkHandlingStarter; + m_NetworkHandlingStarter = 0; + + reset(); +} + +/*! + ut_networkhandlingstarter::t_test + */ +void ut_networkhandlingstarter::t_test() +{ + m_NetworkHandlingStarter->start(); + m_NetworkHandlingStarter->start(); +} + +QTEST_MAIN_S60(ut_networkhandlingstarter) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/ut_networkhandlingstarter.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/ut_networkhandlingstarter.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,50 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += qtestlib hb +TEMPLATE = app +TARGET = + +INCLUDEPATH += ./inc +INCLUDEPATH += ../../inc +INCLUDEPATH += ../common +DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib \ + -lsymbianmock \ + -lxqservice +} + +# test code +HEADERS += ./inc/ut_networkhandlingstarter.h +SOURCES += ./src/ut_networkhandlingstarter.cpp + +# code to be tested +HEADERS += ../../inc/networkhandlingstarter.h +SOURCES += ../../src/networkhandlingstarter.cpp + +# mocks needed for testing +HEADERS += ../../inc/networkhandlingstarter_p.h +SOURCES += ../mocks/mock_networkhandlingstarter_p.cpp + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/inc/ut_networkhandlingstarter_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/inc/ut_networkhandlingstarter_p.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_NETWORKHANDLINGSTARTER_P_H +#define UT_NETWORKHANDLINGSTARTER_P_H + +#include +#include +#include + +class NetworkHandlingStarterPrivate; + +class ut_networkhandlingstarter_p : public QObject, public MockService +{ + Q_OBJECT + +public: + + ut_networkhandlingstarter_p(); + ~ut_networkhandlingstarter_p(); + +private slots: + + void init(); + void cleanup(); + + void t_LaunchNetworksettingsPlugin(); + void t_ViewDone(); + void t_ShowNote(); + void t_RemoveNote(); + + +private: + + NetworkHandlingStarterPrivate *m_NetworkHandlingStarterPrivate; + HbMainWindow m_HbMainWindow; + QList m_MainWindowList; + +}; + +#endif // UT_NETWORKHANDLINGSTARTER_P_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/src/ut_networkhandlingstarter_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/src/ut_networkhandlingstarter_p.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +/*! + ut_networkhandlingstarter_p::ut_networkhandlingstarter_p + */ +ut_networkhandlingstarter_p::ut_networkhandlingstarter_p() + : m_NetworkHandlingStarterPrivate(0) +{ + SmcDefaultValue< QList >::SetL(m_MainWindowList); +} + +/*! + ut_networkhandlingstarter_p::~ut_networkhandlingstarter_p + */ +ut_networkhandlingstarter_p::~ut_networkhandlingstarter_p() +{ + delete m_NetworkHandlingStarterPrivate; +} + +/*! + ut_networkhandlingstarter_p::init + */ +void ut_networkhandlingstarter_p::init() +{ + initialize(); + + m_NetworkHandlingStarterPrivate = new NetworkHandlingStarterPrivate(); + + QVERIFY(verify()); +} + +/*! + ut_networkhandlingstarter_p::cleanup + */ +void ut_networkhandlingstarter_p::cleanup() +{ + delete m_NetworkHandlingStarterPrivate; + m_NetworkHandlingStarterPrivate = 0; + m_MainWindowList.clear(); + + reset(); +} + +/*! + ut_networkhandlingstarter_p::t_LaunchNetworksettingsPlugin + */ +void ut_networkhandlingstarter_p::t_LaunchNetworksettingsPlugin() +{ + m_NetworkHandlingStarterPrivate->LaunchCpNetworkPluginView(); + + m_MainWindowList.append(&m_HbMainWindow); + expect("HbInstance::allMainWindows").returns(m_MainWindowList).times(2); + m_NetworkHandlingStarterPrivate->LaunchCpNetworkPluginView(); +} + +/*! + ut_networkhandlingstarter_p::t_ViewDone + */ +void ut_networkhandlingstarter_p::t_ViewDone() +{ + m_NetworkHandlingStarterPrivate->ViewDone(); + + m_MainWindowList.append(&m_HbMainWindow); + expect("HbInstance::allMainWindows").returns(m_MainWindowList); + m_NetworkHandlingStarterPrivate->ViewDone(); +} + +/*! + ut_networkhandlingstarter_p::t_ShowNote + */ +void ut_networkhandlingstarter_p::t_ShowNote() +{ + m_NetworkHandlingStarterPrivate->ShowNote(); + m_NetworkHandlingStarterPrivate->ShowNote(); +} + +/*! + ut_networkhandlingstarter_p::t_RemoveNote + */ +void ut_networkhandlingstarter_p::t_RemoveNote() +{ + // Create note + m_NetworkHandlingStarterPrivate->ShowNote(); + // Test + m_NetworkHandlingStarterPrivate->RemoveNote(); + m_NetworkHandlingStarterPrivate->RemoveNote(); +} + +QTEST_MAIN_S60(ut_networkhandlingstarter_p) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/ut_networkhandlingstarter_p.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/ut_networkhandlingstarter_p.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,56 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += qtestlib hb +TEMPLATE = app +TARGET = + +INCLUDEPATH += ./inc +INCLUDEPATH += ../../inc +INCLUDEPATH += ../common +DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib \ + -lsymbianmock \ + -lxqserviceutil +} + +# test code +HEADERS += ./inc/ut_networkhandlingstarter_p.h +SOURCES += ./src/ut_networkhandlingstarter_p.cpp + +# code to be tested +HEADERS += ../../inc/networkhandlingstarter_p.h +SOURCES += ../../src/networkhandlingstarter_p.cpp + +# mocks needed for testing +SOURCES += ../mocks/mock_cnetworklistener.cpp +SOURCES += ../mocks/mock_cppluginlauncher.cpp +SOURCES += ../mocks/mock_hbdevicemessagebox.cpp +SOURCES += ../mocks/mock_hbaction.cpp +SOURCES += ../mocks/mock_hbinstance.cpp +SOURCES += ../mocks/mock_hbmainwindow.cpp +SOURCES += ../mocks/mock_qgraphicsview.cpp +SOURCES += ../mocks/mock_qabstractscrollarea.cpp +SOURCES += ../mocks/mock_qframe.cpp + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/parserrecognizer/parserrecognizer.pro --- a/phoneengine/parserrecognizer/parserrecognizer.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/parserrecognizer/parserrecognizer.pro Mon May 03 12:31:11 2010 +0300 @@ -25,7 +25,7 @@ DEFINES += BUILD_PARSERRECOGNIZER INCLUDEPATH += ../../inc \ - ../phonemodel/inc + ../phonemodel/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE parserDefFiles = \ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/moc_parserrecognizer.cpp --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/moc_parserrecognizer.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'parserrecognizer.h' -** -** Created: Fri 18. Sep 14:27:09 2009 -** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2-tower) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "../../inc/parserrecognizer.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'parserrecognizer.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 61 -#error "This file was generated using the moc from 4.5.2-tower. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -static const uint qt_meta_data_ParserRecognizer[] = { - - // content: - 2, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - - 0 // eod -}; - -static const char qt_meta_stringdata_ParserRecognizer[] = { - "ParserRecognizer\0" -}; - -const QMetaObject ParserRecognizer::staticMetaObject = { - { &QObject::staticMetaObject, qt_meta_stringdata_ParserRecognizer, - qt_meta_data_ParserRecognizer, 0 } -}; - -const QMetaObject *ParserRecognizer::metaObject() const -{ - return &staticMetaObject; -} - -void *ParserRecognizer::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_ParserRecognizer)) - return static_cast(const_cast< ParserRecognizer*>(this)); - return QObject::qt_metacast(_clname); -} - -int ParserRecognizer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QObject::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/moc_xqservicerequest.cpp --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/moc_xqservicerequest.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'xqservicerequest.h' -** -** Created: Tue 22. Sep 12:22:55 2009 -** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2-tower) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "xqservicerequest.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'xqservicerequest.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 61 -#error "This file was generated using the moc from 4.5.2-tower. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -static const uint qt_meta_data_XQServiceRequest[] = { - - // content: - 2, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - - 0 // eod -}; - -static const char qt_meta_stringdata_XQServiceRequest[] = { - "XQServiceRequest\0" -}; - -const QMetaObject XQServiceRequest::staticMetaObject = { - { &QObject::staticMetaObject, qt_meta_stringdata_XQServiceRequest, - qt_meta_data_XQServiceRequest, 0 } -}; - -const QMetaObject *XQServiceRequest::metaObject() const -{ - return &staticMetaObject; -} - -void *XQServiceRequest::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_XQServiceRequest)) - return static_cast(const_cast< XQServiceRequest*>(this)); - return QObject::qt_metacast(_clname); -} - -int XQServiceRequest::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QObject::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.moc --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.moc Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'unit_tests.cpp' -** -** Created: Tue 22. Sep 16:19:35 2009 -** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2-tower) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'unit_tests.cpp' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 61 -#error "This file was generated using the moc from 4.5.2-tower. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -static const uint qt_meta_data_TestParserRecognizer[] = { - - // content: - 2, // revision - 0, // classname - 0, 0, // classinfo - 14, 12, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - - // slots: signature, parameters, type, tag, flags - 22, 21, 21, 21, 0x0a, - 37, 21, 21, 21, 0x0a, - 55, 21, 21, 21, 0x0a, - 62, 21, 21, 21, 0x0a, - 72, 21, 21, 21, 0x08, - 94, 21, 21, 21, 0x08, - 118, 21, 21, 21, 0x08, - 145, 21, 21, 21, 0x08, - 171, 21, 21, 21, 0x08, - 192, 21, 21, 21, 0x08, - 218, 21, 21, 21, 0x08, - 233, 21, 21, 21, 0x08, - 251, 21, 21, 21, 0x08, - 276, 21, 21, 21, 0x08, - - 0 // eod -}; - -static const char qt_meta_stringdata_TestParserRecognizer[] = { - "TestParserRecognizer\0\0initTestCase()\0" - "cleanupTestCase()\0init()\0cleanup()\0" - "testActivateRfsDeep()\0testActivateRfsNormal()\0" - "testActivateWarrantyMode()\0" - "testShowBTDeviceAddress()\0" - "testShowBTLoopback()\0testActivateBTDebugMode()\0" - "testShowIMEI()\0testShowVersion()\0" - "testShowWLANMacAddress()\0testSSRequestFailed()\0" -}; - -const QMetaObject TestParserRecognizer::staticMetaObject = { - { &QObject::staticMetaObject, qt_meta_stringdata_TestParserRecognizer, - qt_meta_data_TestParserRecognizer, 0 } -}; - -const QMetaObject *TestParserRecognizer::metaObject() const -{ - return &staticMetaObject; -} - -void *TestParserRecognizer::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_TestParserRecognizer)) - return static_cast(const_cast< TestParserRecognizer*>(this)); - return QObject::qt_metacast(_clname); -} - -int TestParserRecognizer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QObject::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: initTestCase(); break; - case 1: cleanupTestCase(); break; - case 2: init(); break; - case 3: cleanup(); break; - case 4: testActivateRfsDeep(); break; - case 5: testActivateRfsNormal(); break; - case 6: testActivateWarrantyMode(); break; - case 7: testShowBTDeviceAddress(); break; - case 8: testShowBTLoopback(); break; - case 9: testActivateBTDebugMode(); break; - case 10: testShowIMEI(); break; - case 11: testShowVersion(); break; - case 12: testShowWLANMacAddress(); break; - case 13: testSSRequestFailed(); break; - default: ; - } - _id -= 14; - } - return _id; -} -QT_END_MOC_NAMESPACE diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer_0xE31F4ECF.mmp --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer_0xE31F4ECF.mmp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-01-13T16:02:37 -// This file is generated by qmake and should not be modified by the -// user. -// Name : ut_parserrecognizer.mmp -// ============================================================================== - -TARGET ut_parserrecognizer.exe -TARGETTYPE EXE - -UID 0x100039CE 0xE31F4ECF -SECUREID 0xE31F4ECF - -EPOCSTACKSIZE 0x14000 -EPOCHEAPSIZE 0x020000 0x800000 -EPOCALLOWDLLDATA - -SOURCEPATH . -LANG SC -START RESOURCE ut_parserrecognizer.rss -HEADER -TARGETPATH /resource/apps -END - -SOURCEPATH . -START RESOURCE ut_parserrecognizer_reg.rss -TARGETPATH /private/10003a3f/import/apps -END - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO BUILD_PARSERRECOGNIZER -MACRO QT_NO_DEBUG -MACRO QT_GUI_LIB -MACRO QT_CORE_LIB - -SYSTEMINCLUDE /epoc32/include/mw/QtCore -SYSTEMINCLUDE /epoc32/include/mw/QtGui -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE /epoc32/include/mw/QtTest -SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian/tmp -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/stdapis -SYSTEMINCLUDE /epoc32/include/stdapis/sys -SYSTEMINCLUDE . -SYSTEMINCLUDE tmp -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../inc/tmp -SYSTEMINCLUDE /epoc32/include/platform/mw -SYSTEMINCLUDE /epoc32/include/platform -SYSTEMINCLUDE /epoc32/include/app -SYSTEMINCLUDE /epoc32/include/platform/app -SYSTEMINCLUDE /epoc32/include/platform/loc -SYSTEMINCLUDE /epoc32/include/platform/mw/loc -SYSTEMINCLUDE /epoc32/include/platform/app/loc -SYSTEMINCLUDE /epoc32/include/platform/loc/sc -SYSTEMINCLUDE /epoc32/include/platform/mw/loc/sc -SYSTEMINCLUDE /epoc32/include/platform/app/loc/sc -SYSTEMINCLUDE /epoc32/include/mw/qtgui -SYSTEMINCLUDE /epoc32/include/mw/qtcore -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../inc/tmp -SYSTEMINCLUDE ../../src -SYSTEMINCLUDE ../../src/tmp - -SOURCEPATH ../../src -SOURCE parserrecognizer.cpp - -SOURCEPATH . -SOURCE unit_tests.cpp -SOURCE moc_xqservicerequest.cpp -SOURCE moc_parserrecognizer.cpp - - -LIBRARY QtTest.lib -LIBRARY QtGui.lib -LIBRARY QtCore.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib -STATICLIBRARY qtmain.lib - -CAPABILITY ALL -TCB - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden - -VERSION 10.0 - -PAGED - -OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE - -STDCPP diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/cpeexternaldatahandler.h --- a/phoneengine/phonemodel/inc/cpeexternaldatahandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/inc/cpeexternaldatahandler.h Mon May 03 12:31:11 2010 +0300 @@ -22,8 +22,6 @@ // INCLUDE FILES #include "cpeaudiooutputpreferencemonitor.h" #include "cpecalldurationdisplaysettingmonitor.h" -#include "cpeincallearvolumesettingmonitor.h" -#include "cpeincallloudspeakervolumesettingmonitor.h" #include "cpenetworkregistrationstatusmonitor.h" #include "cpeprofilesettingmonitor.h" #include "mpeexternaldatahandler.h" @@ -107,9 +105,7 @@ // Monitor objects CPEAudioOutputPreferenceMonitor* iAudioOutputPreferenceMonitor; - CPECallDurationDisplaySettingMonitor* iCallDurationDisplay; - CPEIncallEarVolumeSettingMonitor* iEarVolumeSetting; - CPEIncallLoudspeakerVolumeSettingMonitor* iLoudspeakerVolumeSetting; + CPECallDurationDisplaySettingMonitor* iCallDurationDisplay; CPENetworkRegistrationStatusMonitor* iNetworkRegistrationStatus; CPEProfileSettingMonitor* iProfileSettings; CPEAccessoryModeMonitor* iAccessoryModeMonitor; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/cpeincallearvolumesettingmonitor.h --- a/phoneengine/phonemodel/inc/cpeincallearvolumesettingmonitor.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file contains the header of the phone engine base -* central repository monitor class -* -*/ - - -#ifndef CPEINCALLEARVOLUMESETTINGMONITOR_H -#define CPEINCALLEARVOLUMESETTINGMONITOR_H - -// INCLUDE FILES -#include "cpecenrepmonitor.h" - -// Forward declarations -class MPEPhoneModelInternal; - -/** -* CPEIncallEarVolumeSettingMonitor -* For set/get of the phone ear volume setting (KTelIncallEarVolume) from -* the central repository -* -* @lib PhoneEngine.lib -*/ -NONSHARABLE_CLASS( CPEIncallEarVolumeSettingMonitor ) : public CPECenRepMonitor -{ -public: - static CPEIncallEarVolumeSettingMonitor* NewL( MPEPhoneModelInternal& aModel ); - ~CPEIncallEarVolumeSettingMonitor(); -public: - TInt Set( TInt aValue ); -protected: // From base class - virtual void UpdateL(); -protected: - CPEIncallEarVolumeSettingMonitor( MPEPhoneModelInternal& aModel ); - void ConstructL(); -private: - MPEPhoneModelInternal& iModel; - TBool iUpdateInProgress; -}; - -#endif // CPEINCALLEARVOLUMESETTINGMONITOR_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/cpeincallloudspeakervolumesettingmonitor.h --- a/phoneengine/phonemodel/inc/cpeincallloudspeakervolumesettingmonitor.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file contains the header of the phone engine base -* central repository monitor class -* -*/ - - -#ifndef CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H -#define CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H - -// INCLUDE FILES -#include "cpecenrepmonitor.h" - -// Forward declarations -class MPEPhoneModelInternal; - -/** -* CPEIncallLoudspeakerVolumeSettingMonitor -* For set/get of the phone ear volume setting (KTelIncallLoudspeakerVolume) -* from the central repository -* -* @lib PhoneEngine.lib -*/ -NONSHARABLE_CLASS( CPEIncallLoudspeakerVolumeSettingMonitor ) : public CPECenRepMonitor -{ -public: - static CPEIncallLoudspeakerVolumeSettingMonitor* NewL( - MPEPhoneModelInternal& aModel ); - ~CPEIncallLoudspeakerVolumeSettingMonitor(); -public: - TInt Set( TInt aValue ); -protected: // From base class - virtual void UpdateL(); -protected: - CPEIncallLoudspeakerVolumeSettingMonitor( MPEPhoneModelInternal& aModel ); - void ConstructL(); -private: - MPEPhoneModelInternal& iModel; - TBool iUpdateInProgress; -}; - -#endif // CPEINCALLLOUDSPEAKERVOLUMESETTINGMONITOR_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/cpephonemodel.h --- a/phoneengine/phonemodel/inc/cpephonemodel.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/inc/cpephonemodel.h Mon May 03 12:31:11 2010 +0300 @@ -77,9 +77,10 @@ EPESimStatusMonitorStart, EPELogHandlingPhaseTwo, EPEContactHandlingPhaseTwo, - EPEMediatorCommandHandler - ,EPEPhoneServices - ,EPEParserRecognizer + EPEMediatorCommandHandler, + EPEPhoneServices, + EPEParserRecognizer, + EPENetworkHandling }; /** diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/mpeexternaldatahandler.h --- a/phoneengine/phonemodel/inc/mpeexternaldatahandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/inc/mpeexternaldatahandler.h Mon May 03 12:31:11 2010 +0300 @@ -38,9 +38,7 @@ EPEAutomaticAnswerWirelessCarkitSetting, EPECallDurationDisplaySetting, EPEDialPrefixChangeSetting, - EPEDialPrefixTextSetting, - EPEIncallEarVolumeSetting, - EPEIncallLoudspeakerVolumeSetting, + EPEDialPrefixTextSetting, EPENetworkRegistrationStatus, EPETelephonyVariationFlags, EPEAccessoryMode, diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/inc/telinternalpskeys.h --- a/phoneengine/phonemodel/inc/telinternalpskeys.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/inc/telinternalpskeys.h Mon May 03 12:31:11 2010 +0300 @@ -124,7 +124,6 @@ */ const TUint32 KTelGenCmdLaunchLogApp = 0x00000001; - #endif // TELINTERNALPSKEYS_H // End of file \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/phonemodel.pro --- a/phoneengine/phonemodel/phonemodel.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/phonemodel.pro Mon May 03 12:31:11 2010 +0300 @@ -24,7 +24,8 @@ TARGET.VID = VID_DEFAULT TARGET.CAPABILITY = ALL -TCB - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE \ + $$OS_LAYER_GLIB_SYSTEMINCLUDE INCLUDEPATH += ../../inc \ ../inc \ ../phoneservices/inc \ @@ -71,7 +72,10 @@ -lengineinfo \ -lparserrecognizer \ -lmediatorclient \ - -lestor + -lestor \ + -lxqservice \ + -llibglib + TARGET.EPOCALLOWDLLDATA =1 } @@ -88,8 +92,6 @@ HEADERS += ./inc/cpedevicemodehandler.h HEADERS += ./inc/cpeexternaldatahandler.h HEADERS += ./inc/cpeidlestatusmonitor.h -HEADERS += ./inc/cpeincallearvolumesettingmonitor.h -HEADERS += ./inc/cpeincallloudspeakervolumesettingmonitor.h HEADERS += ./inc/cpemanualcallcontrolhandler.h HEADERS += ./inc/cpemessagehandler.h HEADERS += ./inc/cpemessagehandler.inl @@ -136,8 +138,6 @@ SOURCES += ./src/cpeclientservices.cpp SOURCES += ./src/cpedevicemodehandler.cpp SOURCES += ./src/cpeexternaldatahandler.cpp -SOURCES += ./src/cpeincallearvolumesettingmonitor.cpp -SOURCES += ./src/cpeincallloudspeakervolumesettingmonitor.cpp SOURCES += ./src/cpemessagehandler.cpp SOURCES += ./src/cpenetworkregistrationstatusmonitor.cpp SOURCES += ./src/cpeprofilesettingmonitor.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/src/cpeexternaldatahandler.cpp --- a/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -60,9 +60,7 @@ delete iTelephonyVariationRepository; delete iTelephonySettingsRepository; delete iProfileSettings; - delete iNetworkRegistrationStatus; - delete iLoudspeakerVolumeSetting; - delete iEarVolumeSetting; + delete iNetworkRegistrationStatus; delete iCallDurationDisplay; delete iAudioOutputPreferenceMonitor; delete iAccessorySettingsRepository; @@ -81,9 +79,7 @@ TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL" ); // Instantiate monitor objects - iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel ); - iEarVolumeSetting = CPEIncallEarVolumeSettingMonitor::NewL( aModel ); - iLoudspeakerVolumeSetting = CPEIncallLoudspeakerVolumeSettingMonitor::NewL( aModel ); + iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel ); iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); iProfileSettings = CPEProfileSettingMonitor::NewL( aModel ); @@ -97,6 +93,7 @@ //iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings ); iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation ); //iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); + TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL 2" ); } @@ -123,20 +120,10 @@ { errorCode = iAudioOutputPreferenceMonitor->Get( aValue ); TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode ); - } - else if ( EPEIncallEarVolumeSetting == aSetting ) - { - errorCode = iEarVolumeSetting->Get( aValue ); - TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallEarVolumeSetting, error code: %d", errorCode ); - } - else if ( EPEIncallLoudspeakerVolumeSetting == aSetting ) - { - errorCode = iLoudspeakerVolumeSetting->Get( aValue ); - TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallLoudspeakerVolumeSetting, error code: %d", errorCode ); - } + } else if ( EPECallDurationDisplaySetting == aSetting ) { - errorCode = iCallDurationDisplay->GetValue( aValue ); + errorCode = iCallDurationDisplay->Get( aValue ); TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode ); } else @@ -196,16 +183,6 @@ switch ( aSetting ) { - case EPEIncallEarVolumeSetting: - { - errorCode = iEarVolumeSetting->Set( aValue ); - break; - } - case EPEIncallLoudspeakerVolumeSetting: - { - errorCode = iLoudspeakerVolumeSetting->Set( aValue ); - break; - } case EPEEmergencyCallInfo: { errorCode = RProperty::Set( KPSUidCtsyEmergencyCallInfo, diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/src/cpeincallearvolumesettingmonitor.cpp --- a/phoneengine/phonemodel/src/cpeincallearvolumesettingmonitor.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains phone engine base central repository monitor class -* -*/ - - -// INCLUDE FILES -#include "cpeincallearvolumesettingmonitor.h" -#include "mpephonemodelinternal.h" -#include -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// CPEIncallEarVolumeSettingMonitor::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CPEIncallEarVolumeSettingMonitor* CPEIncallEarVolumeSettingMonitor::NewL( - MPEPhoneModelInternal& aModel ) - { - CPEIncallEarVolumeSettingMonitor* self = new ( ELeave ) CPEIncallEarVolumeSettingMonitor( - aModel ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self); - return ( self ); - } - -// Destructor -CPEIncallEarVolumeSettingMonitor::~CPEIncallEarVolumeSettingMonitor() - { - // Cancel() is called by base class destructor, which also deletes iRepository - } - -// ----------------------------------------------------------------------------- -// CPEIncallEarVolumeSettingMonitor::CPEIncallEarVolumeSettingMonitor -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CPEIncallEarVolumeSettingMonitor::CPEIncallEarVolumeSettingMonitor( - MPEPhoneModelInternal& aModel - ) : CPECenRepMonitor( KTelIncallEarVolume ), - iModel( aModel ), - iUpdateInProgress( EFalse ) - { - } - -// ----------------------------------------------------------------------------- -// CPEIncallEarVolumeSettingMonitor::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CPEIncallEarVolumeSettingMonitor::ConstructL() - { - BaseConstructL( KCRUidInCallVolume ); - - TInt volume = KPEDefaultAudioVolume; // Default setting - Get( volume ); - TEFLOGSTRING2( - KTAREQOUT, - "PE CPEIncallEarVolumeSettingMonitor::ConstructL, Incall ear volume = %d ", - volume ); - // Write audio volume to EngineInfo. - iModel.DataStore()->SetAudioVolume( volume ); - } - -// ----------------------------------------------------------------------------- -// CPEIncallEarVolumeSettingMonitor::Set -// ----------------------------------------------------------------------------- -// -TInt CPEIncallEarVolumeSettingMonitor::Set( - TInt aValue ) - { - TInt errorCode( KErrNone ); - - // Check whether this function call was initiated by a central repository - // change notification. - if( iUpdateInProgress == EFalse ) - { - errorCode = iRepository->Set( iMonitorSetting, aValue ); - TEFLOGSTRING3( KTAREQOUT, "PE CPEIncallEarVolumeSettingMonitor::Set \ -> CRepository::Set, Incall ear volume = %d, error code: %d", aValue, errorCode ); - } - - return errorCode; - } - -// ----------------------------------------------------------------------------- -// CPEIncallEarVolumeSettingMonitor::UpdateL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CPEIncallEarVolumeSettingMonitor::UpdateL() - { - TInt volume; - // The headset volume has changed in repository. - // Retrieve the current volume from repository. - User::LeaveIfError( Get( volume ) ); - - TEFLOGSTRING2( - KTAREQOUT, - "PE: CPEIncallEarVolumeSettingMonitor::UpdateL, Incall ear volume = %d ", - volume ); - - // Update headset volume using an audiohandling routine - // The routine will try to update the repository as well, - // ensure this is blocked using an internal flag. - iUpdateInProgress = ETrue; - iModel.DataStore()->SetAudioVolumeCommand( volume ); - iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageSetAudioVolume ); - - // Reset the flag when synchronization is complete - iUpdateInProgress = EFalse; - - } - -// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/src/cpeincallloudspeakervolumesettingmonitor.cpp --- a/phoneengine/phonemodel/src/cpeincallloudspeakervolumesettingmonitor.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains phone engine base central repository monitor class -* -*/ - - -// INCLUDE FILES -#include "cpeincallloudspeakervolumesettingmonitor.h" -#include "mpephonemodelinternal.h" -#include -#include -#include -#include -#include - - -// ----------------------------------------------------------------------------- -// CPEIncallLoudspeakerVolumeSettingMonitor::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CPEIncallLoudspeakerVolumeSettingMonitor* CPEIncallLoudspeakerVolumeSettingMonitor::NewL( - MPEPhoneModelInternal& aModel - ) - { - CPEIncallLoudspeakerVolumeSettingMonitor* me = - new ( ELeave ) CPEIncallLoudspeakerVolumeSettingMonitor( aModel ); - CleanupStack::PushL( me ); - me->ConstructL(); - CleanupStack::Pop( me ); - return ( me ); - } - -// Destructor -CPEIncallLoudspeakerVolumeSettingMonitor::~CPEIncallLoudspeakerVolumeSettingMonitor() - { - // Cancel() is called by base class destructor, which also deletes iRepository - } - -// ----------------------------------------------------------------------------- -// CPEIncallLoudspeakerVolumeSettingMonitor::CPEIncallLoudspeakerVolumeSettingMonitor -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CPEIncallLoudspeakerVolumeSettingMonitor::CPEIncallLoudspeakerVolumeSettingMonitor( - MPEPhoneModelInternal& aModel - ) : CPECenRepMonitor( KTelIncallLoudspeakerVolume ), - iModel( aModel ), - iUpdateInProgress( EFalse ) - { - } - -// ----------------------------------------------------------------------------- -// CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL() - { - BaseConstructL( KCRUidInCallVolume ); - - TInt volume = KPEDefaultAudioVolume; // Default setting - Get( volume ); - TEFLOGSTRING2( - KTAREQOUT, - "PE CPEIncallLoudspeakerVolumeSettingMonitor::ConstructL, Incall loudspeaker volume = %d ", - volume ); - //In boot, cannot write volume value to datastore. It override HeadSet mode - // volume ( default value ). - } - -// ----------------------------------------------------------------------------- -// CPEIncallLoudspeakerVolumeSettingMonitor::Set -// ----------------------------------------------------------------------------- -// -TInt CPEIncallLoudspeakerVolumeSettingMonitor::Set( - TInt aValue - ) - { - TInt errorCode( KErrNone ); - - // Check whether this function call was initiated by a central repository - // change notification. - if( iUpdateInProgress == EFalse ) - { - errorCode = iRepository->Set( iMonitorSetting, aValue ); - TEFLOGSTRING3( KTAREQOUT, "PE CPEIncallLoudspeakerVolumeSettingMonitor::Set \ -> CRepository::Set, Incall loudspeaker volume = %d, error code: %d", aValue, errorCode ); - } - - return errorCode; - } - -// ----------------------------------------------------------------------------- -// CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL() - { - TInt volume; - // The loudspeaker volume has changed in repository. - // Retrieve the current volume from repository. - User::LeaveIfError( Get( volume ) ); - - TEFLOGSTRING2( - KTAREQOUT, - "PE CPEIncallLoudspeakerVolumeSettingMonitor::UpdateL, Incall loudspeaker volume = %d ", - volume ); - - // Update loudspeaker volume using an audiohandling routine - // The routine will try to update the repository as well, - // ensure this is blocked using an internal flag. - iUpdateInProgress = ETrue; - iModel.DataStore()->SetAudioVolumeCommand( volume ); - iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageSetAudioVolume ); - - // Reset the flag when synchronization is complete - iUpdateInProgress = EFalse; - } - -// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/src/cpemessagehandler.cpp --- a/phoneengine/phonemodel/src/cpemessagehandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/src/cpemessagehandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -1961,11 +1961,6 @@ { TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialingStateL <"); - if( iCallHandling.GetNumberOfCalls() == 1 ) - { - // Check volume levels - zero level needs to be reset to default value - iGsmAudioData.SetDefaultVolume(); - } // Save call direction to engine info. iDataStore.SetCallDirection( RMobileCall::EMobileOriginated, aCallId ); @@ -2020,11 +2015,7 @@ iGsmAudioData.PlayInbandTone(); iWaitingCallId = aCallId; } - else if( numberOfCalls == 1 ) - { - // Check volume levels - zero level needs to be reset to default value - iGsmAudioData.SetDefaultVolume(); - } + if( AutomaticAnswer( aCallId ) ) { TEFLOGSTRING( KTAINT, diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phonemodel/src/cpephonemodel.cpp --- a/phoneengine/phonemodel/src/cpephonemodel.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phonemodel/src/cpephonemodel.cpp Mon May 03 12:31:11 2010 +0300 @@ -39,6 +39,7 @@ #include #include #include +#include #include "phoneservices.h" #include "parserrecognizer.h" @@ -1426,6 +1427,22 @@ TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 17.1" ); iParserRecognizer = new ParserRecognizer; TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 17.2" ); + break; + } + + case CPEPhoneModel::EPENetworkHandling: + { + TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 18.1" ); + XQServiceRequest request("com.nokia.services.networkhandling","start()"); + bool res = request.send(); + if (!res) { + int error = request.latestError(); + TEFLOGSTRING2( + KTAOBJECT, + "CPEPhoneModel::StepL 18.2 error %d", + error ); + } + TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 18.2" ); continueStepping = EFalse; break; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phoneservices/phoneservices.pro --- a/phoneengine/phoneservices/phoneservices.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phoneservices/phoneservices.pro Mon May 03 12:31:11 2010 +0300 @@ -25,7 +25,7 @@ DEFINES += BUILD_PHONESERVICES INCLUDEPATH += ../../inc \ - ../phonemodel/inc + ../phonemodel/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE servicesDefFiles = \ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneengine/phoneservices/src/dialservice.cpp --- a/phoneengine/phoneservices/src/dialservice.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneengine/phoneservices/src/dialservice.cpp Mon May 03 12:31:11 2010 +0300 @@ -35,7 +35,8 @@ int DialService::dial(const QString& number) { PHONE_DEBUG2("DialService::dial number:", number); - TPtrC16 numberPtr (reinterpret_cast(number.utf16 ())); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr(reinterpret_cast(simplifiedNumber.utf16())); m_parameters.SetPhoneNumber (numberPtr); m_parameters.SetCallTypeCommand (EPECallTypeCSVoice); return m_call.HandleDialServiceCall (); @@ -45,7 +46,7 @@ { PHONE_DEBUG4("DialService::dial number:", number, "contactId:", contactId); QString simplifiedNumber = simplified(number); - TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16 ())); + TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16())); m_parameters.SetPhoneNumber (numberPtr); m_parameters.SetCallTypeCommand (EPECallTypeCSVoice); m_parameters.SetContactId2 (contactId); @@ -55,7 +56,8 @@ void DialService::dialVideo(const QString& number) { PHONE_DEBUG2("DialService::dialVideo number:", number); - TPtrC16 numberPtr (reinterpret_cast(number.utf16 ())); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr(reinterpret_cast(simplifiedNumber.utf16())); m_parameters.SetPhoneNumber (numberPtr); m_parameters.SetCallTypeCommand (EPECallTypeVideo); m_call.HandleDialServiceCall (); @@ -65,7 +67,7 @@ { PHONE_DEBUG4("DialService::dialVideo number:", number, "contactId:", contactId); QString simplifiedNumber = simplified(number); - TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16 ())); + TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16())); m_parameters.SetPhoneNumber (numberPtr); m_parameters.SetCallTypeCommand (EPECallTypeVideo); m_parameters.SetContactId2 (contactId); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/group/csplugin.mmp --- a/phoneplugins/csplugin/group/csplugin.mmp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/csplugin/group/csplugin.mmp Mon May 03 12:31:11 2010 +0300 @@ -29,9 +29,14 @@ // ECOM Dll recognition UID followed by the unique UID for this dll UID 0x10009D8D 0x102828E3 -CAPABILITY CAP_ECOM_PLUGIN NetworkControl NetworkServices ReadDeviceData +CAPABILITY CAP_ECOM_PLUGIN NetworkControl NetworkServices ReadDeviceData MultimediaDD VENDORID VID_DEFAULT +#ifndef WINSCW +EpocAllowDllData +#endif + + SOURCEPATH ../src SOURCE csprovider.cpp SOURCE cspproxy.cpp @@ -63,7 +68,6 @@ SOURCE csppanic.cpp SOURCE cspaudiohandler.cpp SOURCE csppubsublistener.cpp -SOURCE cspcenreplistener.cpp SOURCE cspetelcallwaitingrequester.cpp SOURCE cspsupplementaryservicesmonitor.cpp SOURCE cspcipheringstatusmonitor.cpp @@ -71,16 +75,13 @@ SOURCE cspuuimessagesender.cpp SOURCE cspuuimonitor.cpp SOURCE tcspskypeidparser.cpp -SOURCE cspdevsound.cpp -SOURCE cspmicrophone.cpp -SOURCE cspspeaker.cpp -SOURCE cspaudiostreams.cpp SOURCE csptimer.cpp SOURCE cspcallcommandhandler.cpp SOURCE cspremotealertingtonelistener.cpp SOURCE cspetellinestatusmonitor.cpp SOURCE cspclientvideocall.cpp SOURCE cspclientvoicecall.cpp +SOURCE tmshandler.cpp // user include paths USERINCLUDE ../inc @@ -91,9 +92,13 @@ APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/mmf/server -SYSTEMINCLUDE /epoc32/include/mmf/common -SYSTEMINCLUDE /epoc32/include/mda/client + + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_GLIB_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/stdapis/stlport + SOURCEPATH ../data START RESOURCE 102828e3.rss @@ -109,8 +114,12 @@ LIBRARY esock.lib LIBRARY serviceprovidersettings.lib // Reading service id and related LIBRARY featmgr.lib -LIBRARY mmfdevsound.lib LIBRARY centralrepository.lib LIBRARY sssettings.lib LIBRARY telephonyaudiorouting.lib callprovider.lib cce.lib + +LIBRARY tmsfactory.lib +LIBRARY tmsapi.lib +LIBRARY libglib.lib + DEBUGLIBRARY flogger.lib diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspaudiohandler.h --- a/phoneplugins/csplugin/inc/cspaudiohandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/csplugin/inc/cspaudiohandler.h Mon May 03 12:31:11 2010 +0300 @@ -1,199 +1,108 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declarations for class CSPAudioHandler -* -*/ - + * Copyright (c) 2007-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: Declarations for class CSPAudioHandler + * + */ #ifndef CSPAUDIOHANDLER_H #define CSPAUDIOHANDLER_H #include -#include + +class TmsHandler; +/** + * Handles call adding from calls not done by the plugin. + * + */ +class CSPAudioHandler : public CBase + { +public: + //Constructors and descructor + + /** + * Two-phased constructing for the monitor. + * + * @param aObserver the observer for getting notification + * @param aLine the line to monitor + * @param aLineId line identifier + */ + static CSPAudioHandler* NewL(); + + /** + * C++ default destructor. + */ + virtual ~CSPAudioHandler(); + + /** + * Start audio streams. + */ + void Start(); + + /** + * Stop audio streams. + */ + void Stop(); -#include "mcsppubsubobserver.h" -#include "mcspcenrepobserver.h" +protected: + // From CActive + /** + * From CActive + * RunL + */ + void RunL(); + + /** + * From CActive + * Catches errors if RunL leaves + * @param aError error code + * @return error code + */ + TInt RunError(TInt aError); + + /** + * From CActive + * Cancels the monitor + */ + void DoCancel(); + +private: + /** + * C++ default constructor + * @param aObserver the observer for status change (incoming call) + * @param aLine the line associated with the call + * @param aLineId line identifier + */ + CSPAudioHandler(); + + /** + * Constructs the monitor in the second phase. + */ + void ConstructL(); + +private: + // data -class CSPPubSubListener; -class CSPCenRepListener; -class CSPAudioStreams; - -/** -* Handles call adding from calls not done by the plugin. -* -*/ -class CSPAudioHandler: public CBase, - public MCSPPubSubObserver, - public MCSPCenRepObserver, - public MDevSoundObserver - { - - public: //Constructors and descructor - - /** - * Two-phased constructing for the monitor. - * - * @param aObserver the observer for getting notification - * @param aLine the line to monitor - * @param aLineId line identifier - */ - static CSPAudioHandler* NewL( ); - - /** - * C++ default destructor. - */ - virtual ~CSPAudioHandler( ); - - /** - * Start audio streams. - */ - void Start(); - - /** - * Stop audio streams. - */ - void Stop(); - - /** - * From base class MCSPPubSubObserver. - * Handler for changed event. - * @param aUid uid of setting - * @param aKey id of setting - * @param aStatus status of completed AO operation - */ - virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, - const TRequestStatus& aStatus ); - - /** - * From base class MCSPCenRepObserver. - * Handler for changed event. - * @param aUid uid of setting - * @param aVal value - */ - virtual void CSPAudioHandler::HandleNotifyCenRepL( - const TUid aUid, - const TUint32 aKey, - TInt aVal ); + /** + * Audio streams handler. + */ + TmsHandler* iTmsHandler; - protected: //From DevSound - - /** - * Handles DevDound initialization completion event. - * @param aError. KErrNone if successful. Other values are possible - * indicating a problem initializing CMMFDevSound object. - */ - void InitializeComplete( TInt aError ); - - /** - * Handles CMMFDevSound object's data request event. - * @param aBuffer. Buffer to be filled - */ - void BufferToBeFilled( CMMFBuffer* aBuffer ); - - /** - * Handles play completion or cancel event. - * @param aError. The status of playback - */ - void PlayError( TInt aError ); - - /** - * Not Supported - */ - void ToneFinished( TInt aError ); - - /** - * Not supported. - */ - void BufferToBeEmptied( CMMFBuffer* aBuffer ); - - /** - * Not supported. - */ - void RecordError( TInt aError ); - - /** - * Not supported. - */ - void ConvertError( TInt aError ); - - /** - * Not supported. - */ - void DeviceMessage( TUid aMessageType, const TDesC8& aMsg ); - - protected: // From CActive - /** - * From CActive - * RunL - */ - void RunL(); - - /** - * From CActive - * Catches errors if RunL leaves - * @param aError error code - * @return error code - */ - TInt RunError( TInt aError ); - - /** - * From CActive - * Cancels the monitor - */ - void DoCancel(); + /** + * Call count + */ + TInt iCallCount; + }; - private: - /** - * C++ default constructor - * @param aObserver the observer for status change (incoming call) - * @param aLine the line associated with the call - * @param aLineId line identifier - */ - CSPAudioHandler( ); - - /** - * Constructs the monitor in the second phase. - */ - void ConstructL(); - - private: // data - - /** - * Mute listening from Publish&Subscribe. - */ - CSPPubSubListener* iMuteListener; - - /** - * Incall loudspeaker listening from Central Repository. - */ - CSPCenRepListener* iIncallLoudspeakerVolumeListener; - - /** - * Incall ear volume listening from Central Repository. - */ - CSPCenRepListener* iIncallEarVolumeListener; - - /** - * Audio streams handler. - */ - CSPAudioStreams* iAudioStreams; - - /** - * Call count - */ - TInt iCallCount; - }; - #endif // CSPAUDIOHANDLER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspaudiostreams.h --- a/phoneplugins/csplugin/inc/cspaudiostreams.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Starts and stops audio streams. -* -*/ - - -#ifndef CSPAUDIOSTREAMS_H -#define CSPAUDIOSTREAMS_H - - -#include -#include -#include "MTelephonyAudioRoutingObserver.h" -#include "mcspdevsoundobserver.h" -#include "mcsptimerobserver.h" - -class MCSPDevSoundFactory; -class CSPTimer; -class CSPMicrophone; -class CSPSpeaker; -class MCSPAudioStreamObserver; -class CSPTimer; - - -/** - * Starts and stops audio streams. - * If the activation fails then there is a retry timer which - * will try the activation later. - */ -NONSHARABLE_CLASS( CSPAudioStreams ) : - public CBase, - public MCSPDevSoundObserver, - public MCSPTimerObserver, - public MTelephonyAudioRoutingObserver - { - -public: - - /** - * Two-phased constructing. - */ - static CSPAudioStreams* NewL( ); - - /** - * Two-phased constructing. - */ - static CSPAudioStreams* NewLC( ); - - /** - * C++ default destructor. - */ - virtual ~CSPAudioStreams(); - - /** - * Starts audio streams ie inits mic and speaker. - */ - void StartStreams(); - - /** - * Stops audio streams ie shuts down mic and speaker. - */ - void StopStreams(); - - /** - * Sets volume for ear. - */ - void VolumeChangedEar( TInt aVolume ); - - /** - * Sets volume for loudspeaker. - */ - void VolumeChangedLoudspeaker( TInt aVolume ); - - /** - * Stores volume levels. - */ - void StoreVolumes(TInt aVolumeEar, TInt aVolumeLoudspeaker); - - /** - * Set unmuted. - */ - void SetUnmuted(); - - /** - * Set muted. - */ - void SetMuted(); - - /** - * Gives access to CSPMicrophone instance. Ownership not given. - * @return MCSPMic instance. - */ - CSPMicrophone& Mic() const; - - /** - * Gives access to CSPSpeaker instance. Ownership not given. - * @return MCSPSpeaker instance. - */ - CSPSpeaker& Speaker() const; - - /** - * Set observer for audio stream events. - * @param aObserver - */ - void SetAudioStreamObserver( MCSPAudioStreamObserver& aObserver ); - -// from base class MCSPDevSoundObserver - - /** - * From MCSPDevSoundObserver - * Notification that Mic has been activated successfully - */ - void MicActivatedSuccessfully(); - - /** - * From MCSPDevSoundObserver - * Notification that speaker has been activated successfully - */ - void SpeakerActivatedSuccessfully(); - - /** - * From MCSPDevSoundObserver - * Notification that Mic initialisation failed. - */ - void MicActivationFailed(); - - /** - * From MCSPDevSoundObserver - * Notification that Speaker activation failed. - */ - void SpeakerActivationFailed(); - -// from base class MCSPTimerObserver - - /** - * From MCSPTimerObserver. - * Notify from CSPTimer that timeout passed. - */ - void TimerEvent(); - -protected: // Functions from base classes - -// from base class MTelephonyAudioRoutingObserver - - /** - * @see MTelephonyAudioRoutingObserver. - */ - void AvailableOutputsChanged( CTelephonyAudioRouting& aTelephonyAudioRouting ); - - /** - * @see MTelephonyAudioRoutingObserver. - */ - void OutputChanged( CTelephonyAudioRouting& aTelephonyAudioRouting); - - /** - * @see MTelephonyAudioRoutingObserver. - */ - void SetOutputComplete( CTelephonyAudioRouting& aTelephonyAudioRouting, TInt aError); - -private: - - /** - * C++ default constructor. - */ - CSPAudioStreams( ); - - void ConstructL( ); - - static TInt TimerCallBack( TAny* aThisPtr ); - - void AudioStreamsStarted(); - - void StartTimer(); - - void StartMicAndSpeaker(); - - TBool IsMicAndSpeakerStarted(); - - void ApplyVolume(TInt aVolumeEar, TInt aVolumeLoudspeaker); - -private: // data - - /** - * Mic. - * own. - */ - CSPMicrophone* iMic; - - /** - * Speaker. - * Own. - */ - CSPSpeaker* iSpeaker; - - /** - * Timer for retrying the activation of streams (mic & speaker) if - * there was a failure in activation. - * Own. - */ - CSPTimer* iTimer; - - /** - * Timeout value used with timer. Timeout value doubles every retry to - * activate the streams. - */ - TInt iTimeout; - - /** - * Audio output for checking if loadspeaker or ear volume should be used. - * Own. - */ - CTelephonyAudioRouting* iAudioRouting; - - /** - * Observer for stream events. - * Not own. - */ - MCSPAudioStreamObserver* iStreamObserver; - - /** - * Ear volume. - */ - TInt iVolumeEar; - - /** - * Loudspeaker volume. - */ - TInt iVolumeLoudspeaker; - - }; - -#endif // CSPAUDIOSTREAMS_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspcenreplistener.h --- a/phoneplugins/csplugin/inc/cspcenreplistener.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file contains the header of CenRep Listener class. -* -*/ - - -#ifndef CSPCENREPLISTENER_H -#define CSPCENREPLISTENER_H - -// INCLUDE FILES -#include - -// Forward declarations -class CRepository; -class MCSPCenRepObserver; - -// BASE CLASS - -// CLASS DECLARATION - -/** -* CSPCenRepListener manages getting notification on CenRep key changes. -*/ -class CSPCenRepListener : public CActive - { - public: - - /** - * Two-phased construction. - * - * @param aUid cenrep Uid - * @param aKey key to be listened - * @param aObserver observer for key change. - * @return instance of the class - */ - static CSPCenRepListener* NewL( TUid aUid, TUint32 aKey, - MCSPCenRepObserver* aObserver ); - - /** - * Destructor. - */ - virtual ~CSPCenRepListener(); - - public: - - /** - * Gets the current value of the monitored setting - * @param aValue the current value of the monitored setting - * @return TInt Symbian OS error code from central repository - */ - TInt Get( TInt& aValue ); - - - protected: // From CActive - - void DoCancel(); - TInt RunError( TInt aError ); - void RunL(); - - private: - - /** - * Constructor - * @param aUid cenrep Uid - * @param aKey key to be listened - * @param aObserver observer for key change. - */ - CSPCenRepListener( TUid aUid, TUint32 aKey, - MCSPCenRepObserver* aObserver ); - - - /** - * Private constructing. - */ - void ConstructL(); - - /** - * Submits a notification request - */ - void SubmitNotifyRequestL(); - - - private: // Owned by this object - - /** - * UID of CR key. - */ - TUid iUid; - - /** - * Repository access. - * Own. - */ - CRepository* iRepository; - - /** - * Identification number of the monitored setting. - */ - TUint32 iMonitorSetting; - - MCSPCenRepObserver* iObserver; -}; - -#endif // CSPCENREPLISTENER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspdevsound.h --- a/phoneplugins/csplugin/inc/cspdevsound.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Wrapper for CMMFDevSound -* -*/ - -#ifndef CSPDEVSOUND_H -#define CSPDEVSOUND_H - -#include - -class MCSPDevSoundObserver; - -/** - * Wrapper for CMMFDevSound - * - */ -NONSHARABLE_CLASS( CSPDevSound ): - public CBase, - public MDevSoundObserver - { -public: - - /** - * Destructor. - */ - virtual ~CSPDevSound(); - - /** - * Activates the dev sound stream. MCSPDevSoundObserver methods are called - * when activation goes ok or fails. If the stream is already active or - * activating then nothing is done. - */ - virtual void Activate(); - - /** - * Deactivates the devsound stream. If stream is not active or - * activation is not ongoing then nothing is done. - */ - virtual void Deactivate(); - - /** - * Indicates that activation is ongoing, - * but the result of the activation is still unknown. - * @return ETrue - activation ongoing, EFalse - activation not ongoing. - */ - TBool IsActivationOngoing() const; - - /** - * Determines wether the devsound stream is active or not. - * @return ETrue - Stream is active, EFalse - Stream not active. - */ - TBool IsActive() const; - - CMMFDevSound& DevSound(); - -// from base class MDevSoundObserver - - /** - * From MDevSoundObserver - * Empty implementation - */ - void InitializeComplete( TInt aError ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void BufferToBeFilled( CMMFBuffer* aBuffer ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void PlayError( TInt aError ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void ToneFinished( TInt aError ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void BufferToBeEmptied( CMMFBuffer* aBuffer ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void RecordError( TInt aError ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void ConvertError( TInt aError ); - - /** - * From MDevSoundObserver - * Empty implementation - */ - void DeviceMessage( TUid aMessageType, const TDesC8& aMsg ); - -protected: - - CSPDevSound( MCSPDevSoundObserver& aObserver ); - - void ConstructL( - TMMFState aMode, TUint aAudioPreference, TUint aAudioPriority ); - -private: - - /** - * Derived class has to activate the stream here. - */ - virtual void DoActivateL() = 0; - -protected: // Data - - /** - * Indication if device is activated. Derived class has to update this. - */ - TBool iActive; - - /** - * Indication if activation is ongoing. - * Derived class has to update this. - */ - TBool iActivationOngoing; - - /** - * Devsound instance - * Own. - */ - CMMFDevSound* iDevSound; - - /** - * Observer for successfull activation. - * Not own. - */ - MCSPDevSoundObserver& iObserver; - - /** - * Audio priority settings for Devsound. - */ - TMMFPrioritySettings iPrioritySettings; - - - }; - -#endif // CSPDEVSOUND_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspmicrophone.h --- a/phoneplugins/csplugin/inc/cspmicrophone.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Mic stream to DevSound. -* -*/ - - -#ifndef CSPMICROPHONE_H -#define CSPMICROPHONE_H - -#include "cspdevsound.h" - -/** - * Provides mic functionality. - * - */ -NONSHARABLE_CLASS( CSPMicrophone ): public CSPDevSound - { - -public: - - static CSPMicrophone* NewL( MCSPDevSoundObserver& aObserver ); - - virtual ~CSPMicrophone(); - - /** - * Determines mic mute state. - * - * - * @return ETrue - mic is muted, EFalse - mic is not muted. - */ - TBool IsMuted(); - - /** - * Set mic muted. - * - * - */ - void SetMuted(); - - /** - * Set mic unmuted. - * - * - */ - void SetUnmuted(); - -// from base class MDevSoundObserver - - /** - * From MDevSoundObserver - * Notification from Devsound that stream (mic) is - * activated successfully. - * - * - */ - void BufferToBeEmptied( CMMFBuffer* aBuffer ); - - /** - * From MDevSoundObserver - * Notification from devsound that downstream(mic) activation - * feiled. - * - * - */ - void RecordError( TInt aError ); - -private: - -// from base class MCSPDevSound - - /** - * From MCSPDevSound. - * Tries to activate the mic stream. - * - * - */ - void DoActivateL(); - -protected: - - CSPMicrophone( MCSPDevSoundObserver& aObserver ); - - void ConstructL(); - - }; - -#endif // CSPMICROPHONE_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/cspspeaker.h --- a/phoneplugins/csplugin/inc/cspspeaker.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Provides speaker functionality -* -*/ - - -#ifndef CSPSPEAKER_H -#define CSPSPEAKER_H - -#include "cspdevsound.h" - -class MCSPDevSoundObserver; - -/** - * Provides speaker functionality. - * - */ -NONSHARABLE_CLASS( CSPSpeaker ): public CSPDevSound - { - -public: - - static CSPSpeaker* NewL( MCSPDevSoundObserver& aObserver ); - - virtual ~CSPSpeaker(); - - /** - * Sets volume. - * @param aVolume Volume. - */ - void SetVolume( TInt aVolume ); - - /** - * Gets volume. - * @return Current volume. - */ - TInt Volume(); - -// from base class MDevSoundObserver - - /** - * From MDevSoundObserver. - * Indication from devsound that stream (speaker) has been activated - * successfully. - */ - void BufferToBeFilled( CMMFBuffer* /*aBuffer*/ ); - - /** - * From MDevSoundObserver. - * Indication from devsound that activation of stream( speaker) - * failed. - */ - void PlayError( TInt aErrorCode ); - -private: - - /** - * From CSPDevSound. - * Tries to activate the mic stream. - */ - void DoActivateL(); - -protected: - - CSPSpeaker( MCSPDevSoundObserver& aObserver ); - - void ConstructL(); - - }; - -#endif // CSPSPEAKER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/inc/tmshandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/csplugin/inc/tmshandler.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,154 @@ +/* + * 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: Starts and stops audio streams. + * + */ + +#ifndef TMSHandler_H +#define TMSHandler_H + +#include +#include "mcsptimerobserver.h" +#include +#include + +namespace TMS { +//FORWARD DECLARATIONS +class TMSFactory; +class TMSCall; +class TMSStream; +class TMSSource; +class TMSSink; +} //namespace TMS + +using namespace TMS; + +//FORWARD DECLARATIONS +class CSPTimer; + +/** + * Starts and stops TMS audio streams. + * If the activation fails then there is a retry timer which + * will try the activation later. + */ +NONSHARABLE_CLASS(TmsHandler) : public CBase, + public MCSPTimerObserver, + public TMSStreamObserver + { +public: + + /** + * Two-phased constructing. + */ + static TmsHandler* NewL(); + + /** + * Two-phased constructing. + */ + static TmsHandler* NewLC(); + + /** + * C++ default destructor. + */ + virtual ~TmsHandler(); + + /** + * Starts audio streams ie inits mic and speaker. + */ + void StartStreams(); + + /** + * Stops audio streams ie shuts down mic and speaker. + */ + void StopStreams(); + + /** + * From MCSPTimerObserver. + * Notify from CSPTimer that timeout passed. + */ + void TimerEvent(); + +protected: + // Functions from base classes + + // From TMSStreamObserver + void TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event); + +private: + + /** + * C++ default constructor. + */ + TmsHandler(); + + void ConstructL(); + + static TInt TimerCallBack(TAny* aThisPtr); + + void AudioStreamsStarted(); + + void StartTimer(); + + void StartMicAndSpeaker(); + + TBool IsMicAndSpeakerStarted(); + + gint CreateTMSCallControl(); + gint CreateFactory(); + gint CreateCall(); + + gint CreateUplink(); + gint CreateDownlink(); + gint OpenUplink(); + gint OpenDownlink(); + + gint CreateModemSource(); + gint AddModemSourceToStream(); + gint CreateModemSink(); + gint AddModemSinkToStream(); + gint CreateMicSource(); + gint AddMicSourceToStream(); + gint CreateSpeakerSink(); + gint AddSpeakerSinkToStream(); + +private: + // data + + /** + * Timer for retrying the activation of streams (mic & speaker) if + * there was a failure in activation. + * Own. + */ + CSPTimer* iTimer; + + /** + * Timeout value used with timer. Timeout value doubles every retry to + * activate the streams. + */ + TInt iTimeout; + + TMSFactory* iFactory; + TMSCall* iTmsCall; + TMSCallType iCallType; + TMSStream* iTmsDnlink; + TMSStream* iTmsUplink; + TMSSource* iTmsMicSource; + TMSSource* iTmsModemSource; + TMSSink* iTmsSpeakerSink; + TMSSink* iTmsModemSink; + TBool iUplinkStarted; + TBool iDnlinkStarted; + }; + +#endif // TMSHANDLER_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspaudiohandler.cpp --- a/phoneplugins/csplugin/src/cspaudiohandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/csplugin/src/cspaudiohandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -1,61 +1,46 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implements the class CSPAudioHandler -* -*/ - + * Copyright (c) 2007-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: Implements the class CSPAudioHandler + * + */ #include "cspaudiohandler.h" - -#include -#include -#include -#include - -#include "cspaudiostreams.h" -#include "csppubsublistener.h" -#include "cspcenreplistener.h" +#include "tmshandler.h" #include "csplogger.h" - // --------------------------------------------------------------------------- // CSPAudioHandler::NewL. // --------------------------------------------------------------------------- // -CSPAudioHandler* CSPAudioHandler::NewL( ) +CSPAudioHandler* CSPAudioHandler::NewL() { - CSPLOGSTRING(CSPOBJECT, - "CSPAudioHandler::NewL()" ); - CSPAudioHandler* self = new ( ELeave ) CSPAudioHandler( ); - CleanupStack::PushL( self ); + CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::NewL()" ); + CSPAudioHandler* self = new (ELeave) CSPAudioHandler(); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop( self ); - return self; + CleanupStack::Pop(self); + return self; } // --------------------------------------------------------------------------- // Destructs the object by canceling first ongoing monitoring. // --------------------------------------------------------------------------- // -CSPAudioHandler::~CSPAudioHandler( ) +CSPAudioHandler::~CSPAudioHandler() { - CSPLOGSTRING(CSPOBJECT, - "CSPAudioHandler::~CSPAudioHandler()" ); - delete iMuteListener; - delete iIncallLoudspeakerVolumeListener; - delete iIncallEarVolumeListener; - delete iAudioStreams; + CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::~CSPAudioHandler()" ); + delete iTmsHandler; } // --------------------------------------------------------------------------- @@ -65,11 +50,11 @@ void CSPAudioHandler::Start() { iCallCount++; - CSPLOGSTRING2( CSPINT, "CSPAudioHandler::Start callcount: %d", iCallCount ); + CSPLOGSTRING2(CSPINT, "CSPAudioHandler::Start callcount: %d", iCallCount); - if ( iCallCount == 1 ) + if (iTmsHandler && iCallCount == 1) { - iAudioStreams->StartStreams(); + iTmsHandler->StartStreams(); } } @@ -79,205 +64,38 @@ // void CSPAudioHandler::Stop() { - CSPLOGSTRING2( CSPINT, "CSPAudioHandler::Stop callcount: %d", iCallCount ); - if ( iCallCount == 1 ) + CSPLOGSTRING2(CSPINT, "CSPAudioHandler::Stop callcount: %d", iCallCount); + if (iTmsHandler && iCallCount == 1) { - iAudioStreams->StopStreams(); + iTmsHandler->StopStreams(); iCallCount--; } - else if ( iCallCount > 1 ) + else if (iCallCount > 1) { iCallCount--; } } // --------------------------------------------------------------------------- -// From MCSPPubSubObserver -// CSPAudioHandler::HandleNotifyPSL -// --------------------------------------------------------------------------- -// -void CSPAudioHandler::HandleNotifyPSL( const TUid /*aUid*/, const TInt& /*aKey*/, - const TRequestStatus& /*aStatus*/ ) - { - TInt muteVal; - TInt err = iMuteListener->Get( muteVal ); - if ( err == KErrNone && muteVal == EPSTelMicMuteOn ) - { - CSPLOGSTRING2( CSPINT, - "CSPAudioHandler::HandleNotifyPSL_MUTE %d", muteVal); - #if !defined(__WINSCW__) - iAudioStreams->SetMuted(); - #endif //__WINSCW__ - } - else if ( err == KErrNone ) - { - CSPLOGSTRING2( CSPINT, - "CSPAudioHandler::HandleNotifyPSL_UNMUTE %d", muteVal); - #if !defined(__WINSCW__) - // Change when gain is really changed - iAudioStreams->SetUnmuted(); - #endif //__WINSCW__ - } - } - -// --------------------------------------------------------------------------- -// From MCSPCenRepObserver -// CSPAudioHandler::HandleNotifyCenRepL -// --------------------------------------------------------------------------- -// -void CSPAudioHandler::HandleNotifyCenRepL( const TUid /*aUid*/, - const TUint32 aKey, - TInt aVal ) - { - if ( aKey == KTelIncallLoudspeakerVolume ) - { - CSPLOGSTRING( CSPINT, "CSPAudioHandler::HandleNotifyCenRepL IncallLoudspeaker" ); - iAudioStreams->VolumeChangedLoudspeaker( aVal ); - } - else if ( aKey == KTelIncallEarVolume ) - { - CSPLOGSTRING( CSPINT, "CSPAudioHandler::HandleNotifyCenRepL IncallEar" ); - iAudioStreams->VolumeChangedEar( aVal ); - } - else - { - CSPLOGSTRING( CSPINT, "CSPAudioHandler::HandleNotifyCenRepL UNKNOWN" ); - } - } - -// --------------------------------------------------------- -// CSPAudioHandler::InitializeComplete -// -// Handles DevSound initialisation callback -// --------------------------------------------------------- -// -void CSPAudioHandler::InitializeComplete( TInt aError ) - { - if ( KErrNone != aError ) - { - // If initialisation failed, volume can not be adjusted - CSPLOGSTRING2( CSPERROR, - "CSPAudioHandler::InitializeComplete Error:%d", aError ); - } - else - { - CSPLOGSTRING( CSPINT, - "CSPAudioHandler::InitializeComplete"); - } - } - -// --------------------------------------------------------- -// CSPAudioHandler::BufferToBeFilled -// --------------------------------------------------------- -// -void CSPAudioHandler::BufferToBeFilled( CMMFBuffer* /*aBuffer*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::BufferToBeEmptied() -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::BufferToBeEmptied( CMMFBuffer* /*aBuffer*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::PlayError -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::PlayError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::RecordError -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::RecordError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::ConvertError -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::ConvertError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::DeviceMessage -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::DeviceMessage( TUid /*aMessageType*/, const TDesC8& /*aMsg*/ ) - { - } - -// --------------------------------------------------------- -// CSPAudioHandler::ToneFinished -// Not supported -// --------------------------------------------------------- -// -void CSPAudioHandler::ToneFinished( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- // Constructs the monitor. // --------------------------------------------------------------------------- // -CSPAudioHandler::CSPAudioHandler( ) +CSPAudioHandler::CSPAudioHandler() { - CSPLOGSTRING(CSPOBJECT, - "CSPAudioHandler::CSPAudioHandler()" ); + CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::CSPAudioHandler()"); iCallCount = 0; // Active calls count } - + // --------------------------------------------------------------------------- // Second phase construction. // --------------------------------------------------------------------------- // void CSPAudioHandler::ConstructL() { - RProperty::TType type( RProperty::EInt ); - TSecurityPolicy readPolicy( ECapability_None ); - TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); - - RProperty::Define( KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - type, - readPolicy, - writePolicy ); - - iMuteListener = CSPPubSubListener::NewL( - KPSUidTelMicrophoneMuteStatus, - KTelMicrophoneMuteState, - this ); - - iIncallLoudspeakerVolumeListener = CSPCenRepListener::NewL( KCRUidInCallVolume, - KTelIncallLoudspeakerVolume, this ); - - iIncallEarVolumeListener = CSPCenRepListener::NewL( KCRUidInCallVolume, - KTelIncallEarVolume, this ); - - iAudioStreams = CSPAudioStreams::NewL(); - - // Initialize audio volumes - TInt volEar; - TInt volLoud; - - TInt volGetRes = iIncallEarVolumeListener->Get( volEar ); - CSPLOGSTRING3(CSPINT, "CSPAudioHandler::ConstructL() ear %d %d", volGetRes, volEar ); - volGetRes = iIncallLoudspeakerVolumeListener->Get( volLoud ); - CSPLOGSTRING3(CSPINT, "CSPAudioHandler::ConstructL() loudspkr %d %d", volGetRes, volLoud ); - - iAudioStreams->StoreVolumes( volEar, volLoud ); + if (!iTmsHandler) + { + iTmsHandler = TmsHandler::NewL(); + } } // End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspaudiostreams.cpp --- a/phoneplugins/csplugin/src/cspaudiostreams.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,419 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Starts and stops audio streams. -* -*/ - - -#include "cspaudiostreams.h" -#include "cspmicrophone.h" -#include "cspspeaker.h" -#include "csplogger.h" -#include "mcspaudiostreamobserver.h" -#include "csptimer.h" - -#include - -/** -* Timeout initial value. -*/ -const TInt KTimeoutInitial = 200000; // 0.2s - -/** -* Double the timeout for every retry. -*/ -const TInt KTimeoutMultiplier = 2; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Static constructor -// --------------------------------------------------------------------------- -// -CSPAudioStreams* CSPAudioStreams::NewL( ) - { - CSPAudioStreams* self = - CSPAudioStreams::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Static constructor -// --------------------------------------------------------------------------- -// -CSPAudioStreams* CSPAudioStreams::NewLC( ) - { - CSPAudioStreams* self = new( ELeave ) CSPAudioStreams( ); - CleanupStack::PushL( self ); - self->ConstructL( ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CSPAudioStreams::~CSPAudioStreams() - { - if (iTimer) - { - iTimer->CancelNotify(); - delete iTimer; - } - - delete iSpeaker; - delete iMic; - delete iAudioRouting; - } - -// --------------------------------------------------------------------------- -// Sets observer for audio stream. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::SetAudioStreamObserver( - MCSPAudioStreamObserver& aObserver ) - { - iStreamObserver = &aObserver; - } - -// --------------------------------------------------------------------------- -// Gives access to mic -// --------------------------------------------------------------------------- -// -CSPMicrophone& CSPAudioStreams::Mic() const - { - return *iMic; - } - -// --------------------------------------------------------------------------- -// Gives access to speaker -// --------------------------------------------------------------------------- -// -CSPSpeaker& CSPAudioStreams::Speaker() const - { - return *iSpeaker; - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStream -// Activates mic and speaker. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::StartStreams() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::StartStreams"); - - if( !IsMicAndSpeakerStarted() ) - { - StartMicAndSpeaker(); - - if( iStreamObserver ) - { - iStreamObserver->AudioStreamsStarted(); - } - } - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStream -// Deactivates mic and speaker if the streams are active or they are -// activating. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::StopStreams() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::StopStreams"); - - if( IsMicAndSpeakerStarted() ) - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::StopStreams Stopping"); - iTimer->CancelNotify(); - iTimeout = KTimeoutInitial; - if( iStreamObserver ) - { - iStreamObserver->AudioStreamsGoingToStop(); - } - iMic->Deactivate(); - iSpeaker->Deactivate(); - } - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::VolumeChangedEar -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::VolumeChangedEar(TInt aVolume) - { - CSPLOGSTRING2(CSPINT, "CSPAudioStreams::SetVolume %d", aVolume); - iVolumeEar = aVolume; - iSpeaker->SetVolume( aVolume ); - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::VolumeChangedLoudspeaker -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::VolumeChangedLoudspeaker(TInt aVolume) - { - CSPLOGSTRING2(CSPINT, "CSPAudioStreams::SetVolume %d", aVolume); - iVolumeLoudspeaker = aVolume; - iSpeaker->SetVolume( aVolume ); - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::StoreVolumes -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::StoreVolumes(TInt aVolumeEar, TInt aVolumeLoudspeaker ) - { - iVolumeEar = aVolumeEar; - iVolumeLoudspeaker = aVolumeLoudspeaker; - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::ApplyVolume -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::ApplyVolume(TInt aVolumeEar, TInt aVolumeLoudspeaker ) - { - CTelephonyAudioRouting::TAudioOutput current = iAudioRouting->Output(); - if ( current == CTelephonyAudioRouting::ELoudspeaker ) - { - CSPLOGSTRING( CSPINT, "CSPAudioStreams::ApplyVolume Loudspeaker Active: SetVolume" ); - iSpeaker->SetVolume( aVolumeLoudspeaker ); - } - // else: ear volume should be used - else if ( current == CTelephonyAudioRouting::EHandset ) - { - CSPLOGSTRING( CSPINT, "CSPAudioStreams::ApplyVolume Ear Active: SetVolume" ); - iSpeaker->SetVolume( aVolumeEar ); - } - else - { - CSPLOGSTRING2( CSPINT, "CSPAudioStreams::ApplyVolume UNKNOWN AUDIO OUTPUT MODE %d", current ); - // No volume setting - iSpeaker->SetVolume( aVolumeEar ); - } - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::SetMuted -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::SetMuted() - { - iMic->SetMuted(); - } - -// --------------------------------------------------------------------------- -// CSPAudioStreams::SetUnmuted -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::SetUnmuted() - { - iMic->SetUnmuted(); - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStreamObserver -// If speaker is already active then the streams are active. -// If speker is not active and it is not activating then speaker then -// activation has failed and start retry timer. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::MicActivatedSuccessfully() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::MicActivatedSuccessfully" ); - if( iSpeaker->IsActive() ) - { - // Mic and speaker are active. - AudioStreamsStarted(); - } - else if( !iSpeaker->IsActivationOngoing() ) - { - // Start retry timer for activating speaker again - StartTimer(); - } - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStreamObserver -// If mic is already active then streams are active. -// If mic is not active and it is not activating then mic activation has -// failed and start retry timer. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::SpeakerActivatedSuccessfully() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::SpeakerActivatedSuccessfully" ); - if( iMic->IsActive() ) - { - // Mic and speaker are active. - AudioStreamsStarted(); - } - else if( !iMic->IsActivationOngoing() ) - { - // Start retry timer for activating mic again. - StartTimer(); - } - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStreamObserver -// Starts timer for trying activation again. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::MicActivationFailed() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::MicActivationFailed" ); - - // Dont start timer until speaker has stopped activation. - if( !iSpeaker->IsActivationOngoing() ) - { - StartTimer(); - } - } - -// --------------------------------------------------------------------------- -// From class MCSPAudioStreamObserver -// Starts timer for trying activation again. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::SpeakerActivationFailed() - { - CSPLOGSTRING(CSPINT, "PE.AudioStreams::SpeakerActivationFailed" ); - - // Dont start timer until mic has stopped activation. - if( !iMic->IsActivationOngoing() ) - { - StartTimer(); - } - } - -// --------------------------------------------------------------------------- -// From class MCSPTimerObserver -// Notify from CSPTimer that timeout passed. Try to start mic and -// speaker again. -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::TimerEvent() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams.TimerEvent" ); - iTimeout *= KTimeoutMultiplier; - StartMicAndSpeaker(); - } - -// ----------------------------------------------------------------------------- -// CTSEAudioRouteObserver::AvailableOutputsChanged -// ----------------------------------------------------------------------------- -// -void CSPAudioStreams::AvailableOutputsChanged( - CTelephonyAudioRouting& /*aTelephonyAudioRouting*/ ) - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::AvailableOutputsChanged" ); - } - -// ----------------------------------------------------------------------------- -// CTSEAudioRouteObserver::OutputChanged -// ----------------------------------------------------------------------------- -// -void CSPAudioStreams::OutputChanged( - CTelephonyAudioRouting& /*aTelephonyAudioRouting*/ ) - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::OutputChanged" ); - ApplyVolume(iVolumeEar, iVolumeLoudspeaker); - } - -// ----------------------------------------------------------------------------- -// CSPAudioStreams::SetOutputComplete -// ----------------------------------------------------------------------------- -// -void CSPAudioStreams::SetOutputComplete( CTelephonyAudioRouting& /*aTelephonyAudioRouting*/, - TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CSPAudioStreams::CSPAudioStreams( ): iTimeout(KTimeoutInitial) - { - } - -// --------------------------------------------------------------------------- -// Second phase constructor -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::ConstructL( ) - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::ConstructL"); - - iTimer = CSPTimer::NewL(); - iMic = CSPMicrophone::NewL( *this ); - iSpeaker = CSPSpeaker::NewL( *this ); - - #if !defined(__WINSCW__) - iAudioRouting = CTelephonyAudioRouting::NewL( *this ); - #endif //__WINSCW__ - } - -// --------------------------------------------------------------------------- -// Resets timer -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::AudioStreamsStarted() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::AudioStreamsStarted" ); - iTimeout = KTimeoutInitial; - iTimer->CancelNotify(); - } - -// --------------------------------------------------------------------------- -// Starts timer -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::StartTimer() - { - CSPLOGSTRING(CSPINT, "CSPAudioStreams::StartTimer" ); - iTimer->NotifyAfter( iTimeout, *this ); - } - -// --------------------------------------------------------------------------- -// Starts mic and speaker -// --------------------------------------------------------------------------- -// -void CSPAudioStreams::StartMicAndSpeaker() - { - // if speaker and mic is active then activation does not - // cause any actions. - iSpeaker->Activate(); - iMic->Activate(); - } - -// --------------------------------------------------------------------------- -// Indicated if mic and speaker are started or starting up. -// --------------------------------------------------------------------------- -// -TBool CSPAudioStreams::IsMicAndSpeakerStarted() - { - TBool areStreamsActive( iSpeaker->IsActive() && iMic->IsActive() ); - TBool areStreamsActivating( iMic->IsActivationOngoing() || - iSpeaker->IsActivationOngoing() || iTimer->IsNotifyOngoing() ); - - return areStreamsActive || areStreamsActivating; - } - -// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspcenreplistener.cpp --- a/phoneplugins/csplugin/src/cspcenreplistener.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Central Repository listening -* -*/ - - -// INCLUDE FILES -#include "cspcenreplistener.h" -#include -#include "csppanic.pan" -#include "mcspcenrepobserver.h" -#include "csplogger.h" - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::CSPCenRepListener -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CSPCenRepListener* CSPCenRepListener::NewL( - TUid aUid, - TUint32 aMonitorSetting, - MCSPCenRepObserver* aObserver - ) - { - CSPLOGSTRING( CSPINT, "CSPCenRepListener::NewL" ) - CSPCenRepListener* self = new( ELeave ) - CSPCenRepListener( aUid, aMonitorSetting, aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// Destructor -CSPCenRepListener::~CSPCenRepListener() - { - Cancel(); - delete iRepository; - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::Get -// ----------------------------------------------------------------------------- -// -TInt CSPCenRepListener::Get( TInt& aValue ) - { - return ( iRepository->Get( iMonitorSetting, aValue ) ); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::DoCancel -// ----------------------------------------------------------------------------- -// -void CSPCenRepListener::DoCancel() - { - __ASSERT_DEBUG( iRepository, Panic( ECSPPanicNoRepository ) ); - iRepository->NotifyCancel( iMonitorSetting ); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::RunError -// ----------------------------------------------------------------------------- -// -TInt CSPCenRepListener::RunError( - #ifdef _DEBUG - TInt aError // Log the leavecode from RunL - #else - TInt /*aError*/ - #endif - ) - { - #ifdef _DEBUG - CSPLOGSTRING2( CSPERROR, "CSPCenRepListener::RunError %d", aError ); - #endif - return ( KErrNone ); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::RunL -// ----------------------------------------------------------------------------- -// -void CSPCenRepListener::RunL() - { - CSPLOGSTRING( CSPINT, "CSPCenRepListener::RunL"); - - // Don't resubmit the request on error - // Central repositry completes notifications with id of setting - // so check only that value of iStatus is negative - User::LeaveIfError( iStatus.Int() < KErrNone ); - SubmitNotifyRequestL(); - - TInt volume; - // The loudspeaker volume has changed in repository. - // Retrieve the current volume from repository. - User::LeaveIfError( Get( volume ) ); - - CSPLOGSTRING2( CSPINT, "CSPCenRepListener::RunL vol %d", volume); - iObserver->HandleNotifyCenRepL( iUid, iMonitorSetting, volume ); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::CSPCenRepListener -// ----------------------------------------------------------------------------- -// -CSPCenRepListener::CSPCenRepListener( - TUid aUid, - TUint32 aMonitorSetting, - MCSPCenRepObserver* aObserver - ) : CActive( EPriorityStandard ), - iUid( aUid ), - iMonitorSetting( aMonitorSetting ), - iObserver( aObserver ) - { - CSPLOGSTRING( CSPINT, "CSPCenRepListener::CSPCenRepListener, start"); - CActiveScheduler::Add( this ); - - CSPLOGSTRING( CSPINT, "CSPCenRepListener::CSPCenRepListener, complete"); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::ConstructL -// ----------------------------------------------------------------------------- -// -void CSPCenRepListener::ConstructL() - { - // Create repository instance - iRepository = CRepository::NewL( iUid ); - // Start monitoring - SubmitNotifyRequestL(); - } - - -// ----------------------------------------------------------------------------- -// CSPCenRepListener::SubmitNotifyRequestL -// ----------------------------------------------------------------------------- -// -void CSPCenRepListener::SubmitNotifyRequestL() - { - CSPLOGSTRING( CSPINT, "CSPCenRepListener::SubmitNotifyRequestL"); - __ASSERT_DEBUG( iRepository, Panic( ECSPPanicNoRepository ) ); - __ASSERT_DEBUG( !IsActive(), Panic( ECSPPanicRepositoryAlreadyActive ) ); - iRepository->NotifyRequest( iMonitorSetting, iStatus ); - SetActive(); - CSPLOGSTRING( CSPINT, "CSPCenRepListener::SubmitNotifyRequestL, complete"); - } - - -// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspdevsound.cpp --- a/phoneplugins/csplugin/src/cspdevsound.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Wrapper for CMMFDevSound -* -*/ - - -#include "cspdevsound.h" -#include "csplogger.h" -#include "mcspdevsoundobserver.h" - -#include -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CSPDevSound -// --------------------------------------------------------------------------- -// -CSPDevSound::CSPDevSound( MCSPDevSoundObserver& aObserver ) : - iObserver( aObserver ) - { - } - -// --------------------------------------------------------------------------- -// ConstructL -// --------------------------------------------------------------------------- -// -void CSPDevSound::ConstructL( - TMMFState aMode, - TUint aAudioPreference, - TUint aAudioPriority ) - { - CSPLOGSTRING( CSPINT, "CSPDevSound::ConstructL; Entry" ); - - TFourCC modemFourCC; - modemFourCC.Set(KS60FourCCCodeModem); - - iDevSound = CMMFDevSound::NewL(); -#ifndef __WINSCW__ - iDevSound->InitializeL( *this, modemFourCC, aMode ); -#endif - iPrioritySettings.iPriority = aAudioPriority; - iPrioritySettings.iPref = - static_cast( aAudioPreference ); - iPrioritySettings.iState = aMode; - CSPLOGSTRING( CSPINT, "CSPDevSound::ConstructL; Exit" ); - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -CSPDevSound::~CSPDevSound() - { - delete iDevSound; - } - -// --------------------------------------------------------------------------- -// Tries to activate the audio stream if not active or activating -// --------------------------------------------------------------------------- -// -void CSPDevSound::Activate() - { - CSPLOGSTRING( CSPINT, "CSPDevSound::Activate" ); - if( !IsActive() && !IsActivationOngoing() ) - { - iActivationOngoing = ETrue; - TInt err = KErrNone; - TRAP( err, DoActivateL() ); - CSPLOGSTRING2( CSPINT, "CSPDevSound::Activate %d", err ); - } - } - -// --------------------------------------------------------------------------- -// Deactivates the audio device. -// --------------------------------------------------------------------------- -// -void CSPDevSound::Deactivate() - { - CSPLOGSTRING( CSPINT, "CSPDevSound::Deactivate" ); - if( IsActive() || IsActivationOngoing() ) - { - CSPLOGSTRING( CSPINT, "CSPDevSound::Deactivate Stopping" ); - iDevSound->Stop(); - iActive = EFalse; - iActivationOngoing = EFalse; - } - } - -// --------------------------------------------------------------------------- -// ActivationOngoing -// --------------------------------------------------------------------------- -// -TBool CSPDevSound::IsActivationOngoing() const - { - return iActivationOngoing; - } - -// --------------------------------------------------------------------------- -// IsActive -// --------------------------------------------------------------------------- -// -TBool CSPDevSound::IsActive() const - { - return iActive; - } - -CMMFDevSound& CSPDevSound::DevSound() - { - return *iDevSound; - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::InitializeComplete( TInt aError ) - { - CSPLOGSTRING( CSPINT, "CSPDevSound::InitializeComplete" ); - if( aError == KErrNone ) - { - iDevSound->SetPrioritySettings( iPrioritySettings ); - - } - - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::BufferToBeFilled( CMMFBuffer* /*aBuffer*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::PlayError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::ToneFinished( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::BufferToBeEmptied( CMMFBuffer* /*aBuffer*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::RecordError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::ConvertError( TInt /*aError*/ ) - { - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Not implemented -// --------------------------------------------------------------------------- -// -void CSPDevSound::DeviceMessage( - TUid /*aMessageType*/, - const TDesC8& /*aMsg*/ ) - { - } - -// End of File - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspmicrophone.cpp --- a/phoneplugins/csplugin/src/cspmicrophone.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Mic stream to DevSound. -* -*/ - - -#include "cspmicrophone.h" -#include "csplogger.h" -#include "mcspdevsoundobserver.h" - -#include - -// Mute value -const TInt KSetMuteToDevSound = 0; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Static constructor. -// --------------------------------------------------------------------------- -// -CSPMicrophone* CSPMicrophone::NewL( - MCSPDevSoundObserver& aObserver ) - { - CSPMicrophone* self = new( ELeave ) CSPMicrophone( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CSPMicrophone::~CSPMicrophone() - { - } - -// --------------------------------------------------------------------------- -// Gives mic mute state -// --------------------------------------------------------------------------- -// -TBool CSPMicrophone::IsMuted() - { - const TInt gain( iDevSound->Gain() ); - TBool isMuted = EFalse; - if ( !gain ) - { - // Mute is on - isMuted = ETrue; - } - CSPLOGSTRING( CSPINT, "CSPMicrophone::IsMuted" ); - return isMuted; - } - -// --------------------------------------------------------------------------- -// Set mic muted. -// --------------------------------------------------------------------------- -// -void CSPMicrophone::SetMuted() - { - CSPLOGSTRING( CSPINT, "CSPMicrophone::SetMicMuted" ); - iDevSound->SetGain( KSetMuteToDevSound ); - } - -// --------------------------------------------------------------------------- -// Set mic unmuted -// --------------------------------------------------------------------------- -// -void CSPMicrophone::SetUnmuted() - { - CSPLOGSTRING( CSPINT, "CSPMicrophone::SetUnmuted" ); - iDevSound->SetGain( iDevSound->MaxGain() ); - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Activation was successfull. -// --------------------------------------------------------------------------- -// -void CSPMicrophone::BufferToBeEmptied( CMMFBuffer* /*aBuffer*/ ) - { - CSPLOGSTRING( CSPINT, "CSPMicrophone::BufferToBeEmptied" ); - - // We dont react to devsound messages unless we are activating. - if( IsActivationOngoing() ) - { - iActive = ETrue; - iActivationOngoing = EFalse; - iObserver.MicActivatedSuccessfully(); - } - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Activation feiled -// --------------------------------------------------------------------------- -// -void CSPMicrophone::RecordError( TInt aError ) - { - CSPLOGSTRING( CSPINT, "CSPMicrophone::RecordError" ); - - // We dont react to devsound messages unless we are activating. - if( IsActivationOngoing() ) - { - if( aError == KErrAccessDenied ) - { - iActivationOngoing = EFalse; - iObserver.MicActivationFailed(); - } - } - } - -// --------------------------------------------------------------------------- -// From class CSPDevSound -// Tries to activate mic stream. Stream becomes active when BufferToBeFilled -// gets called. -// --------------------------------------------------------------------------- -// -void CSPMicrophone::DoActivateL() - { - iDevSound->RecordInitL(); - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CSPMicrophone::CSPMicrophone( - MCSPDevSoundObserver& aObserver ) : - CSPDevSound( aObserver ) - { - } - -// --------------------------------------------------------------------------- -// Second phase constructor -// --------------------------------------------------------------------------- -// -void CSPMicrophone::ConstructL() - { - CSPDevSound::ConstructL( - EMMFStateRecording, - KAudioPrefCSCallUplink, - KAudioPriorityCSCallUplink ); - } - -// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/cspspeaker.cpp --- a/phoneplugins/csplugin/src/cspspeaker.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Provides speaker functionality -* -*/ - - -#include - -#include "cspspeaker.h" -#include "csplogger.h" -#include "mcspdevsoundobserver.h" - -//Audio levels -//Max volume level -const TInt KMaxVolumeLevel = 10; - -// --------------------------------------------------------------------------- -// Static constructor -// --------------------------------------------------------------------------- -// -CSPSpeaker* CSPSpeaker::NewL( - MCSPDevSoundObserver& aObserver ) - { - CSPSpeaker* self = new( ELeave ) CSPSpeaker( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CSPSpeaker::~CSPSpeaker() - { - } - -// --------------------------------------------------------------------------- -// Sets volume -// Volume needs to be converted from 0-10 scale to the volume scale used by -// DevSound 0 - MaxVolume(). -// No need to check aVolume value, because devsound takes care -// than illegal value are converted to legal, ie <0 are 0 and >MaxVolume -// are set to MaxVolume. -// --------------------------------------------------------------------------- -// -void CSPSpeaker::SetVolume( TInt aVolume ) - { - TInt vol( 0 ); - vol = iDevSound->MaxVolume() * aVolume / KMaxVolumeLevel; - iDevSound->SetVolume( vol ); - CSPLOGSTRING2(CSPINT, "CSPSpeaker::SetVolume() \ - vol=%d", vol ); - CSPLOGSTRING2(CSPINT, "CSPSpeaker::SetVolume() \ - maxVol=%d", iDevSound->MaxVolume() ); - } - -// --------------------------------------------------------------------------- -// Gives volume -// --------------------------------------------------------------------------- -// -TInt CSPSpeaker::Volume() - { - TInt devVol = iDevSound->Volume(); - CSPLOGSTRING2(CSPINT, "CSPSpeaker::Volume \ - vol from DevSound =%d", devVol ); - TInt vol = devVol * KMaxVolumeLevel / iDevSound->MaxVolume(); - - CSPLOGSTRING2(CSPINT, "CSPSpeaker::Volume() \ - vol=%d", vol ); - - return vol; - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Speaker stream has been activated successfully. -// --------------------------------------------------------------------------- -// -void CSPSpeaker::BufferToBeFilled( CMMFBuffer* /*aBuffer*/ ) - { - CSPLOGSTRING( CSPINT, "CSPSpeaker::BufferToBeFilled activated" ); - // We dont react to devsound messages unless we are activating. - if( IsActivationOngoing() ) - { - iActive = ETrue; - iActivationOngoing = EFalse; - iObserver.SpeakerActivatedSuccessfully(); - } - } - -// --------------------------------------------------------------------------- -// From class MDevSoundObserver -// Speaker stream activation failed -// --------------------------------------------------------------------------- -// -void CSPSpeaker::PlayError( TInt aError ) - { - CSPLOGSTRING( CSPINT, "CSPSpeaker::PlayError" ); - - // We dont react to devsound messages unless we are activating. - if( IsActivationOngoing() ) - { - CSPLOGSTRING( CSPINT, "CSPSpeaker::PlayError activation failed" ); - if( aError == KErrAccessDenied ) - { - iActivationOngoing = EFalse; - iObserver.SpeakerActivationFailed(); - } - } - } - -// --------------------------------------------------------------------------- -// From class CSPDevsound -// Tries to activate speaker stream. -// --------------------------------------------------------------------------- -// -void CSPSpeaker::DoActivateL() - { - iDevSound->PlayInitL(); - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CSPSpeaker::CSPSpeaker( - MCSPDevSoundObserver& aObserver ) : - CSPDevSound( aObserver ) - { - } - -// --------------------------------------------------------------------------- -// Second phase constructor -// --------------------------------------------------------------------------- -// -void CSPSpeaker::ConstructL() - { - CSPDevSound::ConstructL( - EMMFStatePlaying, - KAudioPrefCSCallDownlink, - KAudioPriorityCSCallDownlink ); - } - -// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/csplugin/src/tmshandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/csplugin/src/tmshandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,508 @@ +/* + * 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: Starts and stops audio streams. + * + */ + +#include +#include +#include +#include "tmshandler.h" +#include "csplogger.h" +#include "csptimer.h" +#include "csppanic.pan" + +/** + * Timeout initial value. + */ +const TInt KTimeoutInitial = 200000; // 0.2s + +/** + * Double the timeout for every retry. + */ +const TInt KTimeoutMultiplier = 2; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Static constructor +// --------------------------------------------------------------------------- +// +TmsHandler* TmsHandler::NewL() + { + TmsHandler* self = TmsHandler::NewLC(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// Static constructor +// --------------------------------------------------------------------------- +// +TmsHandler* TmsHandler::NewLC() + { + TmsHandler* self = new (ELeave) TmsHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +TmsHandler::~TmsHandler() + { + if (iTimer) + { + iTimer->CancelNotify(); + delete iTimer; + } + if (iTmsUplink && iTmsCall) + { + // CloseUplink(); + iTmsCall->DeleteStream(iTmsUplink); + } + if (iTmsDnlink && iTmsCall) + { + // CloseDownlink(); + iTmsCall->DeleteStream(iTmsDnlink); + } + if (iFactory && iTmsCall) + { + iFactory->DeleteCall(iTmsCall); + } + if (iFactory && iTmsMicSource) + { + iFactory->DeleteSource(iTmsMicSource); + } + if (iFactory && iTmsModemSource) + { + iFactory->DeleteSource(iTmsModemSource); + } + if (iFactory && iTmsSpeakerSink) + { + iFactory->DeleteSink(iTmsSpeakerSink); + } + if (iFactory && iTmsModemSink) + { + iFactory->DeleteSink(iTmsModemSink); + } + + delete iFactory; + + } + +// --------------------------------------------------------------------------- +// From class MCSPAudioStream +// Activates mic and speaker. +// --------------------------------------------------------------------------- +// +void TmsHandler::StartStreams() + { + CSPLOGSTRING(CSPINT, "TmsHandler::StartStreams"); + + StartMicAndSpeaker(); + } + +// --------------------------------------------------------------------------- +// From class MCSPAudioStream +// Deactivates mic and speaker if the streams are active or they are +// activating. +// --------------------------------------------------------------------------- +// +void TmsHandler::StopStreams() + { + CSPLOGSTRING(CSPINT, "TmsHandler::StopStreams"); + gint status(TMS_RESULT_SUCCESS); + if (iTimer && IsMicAndSpeakerStarted()) + { + CSPLOGSTRING(CSPINT, "TmsHandler::StopStreams Stopping"); + iTimer->CancelNotify(); + iTimeout = KTimeoutInitial; + status = iTmsUplink->Stop(); + iUplinkStarted = FALSE; + status |= iTmsDnlink->Stop(); + iDnlinkStarted = FALSE; + + if (status != TMS_RESULT_SUCCESS) + { + status = TMS_RESULT_GENERAL_ERROR; + } + } + CSPLOGSTRING2(CSPINT, "TmsHandler::StopStreams status %d", status); + } + +// --------------------------------------------------------------------------- +// From class MCSPTimerObserver +// Notify from CSPTimer that timeout passed. Try to start mic and +// speaker again. +// --------------------------------------------------------------------------- +// +void TmsHandler::TimerEvent() + { + CSPLOGSTRING(CSPINT, "TmsHandler.TimerEvent" ); + iTimeout *= KTimeoutMultiplier; + StartMicAndSpeaker(); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +TmsHandler::TmsHandler() : + iTimeout(KTimeoutInitial) + { + } + +// --------------------------------------------------------------------------- +// Second phase constructor +// --------------------------------------------------------------------------- +// +void TmsHandler::ConstructL() + { + CSPLOGSTRING(CSPINT, "TmsHandler::ConstructL"); + iTimer = CSPTimer::NewL(); + + if (CreateTMSCallControl()) + { + User::LeaveIfError(TMS_RESULT_UNINITIALIZED_OBJECT); + } + } + +// --------------------------------------------------------------------------- +// TmsHandler::CreateTMSCallControl() +// --------------------------------------------------------------------------- +// +gint TmsHandler::CreateTMSCallControl() + { + TMSVer* v = NULL; + TInt status; + status = TMSFactory::CreateFactory(iFactory, *v); + + __ASSERT_ALWAYS(iFactory, Panic( ECSPPanicBadHandle)); + + status = iFactory->CreateCall(TMS_CALL_CS, iTmsCall, 0); + + status |= CreateUplink(); + status |= CreateDownlink(); + status |= CreateMicSource(); + status |= AddMicSourceToStream(); + status |= CreateModemSink(); + status |= AddModemSinkToStream(); + status |= CreateModemSource(); + status |= AddModemSourceToStream(); + status |= CreateSpeakerSink(); + status |= AddSpeakerSinkToStream(); + status |= OpenDownlink(); + + return status; + } + +// --------------------------------------------------------------------------- +// Resets timer +// --------------------------------------------------------------------------- +// +void TmsHandler::AudioStreamsStarted() + { + CSPLOGSTRING(CSPINT, "TmsHandler::AudioStreamsStarted" ); + iTimeout = KTimeoutInitial; + iTimer->CancelNotify(); + } + +// --------------------------------------------------------------------------- +// Starts timer +// --------------------------------------------------------------------------- +// +void TmsHandler::StartTimer() + { + CSPLOGSTRING(CSPINT, "TmsHandler::StartTimer" ); + iTimer->NotifyAfter(iTimeout, *this); + } + +// --------------------------------------------------------------------------- +// Starts mic and speaker +// --------------------------------------------------------------------------- +// +void TmsHandler::StartMicAndSpeaker() + { + // if speaker and mic is active then activation does not cause any actions. + gint status(TMS_RESULT_SUCCESS); + + if (iTmsUplink) + { + status = iTmsUplink->Start(); + } + CSPLOGSTRING2( CSPINT, "TmsHandler::StartMicAndSpeaker status %d", status ); + } + +// --------------------------------------------------------------------------- +// Indicated if mic and speaker are started or starting up. +// --------------------------------------------------------------------------- +// +TBool TmsHandler::IsMicAndSpeakerStarted() + { + return (iUplinkStarted || iDnlinkStarted); + } + +// ---------------------------------------------------------------------------- +// CreateUplink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateUplink() + { + CSPLOGSTRING(CSPINT, "TmsHandler::CreateUplink"); + gint status(TMS_RESULT_SUCCESS); + if (iTmsCall) + { + status = iTmsCall->CreateStream(TMS_STREAM_UPLINK, iTmsUplink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// CreateDownlink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateDownlink() + { + CSPLOGSTRING(CSPINT, "TmsHandler::CreateDownlink"); + gint status(TMS_RESULT_SUCCESS); + + if (iTmsCall) + { + status = iTmsCall->CreateStream(TMS_STREAM_DOWNLINK, iTmsDnlink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// OpenUplink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::OpenUplink() + { + CSPLOGSTRING(CSPINT, "TmsHandler::OpenUplink"); + gint status = TMS_RESULT_SUCCESS; + + if (iTmsUplink) + { + status = iTmsUplink->AddObserver(*this, NULL); + if (status == TMS_RESULT_SUCCESS) + { + status = iTmsUplink->Init(); + } + } + return status; + } + +// ---------------------------------------------------------------------------- +// OpenDownlink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::OpenDownlink() + { + CSPLOGSTRING(CSPINT, "TmsHandler::OpenDownlink"); + gint status = TMS_RESULT_SUCCESS; + + if (iTmsDnlink) + { + status = iTmsDnlink->AddObserver(*this, NULL); + if (status == TMS_RESULT_SUCCESS) + { + status = iTmsDnlink->Init(); + } + } + return status; + } + +// ---------------------------------------------------------------------------- +// CreateModemSource +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateModemSource() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSource) + { + status = iFactory->CreateSource(TMS_SOURCE_MODEM, iTmsModemSource); + } + return status; + } + +// ---------------------------------------------------------------------------- +// AddModemSourceToStream +// ---------------------------------------------------------------------------- +// +gint TmsHandler::AddModemSourceToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsModemSource) + { + status = iTmsDnlink->AddSource(iTmsModemSource); + } + return status; + } + +// ---------------------------------------------------------------------------- +// CreateModemSink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateModemSink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSink) + { + status = iFactory->CreateSink(TMS_SINK_MODEM, iTmsModemSink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// AddModemSinkToStream +// ---------------------------------------------------------------------------- +// +gint TmsHandler::AddModemSinkToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsUplink && iTmsModemSink) + { + status = iTmsUplink->AddSink(iTmsModemSink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// CreateMicSource +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateMicSource() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsMicSource) + { + status = iFactory->CreateSource(TMS_SOURCE_MIC, iTmsMicSource); + } + return status; + } + +// ---------------------------------------------------------------------------- +// AddMicSourceToStream +// ---------------------------------------------------------------------------- +// +gint TmsHandler::AddMicSourceToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsUplink && iTmsMicSource) + { + status = iTmsUplink->AddSource(iTmsMicSource); + } + return status; + } + +// ---------------------------------------------------------------------------- +// CreateSpeakerSink +// ---------------------------------------------------------------------------- +// +gint TmsHandler::CreateSpeakerSink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsSpeakerSink) + { + status = iFactory->CreateSink(TMS_SINK_SPEAKER, iTmsSpeakerSink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// AddSpeakerSinkToStream +// ---------------------------------------------------------------------------- +// +gint TmsHandler::AddSpeakerSinkToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsSpeakerSink) + { + status = iTmsDnlink->AddSink(iTmsSpeakerSink); + } + return status; + } + +// TMS CALLBACKS + +// ---------------------------------------------------------------------------- +// TmsHandler::TMSStreamEvent +// ---------------------------------------------------------------------------- +// +void TmsHandler::TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event) + { + CSPLOGSTRING2(CSPINT, "TmsHandler::TMSStreamEvent status %d", event.reason); + + TMSStreamType strmType = const_cast(stream).GetStreamType(); + + if (strmType == TMS_STREAM_UPLINK && + event.type == TMS_EVENT_STREAM_STATE_CHANGED) + { + switch (event.curr_state) + { + case TMS_STREAM_INITIALIZED: + //notify stream ready state + break; + case TMS_STREAM_UNINITIALIZED: + //notify initialization error + break; + case TMS_STREAM_PAUSED: + break; + case TMS_STREAM_STARTED: + iUplinkStarted = TRUE; + iTmsDnlink->Start(); + break; + default: + break; + } + } + else if (strmType == TMS_STREAM_DOWNLINK && + event.type == TMS_EVENT_STREAM_STATE_CHANGED) + { + switch (event.curr_state) + { + case TMS_STREAM_INITIALIZED: + { + if ((iTmsCall->GetCallType() == TMS_CALL_CS) + && (!iUplinkStarted)) + { + OpenUplink(); + } + //notify stream ready state + } + break; + case TMS_STREAM_UNINITIALIZED: + //notify initialization error + break; + case TMS_STREAM_PAUSED: + break; + case TMS_STREAM_STARTED: + iDnlinkStarted = TRUE; + break; + default: + break; + } + } + } + +// End of File diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro --- a/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro Mon May 03 12:31:11 2010 +0300 @@ -1,46 +1,36 @@ -# # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of "Eclipse Public License v1.0" # which accompanies this distribution, and is available # at the URL "http://www.eclipse.org/legal/epl-v10.html". -# # Initial Contributors: # Nokia Corporation - initial contribution. -# # Contributors: -# # Description: -# - TEMPLATE = lib - -CONFIG += plugin hb mobility - +CONFIG += plugin \ + hb \ + mobility MOBILITY = serviceframework - -win32: PLUGIN_SUBDIR = /hsresources/import/widgetregistry/20022F44 -symbian: PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20022F44 - +win32:PLUGIN_SUBDIR = /hsresources/import/widgetregistry/20022F44 +symbian:PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20022F44 LIBS += -lhswidgetmodel - DEPENDPATH += ./inc \ - ./src - + ./src INCLUDEPATH += ./inc \ - ../../inc - -symbian: { + ../../inc +symbian: { LIBS += -lxqservice \ - -lxqtelephonyservice - + -lxqtelephonyservice \ + -lxqsettingsmanager \ + -llogsengine TARGET.UID3 = 0x20022F44 - TARGET.EPOCALLOWDLLDATA=1 - TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL \ + -TCB INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } - OUTPUT_DIR = $$PWD/bin SOURCE_DIR = $$PWD/inc OBJECTS_DIR = $$OUTPUT_DIR/tmp/$$TARGET @@ -49,12 +39,14 @@ RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui LIBS += -L$$DESTDIR -DEPENDPATH += . $$SOURCE_DIR -INCLUDEPATH += . $$SOURCE_DIR +DEPENDPATH += . \ + $$SOURCE_DIR +INCLUDEPATH += . \ + $$SOURCE_DIR INCLUDEPATH += $$MOC_DIR -plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR - +plugin:!isEmpty(PLUGIN_SUBDIR):DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR include(hsdialerwidgetplugin.pri) - exportResources(./resource/*.manifest, $$PLUGIN_SUBDIR) exportResources(./resource/*.svg, $$PLUGIN_SUBDIR) +exportResources(./resource/*.png, $$PLUGIN_SUBDIR) +RESOURCES += hsdialerwidgetpluging.qrc diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,7 @@ + + + resource/qtg_fr_shortcut_badge_bg_r.png + resource/qtg_fr_shortcut_badge_bg_c.png + resource/qtg_fr_shortcut_badge_bg_l.png + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidget.h --- a/phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidget.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidget.h Mon May 03 12:31:11 2010 +0300 @@ -19,6 +19,12 @@ #define HSDIALERWIDGET_H #include +#ifdef Q_OS_SYMBIAN +#include +#else +class XQSettingsManager; +class XQSettingsKey; +#endif #ifndef HOMESCREEN_TEST #define HOMESCREEN_TEST_CLASS(aClassName) @@ -31,7 +37,7 @@ HOMESCREEN_TEST_CLASS(TestDialerWidgetPlugin) class XQCallInfo; - +class HbFrameItem; class HsDialerWidget : public HbWidget { Q_OBJECT @@ -40,8 +46,14 @@ HsDialerWidget(QGraphicsItem* parent = 0, Qt::WindowFlags flags = 0); ~HsDialerWidget(); + void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); + +private: + void setItemPositions(); + public slots: void startDialer(); + void updateMissedCallBadge(const XQSettingsKey &key, const QVariant &value); void onShow(); void onHide(); @@ -49,9 +61,15 @@ protected: void mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) } void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + + private: XQCallInfo *mXQCallInfo; + HbFrameItem *m_shortcutBadge; + HbFrameItem *m_backgroud; + XQSettingsManager * m_setManager; + int m_missedCalls; HOMESCREEN_TEST_FRIEND_CLASS(TestDialerWidgetPlugin) }; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_c.png Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_c.png has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_l.png Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_l.png has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_r.png Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_r.png has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp --- a/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -15,10 +15,13 @@ * */ -#include -#include -#include "hsdialerwidget.h" + +#include +#include +#include +#include #ifdef Q_OS_SYMBIAN +#include #include "qtphonelog.h" #include #include @@ -27,9 +30,12 @@ #include #endif +#include "hsdialerwidget.h" + namespace { const char KDialerWidgetIcon[] = "qtg_graf_hs_dialer"; + const char KMissedCallShortcutBadge[] = ":/icons/resource/qtg_fr_shortcut_badge_bg"; } /*! @@ -47,15 +53,36 @@ : HbWidget(parent, flags), mXQCallInfo(0) { - HbIconItem *iconItem = new HbIconItem; - HbIcon icon(KDialerWidgetIcon); - iconItem->setIcon(icon); +#ifdef Q_OS_SYMBIAN + m_setManager = new XQSettingsManager(this); + + XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, + KCRUidLogs.iUid, KLogsNewMissedCalls ); + + bool ok = connect( m_setManager, + SIGNAL( valueChanged(const XQSettingsKey & ,const QVariant &)), + this, SLOT(updateMissedCallBadge(XQSettingsKey, + QVariant))); + ASSERT( ok ); + ok = false; + ok = m_setManager->startMonitoring( settingsKey ); + ASSERT(ok); - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout; - layout->addItem(iconItem); - setLayout(layout); +#endif + + HbFrameDrawer *drawer = new HbFrameDrawer( + KDialerWidgetIcon, HbFrameDrawer::OnePiece); + m_backgroud = new HbFrameItem(drawer, this); + m_backgroud->setZValue(1); - setPreferredSize(icon.size()); + drawer = new HbFrameDrawer(KMissedCallShortcutBadge, + HbFrameDrawer::ThreePiecesHorizontal ); + + m_shortcutBadge = new HbFrameItem(drawer, this); + m_shortcutBadge->setZValue(2); + m_shortcutBadge->setVisible(true); + m_missedCalls=2; + setItemPositions(); resize(preferredSize()); } @@ -66,6 +93,48 @@ { } +void HsDialerWidget::paint( + QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + painter->setPen(QPen( Qt::transparent ) ); + + QRectF rect(m_backgroud->boundingRect()); + painter->drawRect((int)m_backgroud->pos().x(), + (int)m_backgroud->pos().y(), + rect.toRect().width(), + rect.toRect().height()); + + if ( m_shortcutBadge->isVisible()) + { + rect = m_shortcutBadge->boundingRect(); + HbTextItem *text = new HbTextItem( m_shortcutBadge->graphicsItem()); + + QFont badgefont = font(); +#ifdef Q_OS_SYMBIAN + badgefont.setPointSize( 4 ); +#else + badgefont.setPointSize( 8 ); +#endif + text->setFont(badgefont); + text->setText(QString::number(m_missedCalls)); + text->setZValue(3); + text->setTextColor(Qt::white); + // text->font().setPointSizeF(2); + + text->setX( ( rect.toRect().width() / 2 ) - 2); + text->setY( ( rect.toRect().height() / 5 ) - 1); + + painter->drawRect( (int)m_shortcutBadge->pos().x(), + (int)m_shortcutBadge->pos().y(), + rect.toRect().width(), + rect.toRect().height() ); + } +} + /*! \fn void HsDialerWidget::startDialer() @@ -108,6 +177,22 @@ #endif } +void HsDialerWidget::updateMissedCallBadge( + const XQSettingsKey &key, const QVariant &value) +{ +#ifdef Q_OS_SYMBIAN + if ( key.key() == (quint32)KLogsNewMissedCalls ){ + m_missedCalls = value.toInt(); + m_shortcutBadge->setVisible(value.toBool()); + setItemPositions(); + m_backgroud->update(); + } +#else + Q_UNUSED(key); + Q_UNUSED(value); +#endif +} + /*! \fn void HsDialerWidget::onShow() @@ -137,3 +222,22 @@ Q_UNUSED(event); startDialer(); } + +void HsDialerWidget::setItemPositions() +{ + HbIcon icon(KDialerWidgetIcon); + setPreferredWidth( icon.width()); + int badgeSize = 20; + if ( m_shortcutBadge->isVisible()){ + m_backgroud->setGeometry(QRectF(QPointF(0,badgeSize / 2 ), + QSizeF(icon.width(),icon.height()))); + m_shortcutBadge->setGeometry(QRectF( + QPointF(m_backgroud->boundingRect().width() - (badgeSize / 2),0 ), + QSizeF(badgeSize, badgeSize))); + setPreferredHeight(icon.height()+(badgeSize / 2)); + } else { + m_backgroud->setGeometry(QRectF(QPointF(0,0), + QSizeF(icon.width(),icon.height()))); + setPreferredHeight(icon.height()); + } +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h Mon May 03 12:31:11 2010 +0300 @@ -20,19 +20,23 @@ #include #include +#include #include #include "infowidgetlayoutmanager.h" class QLabel; -class QGraphicsLinearLayout; +class QGraphicsLinearLayout; +class QTranslator; class HbDialog; class HbIconItem; class HbMarqueeItem; class HbLabel; class HbCheckBox; -class HbPushButton; +class HbPushButton; +class HbFrameDrawer; class InfoWidgetEngine; class InfoWidgetPreferences; + class InfoWidget : public HbWidget { @@ -48,11 +52,12 @@ QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const; QSizePolicy sizePolicy () const; -public: // Property definitions with read and write functions +public: // Property definitions Q_PROPERTY(QString homeZoneDisplay READ homeZoneDisplay WRITE setHomeZoneDisplay) Q_PROPERTY(QString mcnDisplay READ mcnDisplay WRITE setMcnDisplay) Q_PROPERTY(QString activeLineDisplay READ activeLineDisplay WRITE setActiveLineDisplay) Q_PROPERTY(QString satDisplay READ satDisplay WRITE setSatDisplay) + Q_PROPERTY(QString spnDisplay READ spnDisplay WRITE setSpnDisplay) QString homeZoneDisplay(); void setHomeZoneDisplay(QString value); QString mcnDisplay(); @@ -61,6 +66,8 @@ void setActiveLineDisplay(QString value); QString satDisplay(); void setSatDisplay(QString value); + QString spnDisplay(); + void setSpnDisplay(QString value); protected: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); @@ -69,21 +76,21 @@ void mouseMoveEvent(QGraphicsSceneMouseEvent *event); void updateInfoDisplay(); - void initializePreferences(); - + bool readPersistentPreferences(); + void initializeCheckBoxStates(); void changeEvent(QEvent *event); + bool installTranslator(QString translationFile); + void removeTranslators(); private: void updateItemsVisibility(); void layoutInfoDisplay(); void layoutSettingsDisplay(); - void initializeInfoDisplayItems(); - void initializeSettingsDisplayItems(); - + void initializeSettingsDisplayItems(); void startChanges(); void endChanges(); - + public slots: // Slots from HsWidget void onInitialize(); @@ -94,12 +101,11 @@ // Info widget specific slots void readModel(); void handleModelError(int operation,int errorCode); - void homeZoneDisplaySettingChanged(int state); + void spnDisplaySettingChanged(int state); void mcnDisplaySettingChanged(int state); - void activeLineDisplaySettingChanged(int state); void satDisplaySettingChanged(int state); - void settingsEditingFinished(); + void settingsValidationFailed(); signals: void setPreferences(const QStringList &names); @@ -113,14 +119,16 @@ // Widget preference store InfoWidgetPreferences *m_preferences; - // Layout for widget - InfoWidgetLayoutManager *m_layoutManager; - QGraphicsLinearLayout *m_layout; + // Layout manager for widget + InfoWidgetLayoutManager *m_layoutManager; - bool m_layoutChanging; - bool m_isDragEvent; - QColor m_backGroundColor; - + QGraphicsLinearLayout *m_layout; + QList m_translators; + QColor m_backGroundColor; + HbFrameDrawer *m_frameDrawer; + bool m_layoutChanging; + bool m_dragEvent; + bool m_initialized; }; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h Mon May 03 12:31:11 2010 +0300 @@ -56,6 +56,11 @@ const QString& serviceProviderName() const { return m_serviceProviderName; }; void setServiceProviderName(const QString& name){ m_serviceProviderName = name; }; + bool serviceProviderNameDisplayRequired() const { + return m_serviceProviderNameDisplayRequired; }; + void setServiceProviderNameDisplayRequired(bool required){ + m_serviceProviderNameDisplayRequired = required; }; + const QString& homeZoneTextTag() const { return m_homeZoneTextTag; }; void setHomeZoneTextTag(const QString& tag){ m_homeZoneTextTag = tag; }; @@ -66,6 +71,7 @@ int m_mcnIndicatorType; int m_homeZoneIndicatorType; int m_activeLine; + bool m_serviceProviderNameDisplayRequired; QString m_mcnName; QString m_serviceProviderName; @@ -94,11 +100,17 @@ void handleSatError(int operation, int errorCode); void handleLineError(int operation, int errorCode); + void suspend(); + void resume(); + + void preferenceChanged(int option, int displaySetting); + private: ModelData m_modelData; // Own QScopedPointer m_networkHandler; + QScopedPointer m_satHandler; }; #endif /* INFOWIDGETENGINE_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h Mon May 03 12:31:11 2010 +0300 @@ -54,21 +54,19 @@ // Content widget, the main widget from document RoleContent, // Marquee items - RoleMcnMarqueeItem, + RoleMcnMarqueeItem, + RoleSatMarqueeItem, // Labels - RoleHomeZoneLabel, + RoleSpnLabel, RoleMcnLabel, - RoleActiveLineLabel, RoleSatTextLabel, - // Icons - RoleHomeZoneIcon, + // Icons + RoleSpnIcon, RoleMcnIcon, - RoleActiveLineIcon, RoleSatTextIcon, // Check boxes - RoleHomeZoneCheckBox, + RoleSpnCheckBox, RoleMcnCheckBox, - RoleActiveLineCheckBox, RoleSatTextCheckBox, // Buttons RoleOkButton, @@ -91,17 +89,19 @@ QList currentWidgetRoles(); int layoutRows() const; - void setLayoutRows(int rows); + void setLayoutRows(int rows); + qreal rowHeight() const; QGraphicsLayout* layoutInfoDisplay(); QGraphicsLayout* layoutSettingsDisplay(); const QList widgetRoles( DisplayRole displayRole) const; - + bool loadWidgets(const DisplayRole displayRole, const QList &displayWidgets, QMap &widgetMap); + bool reloadWidgets(const DisplayRole displayRole); QGraphicsWidget* loadWidget(InfoWidgetDocumentLoader &loader, DisplayRole displayRole, @@ -110,10 +110,12 @@ QGraphicsWidget* getWidget(LayoutItemRole itemRole); QGraphicsWidget* contentWidget(); + void removeWidget(LayoutItemRole itemRole); void hideWidget(LayoutItemRole itemRole); void hideAll(); void showAll(); + private: QMap m_widgets; QMap m_infoDisplayWidgets; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetnetworkhandler.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetnetworkhandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetnetworkhandler.h Mon May 03 12:31:11 2010 +0300 @@ -31,18 +31,32 @@ public: InfoWidgetNetworkHandler(QObject *parent = NULL); ~InfoWidgetNetworkHandler(); - + + QString serviceProviderName() const; + bool serviceProviderNameDisplayRequired() const; QString homeZoneTextTag() const; int homeZoneIndicatorType() const; - QString mcnName() const; int mcnIndicatorType() const; - + int networkRegistrationStatus() const; + bool isOnline() const; + void logCurrentInfo(); public: // From MNWMessageObserver void HandleNetworkMessage(const TNWMessages aMessage); void HandleNetworkError(const TNWOperation aOperation, TInt aErrorCode); + +public slots: + void suspend(); + void resume(); + + void enableMcn(); + void disableMcn(); + +protected: + void writeMcnDisplayState(bool enabled); + bool readMcnDisplayState(); signals: void networkDataChanged(); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h Mon May 03 12:31:11 2010 +0300 @@ -19,6 +19,7 @@ #define INFOWIDGETPREFERENCES_H #include +#include #include // Preference string values @@ -39,7 +40,8 @@ DisplayHomeZone = 0x1, DisplayMcn = 0x2, DisplayActiveLine = 0x4, - DisplaySatText = 0x8 + DisplaySatText = 0x8, + DisplaySpn = 0x10 }; Q_DECLARE_FLAGS(Options, Option) @@ -47,19 +49,26 @@ InfoWidgetPreferences(QObject *parent = NULL); ~InfoWidgetPreferences(); - void loadPreferences(); - void storePreferences(); - -public: + bool storePreferences(); + void restorePreferences(); + QStringList preferenceNames(); + + bool isPreferenceSet(Option preferenceId) const; QString preference(Option preferenceId) const; + InfoWidgetPreferences::Options preferences() const; void setPreference(Option preferenceId, const QString &preferenceString); - - int visibleItemCount(); - + + bool validate(); + int visibleItemCount(); + +signals: + void prefChanged(int option,int displaySetting); + private: Q_DISABLE_COPY(InfoWidgetPreferences) InfoWidgetPreferences::Options m_options; + InfoWidgetPreferences::Options m_validatedOptions; }; Q_DECLARE_OPERATORS_FOR_FLAGS(InfoWidgetPreferences::Options) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandler.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandler.h Mon May 03 12:31:11 2010 +0300 @@ -19,19 +19,28 @@ #define INFOWIDGETSATHANDLER_H_ #include +#include -class InfoWidgetSatHandler: public QObject + +class InfoWidgetSatHandlerPrivate; + +class InfoWidgetSatHandler: public QObject { Q_OBJECT public: InfoWidgetSatHandler(QObject *parent = NULL); ~InfoWidgetSatHandler(); - + + void connect(bool connect); + const QString& satDisplayText() const; void setSatDisplayText(const QString& displayText); void logCurrentInfo(); + + void handleIdleModeTxtMessage( int idleResult ); + void handleSatError( int operation, int errorCode ); signals: void handleMessage( int message ); @@ -39,7 +48,13 @@ private: - QString m_displayText; + QString m_displayText; + + int m_connected; + + InfoWidgetSatHandlerPrivate *d_ptr; + RSatService m_satService; + }; #endif /* INFOWIDGETSATHANDLER_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandlerprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandlerprivate.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include + +class InfoWidgetSatHandler; + +class InfoWidgetSatHandlerPrivate: public CActive +{ +public: + + InfoWidgetSatHandlerPrivate(InfoWidgetSatHandler *iwSatHandler, RSatService& iSatService); + ~InfoWidgetSatHandlerPrivate(); + + void startObserving(); + + int connect(); + int disconnect(); + +private: + + void activate(); + void getIdleModeData(); + + void RunL(); + void DoCancel(); + +private: // Data + + InfoWidgetSatHandler *q_ptr; + RSatService& m_satService; + RSatSession m_satSession; + RSatService::TSATIdleResult m_idleResult; + + QString m_idleTxt; +}; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include @@ -40,10 +42,25 @@ #include "infowidgetlayoutmanager.h" #include "infowidgetpreferences.h" -const int INFOWIDGET_LINE_WIDTH = 0; -const int INFOWIDGET_MARGIN = 5; const int INFOWIDGET_ROUNDING = 15; +const int INFOWIDGET_DEFAULT_HEIGHT = 100; +const int INFOWIDGET_DEFAULT_WIDTH = 100; +const char *TS_FILE_OPERATOR_WIDGET = "operator_widget"; +const char *TS_FILE_COMMON = "common"; +const char *BACKGROUND_COLOR_GROUP_ID = "qtc_default_popup_normal"; +const char *BACKGROUND_FRAME_NAME = "qtg_fr_hswidget_normal"; +/*! + \class InfoWidget + \brief Operator info widget main class. + + Implements HomeScreen specific slots and + graphical representation of the + Operator Info widget. + + Derived from HbWidget. + +*/ /*! InfoWidget::InfoWidget() @@ -54,55 +71,54 @@ m_preferences(NULL), m_layoutManager(NULL), m_layout(NULL), + m_frameDrawer(NULL), m_layoutChanging(false), - m_isDragEvent(false) + m_dragEvent(false), + m_initialized(false) { INSTALL_TRACE_MSG_HANDLER; DPRINT << ": IN"; // Localization file loading - QTranslator translator; - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - DPRINT << ": loading translation: " << QString(path + "operator_widget_" + lang); - bool translatorLoaded = translator.load(path + "operator_widget_" + lang); - DPRINT << ": translator loaded: " << translatorLoaded; - if (translatorLoaded) { - qApp->installTranslator(&translator); - DPRINT << ": translator installed"; - } + installTranslator(TS_FILE_OPERATOR_WIDGET); + installTranslator(TS_FILE_COMMON); m_layoutManager = new InfoWidgetLayoutManager(this); Q_ASSERT(m_layoutManager); - // Create network engine m_engine = new InfoWidgetEngine(this); - - // Create widget preference handler + Q_ASSERT(m_engine); + m_preferences = new InfoWidgetPreferences(this); - - DPRINT << ": reading preferences from meta-object properties"; - initializePreferences(); - - // Create widget main layout + Q_ASSERT(m_preferences); + + QObject::connect( m_preferences, SIGNAL(prefChanged(int,int)), + m_engine, SLOT(preferenceChanged(int,int))); + + // Setup widget main layout m_layout = new QGraphicsLinearLayout; m_layout->setSpacing(0); m_layout->setContentsMargins(0,0,0,0); - - // Layout info display - layoutInfoDisplay(); - setLayout(m_layout); - // Read initial data from model - updateInfoDisplay(); + // Read color definitions + m_backGroundColor = HbColorScheme::color( + BACKGROUND_COLOR_GROUP_ID); + if (!m_backGroundColor.isValid()) { + m_backGroundColor = Qt::black; + } - QObject::connect(m_engine, SIGNAL(modelChanged()), - this, SLOT(readModel())); + // Create background frame drawer + m_frameDrawer = new HbFrameDrawer( + BACKGROUND_FRAME_NAME, + HbFrameDrawer::NinePieces); + Q_ASSERT(m_frameDrawer); - m_backGroundColor = HbColorScheme::color("popupbackground"); - + // Set widget initial size + resize(INFOWIDGET_DEFAULT_WIDTH, + INFOWIDGET_DEFAULT_HEIGHT); + DPRINT << ": OUT"; } @@ -120,34 +136,156 @@ m_layout->removeAt(i); } + if (m_frameDrawer) { + delete m_frameDrawer; + m_frameDrawer = NULL; + } + + // Remove and delete language translators + removeTranslators(); + DPRINT << ": OUT"; UNINSTALL_TRACE_MSG_HANDLER; } /*! + InfoWidget::onInitialize() + + Called by HS framework, saved preference data + is available when onInitialize() is called and + meta-object data reading should be done here +*/ +void InfoWidget::onInitialize() +{ + DPRINT << ": IN"; + + m_initialized = true; + + // Initialize preferences from meta-object data + if (!readPersistentPreferences()) { + + // Reading failed, initialize default values + m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, + DISPLAY_SETTING_ON); + m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, + DISPLAY_SETTING_ON); + m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, + DISPLAY_SETTING_ON); + } + m_preferences->storePreferences(); + + // Layout components + layoutInfoDisplay(); + m_layout->activate(); + + // Read initial data from model + updateInfoDisplay(); + + // Listen for model changes + QObject::connect(m_engine, SIGNAL(modelChanged()), + this, SLOT(readModel())); + + DPRINT << ": OUT"; +} + +/*! + InfoWidget::onUninitialize() +*/ +void InfoWidget::onUninitialize() +{ + DPRINT; + m_initialized = false; + m_engine->suspend(); +} + +/*! + InfoWidget::onShow() +*/ +void InfoWidget::onShow() +{ + DPRINT; + m_engine->resume(); +} + +/*! + InfoWidget::onHide() +*/ +void InfoWidget::onHide() +{ + DPRINT; + m_engine->suspend(); +} + +/*! + InfoWidget::installTranslator() const +*/ +bool InfoWidget::installTranslator(QString translationFile) +{ + DPRINT << ": IN"; + + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + bool translatorLoaded(false); + + QTranslator* widgetTranslator = new QTranslator; + translatorLoaded = widgetTranslator->load( + path + translationFile + "_" + lang); + if (translatorLoaded) { + qApp->installTranslator(widgetTranslator); + m_translators.append(widgetTranslator); + DPRINT << ": translator installed: " << translationFile; + } else { + delete widgetTranslator; + widgetTranslator = NULL; + } + + DPRINT << ": OUT"; + return translatorLoaded; +} + +/*! + InfoWidget::removeTranslators() const +*/ +void InfoWidget::removeTranslators() +{ + DPRINT << ": IN"; + + foreach (QTranslator *translator, m_translators) { + qApp->removeTranslator(translator); + } + qDeleteAll(m_translators); + m_translators.clear(); + + DPRINT << ": OUT"; +} + +/*! InfoWidget::boundingRect() const */ QRectF InfoWidget::boundingRect() const -{ - DPRINT; - - QRectF rectF = rect(); - rectF.adjust(-INFOWIDGET_MARGIN, -INFOWIDGET_MARGIN, - INFOWIDGET_MARGIN, INFOWIDGET_MARGIN); - - return rectF; +{ + return rect(); } /*! InfoWidget::shape() const - Return shape + + Return Operator widget's shape + according to currect display */ QPainterPath InfoWidget::shape() const { DPRINT; QPainterPath path; - path.addRoundRect(boundingRect(), INFOWIDGET_ROUNDING, INFOWIDGET_ROUNDING); + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::InfoDisplay) { + path.addRoundRect(boundingRect(), + INFOWIDGET_ROUNDING, + INFOWIDGET_ROUNDING); + } else { + path.addRect(boundingRect()); + } return path; } @@ -159,24 +297,32 @@ Q_UNUSED(which); Q_UNUSED(constraint); - QSizeF requiredSize(70,160); + QSizeF requiredSize( + INFOWIDGET_DEFAULT_WIDTH, + INFOWIDGET_DEFAULT_HEIGHT); - // Try to get size hint from docml content, if not found use default - // size preference - if (m_layoutManager->currentDisplayRole() == - InfoWidgetLayoutManager::InfoDisplay) { - if (m_layoutManager->contentWidget()) { - requiredSize = m_layoutManager->contentWidget()->minimumSize(); + if (m_initialized) { + // Read size hint from docml content + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::InfoDisplay) { + if (m_layoutManager->contentWidget()) { + requiredSize = m_layoutManager->contentWidget()->minimumSize(); + // Height according number of rows, if 0 or 1 row use minimum size + int rowCount = m_preferences->visibleItemCount(); + if (1 < rowCount) { + requiredSize.rheight() += (rowCount-1)* + m_layoutManager->rowHeight(); + } } - } - else if (m_layoutManager->currentDisplayRole() == - InfoWidgetLayoutManager::SettingsDisplay) { - requiredSize = QSizeF(250,250); - if (m_layoutManager->contentWidget()) { - requiredSize = m_layoutManager->contentWidget()->preferredSize(); - } + } + else if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::SettingsDisplay) { + if (m_layoutManager->contentWidget()) { + requiredSize= m_layoutManager->contentWidget()->size(); + } + } } - + DPRINT << ": returning size: " << requiredSize; return requiredSize; } @@ -187,49 +333,9 @@ QSizePolicy InfoWidget::sizePolicy () const { DPRINT; - - // Size tells the exact size for the widget - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); -} - -/*! - InfoWidget::onInitialize() -*/ -void InfoWidget::onInitialize() -{ - DPRINT << ": IN"; - - // Initialize preferences from meta-object data - // set by homescreen framework. Homescreen framework - // has restored the properties before calling onInitialize - DPRINT << ": reading preferences from meta-object properties"; - initializePreferences(); - - DPRINT << ": OUT"; -} - -/*! - InfoWidget::onUninitialize() -*/ -void InfoWidget::onUninitialize() -{ - DPRINT; -} - -/*! - InfoWidget::onShow() -*/ -void InfoWidget::onShow() -{ - DPRINT; -} - -/*! - InfoWidget::onHide() -*/ -void InfoWidget::onHide() -{ - DPRINT; + return QSizePolicy( + QSizePolicy::Fixed, + QSizePolicy::Fixed); } /*! @@ -242,37 +348,28 @@ QList widgetsToHide; // Update layout according to item visibility settings - // 1. read visible items - if (m_preferences->preference(InfoWidgetPreferences::DisplayHomeZone).compare( + if (m_preferences->preference(InfoWidgetPreferences::DisplaySpn).compare( DISPLAY_SETTING_ON) == 0) { layoutRows++; } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) { - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleHomeZoneLabel); - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleHomeZoneIcon); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSpnLabel); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSpnIcon); } - + if (m_preferences->preference(InfoWidgetPreferences::DisplayMcn).compare( DISPLAY_SETTING_ON) == 0) { layoutRows++; } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) { - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleMcnMarqueeItem); - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleMcnIcon); - } - - if (m_preferences->preference(InfoWidgetPreferences::DisplayActiveLine).compare( - DISPLAY_SETTING_ON) == 0) { - layoutRows++; - } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) { - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleActiveLineLabel); - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleActiveLineIcon); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleMcnMarqueeItem); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleMcnIcon); } if (m_preferences->preference(InfoWidgetPreferences::DisplaySatText).compare( DISPLAY_SETTING_ON) == 0) { layoutRows++; } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) { - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleSatTextLabel); - m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleSatTextIcon); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSatMarqueeItem); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSatTextIcon); } DPRINT << ": visible layout rows count: " << layoutRows; @@ -307,14 +404,15 @@ // Add content widget to main layout m_layout->addItem(contentWidget); - - resize(contentWidget->preferredSize()); } } m_layoutManager->showAll(); updateItemsVisibility(); + m_layout->invalidate(); + m_layout->activate(); + endChanges(); DPRINT << ": OUT"; @@ -348,8 +446,6 @@ // Add content widget to main layout m_layout->addItem(contentWidget); - - resize(contentWidget->preferredSize()); } // Connect settings display widget signals @@ -357,7 +453,6 @@ } m_layoutManager->showAll(); - endChanges(); DPRINT << ": OUT"; @@ -384,52 +479,39 @@ HbPushButton *okButton = qobject_cast(m_layoutManager->getWidget( InfoWidgetLayoutManager::RoleOkButton)); if (okButton) { - DPRINT << ": okButton has been returned from layout manager, connecting signal"; QObject::connect(okButton, SIGNAL(clicked()), - this, SLOT(settingsEditingFinished())); + this, SLOT(settingsEditingFinished()), Qt::UniqueConnection); } // Connect display setting check boxes - HbCheckBox *homeZoneBox = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleHomeZoneCheckBox)); - if (homeZoneBox) { - DPRINT << ": homeZoneBox has been returned from layout manager, initializing"; - // Make checkable when home zone display is supported - homeZoneBox->setCheckable(false); - QObject::connect(homeZoneBox, SIGNAL(stateChanged(int)), - this, SLOT(homeZoneDisplaySettingChanged(int))); + HbCheckBox *spnCheckBox = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleSpnCheckBox)); + if (spnCheckBox) { + spnCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplaySpn)); + + QObject::connect(spnCheckBox, SIGNAL(stateChanged(int)), + this, SLOT(spnDisplaySettingChanged(int)), Qt::UniqueConnection); } HbCheckBox *mcnCheckBox = qobject_cast(m_layoutManager->getWidget( InfoWidgetLayoutManager::RoleMcnCheckBox)); if (mcnCheckBox) { - mcnCheckBox->setChecked(true); + mcnCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplayMcn)); - DPRINT << ": mcnCheckBox has been returned from layout manager, connecting signal"; QObject::connect(mcnCheckBox, SIGNAL(stateChanged(int)), - this, SLOT(mcnDisplaySettingChanged(int))); - } - - HbCheckBox *activeLineCheckBox = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleActiveLineCheckBox)); - if (activeLineCheckBox) { - // Make checkable when active line display is supported - activeLineCheckBox->setCheckable(false); - - DPRINT << ": activeLineCheckBox has been returned from layout manager, connecting signal"; - QObject::connect(activeLineCheckBox, SIGNAL(stateChanged(int)), - this, SLOT(activeLineDisplaySettingChanged(int))); + this, SLOT(mcnDisplaySettingChanged(int)), Qt::UniqueConnection); } HbCheckBox *satTextCheckBox = qobject_cast(m_layoutManager->getWidget( InfoWidgetLayoutManager::RoleSatTextCheckBox)); if (satTextCheckBox) { - // Make checkable when sat text display is supported - satTextCheckBox->setCheckable(false); - - DPRINT << ": satTextCheckBox has been returned from layout manager, connecting signal"; + satTextCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplaySatText)); + QObject::connect(satTextCheckBox, SIGNAL(stateChanged(int)), - this, SLOT(satDisplaySettingChanged(int))); + this, SLOT(satDisplaySettingChanged(int)), Qt::UniqueConnection); } DPRINT << ": OUT"; @@ -440,30 +522,32 @@ */ void InfoWidget::updateInfoDisplay() { - DPRINT; + DPRINT << ": IN"; + + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::InfoDisplay ) + { + QString text; + InfoWidgetEngine::ModelData modelData = m_engine->modelData(); - QString text; - InfoWidgetEngine::ModelData modelData = m_engine->modelData(); - - HbLabel *homeZoneLabel = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleHomeZoneLabel)); - if (homeZoneLabel && - m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { - text = modelData.homeZoneTextTag(); - homeZoneLabel->setPlainText(text); - } - - HbMarqueeItem *mcnMarqueeItem = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleMcnMarqueeItem)); - if (mcnMarqueeItem && - m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { - text = modelData.mcnName(); - if (text.length()) { + HbLabel *spnLabel = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleSpnLabel)); + if (spnLabel) { + if (m_engine->modelData().serviceProviderNameDisplayRequired()) { + text = modelData.serviceProviderName(); + spnLabel->setPlainText(text); + } + } + + HbMarqueeItem *mcnMarqueeItem = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleMcnMarqueeItem)); + if (mcnMarqueeItem) { + text = modelData.mcnName(); mcnMarqueeItem->setText(text); - + // Set marquee animation looping mode to infinite mcnMarqueeItem->setLoopCount(-1); - + // Finally, start marquee animation DPRINT << ": mcnMarqueeItem->isAnimating()"; if (!mcnMarqueeItem->isAnimating()) { @@ -471,32 +555,25 @@ mcnMarqueeItem->startAnimation(); } } - } - - HbLabel *activeLineLabel = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleActiveLineLabel)); - if (activeLineLabel && - m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { - text.setNum(modelData.activeLine()); - text.insert(0, hbTrId("Line: ")); + + HbMarqueeItem *satMarqueeItem = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleSatMarqueeItem)); + if (satMarqueeItem) { + text = modelData.satDisplayText(); - if (text.length()) { - activeLineLabel->setPlainText(text); + satMarqueeItem->setText(text); + + // Set marquee animation looping mode to infinite + satMarqueeItem->setLoopCount(-1); + + // Finally, start marquee animation + DPRINT << ": satMarqueeItem->isAnimating()"; + if (!satMarqueeItem->isAnimating()) { + DPRINT << ": mcnMarqueeItem->startAnimation()"; + satMarqueeItem->startAnimation(); + } } - } - - HbLabel *satTextLabel = qobject_cast(m_layoutManager->getWidget( - InfoWidgetLayoutManager::RoleSatTextLabel)); - if (satTextLabel && - m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { - - text = modelData.satDisplayText(); - - if (text.length()) { - satTextLabel->setPlainText(text); - } - } - + } } /*! @@ -508,7 +585,8 @@ { DPRINT << ": IN"; - if (m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::InfoDisplay) { updateInfoDisplay(); } DPRINT << ": OUT"; @@ -529,26 +607,31 @@ /*! InfoWidget::paint() */ -void InfoWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void InfoWidget::paint(QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); DPRINT; if (!m_layoutChanging) { - QBrush brush(Qt::white); - if (m_backGroundColor.isValid()) { - brush.setColor(m_backGroundColor); + painter->save(); + + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::InfoDisplay) { + if (m_frameDrawer) { + m_frameDrawer->paint(painter,boundingRect()); + } + } else { + QBrush brush(Qt::black); + QPainterPath path; + path.addRoundRect(boundingRect(), + INFOWIDGET_ROUNDING, + INFOWIDGET_ROUNDING); + painter->fillPath(path, brush); } - QRectF drawRect = boundingRect(); - drawRect.adjust( INFOWIDGET_LINE_WIDTH, INFOWIDGET_LINE_WIDTH, - -INFOWIDGET_LINE_WIDTH, -INFOWIDGET_LINE_WIDTH ); - QPainterPath path; - path.addRoundRect(drawRect, INFOWIDGET_ROUNDING, INFOWIDGET_ROUNDING); - - painter->save(); - painter->fillPath(path, brush); painter->restore(); } } @@ -556,16 +639,12 @@ /*! InfoWidget::mousePressEvent() */ - void InfoWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); - DPRINT; - // Initialize flag - m_isDragEvent = false; - - DPRINT; + // Clear flag + m_dragEvent = false; } /*! @@ -577,14 +656,15 @@ // If in info display and widget wasn't dragged // change to settings display - if ((!m_isDragEvent) && + if ((!m_dragEvent) && m_layoutManager->currentDisplayRole() == InfoWidgetLayoutManager::InfoDisplay) { DPRINT << ": layout settings display"; layoutSettingsDisplay(); } - m_isDragEvent = false; + // Clear flag + m_dragEvent = false; } /*! @@ -594,20 +674,21 @@ { Q_UNUSED(event); - // Mouse is moving after mouse press event - m_isDragEvent = true; + // Mouse is moving + // after mouse press event + m_dragEvent = true; } /*! - InfoWidget::homeZoneDisplaySettingChanged() + InfoWidget::spnDisplaySettingChanged() */ -void InfoWidget::homeZoneDisplaySettingChanged(int state) +void InfoWidget::spnDisplaySettingChanged(int state) { DPRINT << ": state: " << state; if (state == Qt::Checked){ - m_preferences->setPreference(InfoWidgetPreferences::DisplayHomeZone, DISPLAY_SETTING_ON); + m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_ON); } else { - m_preferences->setPreference(InfoWidgetPreferences::DisplayHomeZone, DISPLAY_SETTING_OFF); + m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_OFF); } } @@ -625,19 +706,6 @@ } /*! - InfoWidget::activeLineDisplaySettingChanged() -*/ -void InfoWidget::activeLineDisplaySettingChanged(int state) -{ - DPRINT << ": state: " << state; - if (state == Qt::Checked){ - m_preferences->setPreference(InfoWidgetPreferences::DisplayActiveLine, DISPLAY_SETTING_ON); - } else { - m_preferences->setPreference(InfoWidgetPreferences::DisplayActiveLine, DISPLAY_SETTING_OFF); - } -} - -/*! InfoWidget::satDisplaySettingChanged() */ void InfoWidget::satDisplaySettingChanged(int state) @@ -739,14 +807,38 @@ } /*! - InfoWidget::initializePreferences() + InfoWidget::spnDisplay() + + Getter function for Meta-object property "spnDisplay" +*/ +QString InfoWidget::spnDisplay() +{ + DPRINT; + return m_preferences->preference(InfoWidgetPreferences::DisplaySpn); +} + +/*! + InfoWidget::setSpnDisplay() - Read initial Meta-object properties and store to preference handler. + Setter function for Meta-object property "spnDisplay" +*/ +void InfoWidget::setSpnDisplay(QString value) +{ + DPRINT; + m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, value); +} + +/*! + InfoWidget::readPersistentPreferences() + + Read Meta-object properties and store to preference handler. Restores preferences from previous session. */ -void InfoWidget::initializePreferences() +bool InfoWidget::readPersistentPreferences() { DPRINT << ": IN"; + bool changed(false); + QString propertyValue; propertyValue = QObject::property("homeZoneDisplay").toString(); @@ -765,12 +857,46 @@ m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, propertyValue); - // Check that at least one item is set visible. If not - // set default item(s) visible. TBD which items and how selected. - if (m_preferences->visibleItemCount() == 0) { - DPRINT << ": no visible items initially, setting MCN on by default"; - m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, - DISPLAY_SETTING_ON); + propertyValue = QObject::property("spnDisplay").toString(); + m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, + propertyValue); + + // Check that at least one item is set visible and + // store preferences if true + if (m_preferences->validate()) { + changed = m_preferences->storePreferences(); + } + + DPRINT << ": OUT"; + return changed; +} + +/*! + InfoWidget::initializeCheckBoxStates() +*/ +void InfoWidget::initializeCheckBoxStates() +{ + DPRINT << ": IN"; + + HbCheckBox *spnCheckBox = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleSpnCheckBox)); + if (spnCheckBox) { + spnCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplaySpn)); + } + + HbCheckBox *mcnCheckBox = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleMcnCheckBox)); + if (mcnCheckBox) { + mcnCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplayMcn)); + } + + HbCheckBox *satTextCheckBox = qobject_cast(m_layoutManager->getWidget( + InfoWidgetLayoutManager::RoleSatTextCheckBox)); + if (satTextCheckBox) { + satTextCheckBox->setChecked(m_preferences->isPreferenceSet( + InfoWidgetPreferences::DisplaySatText)); } DPRINT << ": OUT"; @@ -783,9 +909,33 @@ { DPRINT << ": IN"; - layoutInfoDisplay(); - - updateInfoDisplay(); + // Save settings data if validation succeeds + if (m_preferences->validate()) { + DPRINT << ": switching to info display"; + + // Store preferences if changed + if (m_preferences->storePreferences()) { + // Signal Homescreen FW + emit setPreferences( + m_preferences->preferenceNames()); + } + + // ToDo: do only if settings have really changed + m_layoutManager->reloadWidgets( + InfoWidgetLayoutManager::InfoDisplay); + + // Switch to info display + layoutInfoDisplay(); + updateInfoDisplay(); + + } else { + DPRINT << ": staying in settings display"; + // Display warning note + settingsValidationFailed(); + + // Restore check box states + initializeCheckBoxStates(); + } DPRINT << ": OUT"; } @@ -795,11 +945,8 @@ */ void InfoWidget::startChanges() { - DPRINT << ": IN"; - - m_layoutChanging = true; - - DPRINT << ": OUT"; + DPRINT; + m_layoutChanging = true; } /*! @@ -807,11 +954,8 @@ */ void InfoWidget::endChanges() { - DPRINT << ": IN"; - - m_layoutChanging = false; - - DPRINT << ": OUT"; + DPRINT; + m_layoutChanging = false; } /*! @@ -822,12 +966,34 @@ DPRINT << ": IN"; if (event->type() == HbEvent::ThemeChanged) { - m_backGroundColor = HbColorScheme::color("popupbackground"); + DPRINT << ": HbEvent::ThemeChanged"; + m_backGroundColor = HbColorScheme::color( + BACKGROUND_COLOR_GROUP_ID); + if (!m_backGroundColor.isValid()) { + m_backGroundColor = Qt::black; + } } - HbWidget::changeEvent( event ); + HbWidget::changeEvent(event); DPRINT << ": OUT"; } +/*! + InfoWidget::settingsValidationFailed() +*/ +void InfoWidget::settingsValidationFailed() +{ + DPRINT << ": IN"; + + if (m_layoutManager->currentDisplayRole() == + InfoWidgetLayoutManager::SettingsDisplay) { + HbMessageBox::warning( + hbTrId("txt_operatorwidget_info_select_one")); + } + + DPRINT << ": OUT"; +} + + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,18 +17,25 @@ #include "infowidgetengine.h" #include "infowidgetnetworkhandler.h" +#include "infowidgetsathandler.h" #include #include "infowidgetlogging.h" -#include -#include -#include +#include "infowidgetpreferences.h" + +/*! + \class InfoWidgetEngine + \brief Engine functionality of + Operator info widget +*/ + /*! InfoWidgetEngine::InfoWidgetEngine */ InfoWidgetEngine::InfoWidgetEngine(QObject *parent): QObject(parent), - m_networkHandler(new InfoWidgetNetworkHandler) + m_networkHandler(new InfoWidgetNetworkHandler), + m_satHandler(new InfoWidgetSatHandler) { DPRINT << ": IN"; @@ -39,14 +46,17 @@ QObject::connect( m_networkHandler.data(), SIGNAL(networkDataChanged()), this, SLOT(updateNetworkDataToModel())); + + QObject::connect(m_satHandler.data(), + SIGNAL(handleError(int, int)), + this, SLOT(handleSatError(int, int))); - XQSettingsManager *settingsManager = new XQSettingsManager(0); - XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, - KCRUidNetworkSettings.iUid, KSettingsMcnDisplay); - bool result = settingsManager->writeItemValue(settingsKey, 1 ); - delete settingsManager; + QObject::connect(m_satHandler.data(), + SIGNAL(handleMessage(int)), + this, SLOT(updateSatDataToModel())); - updateNetworkDataToModel(); + updateNetworkDataToModel(); + updateSatDataToModel(); DPRINT << ": OUT"; } @@ -66,13 +76,19 @@ */ void InfoWidgetEngine::logModelData() { - DPRINT << ": mcn name: " << m_modelData.mcnName(); - DPRINT << ": service provider name: " << m_modelData.serviceProviderName(); - DPRINT << ": homezone text tag: " << m_modelData.homeZoneTextTag(); - - DPRINT << ": mcn type: " << m_modelData.mcnIndicatorType(); - DPRINT << ": active line: " << m_modelData.activeLine(); - DPRINT << ": homezone indicator type: " << m_modelData.homeZoneIndicatorType(); + DPRINT << ": mcn name: " << m_modelData.mcnName(); + DPRINT << ": mcn type: " << m_modelData.mcnIndicatorType(); + DPRINT << ": service provider name: " << + m_modelData.serviceProviderName(); + DPRINT << ": service provider display required: " << + m_modelData.serviceProviderNameDisplayRequired(); + + DPRINT << ": homezone text tag: " << + m_modelData.homeZoneTextTag(); + DPRINT << ": homezone indicator type: " << + m_modelData.homeZoneIndicatorType(); + DPRINT << ": active line: " << + m_modelData.activeLine(); } /*! @@ -95,13 +111,28 @@ m_networkHandler->logCurrentInfo(); - // Read network handler data to model data - m_modelData.setHomeZoneIndicatorType( - m_networkHandler->homeZoneIndicatorType()); - m_modelData.setHomeZoneTextTag(m_networkHandler->homeZoneTextTag()); - m_modelData.setMcnName(m_networkHandler->mcnName()); - m_modelData.setMcnIndicatorType(m_networkHandler->mcnIndicatorType()); + if (m_networkHandler->isOnline()) { + // Read network handler data to model data + m_modelData.setServiceProviderName( + m_networkHandler->serviceProviderName()); + m_modelData.setServiceProviderNameDisplayRequired( + m_networkHandler->serviceProviderNameDisplayRequired()); + m_modelData.setMcnName(m_networkHandler->mcnName()); + m_modelData.setMcnIndicatorType( + m_networkHandler->mcnIndicatorType()); + + m_modelData.setHomeZoneIndicatorType( + m_networkHandler->homeZoneIndicatorType()); + m_modelData.setHomeZoneTextTag( + m_networkHandler->homeZoneTextTag()); + } else { + // Not registered to network, clear data + m_modelData.setServiceProviderName(QString("")); + m_modelData.setMcnName(QString("")); + m_modelData.setHomeZoneTextTag(QString("")); + } + emit modelChanged(); DPRINT << ": OUT"; @@ -112,7 +143,19 @@ */ void InfoWidgetEngine::updateSatDataToModel() { - DPRINT; + DPRINT << ": IN"; + + if (m_satHandler) { + // Log current network data + m_satHandler->logCurrentInfo(); + // Read SAT handler data to model data + m_modelData.setSatDisplayText( + m_satHandler->satDisplayText()); + + emit modelChanged(); + } + + DPRINT << ": OUT"; } /*! @@ -126,26 +169,81 @@ /*! InfoWidgetEngine::handleNetworkError */ -void InfoWidgetEngine::handleNetworkError(int operation, int errorCode) +void InfoWidgetEngine::handleNetworkError( + int operation, int errorCode) { - DPRINT << ": operation: " << operation << " error code: " << errorCode; + DPRINT << ": operation: " << operation << + " error code: " << errorCode; } /*! InfoWidgetEngine::handleSatError */ -void InfoWidgetEngine::handleSatError(int operation, int errorCode) +void InfoWidgetEngine::handleSatError( + int operation, int errorCode) { - DPRINT << ": operation: " << operation << " error code: " << errorCode; + DPRINT << ": operation: " << operation << + " error code: " << errorCode; } /*! InfoWidgetEngine::handleLineError */ -void InfoWidgetEngine::handleLineError(int operation, int errorCode) +void InfoWidgetEngine::handleLineError( + int operation, int errorCode) { DPRINT << ": operation: " << operation << " error code: " << errorCode; } +/*! + InfoWidgetEngine::preferenceChanged + */ +void InfoWidgetEngine::preferenceChanged( + int option, int displaySetting) +{ + DPRINT << "option: " << option << " displaySetting: " << displaySetting; + switch(option){ + case InfoWidgetPreferences::DisplayMcn: + if (displaySetting == InfoWidgetPreferences::DisplayOn) { + m_networkHandler->enableMcn(); + } else { + m_networkHandler->disableMcn(); + } + break; + case InfoWidgetPreferences::DisplaySatText: + m_satHandler->connect(displaySetting); + break; + default: + break; + } + DPRINT << ": OUT"; +} + +/*! + InfoWidgetEngine::suspend + + Called when widget is deactivated + and widget should suspend all + possible activities + */ +void InfoWidgetEngine::suspend() +{ + DPRINT; + m_networkHandler->suspend(); +} + +/*! + InfoWidgetEngine::preferenceChanged + + Called when widget is activated + and widget can resume activities + */ +void InfoWidgetEngine::resume() +{ + DPRINT; + m_networkHandler->resume(); +} + + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine_s.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine_s.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine_s.cpp Mon May 03 12:31:11 2010 +0300 @@ -32,7 +32,7 @@ */ InfoWidgetEngine::~InfoWidgetEngine() { -DPRINT; + DPRINT; } /*! @@ -97,17 +97,25 @@ DPRINT; } - +/*! + InfoWidgetEngine::handleNetworkError + */ void InfoWidgetEngine::handleNetworkError(int operation, int errorCode) { DPRINT << ": operation: " << operation << " error code: " << errorCode; } +/*! + InfoWidgetEngine::handleSatError + */ void InfoWidgetEngine::handleSatError(int operation, int errorCode) { DPRINT << ": operation: " << operation << " error code: " << errorCode; } +/*! + InfoWidgetEngine::handleLineError + */ void InfoWidgetEngine::handleLineError(int operation, int errorCode) { DPRINT << ": operation: " << operation << " error code: " << errorCode; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -35,16 +35,14 @@ const char LAYOUT_NAME_CONTENT[] = "content"; const char LAYOUT_NAME_MCNMARQUEEITEM[] = "mcnMarqueeItem"; const char LAYOUT_NAME_MCNLABEL[] = "mcnLabel"; -const char LAYOUT_NAME_HOMEZONELABEL[] = "homeZoneLabel"; -const char LAYOUT_NAME_ACTIVELINELABEL[] = "activeLineLabel"; +const char LAYOUT_NAME_SPNLABEL[] = "spnLabel"; +const char LAYOUT_NAME_SATMARQUEEITEM[] = "satMarqueeItem"; const char LAYOUT_NAME_SATTEXTLABEL[] = "satTextLabel"; -const char LAYOUT_NAME_HOMEZONEICON[] = "homeZoneIcon"; +const char LAYOUT_NAME_SPNICON[] = "spnIcon"; const char LAYOUT_NAME_MCNICON[] = "mcnIcon"; -const char LAYOUT_NAME_ACTIVELINEICON[] = "activeLineIcon"; const char LAYOUT_NAME_SATTEXTICON[] = "satTextIcon"; -const char LAYOUT_NAME_HOMEZONECHECKBOX[] = "homeZoneCheckBox"; +const char LAYOUT_NAME_SPNCHECKBOX[] = "spnCheckBox"; const char LAYOUT_NAME_MCNCHECKBOX[] = "mcnCheckBox"; -const char LAYOUT_NAME_ACTIVELINECHECKBOX[] = "activeLineCheckBox"; const char LAYOUT_NAME_SATTEXTCHECKBOX[] = "satTextCheckBox"; const char LAYOUT_NAME_OKBUTTON[] = "okButton"; const char LAYOUT_NAME_CONTAINER[] = "container"; @@ -52,6 +50,14 @@ /*! + \class InfoWidgetDocumentLoader + \brief Custom document loader for Operator info widget + + Derived from HbDocumentLoader. + +*/ + +/*! InfoWidgetDocumentLoader::InfoWidgetDocumentLoader() */ InfoWidgetDocumentLoader::InfoWidgetDocumentLoader() @@ -77,14 +83,24 @@ DPRINT << ": HbMarqueeitem found, OUT"; return object; } - + DPRINT << ": OUT"; - return HbDocumentLoader::createObject(type, name); } + /*! - */ + \class InfoWidgetLayoutManager + \brief Layout manager class for Operator info widget. + + Handles layout document loading and accessing the loaded + widgets. + +*/ + +/*! + InfoWidgetLayoutManager::InfoWidgetLayoutManager() +*/ InfoWidgetLayoutManager::InfoWidgetLayoutManager(QObject *parent) : QObject(parent), m_documentLoader(NULL), @@ -115,7 +131,8 @@ } /*! - */ + InfoWidgetLayoutManager::~InfoWidgetLayoutManager() +*/ InfoWidgetLayoutManager::~InfoWidgetLayoutManager() { DPRINT << ": IN"; @@ -128,7 +145,8 @@ } /*! - */ + InfoWidgetLayoutManager::currentDisplayRole() +*/ InfoWidgetLayoutManager::DisplayRole InfoWidgetLayoutManager::currentDisplayRole() { DPRINT; @@ -136,19 +154,26 @@ } /*! - */ + InfoWidgetLayoutManager::currentWidgetRoles() +*/ QList InfoWidgetLayoutManager::currentWidgetRoles() { DPRINT; return m_widgets.keys(); } +/*! + InfoWidgetLayoutManager::layoutRows() +*/ int InfoWidgetLayoutManager::layoutRows() const { DPRINT; return m_layoutRows; } +/*! + InfoWidgetLayoutManager::setLayoutRows() +*/ void InfoWidgetLayoutManager::setLayoutRows(int rows) { DPRINT; @@ -156,6 +181,26 @@ } /*! + InfoWidgetLayoutManager::rowHeight() +*/ +qreal InfoWidgetLayoutManager::rowHeight() const +{ + DPRINT; + HbStyle style; + qreal rowHeight; + + bool ok = style.parameter("hb-param-graphic-size-primary-small", + rowHeight); + if (!ok) { + DPRINT << ": ERROR! Paremeters reading failed!! Using default"; + rowHeight = 26.8; + } + + DPRINT << ": rowHeight: " << rowHeight; + return rowHeight; +} + +/*! InfoWidgetLayoutManager::contentWidget() */ QGraphicsWidget* InfoWidgetLayoutManager::contentWidget() @@ -180,6 +225,21 @@ } /*! + InfoWidgetLayoutManager::removeWidget(); +*/ +void InfoWidgetLayoutManager::removeWidget(LayoutItemRole itemRole) +{ + DPRINT << ": item role: " << itemRole; + + QGraphicsWidget *widget = m_widgets.value(itemRole); + if (widget) { + DPRINT << ": removing widget: " << widget; + m_widgets.remove(itemRole); + delete widget; + } +} + +/*! InfoWidgetLayoutManager::hideWidget(); */ void InfoWidgetLayoutManager::hideWidget(LayoutItemRole itemRole) @@ -189,7 +249,7 @@ QGraphicsWidget *widget = m_widgets.value(itemRole); if (widget) { DPRINT << ": hiding widget: " << widget; - widget->hide(); + widget->hide(); } } @@ -205,14 +265,13 @@ iterator.next(); QGraphicsWidget *widget = iterator.value(); if (widget) { - widget->hide(); + widget->hide(); } } DPRINT << ": OUT"; } - /*! InfoWidgetLayoutManager::showAll(); */ @@ -301,7 +360,10 @@ bool loaded = false; m_documentLoader->load(INFOWIDGET_DOCML_FILE, &loaded); - + Q_ASSERT_X(loaded, + "InfoWidgetLayoutManager", + "Invalid docml file"); + if (!loaded) { qWarning() << "Unable to load .docml: " << INFOWIDGET_DOCML_FILE; } @@ -344,6 +406,27 @@ } /*! + InfoWidgetLayoutManager::reloadWidgets() +*/ +bool InfoWidgetLayoutManager::reloadWidgets(const DisplayRole displayRole) +{ + QList displayWidgetRoles = widgetRoles(displayRole); + bool loadResult(false); + + switch (displayRole) { + case InfoDisplay: + loadResult = loadWidgets(displayRole, + displayWidgetRoles, + m_infoDisplayWidgets); + break; + case SettingsDisplay: // Fall through + default: + break; + } + return loadResult; +} + +/*! InfoWidgetLayoutManager::loadWidget() Initialize loader with corresponding document file before calling this single widget loader utility @@ -372,39 +455,33 @@ case RoleMcnMarqueeItem: widgetName.append(LAYOUT_NAME_MCNMARQUEEITEM); break; - case RoleHomeZoneLabel: - widgetName.append(LAYOUT_NAME_HOMEZONELABEL); + case RoleSpnLabel: + widgetName.append(LAYOUT_NAME_SPNLABEL); break; case RoleMcnLabel: widgetName.append(LAYOUT_NAME_MCNLABEL); break; - case RoleActiveLineLabel: - widgetName.append(LAYOUT_NAME_ACTIVELINELABEL); + case RoleSatMarqueeItem: + widgetName.append(LAYOUT_NAME_SATMARQUEEITEM); break; case RoleSatTextLabel: widgetName.append(LAYOUT_NAME_SATTEXTLABEL); break; - case RoleHomeZoneIcon: - widgetName.append(LAYOUT_NAME_HOMEZONEICON); + case RoleSpnIcon: + widgetName.append(LAYOUT_NAME_SPNICON); break; case RoleMcnIcon: widgetName.append(LAYOUT_NAME_MCNICON); break; - case RoleActiveLineIcon: - widgetName.append(LAYOUT_NAME_ACTIVELINEICON); - break; case RoleSatTextIcon: widgetName.append(LAYOUT_NAME_SATTEXTICON); break; - case RoleHomeZoneCheckBox: - widgetName.append(LAYOUT_NAME_HOMEZONECHECKBOX); + case RoleSpnCheckBox: + widgetName.append(LAYOUT_NAME_SPNCHECKBOX); break; case RoleMcnCheckBox: widgetName.append(LAYOUT_NAME_MCNCHECKBOX); break; - case RoleActiveLineCheckBox: - widgetName.append(LAYOUT_NAME_ACTIVELINECHECKBOX); - break; case RoleSatTextCheckBox: widgetName.append(LAYOUT_NAME_SATTEXTCHECKBOX); break; @@ -451,35 +528,22 @@ case SettingsDisplay: // Fill supported layout item roles for settings display widgetRoles.append(RoleContent); - widgetRoles.append(RoleHomeZoneLabel); - widgetRoles.append(RoleMcnLabel); - widgetRoles.append(RoleActiveLineLabel); - widgetRoles.append(RoleSatTextLabel); - widgetRoles.append(RoleHomeZoneIcon); - widgetRoles.append(RoleMcnIcon); - widgetRoles.append(RoleActiveLineIcon); - widgetRoles.append(RoleSatTextIcon); - widgetRoles.append(RoleHomeZoneCheckBox); + widgetRoles.append(RoleSpnCheckBox); widgetRoles.append(RoleMcnCheckBox); - widgetRoles.append(RoleActiveLineCheckBox); widgetRoles.append(RoleSatTextCheckBox); widgetRoles.append(RoleOkButton); widgetRoles.append(RoleSettingsContainer); break; case InfoDisplay: // Fill supported layout item roles for info display - widgetRoles.append(RoleContent); - widgetRoles.append(RoleHomeZoneLabel); + widgetRoles.append(RoleContent); + widgetRoles.append(RoleSpnIcon); + widgetRoles.append(RoleSpnLabel); + widgetRoles.append(RoleMcnIcon); widgetRoles.append(RoleMcnMarqueeItem); - widgetRoles.append(RoleActiveLineLabel); - widgetRoles.append(RoleSatTextLabel); - widgetRoles.append(RoleHomeZoneIcon); - widgetRoles.append(RoleMcnIcon); - widgetRoles.append(RoleActiveLineIcon); widgetRoles.append(RoleSatTextIcon); - widgetRoles.append(RoleSettingsContainer); + widgetRoles.append(RoleSatMarqueeItem); break; - default: break; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlinehandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlinehandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlinehandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -20,31 +20,27 @@ #include "infowidgetlogging.h" -/*! +/*! */ InfoWidgetLineHandler::InfoWidgetLineHandler(QObject *parent): QObject(parent), m_activeLine(1) { - DPRINT << ": IN"; - DPRINT << ": OUT"; + DPRINT; } /*! */ InfoWidgetLineHandler::~InfoWidgetLineHandler() { - DPRINT << ": IN"; - DPRINT << ": OUT"; + DPRINT; } /*! */ void InfoWidgetLineHandler::logCurrentInfo() { - DPRINT << ": IN"; - DPRINT << ": OUT"; - + DPRINT; } /*! diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetnetworkhandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetnetworkhandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetnetworkhandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,13 +17,22 @@ #include #include +#include +#include +#include #include "infowidgetnetworkhandler.h" #include "infowidgetlogging.h" /*! - * InfoWidgetNetworkHandler::InfoWidgetNetworkHandler - */ + \class InfoWidgetNetworkHandler + \brief Handles network specific functionality of + Operator info widget +*/ + +/*! + InfoWidgetNetworkHandler::InfoWidgetNetworkHandler() +*/ InfoWidgetNetworkHandler::InfoWidgetNetworkHandler(QObject *parent) : QObject(parent), @@ -31,6 +40,10 @@ { DPRINT << ": IN"; + // Initialize key + // ToDo: need to check if preference is ON initially + enableMcn(); + CNWSession *session = 0; QT_TRAP_THROWING(session = CreateL(*this, m_nwInfo)); m_nwSession.reset(session); @@ -39,18 +52,70 @@ } /*! - * InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler - */ + InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler() +*/ InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler() { - DPRINT << ": IN"; - - DPRINT << ": OUT"; + DPRINT; + + // Disable MCN setting, + // no display client + disableMcn(); } /*! - * InfoWidgetNetworkHandler::homeZoneTextTag - */ + InfoWidgetNetworkHandler::suspend() +*/ +void InfoWidgetNetworkHandler::suspend() +{ + DPRINT; + disableMcn(); +} + +/*! + InfoWidgetNetworkHandler::suspend() +*/ +void InfoWidgetNetworkHandler::resume() +{ + DPRINT; + enableMcn(); +} + +/*! + InfoWidgetNetworkHandler::serviceProviderName() +*/ +QString InfoWidgetNetworkHandler::serviceProviderName() const +{ + DPRINT; + QString qBuf; + qBuf = QString((QChar*)m_nwInfo.iSPName.Ptr(), + m_nwInfo.iSPName.Length()); + DPRINT << ": serviceProviderName: " << qBuf; + + return qBuf; +} + +/*! + InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired() +*/ +bool InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired() const +{ + DPRINT; + bool displayRequired(true); + + if (m_nwInfo.iServiceProviderNameDisplayReq == + RMobilePhone::KDisplaySPNNotRequired) { + displayRequired = false; + } + DPRINT << ": serviceProviderNameDisplayRequired: " << + displayRequired; + + return displayRequired; +} + +/*! + InfoWidgetNetworkHandler::homeZoneTextTag() +*/ QString InfoWidgetNetworkHandler::homeZoneTextTag() const { DPRINT; @@ -63,8 +128,8 @@ } /*! - * InfoWidgetNetworkHandler::homeZoneIndicatorType - */ + InfoWidgetNetworkHandler::homeZoneIndicatorType() +*/ int InfoWidgetNetworkHandler::homeZoneIndicatorType() const { DPRINT; @@ -75,8 +140,32 @@ } /*! - * InfoWidgetNetworkHandler::mcnName - */ + InfoWidgetNetworkHandler::enableMcn() +*/ +void InfoWidgetNetworkHandler::enableMcn() +{ + DPRINT; + if (!readMcnDisplayState()) { + DPRINT << ": enabling mcn display cenrep"; + writeMcnDisplayState(true); + } +} + +/*! + InfoWidgetNetworkHandler::disableMcn() +*/ +void InfoWidgetNetworkHandler::disableMcn() +{ + DPRINT; + if (readMcnDisplayState()) { + DPRINT << ": disabling mcn display cenrep"; + writeMcnDisplayState(false); + } +} + +/*! + InfoWidgetNetworkHandler::mcnName() +*/ QString InfoWidgetNetworkHandler::mcnName() const { DPRINT; @@ -89,8 +178,8 @@ } /*! - * InfoWidgetNetworkHandler::mcnIndicatorType - */ + InfoWidgetNetworkHandler::mcnIndicatorType() +*/ int InfoWidgetNetworkHandler::mcnIndicatorType() const { DPRINT; @@ -100,78 +189,71 @@ return indicatorType; } + /*! - * InfoWidgetNetworkHandler::logCurrentInfo - */ + InfoWidgetNetworkHandler::networkRegistrationStatus() +*/ +int InfoWidgetNetworkHandler::networkRegistrationStatus() const +{ + DPRINT << ": registration status: " << + static_cast(m_nwInfo.iRegistrationStatus); + + return static_cast(m_nwInfo.iRegistrationStatus); +} + +/*! + InfoWidgetNetworkHandler::isOnline() + + Check if network registration status is registered and + return status accordingly +*/ +bool InfoWidgetNetworkHandler::isOnline() const +{ + bool online(false); + + switch (networkRegistrationStatus()) { + case ENWRegisteredBusy: // Fall through + case ENWRegisteredOnHomeNetwork: // Fall through + case ENWRegisteredRoaming: + online = true; + break; + default: + break; + } + + DPRINT << ": online: " << online; + return online; +} + +/*! + InfoWidgetNetworkHandler::logCurrentInfo() +*/ void InfoWidgetNetworkHandler::logCurrentInfo() { DPRINT << ": IN"; - DPRINT << "iRegistrationStatus " << m_nwInfo.iRegistrationStatus; - DPRINT << "iNetworkMode " << m_nwInfo.iNetworkMode; - DPRINT << "iStatus " << m_nwInfo.iStatus; QString qBuf; - - qBuf = QString((QChar*)m_nwInfo.iCountryCode.Ptr(), - m_nwInfo.iCountryCode.Length()); - DPRINT << "iCountryCode " << qBuf; - - qBuf = QString((QChar*)m_nwInfo.iNetworkId.Ptr(), - m_nwInfo.iNetworkId.Length()); - DPRINT << "iNetworkId " << qBuf; - - qBuf = QString((QChar*)m_nwInfo.iDisplayTag.Ptr(), - m_nwInfo.iDisplayTag.Length()); - DPRINT << "iDisplayTag " << qBuf; - - qBuf = QString((QChar*)m_nwInfo.iShortName.Ptr(), - m_nwInfo.iShortName.Length()); - DPRINT << "iShortName " << qBuf; - - qBuf = QString((QChar*)m_nwInfo.iLongName.Ptr(), - m_nwInfo.iLongName.Length()); - DPRINT << "iLongName " << qBuf; - - DPRINT << "iViagIndicatorType " << m_nwInfo.iViagIndicatorType; - - qBuf = QString((QChar*)m_nwInfo.iViagTextTag.Ptr(), - m_nwInfo.iViagTextTag.Length()); - DPRINT << "iViagTextTag " << qBuf; - DPRINT << "iMCNIndicatorType " << m_nwInfo.iMCNIndicatorType; - qBuf = QString((QChar*)m_nwInfo.iMCNName.Ptr(), m_nwInfo.iMCNName.Length()); DPRINT << "iMCNName " << qBuf; qBuf = QString((QChar*)m_nwInfo.iSPName.Ptr(),m_nwInfo.iSPName.Length()); DPRINT << "iSPName " << qBuf; - DPRINT << "iServiceProviderNameDisplayReq " << m_nwInfo.iServiceProviderNameDisplayReq; - qBuf = QString((QChar*)m_nwInfo.iNPName.Ptr(), m_nwInfo.iNPName.Length()); - DPRINT << "iNPName " << qBuf; - - qBuf = QString((QChar*)m_nwInfo.iOperatorNameInfo.iName.Ptr(), - m_nwInfo.iOperatorNameInfo.iName.Length()); - DPRINT << "iOperatorNameInfo iName" << qBuf; - DPRINT << "iOperatorNameInfo iType" << m_nwInfo.iOperatorNameInfo.iType; - - DPRINT << "iNoServerMode " << m_nwInfo.iNoServerMode; - - DPRINT << "iVoicePrivacyStatus " << m_nwInfo.iVoicePrivacyStatus; - - qBuf = QString((QChar*)m_nwInfo.iPLMNField.Ptr(), - m_nwInfo.iPLMNField.Length()); - DPRINT << "iPLMNField " << qBuf; + DPRINT << "iViagIndicatorType " << m_nwInfo.iViagIndicatorType; + qBuf = QString((QChar*)m_nwInfo.iViagTextTag.Ptr(), + m_nwInfo.iViagTextTag.Length()); + DPRINT << "iViagTextTag " << qBuf; DPRINT << ": OUT"; } /*! - * InfoWidgetNetworkHandler::HandleNetworkMessage - */ + InfoWidgetNetworkHandler::HandleNetworkMessage() +*/ void InfoWidgetNetworkHandler::HandleNetworkMessage( const TNWMessages aMessage ) { @@ -179,7 +261,9 @@ bool acceptedMessage = false; switch (aMessage) { - case ENWMessageCurrentCellInfoMessage: + case ENWMessageCurrentCellInfoMessage: // Fall through + case ENWMessageServiceProviderNameChange: // Fall through + case ENWMessageNetworkRegistrationStatusChange: // Fall through acceptedMessage = true; break; default: @@ -198,8 +282,8 @@ } /*! - * InfoWidgetNetworkHandler::HandleNetworkError - */ + InfoWidgetNetworkHandler::HandleNetworkError() +*/ void InfoWidgetNetworkHandler::HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ) @@ -207,6 +291,18 @@ DPRINT << ": operation: " << aOperation << " error code: " << aErrorCode; + // Reset invalid data + switch (aOperation) { + case MNWMessageObserver::ENWGetServiceProviderName: + m_nwInfo.iServiceProviderNameDisplayReq = + RMobilePhone::KDisplaySPNNotRequired; + m_nwInfo.iSPName.Zero(); + break; + default: + break; + } + + // Emit error signal int result = 0; QT_TRYCATCH_ERROR(result, emit networkError( static_cast(aOperation), static_cast(aErrorCode))); @@ -215,4 +311,54 @@ } } +/*! + InfoWidgetNetworkHandler::writeMcnDisplayState() + + Handler for cenrep key writing +*/ +void InfoWidgetNetworkHandler::writeMcnDisplayState(bool enabled) +{ + DPRINT << ": IN"; + + XQSettingsManager *settingsManager = new XQSettingsManager(0); + XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, + KCRUidNetworkSettings.iUid, KSettingsMcnDisplay); + int value; + if (enabled) { + value = 1; + } else { + value = 0; + } + bool result = settingsManager->writeItemValue(settingsKey, value ); + delete settingsManager; + + DPRINT << ": OUT"; +} + +/*! + InfoWidgetNetworkHandler::readMcnDisplayState() +*/ +bool InfoWidgetNetworkHandler::readMcnDisplayState() +{ + DPRINT << ": IN"; + bool mcnDisplayKeyOn(false); + + XQSettingsManager *settingsManager = new XQSettingsManager(0); + XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, + KCRUidNetworkSettings.iUid, KSettingsMcnDisplay); + bool conversionOk(false); + int value = settingsManager->readItemValue( + settingsKey, + XQSettingsManager::TypeInt).toInt(&conversionOk); + + if (conversionOk && value == 1) { + mcnDisplayKeyOn = true; + } + delete settingsManager; + + DPRINT << ": OUT"; + return mcnDisplayKeyOn; +} + + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences.cpp Mon May 03 12:31:11 2010 +0300 @@ -18,6 +18,12 @@ #include "infowidgetpreferences.h" #include "infowidgetlogging.h" +/*! + \class InfoWidgetPreferences + \brief Preference store for widget + display etc. options +*/ + /*! InfoWidgetPreferences::InfoWidgetPreferences() @@ -37,19 +43,38 @@ } /*! - InfoWidgetPreferences::loadPreferences() + InfoWidgetPreferences::storePreferences() + + Store acceptable preference set */ -void InfoWidgetPreferences::loadPreferences() +bool InfoWidgetPreferences::storePreferences() { DPRINT; + bool changed(false); + + if (validate() && + m_validatedOptions != m_options){ + DPRINT << ": preferences differ"; + changed = true; + m_validatedOptions = m_options; + } + else if (visibleItemCount() <= 0) { + DPRINT << ": invalid options, restoring initial options"; + restorePreferences(); + } + + return changed; } /*! - InfoWidgetPreferences::storePreferences() + InfoWidgetPreferences::restorePreferences() + + Restores last acceptable preference set */ -void InfoWidgetPreferences::storePreferences() +void InfoWidgetPreferences::restorePreferences() { DPRINT; + m_options = m_validatedOptions; } /*! @@ -70,6 +95,23 @@ } /*! + InfoWidgetPreferences::isPreferenceSet() +*/ +bool InfoWidgetPreferences::isPreferenceSet(Option preferenceId) const +{ + DPRINT << ": preference id: " << static_cast(preferenceId); + return m_options.testFlag(preferenceId); +} + +/*! + InfoWidgetPreferences::preferences() +*/ +InfoWidgetPreferences::Options InfoWidgetPreferences::preferences() const +{ + return m_options; +} + +/*! InfoWidgetPreferences::setPreference() */ void InfoWidgetPreferences::setPreference(Option preferenceId, @@ -81,8 +123,10 @@ if (preferenceString.compare(DISPLAY_SETTING_ON) == 0) { m_options |= preferenceId; + emit prefChanged(preferenceId,DisplayOn); } else { - m_options &= ~preferenceId; + m_options &= ~preferenceId; + emit prefChanged(preferenceId,DisplayOff); } DPRINT << ": modified options: " << m_options; @@ -108,10 +152,35 @@ if (m_options.testFlag(DisplaySatText)){ visibleItems++; } + if (m_options.testFlag(DisplaySpn)){ + visibleItems++; + } DPRINT << ": visible item count: " << visibleItems; return visibleItems; } +/*! + InfoWidgetPreferences::validate() +*/ +bool InfoWidgetPreferences::validate() +{ + return visibleItemCount() > 0; +} + +/*! + InfoWidgetPreferences::preferenceNames() + + Convenience function for getting all preference names +*/ +QStringList InfoWidgetPreferences::preferenceNames() +{ + QStringList preferenceList; + preferenceList << "spnDisplay" << "homeZoneDisplay" << + "activeLineDisplay" << "satDisplay" << "mcnDisplay"; + return preferenceList; +} + + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,19 +17,24 @@ #include "infowidgetsathandler.h" +#include "infowidgetsathandlerprivate.h" #include "infowidgetlogging.h" +#include +/*! + \class InfoWidgetSatHandler + \brief Handles SIM Application Toolkit specific functionality of + Operator info widget +*/ /*! */ InfoWidgetSatHandler::InfoWidgetSatHandler(QObject *parent): - QObject(parent) + QObject(parent) , m_connected(false) { DPRINT << ": IN"; - - // ToDo: remove when SAT implemented / releasing - DPRINT << ": setting DUMMY DATA to sat display text"; - m_displayText = "SAT DISPLAY TEXT"; + + d_ptr = new InfoWidgetSatHandlerPrivate(this, m_satService); DPRINT << ": OUT"; } @@ -39,19 +44,41 @@ InfoWidgetSatHandler::~InfoWidgetSatHandler() { DPRINT << ": IN"; + delete d_ptr; DPRINT << ": OUT"; -} +} /*! + InfoWidgetSatHandler::connect + */ +void InfoWidgetSatHandler::connect(bool connect) +{ + DPRINT << ": IN : connected = " << m_connected << " : connect = " << connect; + if(connect && !m_connected){ + DPRINT << "connect and startObserving() "; + m_connected = d_ptr->connect(); + if(m_connected){ + d_ptr->startObserving(); + } + }else if (!connect && m_connected){ + DPRINT << "disconnect and stopObserving() "; + m_connected = d_ptr->disconnect(); + } + DPRINT << ": OUT : connected = " << m_connected; +} + +/*! + InfoWidgetSatHandler::logCurrentInfo */ void InfoWidgetSatHandler::logCurrentInfo() { DPRINT << ": IN"; - DPRINT << ": OUT"; - + DPRINT << "SAT IdleModeText: " << m_displayText; + DPRINT << ": OUT"; } /*! + InfoWidgetSatHandler::satDisplayText */ const QString& InfoWidgetSatHandler::satDisplayText() const { @@ -60,6 +87,7 @@ } /*! + InfoWidgetSatHandler::setSatDisplayText */ void InfoWidgetSatHandler::setSatDisplayText(const QString& displayText) { @@ -67,5 +95,33 @@ m_displayText = displayText; } +/*! + InfoWidgetSatHandler::handleIdleModeTxtMessage + */ +void InfoWidgetSatHandler::handleIdleModeTxtMessage( int idleResult ) +{ + DPRINT << ": handleIdleModeTxtMessage: " << idleResult; + if(m_connected){ + m_satService.SetIdleModeTextResponse((RSatService::TSATIdleResult)idleResult); + } + else{ + //TODO: What's correct response if widget isn't visible? For now it's permanen problem + m_satService.SetIdleModeTextResponse( RSatService::ESATIdleCmdBeyondMeCapabilities ); + } + + //Pass the result + emit handleMessage(idleResult); +} + +/*! + InfoWidgetSatHandler::handleSatError + */ +void InfoWidgetSatHandler::handleSatError( int operation, int errorCode ) +{ + DPRINT << ": satError : operation: " << operation << ": errorCode: "< + +#include "InfoWidgetSatHandlerPrivate.h" +#include "InfoWidgetSatHandler.h" +#include "infowidgetlogging.h" + +/*! + InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate + */ +InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate( + InfoWidgetSatHandler *iwSatHandler, RSatService& satService) + : CActive(CActive::EPriorityStandard), + q_ptr(iwSatHandler), + m_satService(satService) +{ + DPRINT << ": IN"; + CActiveScheduler::Add(this); + DPRINT << ": OUT"; +} +/*! + InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate +*/ +InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate() +{ + DPRINT << ": IN"; + Cancel(); + DPRINT << ": OUT"; +} +/*! + InfoWidgetSatHandlerPrivate::connect + */ +int InfoWidgetSatHandlerPrivate::connect() +{ + TInt result( KErrGeneral ); + TRAP(result, m_satSession.ConnectL()); + if (0 != result) { + DPRINT << ": Exception occured while connecting SatSession:" << result; + } + else{ + TRAP(result, m_satService.OpenL(m_satSession)); + if (0 != result) { + DPRINT << ": Exception occured while opening SatService:" << result; + } + } + return !result; +} +/*! + InfoWidgetSatHandlerPrivate::startObserving + + To get initial content if any and start listening + */ +void InfoWidgetSatHandlerPrivate::startObserving() +{ + //not observing yet but + getIdleModeData(); + // in case there were content, there is need to send response to SAT + if(!m_idleTxt.isEmpty()){ + q_ptr->handleIdleModeTxtMessage( m_idleResult ); + } + // Start observing for changes + activate(); +} +/*! + InfoWidgetSatHandlerPrivate::disconnect + */ +int InfoWidgetSatHandlerPrivate::disconnect() +{ + DPRINT << ": IN"; + m_idleTxt = ""; + Cancel(); + m_satService.NotifySetupIdleModeTextChangeCancel(); + m_satService.Close(); + m_satSession.Close(); + + DPRINT << ": OUT"; + return 0;//TODO:Fixme +} +/*! + InfoWidgetSatHandlerPrivate::getIdleModeData + */ +void InfoWidgetSatHandlerPrivate::getIdleModeData() +{ + HBufC* string( NULL ); + TUint8 recordId( NULL ); + RSatService::TSatIconQualifier iconQualifier( + RSatService::ESatIconNoIcon ); + + // Get setup idle mode text, icon qualifier and record id. + TInt result( KErrNotFound ); + TRAP(result, m_satService.GetSetupIdleModeTextL( string, iconQualifier, recordId )); + if (0 != result) { + DPRINT << ": Exception occured while GetSetupIdleModeTextL :" << result; + m_idleResult = RSatService::ESATIdleMeUnableToProcessCmd; + } + else{ + DPRINT << "string->Length() : " << string->Length(); + if(RSatService::ESatIconSelfExplanatory != iconQualifier){ + m_idleTxt = QString((QChar*)string->Des().Ptr(), string->Length()); + }else{ + m_idleTxt = ""; + } + //determine result + if(RSatService::ESatIconNoIcon != iconQualifier + && !m_idleTxt.isEmpty()){ + //icon requested but we don't have icon support + m_idleResult = RSatService::ESATIdleSuccessRequestedIconNotDisplayed; + }else if(RSatService::ESatIconNoIcon == iconQualifier + && !m_idleTxt.isEmpty()){ + m_idleResult = RSatService::ESATIdleSuccess; + }else{ //got empty string, could be permanen problem as well? + //m_idleResult = RSatService::ESATIdleCmdBeyondMeCapabilities + m_idleResult = RSatService::ESATIdleMeUnableToProcessCmd; + } + } + delete string; + q_ptr->setSatDisplayText(m_idleTxt);//empty in case of selexplanatory icon +} + +/*! + InfoWidgetSatHandlerPrivate::RunL + */ +void InfoWidgetSatHandlerPrivate::RunL() +{ + DPRINT << ": IN"; + if ( KErrNone == iStatus.Int() ) + { + getIdleModeData(); + q_ptr->handleIdleModeTxtMessage( m_idleResult ); + } else { + q_ptr->handleSatError(1,iStatus.Int()); + } + if ( !IsActive() ) + { + activate(); + } + DPRINT << ": OUT"; +} +/*! + InfoWidgetSatHandlerPrivate::DoCancel + */ +void InfoWidgetSatHandlerPrivate::DoCancel() +{ + DPRINT << ": IN"; + m_satService.NotifySetupIdleModeTextChangeCancel(); + DPRINT << ": OUT"; +} +/*! + InfoWidgetSatHandlerPrivate::activate + */ +void InfoWidgetSatHandlerPrivate::activate() +{ + DPRINT << ": IN"; + Cancel(); + TInt error = m_satService.NotifySetupIdleModeTextChange( iStatus ); + + if ( KErrNone == error ) + { + SetActive(); + } + DPRINT << ": OUT"; +} + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pri --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pri Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pri Mon May 03 12:31:11 2010 +0300 @@ -20,19 +20,20 @@ ./infowidget/inc/infowidget.h \ ./infowidget/inc/infowidgetlayoutmanager.h \ ./infowidget/inc/infowidgetpreferences.h \ - ./infowidget/inc/infowidgetengine.h + ./infowidget/inc/infowidgetengine.h \ + ./infowidget/inc/infowidgetsathandlerprivate.h symbian: { HEADERS += ./infowidget/inc/infowidgetnetworkhandler.h \ ./infowidget/inc/infowidgetsathandler.h \ ./infowidget/inc/infowidgetlinehandler.h -} - -SOURCES += ./src/infowidgetprovider.cpp \ - ./infowidget/src/infowidget.cpp \ - ./infowidget/src/infowidgetlayoutmanager.cpp \ - ./infowidget/src/infowidgetengine.cpp - +} +SOURCES += infowidget/src/infowidgetsathandlerprivate.cpp \ + ./src/infowidgetprovider.cpp \ + ./infowidget/src/infowidget.cpp \ + ./infowidget/src/infowidgetlayoutmanager.cpp \ + ./infowidget/src/infowidgetengine.cpp + symbian: { SOURCES += ./infowidget/src/infowidgetpreferences.cpp \ ./infowidget/src/infowidgetnetworkhandler.cpp \ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pro Mon May 03 12:31:11 2010 +0300 @@ -30,7 +30,8 @@ -lnetworkhandling \ -lcbsclient \ -lcbsmcnclient \ - -lxqsettingsmanager + -lxqsettingsmanager \ + -lsatclient } INCLUDEPATH += ./inc \ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.qrc --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.qrc Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.qrc Mon May 03 12:31:11 2010 +0300 @@ -1,12 +1,7 @@ + - - resource/infowidget.png - resource/infowidget.docml - resource/qgn_prop_network_2g.svg - resource/qgn_prop_pb_call.svg - resource/qgn_prop_pb_sim.svg - resource/qgn_stat_zone_home_uni.svg + + resource/infowidget.png + resource/infowidget.docml - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.png Binary file phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.png has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.manifest --- a/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.manifest Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.manifest Mon May 03 12:31:11 2010 +0300 @@ -3,5 +3,5 @@ + description=""/> diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_RSatSession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_RSatSession.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "RSatSession.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// RSatSession::RSatSession +// ----------------------------------------------------------------------------- +// +RSatSession::RSatSession( ) + { + + } + + +// ----------------------------------------------------------------------------- +// RSatSession::ConnectL +// ----------------------------------------------------------------------------- +// +void RSatSession::ConnectL( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RSatSession::Version +// ----------------------------------------------------------------------------- +// +TVersion RSatSession::Version( ) const + { + SMC_MOCK_METHOD0( TVersion ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbframedrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbframedrawer.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,347 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::HbFrameDrawer +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::HbFrameDrawer( + bool cacheFlag ) + { + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::HbFrameDrawer +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::HbFrameDrawer( + const QString & frameGraphicsName, + FrameType type, + bool cacheFlag ) + { + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::~HbFrameDrawer +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::~HbFrameDrawer( ) + { + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::isNull +// ----------------------------------------------------------------------------- +// +bool HbFrameDrawer::isNull( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::frameGraphicsName +// ----------------------------------------------------------------------------- +// +QString HbFrameDrawer::frameGraphicsName( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setFrameGraphicsName +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setFrameGraphicsName( + const QString & frameGraphicsName ) + { + SMC_MOCK_METHOD1( void, const QString &, frameGraphicsName ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::frameType +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::FrameType HbFrameDrawer::frameType() const + { + SMC_MOCK_METHOD0( FrameType ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setFrameType +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setFrameType( + HbFrameDrawer::FrameType type ) + { + SMC_MOCK_METHOD1( void, FrameType, type ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::borderWidths +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::borderWidths( + qreal & left, + qreal & top, + qreal & right, + qreal & bottom ) const + { + SMC_MOCK_METHOD4( void, qreal &, left, + qreal &, top, + qreal &, right, + qreal &, bottom ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setBorderWidths +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setBorderWidths( + const qreal left, + const qreal top, + const qreal right, + const qreal bottom ) + { + SMC_MOCK_METHOD4( void, const qreal, left, + const qreal, top, + const qreal, right, + const qreal, bottom ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setBorderWidths +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setBorderWidths( + const qreal horizontal, + const qreal vertical ) + { + SMC_MOCK_METHOD2( void, const qreal, horizontal, + const qreal, vertical ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setBorderWidth +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setBorderWidth( + const qreal width ) + { + SMC_MOCK_METHOD1( void, const qreal, width ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::fillWholeRect +// ----------------------------------------------------------------------------- +// +bool HbFrameDrawer::fillWholeRect( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setFillWholeRect +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setFillWholeRect( + bool fill ) + { + SMC_MOCK_METHOD1( void, bool, fill ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::mirroringMode +// ----------------------------------------------------------------------------- +// +HbIcon::MirroringMode HbFrameDrawer::mirroringMode( ) const + { + SMC_MOCK_METHOD0( HbIcon::MirroringMode ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setMirroringMode +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setMirroringMode( + HbIcon::MirroringMode mode ) + { + SMC_MOCK_METHOD1( void, HbIcon::MirroringMode, mode ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::fileNameSuffixList +// ----------------------------------------------------------------------------- +// +QStringList HbFrameDrawer::fileNameSuffixList( ) const + { + SMC_MOCK_METHOD0( QStringList ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setFileNameSuffixList +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setFileNameSuffixList( + const QStringList & list ) + { + SMC_MOCK_METHOD1( void, const QStringList &, list ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setMask +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setMask( + const QPixmap & mask ) + { + SMC_MOCK_METHOD1( void, const QPixmap &, mask ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setMask +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setMask( + const QBitmap & mask ) + { + SMC_MOCK_METHOD1( void, const QBitmap &, mask ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::mask +// ----------------------------------------------------------------------------- +// +QPixmap HbFrameDrawer::mask( ) const + { + SMC_MOCK_METHOD0( QPixmap ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::maskBitmap +// ----------------------------------------------------------------------------- +// +QBitmap HbFrameDrawer::maskBitmap( ) const + { + SMC_MOCK_METHOD0( QBitmap ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::frameSize +// ----------------------------------------------------------------------------- +// +QSize HbFrameDrawer::frameSize( ) const + { + SMC_MOCK_METHOD0( QSize ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::themeChanged +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::themeChanged( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setLayoutDirection +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setLayoutDirection( + Qt::LayoutDirection direction ) + { + SMC_MOCK_METHOD1( void, Qt::LayoutDirection, direction ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setGraphicsItem +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setGraphicsItem( + QGraphicsItem * item ) + { + SMC_MOCK_METHOD1( void, QGraphicsItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::paint +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::paint( + QPainter * painter, + const QRectF & rect ) const + { + SMC_MOCK_METHOD2( void, QPainter *, painter, + const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::rect +// ----------------------------------------------------------------------------- +// +QRectF HbFrameDrawer::rect( ) const + { + SMC_MOCK_METHOD0( QRectF ) + } + + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::setRect +// ----------------------------------------------------------------------------- +// +void HbFrameDrawer::setRect( + const QRectF & rect ) + { + SMC_MOCK_METHOD1( void, const QRectF &, rect ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hblabel.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hblabel.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hblabel.cpp Mon May 03 12:31:11 2010 +0300 @@ -1,4 +1,5 @@ -/** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbmarqueeitem.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbmarqueeitem.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbmarqueeitem.cpp Mon May 03 12:31:11 2010 +0300 @@ -26,10 +26,8 @@ // HbMarqueeItem::HbMarqueeItem( QGraphicsItem * parent ) - //: - //HbWidgetBase( /*parent*/ ) { - + Q_UNUSED(parent) } @@ -40,10 +38,9 @@ HbMarqueeItem::HbMarqueeItem( const QString & text, QGraphicsItem * parent ) - //: - //HbWidgetBase( /*text, parent*/ ) { - + Q_UNUSED(text) + Q_UNUSED(parent) } @@ -224,10 +221,9 @@ HbMarqueeItem::HbMarqueeItem( HbMarqueeItemPrivate & dd, QGraphicsItem * parent ) - //: - //HbWidgetBase( /*dd, parent*/ ) { - + Q_UNUSED(dd) + Q_UNUSED(parent) } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyleoptionlabel.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyleoptionlabel.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyleoptionlabel.cpp Mon May 03 12:31:11 2010 +0300 @@ -1,4 +1,5 @@ -/** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -185,6 +185,27 @@ // ----------------------------------------------------------------------------- +// InfoWidget::spnDisplay +// ----------------------------------------------------------------------------- +// +QString InfoWidget::spnDisplay( ) + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidget::setSpnDisplay +// ----------------------------------------------------------------------------- +// +void InfoWidget::setSpnDisplay( + QString value ) + { + SMC_MOCK_METHOD1( void, QString, value ) + } + + +// ----------------------------------------------------------------------------- // InfoWidget::onInitialize // ----------------------------------------------------------------------------- // @@ -248,6 +269,17 @@ // ----------------------------------------------------------------------------- +// InfoWidget::spnDisplaySettingChanged +// ----------------------------------------------------------------------------- +// +void InfoWidget::spnDisplaySettingChanged( + int state ) + { + SMC_MOCK_METHOD1( void, int, state ) + } + + +// ----------------------------------------------------------------------------- // InfoWidget::homeZoneDisplaySettingChanged // ----------------------------------------------------------------------------- // @@ -302,6 +334,18 @@ // ----------------------------------------------------------------------------- +// InfoWidget::settingsValidationFailed +// ----------------------------------------------------------------------------- +// +void InfoWidget::settingsValidationFailed( ) + { + SMC_MOCK_METHOD0( void ) + } + + + + +// ----------------------------------------------------------------------------- // InfoWidget::paint // ----------------------------------------------------------------------------- // @@ -358,10 +402,20 @@ // ----------------------------------------------------------------------------- -// InfoWidget::initializePreferences +// InfoWidget::readPersistentPreferences // ----------------------------------------------------------------------------- // -void InfoWidget::initializePreferences( ) +bool InfoWidget::readPersistentPreferences( ) + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidget::initializeCheckBoxStates +// ----------------------------------------------------------------------------- +// +void InfoWidget::initializeCheckBoxStates( ) { SMC_MOCK_METHOD0( void ) } @@ -378,3 +432,24 @@ } +// ----------------------------------------------------------------------------- +// InfoWidget::installTranslator +// ----------------------------------------------------------------------------- +// +bool InfoWidget::installTranslator( + QString translationFile ) + { + SMC_MOCK_METHOD1( bool, QString, translationFile ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidget::removeTranslators +// ----------------------------------------------------------------------------- +// +void InfoWidget::removeTranslators( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetengine.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetengine.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetengine.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,6 +17,7 @@ #include #include #include "infowidgetnetworkhandler.h" +#include "infowidgetsathandler.h" #include "infowidgetengine.h" // ============================ MEMBER FUNCTIONS =============================== @@ -62,6 +63,7 @@ SMC_MOCK_METHOD0( void ) } + // ----------------------------------------------------------------------------- // InfoWidgetEngine::updateNetworkDataToModel // ----------------------------------------------------------------------------- @@ -131,3 +133,36 @@ } +// ----------------------------------------------------------------------------- +// InfoWidgetEngine::suspend +// ----------------------------------------------------------------------------- +// +void InfoWidgetEngine::suspend( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetEngine::resume +// ----------------------------------------------------------------------------- +// +void InfoWidgetEngine::resume( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetEngine::preferenceChanged +// ----------------------------------------------------------------------------- +// +void InfoWidgetEngine::preferenceChanged( + int option, + int displaySetting ) + { + SMC_MOCK_METHOD2( void, int, option, + int, displaySetting ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available @@ -86,6 +86,16 @@ // ----------------------------------------------------------------------------- +// InfoWidgetLayoutManager::rowHeight +// ----------------------------------------------------------------------------- +// +qreal InfoWidgetLayoutManager::rowHeight( ) const + { + SMC_MOCK_METHOD0( qreal ) + } + + +// ----------------------------------------------------------------------------- // InfoWidgetLayoutManager::layoutInfoDisplay // ----------------------------------------------------------------------------- // @@ -133,6 +143,16 @@ TYPE3, widgetMap ) } +// ----------------------------------------------------------------------------- +// InfoWidgetLayoutManager::reloadWidgets +// ----------------------------------------------------------------------------- +// +bool InfoWidgetLayoutManager::reloadWidgets( + const DisplayRole displayRole ) + { + SMC_MOCK_METHOD1( bool, const DisplayRole, displayRole ) + } + // ----------------------------------------------------------------------------- // InfoWidgetLayoutManager::loadWidget @@ -149,7 +169,6 @@ } - // ----------------------------------------------------------------------------- // InfoWidgetLayoutManager::getWidget // ----------------------------------------------------------------------------- @@ -172,6 +191,17 @@ // ----------------------------------------------------------------------------- +// InfoWidgetLayoutManager::removeWidget +// ----------------------------------------------------------------------------- +// +void InfoWidgetLayoutManager::removeWidget( + LayoutItemRole itemRole ) + { + SMC_MOCK_METHOD1( void, LayoutItemRole, itemRole ) + } + + +// ----------------------------------------------------------------------------- // InfoWidgetLayoutManager::hideWidget // ----------------------------------------------------------------------------- // diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetnetworkhandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetnetworkhandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetnetworkhandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -47,6 +47,26 @@ // ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::serviceProviderName +// ----------------------------------------------------------------------------- +// +QString InfoWidgetNetworkHandler::serviceProviderName( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired +// ----------------------------------------------------------------------------- +// +bool InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- // InfoWidgetNetworkHandler::homeZoneTextTag // ----------------------------------------------------------------------------- // @@ -84,6 +104,25 @@ { SMC_MOCK_METHOD0( int ) } + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::networkRegistrationStatus +// ----------------------------------------------------------------------------- +// +int InfoWidgetNetworkHandler::networkRegistrationStatus( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::isOnline +// ----------------------------------------------------------------------------- +// +bool InfoWidgetNetworkHandler::isOnline( ) const + { + SMC_MOCK_METHOD0( bool ) + } // ----------------------------------------------------------------------------- @@ -118,3 +157,68 @@ SMC_MOCK_METHOD2( void, const TNWOperation, aOperation, TInt, aErrorCode ) } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::suspend +// ----------------------------------------------------------------------------- +// +void InfoWidgetNetworkHandler::suspend( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::resume +// ----------------------------------------------------------------------------- +// +void InfoWidgetNetworkHandler::resume( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::enableMcn +// ----------------------------------------------------------------------------- +// +void InfoWidgetNetworkHandler::enableMcn( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::disableMcn +// ----------------------------------------------------------------------------- +// +void InfoWidgetNetworkHandler::disableMcn( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::writeMcnDisplayState +// ----------------------------------------------------------------------------- +// +void InfoWidgetNetworkHandler::writeMcnDisplayState( + bool enabled ) + { + SMC_MOCK_METHOD1( void, bool, enabled ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetNetworkHandler::readMcnDisplayState +// ----------------------------------------------------------------------------- +// +bool InfoWidgetNetworkHandler::readMcnDisplayState( ) + { + SMC_MOCK_METHOD0( bool ) + } + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetpreferences.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetpreferences.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetpreferences.cpp Mon May 03 12:31:11 2010 +0300 @@ -46,7 +46,7 @@ // InfoWidgetPreferences::loadPreferences // ----------------------------------------------------------------------------- // -void InfoWidgetPreferences::loadPreferences( ) +void InfoWidgetPreferences::restorePreferences( ) { SMC_MOCK_METHOD0( void ) } @@ -56,9 +56,9 @@ // InfoWidgetPreferences::storePreferences // ----------------------------------------------------------------------------- // -void InfoWidgetPreferences::storePreferences( ) +bool InfoWidgetPreferences::storePreferences( ) { - SMC_MOCK_METHOD0( void ) + SMC_MOCK_METHOD0( bool ) } @@ -72,6 +72,14 @@ SMC_MOCK_METHOD1( QString, Option, preferenceId ) } +// ----------------------------------------------------------------------------- +// InfoWidgetPreferences::preferences +// ----------------------------------------------------------------------------- +// +InfoWidgetPreferences::Options InfoWidgetPreferences::preferences() const + { + SMC_MOCK_METHOD0( InfoWidgetPreferences::Options ) + } // ----------------------------------------------------------------------------- // InfoWidgetPreferences::setPreference @@ -87,6 +95,27 @@ // ----------------------------------------------------------------------------- +// InfoWidgetPreferences::isPreferenceSet +// ----------------------------------------------------------------------------- +// +bool InfoWidgetPreferences::isPreferenceSet( Option preferenceId ) const + { + SMC_MOCK_METHOD1( bool, Option, preferenceId) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetPreferences::validate +// ----------------------------------------------------------------------------- +// +bool InfoWidgetPreferences::validate( ) + { + SMC_MOCK_METHOD0( bool) + } + + + +// ----------------------------------------------------------------------------- // InfoWidgetPreferences::visibleItemCount // ----------------------------------------------------------------------------- // @@ -96,3 +125,14 @@ } +// ----------------------------------------------------------------------------- +// InfoWidgetPreferences::preferenceNames +// ----------------------------------------------------------------------------- +// +QStringList InfoWidgetPreferences::preferenceNames() + { + SMC_MOCK_METHOD0( QStringList ) + } + + + \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "infowidgetsathandler.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::InfoWidgetSatHandler +// ----------------------------------------------------------------------------- +// +InfoWidgetSatHandler::InfoWidgetSatHandler( + QObject * parent ) + { + Q_UNUSED(parent); + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::~InfoWidgetSatHandler +// ----------------------------------------------------------------------------- +// +InfoWidgetSatHandler::~InfoWidgetSatHandler( ) + { + + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::connect +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandler::connect( + bool connect ) + { + SMC_MOCK_METHOD1( void, bool, connect ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::satDisplayText +// ----------------------------------------------------------------------------- +// +const QString & InfoWidgetSatHandler::satDisplayText( ) const + { + SMC_MOCK_METHOD0( const QString & ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::setSatDisplayText +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandler::setSatDisplayText( + const QString & displayText ) + { + SMC_MOCK_METHOD1( void, const QString &, displayText ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::logCurrentInfo +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandler::logCurrentInfo( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::handleIdleModeTxtMessage +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandler::handleIdleModeTxtMessage( + int idleResult ) + { + SMC_MOCK_METHOD1( void, int, idleResult ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandler::handleSatError +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandler::handleSatError( + int operation, + int errorCode ) + { + SMC_MOCK_METHOD2( void, int, operation, + int, errorCode ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandlerprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandlerprivate.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "infowidgetsathandlerprivate.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate +// ----------------------------------------------------------------------------- +// +InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate( + InfoWidgetSatHandler * iwSatHandler, + RSatService & iSatService ) + :CActive( 0 ), + m_satService(iSatService) + + { + Q_UNUSED(iwSatHandler) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate +// ----------------------------------------------------------------------------- +// +InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate( ) + { + + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::startObserving +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandlerPrivate::startObserving( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::connect +// ----------------------------------------------------------------------------- +// +int InfoWidgetSatHandlerPrivate::connect( ) + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::disconnect +// ----------------------------------------------------------------------------- +// +int InfoWidgetSatHandlerPrivate::disconnect( ) + { + SMC_MOCK_METHOD0( int ) + } + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::DoCancel +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandlerPrivate::DoCancel( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// InfoWidgetSatHandlerPrivate::RunL +// ----------------------------------------------------------------------------- +// +void InfoWidgetSatHandlerPrivate::RunL( ) + { + SMC_MOCK_METHOD0( void ) + } + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslayout.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslayout.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 "qgraphicslayout.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::QGraphicsLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLayout::QGraphicsLayout( + QGraphicsLayoutItem * parent ) + //: + //QGraphicsLayoutItem( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::~QGraphicsLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLayout::~QGraphicsLayout( ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::setContentsMargins +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::setContentsMargins( + qreal left, + qreal top, + qreal right, + qreal bottom ) + { + SMC_MOCK_METHOD4( void, qreal, left, + qreal, top, + qreal, right, + qreal, bottom ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::getContentsMargins +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::getContentsMargins( + qreal * left, + qreal * top, + qreal * right, + qreal * bottom ) const + { + SMC_MOCK_METHOD4( void, qreal *, left, + qreal *, top, + qreal *, right, + qreal *, bottom ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::activate +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::activate( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::isActivated +// ----------------------------------------------------------------------------- +// +bool QGraphicsLayout::isActivated( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::invalidate +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::invalidate( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::updateGeometry +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::updateGeometry( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::widgetEvent +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::widgetEvent( + QEvent * e ) + { + SMC_MOCK_METHOD1( void, QEvent *, e ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::count +// ----------------------------------------------------------------------------- +// +int QGraphicsLayout::count( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::itemAt +// ----------------------------------------------------------------------------- +// +QGraphicsLayoutItem * QGraphicsLayout::itemAt( + int i ) const + { + SMC_MOCK_METHOD1( QGraphicsLayoutItem *, int, i ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::removeAt +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::removeAt( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::QGraphicsLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLayout::QGraphicsLayout( + QGraphicsLayoutPrivate &, + QGraphicsLayoutItem * ) + //: + //QGraphicsLayoutItem( /*&, **/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLayout::addChildLayoutItem +// ----------------------------------------------------------------------------- +// +void QGraphicsLayout::addChildLayoutItem( + QGraphicsLayoutItem * layoutItem ) + { + SMC_MOCK_METHOD1( void, QGraphicsLayoutItem *, layoutItem ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslinearlayout.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslinearlayout.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,289 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 "qgraphicslinearlayout.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::QGraphicsLinearLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLinearLayout::QGraphicsLinearLayout( + QGraphicsLayoutItem * parent ) + //: + //QGraphicsLayout( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::QGraphicsLinearLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLinearLayout::QGraphicsLinearLayout( + Qt::Orientation orientation, + QGraphicsLayoutItem * parent ) + //: + //QGraphicsLayout( /*orientation, parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::~QGraphicsLinearLayout +// ----------------------------------------------------------------------------- +// +QGraphicsLinearLayout::~QGraphicsLinearLayout( ) + { + + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setOrientation +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setOrientation( + Qt::Orientation orientation ) + { + SMC_MOCK_METHOD1( void, Qt::Orientation, orientation ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::orientation +// ----------------------------------------------------------------------------- +// +Qt::Orientation QGraphicsLinearLayout::orientation( ) const + { + SMC_MOCK_METHOD0( Qt::Orientation ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::insertItem +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::insertItem( + int index, + QGraphicsLayoutItem * item ) + { + SMC_MOCK_METHOD2( void, int, index, + QGraphicsLayoutItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::insertStretch +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::insertStretch( + int index, + int stretch ) + { + SMC_MOCK_METHOD2( void, int, index, + int, stretch ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::removeItem +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::removeItem( + QGraphicsLayoutItem * item ) + { + SMC_MOCK_METHOD1( void, QGraphicsLayoutItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::removeAt +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::removeAt( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setSpacing +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setSpacing( + qreal spacing ) + { + SMC_MOCK_METHOD1( void, qreal, spacing ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::spacing +// ----------------------------------------------------------------------------- +// +qreal QGraphicsLinearLayout::spacing( ) const + { + SMC_MOCK_METHOD0( qreal ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setItemSpacing +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setItemSpacing( + int index, + qreal spacing ) + { + SMC_MOCK_METHOD2( void, int, index, + qreal, spacing ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::itemSpacing +// ----------------------------------------------------------------------------- +// +qreal QGraphicsLinearLayout::itemSpacing( + int index ) const + { + SMC_MOCK_METHOD1( qreal, int, index ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setStretchFactor +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setStretchFactor( + QGraphicsLayoutItem * item, + int stretch ) + { + SMC_MOCK_METHOD2( void, QGraphicsLayoutItem *, item, + int, stretch ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::stretchFactor +// ----------------------------------------------------------------------------- +// +int QGraphicsLinearLayout::stretchFactor( + QGraphicsLayoutItem * item ) const + { + SMC_MOCK_METHOD1( int, QGraphicsLayoutItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setAlignment +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setAlignment( + QGraphicsLayoutItem * item, + Qt::Alignment alignment ) + { +// SMC_MOCK_METHOD2( void, QGraphicsLayoutItem *, item, +// Qt::Alignment, alignment ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::alignment +// ----------------------------------------------------------------------------- +// +Qt::Alignment QGraphicsLinearLayout::alignment( + QGraphicsLayoutItem * item ) const + { + //SMC_MOCK_METHOD1( Qt::Alignment, QGraphicsLayoutItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::setGeometry +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::setGeometry( + const QRectF & rect ) + { + SMC_MOCK_METHOD1( void, const QRectF &, rect ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::count +// ----------------------------------------------------------------------------- +// +int QGraphicsLinearLayout::count( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::itemAt +// ----------------------------------------------------------------------------- +// +QGraphicsLayoutItem * QGraphicsLinearLayout::itemAt( + int index ) const + { + SMC_MOCK_METHOD1( QGraphicsLayoutItem *, int, index ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::invalidate +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::invalidate( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::sizeHint +// ----------------------------------------------------------------------------- +// +QSizeF QGraphicsLinearLayout::sizeHint( + Qt::SizeHint which, + const QSizeF & constraint ) const + { + SMC_MOCK_METHOD2( QSizeF, Qt::SizeHint, which, + const QSizeF &, constraint ) + } + + +// ----------------------------------------------------------------------------- +// QGraphicsLinearLayout::dump +// ----------------------------------------------------------------------------- +// +void QGraphicsLinearLayout::dump( + int indent ) const + { + SMC_MOCK_METHOD1( void, int, indent ) + } + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_rsatservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_rsatservice.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 "rsatservice.h" + +class TSatIconInfo{ + +}; + +class RSatSession{ + +}; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// RSatService::RSatService +// ----------------------------------------------------------------------------- +// +RSatService::RSatService( ) + //: + //RSubSessionBase( /**/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// RSatService::OpenL +// ----------------------------------------------------------------------------- +// +void RSatService::OpenL( + const RSatSession & aSession ) + { + SMC_MOCK_METHOD1( void, const RSatSession &, aSession ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::Close +// ----------------------------------------------------------------------------- +// +void RSatService::Close( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::NotifySetupIdleModeTextChange +// ----------------------------------------------------------------------------- +// +TInt RSatService::NotifySetupIdleModeTextChange( + TRequestStatus & aStatus ) + { + SMC_MOCK_METHOD1( TInt, TRequestStatus &, aStatus ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::NotifySetupIdleModeTextChangeCancel +// ----------------------------------------------------------------------------- +// +void RSatService::NotifySetupIdleModeTextChangeCancel( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::GetSetupIdleModeTextL +// ----------------------------------------------------------------------------- +// +TBool RSatService::GetSetupIdleModeTextL( + HBufC * & aText, + TSatIconQualifier & aIconQualifier, + TUint8 & aRecordNumber ) + { + aText = HBufC::NewL(15); + SMC_MOCK_METHOD3( TBool, + HBufC* , aText, + TSatIconQualifier &, aIconQualifier, + TUint8 &, aRecordNumber ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::GetIconInfoL +// ----------------------------------------------------------------------------- +// +void RSatService::GetIconInfoL( + TUint8 aRecordNumber, + RIconEf & aIconEf ) const + { + SMC_MOCK_METHOD2( void, TUint8, aRecordNumber, + RIconEf &, aIconEf ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::GetIconL +// ----------------------------------------------------------------------------- +// +CFbsBitmap * RSatService::GetIconL( + const TSatIconInfo & aIconInfo ) const + { + SMC_MOCK_METHOD1( CFbsBitmap *, const TSatIconInfo &, aIconInfo ) + } + + +// ----------------------------------------------------------------------------- +// RSatService::SetIdleModeTextResponse +// ----------------------------------------------------------------------------- +// +void RSatService::SetIdleModeTextResponse( + const TSATIdleResult & aResult ) const + { + SMC_MOCK_METHOD1( void, const TSATIdleResult &, aResult ) + } + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingskey.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingskey.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingskey.cpp Mon May 03 12:31:11 2010 +0300 @@ -28,7 +28,9 @@ long int uid, unsigned long int key ) { - + Q_UNUSED(target) + Q_UNUSED(uid) + Q_UNUSED(key) } @@ -49,7 +51,7 @@ XQSettingsKey::Target XQSettingsKey::target( ) const { - XQSettingsKey::Target variable; + XQSettingsKey::Target variable = (XQSettingsKey::Target)1; return variable; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingsmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingsmanager.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingsmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -61,10 +61,7 @@ const XQSettingsKey & key, const QVariant & value ) { - Q_UNUSED( key ) - Q_UNUSED( value ) - bool variable; - return variable; + SMC_MOCK_METHOD2( bool, XQSettingsKey &, key, QVariant &, value ) } @@ -76,10 +73,7 @@ const XQSettingsKey & key, XQSettingsManager::Type type ) { - Q_UNUSED( key ) - Q_UNUSED( type ) - bool variable; - return variable; + SMC_MOCK_METHOD2( bool, XQSettingsKey &, key, XQSettingsManager::Type, type ) } @@ -90,9 +84,7 @@ bool XQSettingsManager::stopMonitoring( const XQSettingsKey & key ) { - Q_UNUSED( key ) - bool variable; - return variable; + SMC_MOCK_METHOD1( bool, XQSettingsKey &, key ) } @@ -102,9 +94,7 @@ // XQSettingsManager::Error XQSettingsManager::error( ) const { - - XQSettingsManager::Error variable; - return variable; + SMC_MOCK_METHOD0( XQSettingsManager::Error ) } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/run_auto_tests_qt.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,194 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo off +setlocal +goto :startup + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function DEFAULT +:: +:: Modify this function +:: - TESTED_SRC can be changed to match tested code. +:: Specifies path from testcode group directory to +:: tested code +:: - Add test directories to be runned +:: ie. "call :build ut_projectdirectory" or use +:: "for /f %%a in ('dir /b ut_*') do call :build %%a" +:: which compiles, instruments and runs all test directories +:: starting with "ut_". +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:DEFAULT +set TESTED_SRC=..\..\infowidget\src\*.cpp + +for /f %%a in ('dir /b ut_*') do call :build %%a +if [%DOMODULESTESTS%] EQU [TRUE] ( +for /f %%a in ('dir /b mt_*') do call :build %%a +) + +call :finish +goto :END + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function STARTUP +:: +:: Initializing script +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:STARTUP + +set BUILDTESTS=TRUE +set RUNTESTS=TRUE +set INSTRUMENT=TRUE +set REMOVEINSTRUMENT=TRUE +set DOMODULESTESTS=TRUE +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing +set PATH_TO_DLL=\epoc32\release\winscw\udeb +set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result + +if not exist %PATH_TO_COVERAGE_DATA% ( +mkdir %PATH_TO_COVERAGE_DATA% +) + +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + +if [%1] EQU [] ( goto default ) + +call :%1 +call :%2 +call :%3 +call :%4 +call :%5 +echo Running tests = %RUNTESTS% +echo Instrumenting tests = %INSTRUMENT% +goto default + +:/NOCLEANUP +set REMOVEINSTRUMENT=FALSE +goto end + +:/NORUN +set RUNTESTS=FALSE +set REMOVEINSTRUMENT=FALSE +goto end + +:/NOINSTRUMENT +set INSTRUMENT=FALSE +goto end + +:/NOBUILD +set BUILDTESTS=FALSE +goto end + +:/ONLYUNITTESTS +set DOMODULESTESTS=FALSE +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function FINISH +:: +:: Finishes run_auto_tests.bat +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:FINISH + +if [%RUNTESTS%] EQU [TRUE] ( +call :runtests +) + +if [%INSTRUMENT%] EQU [TRUE] ( +call :calculatecoverage +) + +if [%REMOVEINSTRUMENT%] EQU [TRUE] ( +call :removecoverage +) +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function BUILD +:: param directory +:: +:: builds test from given directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:BUILD +setlocal +if [%BUILDTESTS%] EQU [FALSE] ( goto end ) +echo Building %1 +if not exist %1 ( +echo %1 Not found! +goto end +) + +pushd . +call cd %1 +call qmake +call sbs -c winscw_udeb clean +if [%INSTRUMENT%] EQU [TRUE] ( +call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +) else ( +call %ABLD_CALL% +) + +popd +endlocal +goto end + + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function RUNTESTS +:: +:: NOTE! Function assumes that test binary is named according to test directory. +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:RUNTESTS +echo Running tests +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function CALCULATECOVERAGE +:: +:: Calculates test coverage. Generates html +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:CALCULATECOVERAGE +echo Calculating coverage +ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt +call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function REMOVECOVERAGE +:: +:: Removes data from coverage directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:REMOVECOVERAGE +echo Removing deleting coverage data +call del %PATH_TO_COVERAGE_DATA%\*.sym +call del %PATH_TO_COVERAGE_DATA%\*.dat +call del profile.txt +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function END +:: +:: Prints done +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:END +echo Done! \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h Mon May 03 12:31:11 2010 +0300 @@ -45,7 +45,6 @@ //From QGraphicsItem. void t_boundingRect(); void t_shape(); - void t_sizeHint(); void t_sizePolicy(); void t_setHomeZoneDisplay(); @@ -58,8 +57,7 @@ void t_mouseReleaseEvent(); void t_mouseMoveEvent(); void t_updateInfoDisplay(); - void t_initializePreferences(); - + void t_readPersistentPreferences(); void t_onInitialize(); void t_onUninitialize(); @@ -67,9 +65,7 @@ void t_onHide(); void t_readModel(); void t_handleModelError(); - void t_homeZoneDisplaySettingChanged(); void t_mcnDisplaySettingChanged(); - void t_activeLineDisplaySettingChanged(); void t_satDisplaySettingChanged(); void t_settingsEditingFinished(); @@ -82,11 +78,15 @@ void t_startChanges(); void t_endChanges(); + void t_sizeHint(); + /* * Not work from commmand prompt. */ void t_changeEvent(); + + private: InfoWidget *m_infoWidget; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidget.exe -- +move \epoc32\winscw\c\data\ut_infowidget.log %PATH_TO_RESULT%\ut_infowidget.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/src/ut_infowidget.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/src/ut_infowidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/src/ut_infowidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include #include "ut_infowidget.h" #include "qtestmains60.h" @@ -103,53 +104,6 @@ m_infoWidget->shape(); } -/*! - UT_InfoWidget::t_sizeHint - */ -void UT_InfoWidget::t_sizeHint() -{ - const QSizeF KMinimumSize(50, 50); - const QSizeF KPreferredSize(70, 70); - const QSizeF KDefaultSizeInfoDisplay(70, 160); - const QSizeF KDefaultSizeSettingsDisplay(250, 250); - - // current display is info display - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); - EXPECT(InfoWidgetLayoutManager::contentWidget); - m_qgraphicswidget.setMinimumSize(KMinimumSize); - m_qgraphicswidget.setPreferredSize(KPreferredSize); - Qt::SizeHint sizeHint = Qt::MinimumSize; - QSizeF constraint = QSizeF(); - QVERIFY(KMinimumSize == m_infoWidget->sizeHint(sizeHint, constraint)); - - // current display is settings display - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::SettingsDisplay); - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::SettingsDisplay); - EXPECT(InfoWidgetLayoutManager::contentWidget); - QVERIFY(KPreferredSize == m_infoWidget->sizeHint(sizeHint, constraint)); - - QGraphicsWidget* nullPoiter(NULL); - // cannot fetch info display size from docml, default size to be used - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); - EXPECT(InfoWidgetLayoutManager::contentWidget).returns(nullPoiter); - QVERIFY(KDefaultSizeInfoDisplay == - m_infoWidget->sizeHint(sizeHint, constraint)); - - // cannot fetch settings display size from docml, default size to be used - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::SettingsDisplay); - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::SettingsDisplay); - EXPECT(InfoWidgetLayoutManager::contentWidget).returns(nullPoiter); - QVERIFY(KDefaultSizeSettingsDisplay == - m_infoWidget->sizeHint(sizeHint, constraint)); - - QVERIFY(verify()); -} /*! UT_InfoWidget::t_sizePolicy @@ -284,33 +238,23 @@ { HbLabel hbLabel; QGraphicsWidget* pointerHbLabel(&hbLabel); - - EXPECT(InfoWidgetLayoutManager::getWidget) - .with(InfoWidgetLayoutManager::RoleHomeZoneLabel) - .returns(pointerHbLabel); + EXPECT(InfoWidgetLayoutManager::currentDisplayRole) .returns(InfoWidgetLayoutManager::InfoDisplay); + + EXPECT(InfoWidgetLayoutManager::getWidget) + .with(InfoWidgetLayoutManager::RoleSpnLabel) + .returns(pointerHbLabel); HbMarqueeItem mcnMarqueeItem; QGraphicsWidget* pointerMcnMarqueeItem(&mcnMarqueeItem); EXPECT(InfoWidgetLayoutManager::getWidget) .with(InfoWidgetLayoutManager::RoleMcnMarqueeItem) .returns(pointerMcnMarqueeItem); - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); EXPECT(HbMarqueeItem::isAnimating).returns(true); - EXPECT(InfoWidgetLayoutManager::getWidget) - .with(InfoWidgetLayoutManager::RoleActiveLineLabel) - .returns(pointerHbLabel); - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); - - EXPECT(InfoWidgetLayoutManager::getWidget) - .with(InfoWidgetLayoutManager::RoleSatTextLabel) - .returns(pointerHbLabel); - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); + .with(InfoWidgetLayoutManager::RoleSatMarqueeItem) + .returns(pointerMcnMarqueeItem); m_infoWidget->updateInfoDisplay(); @@ -318,46 +262,36 @@ } /*! - UT_InfoWidget::t_initializePreferences + UT_InfoWidget::t_readPersistentPreferences */ -void UT_InfoWidget::t_initializePreferences() +void UT_InfoWidget::t_readPersistentPreferences() { - EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayHomeZone) - .returns(KPreferenceOff); EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayHomeZone, KPreferenceOff); + .with(InfoWidgetPreferences::DisplayHomeZone, QString("")); - EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayMcn) - .returns(KPreferenceOff); EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayMcn, KPreferenceOff); + .with(InfoWidgetPreferences::DisplayMcn, QString("")); - EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayActiveLine) - .returns(KPreferenceOff); EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayActiveLine, KPreferenceOff); + .with(InfoWidgetPreferences::DisplayActiveLine, QString("")); - EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplaySatText) - .returns(KPreferenceOff); EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplaySatText, KPreferenceOff); + .with(InfoWidgetPreferences::DisplaySatText, QString("")); + + EXPECT(InfoWidgetPreferences::setPreference) + .with(InfoWidgetPreferences::DisplaySpn, QString("")); - EXPECT(InfoWidgetPreferences::visibleItemCount).returns(0); - EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayMcn, KPreferenceOn); - - m_infoWidget->initializePreferences(); + EXPECT(InfoWidgetPreferences::validate); + + m_infoWidget->readPersistentPreferences(); QVERIFY(verify()); // one visible item initially - EXPECT(InfoWidgetPreferences::visibleItemCount).returns(1); + EXPECT(InfoWidgetPreferences::validate).returns(true); + EXPECT(InfoWidgetPreferences::storePreferences); - m_infoWidget->initializePreferences(); + m_infoWidget->readPersistentPreferences(); QVERIFY(verify()); } @@ -366,8 +300,22 @@ UT_InfoWidget::t_onInitialize */ void UT_InfoWidget::t_onInitialize() -{ - m_infoWidget->onInitialize(); +{ + // Test onInitialize sequence where + // meta-object properties have been + // initialized + EXPECT(InfoWidgetPreferences::validate) + .returns(true); + EXPECT(InfoWidgetPreferences::storePreferences) + .returns(true); + m_infoWidget->onInitialize(); + + // Test onInitialize sequence where + // meta-object properties are + // uninitialized + EXPECT(InfoWidgetPreferences::validate) + .returns(false); + m_infoWidget->onInitialize(); } /*! @@ -420,23 +368,9 @@ m_infoWidget->handleModelError(operation, errorCode); } -void UT_InfoWidget::t_homeZoneDisplaySettingChanged() -{ - // user enables home zone setting - EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayHomeZone, KPreferenceOn); - int setting(Qt::Checked); - m_infoWidget->homeZoneDisplaySettingChanged(setting); - - // user disables home zone setting - EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayHomeZone, KPreferenceOff); - setting = Qt::Unchecked; - m_infoWidget->homeZoneDisplaySettingChanged(setting); - - QVERIFY(verify()); -} - +/*! + UT_InfoWidget::t_mcnDisplaySettingChanged + */ void UT_InfoWidget::t_mcnDisplaySettingChanged() { // user enables MCN setting @@ -454,23 +388,6 @@ QVERIFY(verify()); } -void UT_InfoWidget::t_activeLineDisplaySettingChanged() -{ - // user enables active line setting - EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayActiveLine, KPreferenceOn); - int setting(Qt::Checked); - m_infoWidget->activeLineDisplaySettingChanged(setting); - - // user disables active line setting - EXPECT(InfoWidgetPreferences::setPreference) - .with(InfoWidgetPreferences::DisplayActiveLine, KPreferenceOff); - setting = Qt::Unchecked; - m_infoWidget->activeLineDisplaySettingChanged(setting); - - QVERIFY(verify()); -} - void UT_InfoWidget::t_satDisplaySettingChanged() { // user enables SAT setting @@ -495,60 +412,48 @@ void UT_InfoWidget::t_updateItemsVisibility() { - // all items visible - EXPECT(InfoWidgetLayoutManager::currentDisplayRole) - .returns(InfoWidgetLayoutManager::InfoDisplay); + // All items visible EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayHomeZone) + .with(InfoWidgetPreferences::DisplaySpn) .returns(KPreferenceOn); EXPECT(InfoWidgetPreferences::preference) .with(InfoWidgetPreferences::DisplayMcn) .returns(KPreferenceOn); EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayActiveLine) - .returns(KPreferenceOn); - EXPECT(InfoWidgetPreferences::preference) .with(InfoWidgetPreferences::DisplaySatText) .returns(KPreferenceOn); EXPECT(InfoWidgetLayoutManager::setLayoutRows) - .with(4); + .with(3); m_infoWidget->updateItemsVisibility(); - + QVERIFY(verify()); + // none of items visible EXPECT(InfoWidgetLayoutManager::currentDisplayRole) .returns(InfoWidgetLayoutManager::InfoDisplay); EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayHomeZone) + .with(InfoWidgetPreferences::DisplaySpn) .returns(KPreferenceOff); - EXPECT(InfoWidgetLayoutManager::hideWidget) - .with(InfoWidgetLayoutManager::RoleHomeZoneLabel); - EXPECT(InfoWidgetLayoutManager::hideWidget) - .with(InfoWidgetLayoutManager::RoleHomeZoneIcon); - + EXPECT(InfoWidgetLayoutManager::removeWidget) + .with(InfoWidgetLayoutManager::RoleSpnLabel); + EXPECT(InfoWidgetLayoutManager::removeWidget) + .with(InfoWidgetLayoutManager::RoleSpnIcon); + EXPECT(InfoWidgetPreferences::preference) .with(InfoWidgetPreferences::DisplayMcn) .returns(KPreferenceOff); - EXPECT(InfoWidgetLayoutManager::hideWidget) + EXPECT(InfoWidgetLayoutManager::removeWidget) .with(InfoWidgetLayoutManager::RoleMcnMarqueeItem); - EXPECT(InfoWidgetLayoutManager::hideWidget) + EXPECT(InfoWidgetLayoutManager::removeWidget) .with(InfoWidgetLayoutManager::RoleMcnIcon); EXPECT(InfoWidgetPreferences::preference) - .with(InfoWidgetPreferences::DisplayActiveLine) - .returns(KPreferenceOff); - EXPECT(InfoWidgetLayoutManager::hideWidget) - .with(InfoWidgetLayoutManager::RoleActiveLineLabel); - EXPECT(InfoWidgetLayoutManager::hideWidget) - .with(InfoWidgetLayoutManager::RoleActiveLineIcon); - - EXPECT(InfoWidgetPreferences::preference) .with(InfoWidgetPreferences::DisplaySatText) .returns(KPreferenceOff); - EXPECT(InfoWidgetLayoutManager::hideWidget) - .with(InfoWidgetLayoutManager::RoleSatTextLabel); - EXPECT(InfoWidgetLayoutManager::hideWidget) + EXPECT(InfoWidgetLayoutManager::removeWidget) + .with(InfoWidgetLayoutManager::RoleSatMarqueeItem); + EXPECT(InfoWidgetLayoutManager::removeWidget) .with(InfoWidgetLayoutManager::RoleSatTextIcon); EXPECT(InfoWidgetLayoutManager::setLayoutRows) @@ -591,21 +496,11 @@ .with(InfoWidgetLayoutManager::RoleOkButton) .returns(&okButton); - QGraphicsWidget homeZoneBox; - EXPECT(InfoWidgetLayoutManager::getWidget) - .with(InfoWidgetLayoutManager::RoleHomeZoneCheckBox) - .returns(&homeZoneBox); - QGraphicsWidget mcnCheckBox; EXPECT(InfoWidgetLayoutManager::getWidget) .with(InfoWidgetLayoutManager::RoleMcnCheckBox) .returns(&mcnCheckBox); - QGraphicsWidget activeLineCheckBox; - EXPECT(InfoWidgetLayoutManager::getWidget) - .with(InfoWidgetLayoutManager::RoleActiveLineCheckBox) - .returns(&activeLineCheckBox); - QGraphicsWidget satTextCheckBox; EXPECT(InfoWidgetLayoutManager::getWidget) .with(InfoWidgetLayoutManager::RoleSatTextCheckBox) @@ -644,4 +539,49 @@ QVERIFY(verify()); } + +/*! + UT_InfoWidget::t_sizeHint + */ +void UT_InfoWidget::t_sizeHint() +{ + const QSizeF KMinimumSize(33.5, 160); + const QSizeF KPreferredSize(134, 160); + const QSizeF KDefaultSizeInfoDisplay(100, 100); + const QSizeF KDefaultSizeSettingsDisplay(230, 220); + + // Test: initial size after construction + Qt::SizeHint sizeHint = Qt::PreferredSize; + QSizeF constraint = QSizeF(); + QVERIFY(KDefaultSizeInfoDisplay == m_infoWidget->sizeHint( + sizeHint, constraint)); + + // Test: size after onInitialize is called + // and current display is InfoDisplay + m_infoWidget->onInitialize(); + + EXPECT(InfoWidgetLayoutManager::currentDisplayRole). + returns(InfoWidgetLayoutManager::InfoDisplay); + QGraphicsWidget *contentWidget = new QGraphicsWidget; + contentWidget->setMinimumSize(KMinimumSize); + EXPECT(InfoWidgetLayoutManager::contentWidget). + returns(contentWidget); + EXPECT(InfoWidgetPreferences::visibleItemCount). + returns(1); + + // No strict verification, approximate values. + // Data in docml is in "un" format and strict comparison to pixels won't work + //QVERIFY(abs(KMinimumSize.width()-m_infoWidget->sizeHint(sizeHint, constraint).width()) < 1); + //QVERIFY(abs(KMinimumSize.height()-m_infoWidget->sizeHint(sizeHint, constraint).height()) < 1); + QVERIFY(KDefaultSizeInfoDisplay != m_infoWidget->sizeHint(sizeHint, constraint)); + + // Test: size after onInitialize is called + // and current display is SettingsDisplay + + delete contentWidget; + contentWidget = NULL; + + QVERIFY(verify()); +} + QTEST_MAIN_S60(UT_InfoWidget) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/ut_infowidget.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/ut_infowidget.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/ut_infowidget.pro Mon May 03 12:31:11 2010 +0300 @@ -18,14 +18,13 @@ CONFIG += qtestlib hb TEMPLATE = app TARGET = -DEPENDPATH += . ../../infowidget/src ../../infowidget/inc +DEPENDPATH += . ../../infowidget/src INCLUDEPATH += . INCLUDEPATH += ../common INCLUDEPATH += ../../inc/ INCLUDEPATH += ../../infowidget/inc/ DEFINES += QT_NO_DEBUG_STREAM -MOC_DIR = moc QT -= gui QT += testlib @@ -47,9 +46,6 @@ SOURCES += ../../infowidget/src/infowidget.cpp # mocks needed for testing -#HEADERS += hbdocumentloader.h -#SOURCES += ../mocks/mock_hbdocumentloader.cpp - HEADERS += ../../infowidget/inc/infowidgetpreferences.h SOURCES += ../mocks/mock_infowidgetpreferences.cpp HEADERS += ../../infowidget/inc/infowidgetengine.h @@ -58,10 +54,14 @@ SOURCES += ../mocks/mock_infowidgetlayoutmanager.cpp HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h SOURCES += ../mocks/mock_infowidgetnetworkhandler.cpp +HEADERS += ../../infowidget/inc/infowidgetsathandler.h +SOURCES += ../mocks/mock_infowidgetsathandler.cpp SOURCES += ../mocks/mock_hbcolorscheme.cpp SOURCES += ../mocks/mock_hblabel.cpp SOURCES += ../mocks/mock_hbstyleoptionlabel.cpp SOURCES += ../mocks/mock_hbmarqueeitem.cpp SOURCES += ../mocks/mock_hbwidget.cpp - +SOURCES += ../mocks/mock_qgraphicslinearlayout.cpp +SOURCES += ../mocks/mock_qgraphicslayout.cpp +SOURCES += ../mocks/mock_hbframedrawer.cpp \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/inc/ut_infowidgetengine.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/inc/ut_infowidgetengine.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/inc/ut_infowidgetengine.h Mon May 03 12:31:11 2010 +0300 @@ -45,6 +45,11 @@ void t_handleSatError(); void t_handleLineError(); + void t_logModelData(); + void t_preferenceChanged(); + void t_suspend(); + void t_resume(); + private: InfoWidgetEngine *m_infoWidgetEngine; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetengine.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetengine.log %PATH_TO_RESULT%\ut_infowidgetengine.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,8 +17,11 @@ #include "ut_infowidgetengine.h" #include "infowidgetengine.h" #include "qtestmains60.h" +#include "infowidgetpreferences.h" + // mocked dependencies of the class under test #include "infowidgetnetworkhandler.h" +#include "infowidgetsathandler.h" const QString KHomeZoneTextTag("HomeZoneText0"); // max length 13 const TNWViagIndicatorType @@ -38,7 +41,6 @@ } - /*! UT_InfoWidgetEngine::~UT_InfoWidgetEngine */ @@ -47,7 +49,6 @@ delete m_infoWidgetEngine; } - /*! UT_InfoWidgetEngine::init */ @@ -55,6 +56,9 @@ { initialize(); + SmcDefaultValue::SetL(""); + SmcDefaultValue::SetL(""); + EXPECT(InfoWidgetNetworkHandler::logCurrentInfo); EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag) .returns(KHomeZoneTextTag); @@ -69,7 +73,6 @@ QVERIFY(verify()); } - /*! UT_InfoWidgetEngine::cleanup */ @@ -81,7 +84,6 @@ m_infoWidgetEngine = 0; } - /*! UT_InfoWidgetEngine::t_modelData */ @@ -94,7 +96,6 @@ QVERIFY(data.mcnIndicatorType() == KMcnIndicatorType); } - /*! UT_InfoWidgetEngine::t_updateNetworkDataToModel */ @@ -120,49 +121,112 @@ QVERIFY(verify()); } - /*! UT_InfoWidgetEngine::t_updateSatDataToModel */ void UT_InfoWidgetEngine::t_updateSatDataToModel() { + EXPECT(InfoWidgetSatHandler::satDisplayText) + .returns(QString("")); + m_infoWidgetEngine->updateSatDataToModel(); } - /*! UT_InfoWidgetEngine::t_updateLineDataToModel */ void UT_InfoWidgetEngine::t_updateLineDataToModel() { m_infoWidgetEngine->updateLineDataToModel(); + + QVERIFY(verify()); } - /*! UT_InfoWidgetEngine::t_handleNetworkError */ void UT_InfoWidgetEngine::t_handleNetworkError() { m_infoWidgetEngine->handleNetworkError(0, 0); + + QVERIFY(verify()); } - /*! UT_InfoWidgetEngine::t_handleSatError */ -void UT_InfoWidgetEngine:: t_handleSatError() +void UT_InfoWidgetEngine::t_handleSatError() { m_infoWidgetEngine->handleSatError(0, 0); + + QVERIFY(verify()); } +/*! + UT_InfoWidgetEngine::t_handleLineError + */ +void UT_InfoWidgetEngine::t_handleLineError() +{ + m_infoWidgetEngine->handleLineError(0, 0); + + QVERIFY(verify()); +} /*! UT_InfoWidgetEngine::t_handleLineError */ -void UT_InfoWidgetEngine:: t_handleLineError() +void UT_InfoWidgetEngine::t_logModelData() +{ + m_infoWidgetEngine->logModelData(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetEngine::t_preferenceChanged + */ +void UT_InfoWidgetEngine::t_preferenceChanged() { - m_infoWidgetEngine->handleLineError(0, 0); + m_infoWidgetEngine->preferenceChanged + (InfoWidgetPreferences::DisplayMcn, + InfoWidgetPreferences::DisplayOn); + + m_infoWidgetEngine->preferenceChanged + (InfoWidgetPreferences::DisplayMcn, + InfoWidgetPreferences::DisplayOff); + + m_infoWidgetEngine->preferenceChanged + (InfoWidgetPreferences::DisplaySatText, + InfoWidgetPreferences::DisplayOn); + + m_infoWidgetEngine->preferenceChanged + (InfoWidgetPreferences::DisplaySatText, + InfoWidgetPreferences::DisplayOff); + + m_infoWidgetEngine->preferenceChanged(-1, + InfoWidgetPreferences::DisplayOff); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetEngine::t_suspend + */ +void UT_InfoWidgetEngine::t_suspend() +{ + m_infoWidgetEngine->suspend(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetEngine::t_resume + */ +void UT_InfoWidgetEngine::t_resume() +{ + m_infoWidgetEngine->resume(); + + QVERIFY(verify()); } QTEST_MAIN_S60(UT_InfoWidgetEngine) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/ut_infowidgetengine.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/ut_infowidgetengine.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/ut_infowidgetengine.pro Mon May 03 12:31:11 2010 +0300 @@ -46,9 +46,14 @@ SOURCES += ../../infowidget/src/infowidgetengine.cpp # mocks needed for testing -HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h +HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h \ + ../../infowidget/inc/infowidgetsathandler.h HEADERS += /epoc32/include/mw/xqsettingskey.h \ /epoc32/include/mw/xqsettingsmanager.h + SOURCES += ../mocks/mock_xqsettingsmanager.cpp \ ../mocks/mock_xqsettingskey.cpp \ - ../mocks/mock_infowidgetnetworkhandler.cpp + ../mocks/mock_infowidgetnetworkhandler.cpp \ + ../mocks/mock_infowidgetsathandler.cpp \ + ../mocks/mock_rsatservice.cpp + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h Mon May 03 12:31:11 2010 +0300 @@ -35,6 +35,7 @@ private: void fillDisplayContainers(); void fillCurrentWidgetsContainer(); + void fillParams(const QString & fileName, bool * ok); private slots: void init(); @@ -45,6 +46,7 @@ void t_layoutRows(); void t_setLayoutRows(); + //void t_rowHeight(); void t_layoutInfoDisplay(); void t_layoutSettingsDisplay(); @@ -53,10 +55,16 @@ void t_loadWidgets(); void t_loadWidget(); void t_getWidget(); + void t_hideWidget(); + void t_contentWidget(); - void t_hideWidget(); + + void t_showAll(); void t_hideAll(); - void t_showAll(); + + void t_reloadWidgets(); + + void t_removeWidget(); // InfoWidgetDocumentLoader tests void t_createObject(); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetlayoutmanager.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetlayoutmanager.log %PATH_TO_RESULT%\ut_infowidgetlayoutmanager.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -17,15 +17,17 @@ #include "ut_infowidgetlayoutmanager.h" #include - +#include #define private public #include "infowidgetlayoutmanager.h" #include "qtestmains60.h" -const int KNumOfSettingsDisplayRoles = 15; -const int KNumOfInfoDisplayRoles = 10; +const int KNumOfSettingsDisplayRoles = 12; +const int KNumOfInfoDisplayRoles = 8; const QString KInfoWidgetDocmlFile = ":/resource/infowidget.docml"; +const QString KMargueeItemClassName = HbMarqueeItem::staticMetaObject.className(); + /*! UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager @@ -115,6 +117,15 @@ } /*! + UT_InfoWidgetLayoutManager::fillParams + */ +void UT_InfoWidgetLayoutManager::fillParams(const QString & fileName, + bool * ok){ + Q_UNUSED(fileName) + *ok = true; +} + +/*! UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer */ void UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer() @@ -164,20 +175,16 @@ QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleContent)); QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneLabel)); + InfoWidgetLayoutManager::RoleSpnLabel)); QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleMcnMarqueeItem)); QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineLabel)); + InfoWidgetLayoutManager::RoleSatMarqueeItem)); QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleSatTextLabel)); - QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneIcon)); + InfoWidgetLayoutManager::RoleSpnIcon)); QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleMcnIcon)); QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineIcon)); - QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleSatTextIcon)); QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleSettingsContainer)); @@ -213,13 +220,20 @@ QVERIFY(KLayoutRows == m_layoutManager->layoutRows()); } +/*! + UT_InfoWidgetLayoutManager::t_setLayoutRows + *//* +void UT_InfoWidgetLayoutManager::t_rowHeight() +{ + QVERIFY(m_layoutManager->rowHeight()); +}*/ /*! UT_InfoWidgetLayoutManager::t_layoutInfoDisplay */ void UT_InfoWidgetLayoutManager::t_layoutInfoDisplay() { - m_layoutManager->layoutInfoDisplay(); + QVERIFY(!m_layoutManager->layoutInfoDisplay()); } @@ -228,7 +242,7 @@ */ void UT_InfoWidgetLayoutManager::t_layoutSettingsDisplay() { - m_layoutManager->layoutSettingsDisplay(); + QVERIFY(!m_layoutManager->layoutSettingsDisplay()); } /*! @@ -244,32 +258,27 @@ QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleContent)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneLabel)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnLabel)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineLabel)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSatTextLabel)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneIcon)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnIcon)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineIcon)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSatTextIcon)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneCheckBox)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnCheckBox)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineCheckBox)); - QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSatTextCheckBox)); QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleOkButton)); QVERIFY(0 <= settingDisplayRoles.indexOf( + InfoWidgetLayoutManager::RoleSpnLabel)); + QVERIFY(0 <= settingDisplayRoles.indexOf( + InfoWidgetLayoutManager::RoleSpnIcon)); + QVERIFY(0 <= settingDisplayRoles.indexOf( + InfoWidgetLayoutManager::RoleSpnCheckBox)); + + QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSettingsContainer)); } @@ -280,34 +289,38 @@ QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleContent)); QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneLabel)); + InfoWidgetLayoutManager::RoleSpnLabel)); QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnMarqueeItem)); QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineLabel)); + InfoWidgetLayoutManager::RoleSatMarqueeItem)); QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleSatTextLabel)); - QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleHomeZoneIcon)); + InfoWidgetLayoutManager::RoleSpnIcon)); QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnIcon)); QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleActiveLineIcon)); - QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSatTextIcon)); QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSettingsContainer)); } } - /*! UT_InfoWidgetLayoutManager::t_loadWidgets */ void UT_InfoWidgetLayoutManager::t_loadWidgets() { - bool loadResult; - //m_layoutManager->loadWidgets(); + QObjectList list = QObjectList(); + EXPECT(HbDocumentLoader::load) + .willOnce(invoke(this, &fillParams)).returns(list); + + const QList settingDisplayRoles = + m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDisplay); + bool loadResult = m_layoutManager->loadWidgets(InfoWidgetLayoutManager::SettingsDisplay, + settingDisplayRoles, + m_layoutManager->m_infoDisplayWidgets); + + QVERIFY(!loadResult); } /*! @@ -321,11 +334,16 @@ QList infoDisplayWidgetRoles = m_layoutManager->widgetRoles( InfoWidgetLayoutManager::InfoDisplay); + + infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleUndefined); + infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleContainer); + foreach (currentRole, infoDisplayWidgetRoles) { currentWidget = m_layoutManager->loadWidget(*m_documentLoader, InfoWidgetLayoutManager::InfoDisplay, currentRole); + QVERIFY(!currentWidget); } QList @@ -336,8 +354,14 @@ currentWidget = m_layoutManager->loadWidget(*m_documentLoader, InfoWidgetLayoutManager::SettingsDisplay, currentRole); + QVERIFY(!currentWidget); } - + + currentWidget = m_layoutManager->loadWidget(*m_documentLoader, + (InfoWidgetLayoutManager::DisplayRole)2, + InfoWidgetLayoutManager::RoleLastEnum ); + + QVERIFY(!currentWidget); } /*! @@ -347,9 +371,23 @@ { fillCurrentWidgetsContainer(); - m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleUndefined); - m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleContent); - m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleLastEnum); + QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleUndefined)); + QVERIFY(m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleContent)); + QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleLastEnum)); +} + +/*! + UT_InfoWidgetLayoutManager::t_removeWidget + */ +void UT_InfoWidgetLayoutManager::t_removeWidget() +{ + fillCurrentWidgetsContainer(); + + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleUndefined); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleContent); + m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleLastEnum); + + QVERIFY(verify()); } @@ -360,7 +398,7 @@ { fillCurrentWidgetsContainer(); - m_layoutManager->contentWidget(); + QVERIFY(m_layoutManager->contentWidget()); } @@ -374,6 +412,8 @@ m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleUndefined); m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleContent); m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleLastEnum); + + QVERIFY(verify()); } @@ -382,9 +422,9 @@ */ void UT_InfoWidgetLayoutManager::t_hideAll() { - fillCurrentWidgetsContainer(); + m_layoutManager->hideAll(); - m_layoutManager->hideAll(); + QVERIFY(verify()); } @@ -393,14 +433,35 @@ */ void UT_InfoWidgetLayoutManager::t_showAll() { - fillCurrentWidgetsContainer(); + fillCurrentWidgetsContainer();//times 2 HbDocumentLoader::load + m_layoutManager->showAll(); - m_layoutManager->showAll(); + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetLayoutManager::t_reloadWidgets + */ +void UT_InfoWidgetLayoutManager::t_reloadWidgets() +{ + QVERIFY(!m_layoutManager->reloadWidgets(InfoWidgetLayoutManager::SettingsDisplay)); + QVERIFY(!m_layoutManager->reloadWidgets((InfoWidgetLayoutManager::DisplayRole)101)); } +/*! + UT_InfoWidgetLayoutManager::t_createObject + */ void UT_InfoWidgetLayoutManager::t_createObject() { - m_documentLoader->createObject(QString(), QString()); + QObject *object = m_documentLoader->createObject(QString(), QString()); + QVERIFY(!object); + object = m_documentLoader->createObject(KMargueeItemClassName, QString()); + QVERIFY(object); + delete object; + + //For destructor coverage + delete m_layoutManager->m_documentLoader; + m_layoutManager->m_documentLoader = NULL; } QTEST_MAIN_S60(UT_InfoWidgetLayoutManager) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro Mon May 03 12:31:11 2010 +0300 @@ -41,4 +41,5 @@ # mocks needed for testing SOURCES += ../mocks/mock_hbdocumentloader.cpp +SOURCES += ../mocks/mock_hbmarqueeitem.cpp RESOURCES = ../../infowidgetprovider.qrc diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetlinehandler.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetlinehandler.log %PATH_TO_RESULT%\ut_infowidgetlinehandler.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h Mon May 03 12:31:11 2010 +0300 @@ -36,6 +36,7 @@ public slots: void generateException(); + void doLeaveL(); private slots: @@ -50,6 +51,12 @@ void t_HandleNetworkMessageExceptionWhileEmittingSignal(); void t_HandleNetworkError(); void t_HandleNetworkErrorExceptionWhileEmittingSignal(); + void t_resume(); + void t_suspend(); + void t_serviceProviderName(); + void t_serviceProviderNameDisplayRequired(); + void t_logCurrentInfo(); + void t_createLeave(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetnetworkhandler.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetnetworkhandler.log %PATH_TO_RESULT%\ut_infowidgetnetworkhandler.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -16,9 +16,22 @@ */ #include #include +#include "qtestmains60.h" +#include +#include #include "ut_infowidgetnetworkhandler.h" #include "infowidgetnetworkhandler.h" -#include "qtestmains60.h" + +#define EXPECT_EXCEPTION(statements) \ +{ \ + bool exceptionDetected = false; \ + try { \ + statements \ + } catch (...) { \ + exceptionDetected = true; \ + } \ + QVERIFY(true == exceptionDetected); \ +} const QString KHomeZoneTextTag("HomeZoneText0"); // max length 13 const TNWViagIndicatorType @@ -28,6 +41,7 @@ const TNWMCNIndicatorType KMcnIndicatorType = ENWMCNIndicatorTypeActive; + /*! UT_InfoWidgetNetworkHandler::UT_InfoWidgetNetworkHandler */ @@ -48,6 +62,14 @@ } /*! + UT_InfoWidgetNetworkHandler::doLeaveL + */ +void UT_InfoWidgetNetworkHandler::doLeaveL() +{ + User::Leave(KErrGeneral); +} + +/*! UT_InfoWidgetNetworkHandler::generateException */ void UT_InfoWidgetNetworkHandler::generateException() @@ -62,6 +84,10 @@ { initialize(); + SmcDefaultValue::SetL(""); + SmcDefaultValue::SetL(""); + QVariant i(1); + EXPECT(XQSettingsManager::readItemValue).returns(i); EXPECT(CreateL).willOnce(invoke(this, &initializeNetworkInfo)); m_networkHandler = new InfoWidgetNetworkHandler(); @@ -76,8 +102,12 @@ { reset(); + QVariant i(1); + EXPECT(XQSettingsManager::readItemValue).returns(i); delete m_networkHandler; m_networkHandler = 0; + + QVERIFY(verify()); } /*! @@ -85,6 +115,9 @@ */ void UT_InfoWidgetNetworkHandler::t_homeZoneTextTag() { + QVariant i(1); + EXPECT(XQSettingsManager::readItemValue).returns(i); + QVERIFY(m_networkHandler->homeZoneTextTag() == KHomeZoneTextTag); } @@ -178,7 +211,7 @@ m_networkHandler->HandleNetworkMessage( MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteFail); - const int KExpectedNumOfSignalEmissions = 1; + const int KExpectedNumOfSignalEmissions = 2; QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions); const QList &arguments = spy.at(0); @@ -197,6 +230,8 @@ m_networkHandler->HandleNetworkMessage( MNWMessageObserver::ENWMessageCurrentCellInfoMessage); + + QVERIFY(verify()); } @@ -210,11 +245,15 @@ qRegisterMetaType ("MNWMessageObserver::TNWOperation"); - MNWMessageObserver::TNWOperation operation = MNWMessageObserver::ENWNone; const int errorCode = -4; + MNWMessageObserver::TNWOperation operation = + MNWMessageObserver::ENWGetServiceProviderName; + m_networkHandler->HandleNetworkError(operation, errorCode); + + operation = MNWMessageObserver::ENWNone; m_networkHandler->HandleNetworkError(operation, errorCode); - const int KExpectedNumOfSignalEmissions = 1; + const int KExpectedNumOfSignalEmissions = 2; QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions); const QList &arguments = spy.at(0); QCOMPARE(arguments.count(), 2); @@ -238,6 +277,8 @@ MNWMessageObserver::TNWOperation operation = MNWMessageObserver::ENWNone; const int errorCode = -4; m_networkHandler->HandleNetworkError(operation, errorCode); + + QVERIFY(verify()); } @@ -254,4 +295,70 @@ aTNWInfo.iMCNIndicatorType = KMcnIndicatorType; } +/*! + UT_InfoWidgetNetworkHandler::t_suspend + */ +void UT_InfoWidgetNetworkHandler::t_suspend() +{ + QVariant i(0); + EXPECT(XQSettingsManager::readItemValue).returns(i); + m_networkHandler->suspend(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetNetworkHandler::t_resume + */ +void UT_InfoWidgetNetworkHandler::t_resume() +{ + QVariant i(0); + bool b = true; + EXPECT(XQSettingsManager::readItemValue).returns(i); + EXPECT(XQSettingsManager::writeItemValue).returns(b); + m_networkHandler->resume(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetNetworkHandler::t_serviceProviderName + */ +void UT_InfoWidgetNetworkHandler::t_serviceProviderName() +{ + QString s = ""; + QCOMPARE(m_networkHandler->serviceProviderName(), s); +} + +/*! + UT_InfoWidgetNetworkHandler::t_serviceProviderNameDisplayRequired + */ +void UT_InfoWidgetNetworkHandler::t_serviceProviderNameDisplayRequired() +{ + QCOMPARE(m_networkHandler->serviceProviderNameDisplayRequired(),true); +} + +/*! + UT_InfoWidgetNetworkHandler::t_logCurrentInfo + */ +void UT_InfoWidgetNetworkHandler::t_logCurrentInfo() +{ + m_networkHandler->logCurrentInfo(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetNetworkHandler::t_createLeave + */ +void UT_InfoWidgetNetworkHandler::t_createLeave() +{ + QVariant i(1); + EXPECT(XQSettingsManager::readItemValue).returns(i); + EXPECT(CreateL) + .willOnce(invokeWithoutArguments(this, &doLeaveL)); + + EXPECT_EXCEPTION(InfoWidgetNetworkHandler * p = new InfoWidgetNetworkHandler();); +} + QTEST_MAIN_S60(UT_InfoWidgetNetworkHandler) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/ut_infowidgetnetworkhandler.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/ut_infowidgetnetworkhandler.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/ut_infowidgetnetworkhandler.pro Mon May 03 12:31:11 2010 +0300 @@ -23,6 +23,7 @@ INCLUDEPATH += ../common INCLUDEPATH += ../../inc/ INCLUDEPATH += ../../infowidget/inc/ +DEFINES += XQSETTINGSMANAGER_NO_LIBRARY QT -= gui QT += testlib @@ -45,3 +46,8 @@ # mocks needed for testing SOURCES += ../mocks/mock_networkhandlingproxy.cpp + +HEADERS += /epoc32/include/mw/xqsettingskey.h \ + /epoc32/include/mw/xqsettingsmanager.h +SOURCES += ../mocks/mock_xqsettingskey.cpp +SOURCES += ../mocks/mock_xqsettingsmanager.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/inc/ut_infowidgetpreferences.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/inc/ut_infowidgetpreferences.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/inc/ut_infowidgetpreferences.h Mon May 03 12:31:11 2010 +0300 @@ -37,11 +37,13 @@ void init(); void cleanup(); - void t_loadPreferences(); void t_storePreferences(); void t_preference(); void t_setPreference(); void t_visibleItemCount(); + void t_isPreferenceSet(); + void t_preferences(); + void t_preferenceNames(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetpreferences.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetpreferences.log %PATH_TO_RESULT%\ut_infowidgetpreferences.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/src/ut_infowidgetpreferences.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/src/ut_infowidgetpreferences.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/src/ut_infowidgetpreferences.cpp Mon May 03 12:31:11 2010 +0300 @@ -15,6 +15,7 @@ * */ #include "ut_infowidgetpreferences.h" +#define private public #include "infowidgetpreferences.h" #include "qtestmains60.h" @@ -64,20 +65,17 @@ /*! - UT_InfoWidgetPreferences::t_loadPreferences - */ -void UT_InfoWidgetPreferences::t_loadPreferences() -{ - m_infoWidgetPreferences->loadPreferences(); -} - - -/*! UT_InfoWidgetPreferences::t_storePreferences */ void UT_InfoWidgetPreferences::t_storePreferences() { m_infoWidgetPreferences->storePreferences(); + + m_infoWidgetPreferences->m_options = (InfoWidgetPreferences::Option)1; + m_infoWidgetPreferences->m_validatedOptions = (InfoWidgetPreferences::Option)2; + m_infoWidgetPreferences->storePreferences(); + + QVERIFY(verify()); } @@ -151,8 +149,41 @@ InfoWidgetPreferences::DisplayActiveLine, DISPLAY_SETTING_ON); m_infoWidgetPreferences->setPreference( InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_ON); + m_infoWidgetPreferences->setPreference( + InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_ON); visibleItems = m_infoWidgetPreferences->visibleItemCount(); - QVERIFY(visibleItems == 4); + QVERIFY(visibleItems == 5); +} + +/*! + UT_InfoWidgetPreferences::t_isPreferenceSet + */ +void UT_InfoWidgetPreferences::t_isPreferenceSet() +{ + m_infoWidgetPreferences->isPreferenceSet + (InfoWidgetPreferences::DisplayHomeZone); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetPreferences::t_preferences + */ +void UT_InfoWidgetPreferences::t_preferences() +{ + m_infoWidgetPreferences->preferences(); + + QVERIFY(verify()); +} + +/*! + UT_InfoWidgetPreferences::t_preferenceNames + */ +void UT_InfoWidgetPreferences::t_preferenceNames() +{ + m_infoWidgetPreferences->preferenceNames(); + + QVERIFY(verify()); } QTEST_MAIN_S60(UT_InfoWidgetPreferences) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/inc/ut_infowidgetprovider.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/inc/ut_infowidgetprovider.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/inc/ut_infowidgetprovider.h Mon May 03 12:31:11 2010 +0300 @@ -41,10 +41,6 @@ void cleanup(); void t_createInstance(); -private: - - InfoWidgetProvider *m_infoWidgetProvider; - }; #endif // UT_INFOWIDGET_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,7 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetprovider.exe -dtextshell -- +move \epoc32\winscw\c\data\ut_infowidgetprovider.log %PATH_TO_RESULT%\ut_infowidgetprovider.log goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/src/ut_infowidgetprovider.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/src/ut_infowidgetprovider.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/src/ut_infowidgetprovider.cpp Mon May 03 12:31:11 2010 +0300 @@ -23,6 +23,8 @@ #include #include +Q_EXTERN_C const char * qt_plugin_query_verification_data(); +Q_EXTERN_C ::QObject * qt_plugin_instance(); class MyQServiceInterfaceDescriptor : public QServiceInterfaceDescriptor {}; @@ -30,16 +32,22 @@ class MyQServiceContext : public QServiceContext { public: - virtual void notify( ContextType type, const QVariant& variant){}; + virtual void notify( ContextType type, const QVariant& variant){ + Q_UNUSED(type) + Q_UNUSED(variant) + }; }; class MyQAbstractSecuritySession : public QAbstractSecuritySession { public: - virtual bool isAllowed(const QStringList& capabilityList){return true;}; + virtual bool isAllowed(const QStringList& capabilityList){ + Q_UNUSED(capabilityList) + return true; + }; }; -QString KValidInfoWidgetInterfaceName("com.nokia.homescreen.widget"); +QString KValidInfoWidgetInterfaceName("com.nokia.IHomeScreenWidget"); QString KInvalidInfoWidgetInterfaceName("com"); @@ -47,10 +55,8 @@ UT_InfoWidgetProvider::UT_InfoWidgetProvider */ UT_InfoWidgetProvider::UT_InfoWidgetProvider() - : - m_infoWidgetProvider(0) { - + const char * verificationData = qt_plugin_query_verification_data(); } @@ -59,7 +65,7 @@ */ UT_InfoWidgetProvider::~UT_InfoWidgetProvider() { - delete m_infoWidgetProvider; + } @@ -69,9 +75,7 @@ void UT_InfoWidgetProvider::init() { initialize(); - - m_infoWidgetProvider = new InfoWidgetProvider(); - + QVERIFY(verify()); } @@ -83,8 +87,7 @@ { reset(); - delete m_infoWidgetProvider; - m_infoWidgetProvider = 0; + delete (InfoWidgetProvider*)qt_plugin_instance(); } @@ -94,25 +97,23 @@ MyQServiceContext myQServiceContext; MyQAbstractSecuritySession myAbstractSecuritySession; - QObject *instanceValue = NULL; - + QObject *instanceValue = NULL; + InfoWidgetProvider* p = (InfoWidgetProvider*)qt_plugin_instance(); // Test: instance creation with valid interface name expect("QtMobility::QServiceInterfaceDescriptor::interfaceName").returns(KValidInfoWidgetInterfaceName); expect("InfoWidget::InfoWidget"); - instanceValue = m_infoWidgetProvider->createInstance(myServiceInterfaceDescriptor, + instanceValue = p->createInstance(myServiceInterfaceDescriptor, &myQServiceContext, &myAbstractSecuritySession); Q_ASSERT(instanceValue); // Test: instance creation with invalid interface name expect("QtMobility::QServiceInterfaceDescriptor::interfaceName").returns(KInvalidInfoWidgetInterfaceName); - instanceValue = m_infoWidgetProvider->createInstance(myServiceInterfaceDescriptor, + instanceValue = p->createInstance(myServiceInterfaceDescriptor, &myQServiceContext, &myAbstractSecuritySession); Q_ASSERT(instanceValue == NULL); - } - QTEST_MAIN_S60(UT_InfoWidgetProvider) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/inc/ut_infowidgetsathandler.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/inc/ut_infowidgetsathandler.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/inc/ut_infowidgetsathandler.h Mon May 03 12:31:11 2010 +0300 @@ -41,6 +41,10 @@ void t_setSatDisplayText(); void t_logCurrentInfo(); + void t_connect(); + void t_handleIdleModeTxtMessage(); + void t_handleSatError(); + private: InfoWidgetSatHandler *m_satHandler; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/run_auto_tests_qt.bat --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,8 +137,7 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs -c winscw_udeb clean if [%INSTRUMENT%] EQU [TRUE] ( call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% ) else ( @@ -153,6 +157,9 @@ :RUNTESTS echo Running tests call %PATH_TO_DLL%\ut_infowidgetsathandler.exe -dtextshell -- + +move \epoc32\winscw\c\data\ut_infowidgetsathandler.log %PATH_TO_RESULT%\ut_infowidgetsathandler.log + goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -15,6 +15,7 @@ * */ #include "ut_infowidgetsathandler.h" +#define private public #include "infowidgetsathandler.h" #include "qtestmains60.h" @@ -67,8 +68,9 @@ */ void UT_InfoWidgetSatHandler::t_satDisplayText() { - const QString& satDisplayText = m_satHandler->satDisplayText(); - QVERIFY(satDisplayText == QString("SAT DISPLAY TEXT")); + QString satDisplayText("satDisplayText"); + m_satHandler->setSatDisplayText(satDisplayText); + QVERIFY(satDisplayText == m_satHandler->satDisplayText()); } @@ -90,6 +92,41 @@ void UT_InfoWidgetSatHandler::t_logCurrentInfo() { m_satHandler->logCurrentInfo(); + + QVERIFY(verify()); } +void UT_InfoWidgetSatHandler::t_connect() +{ + //}else if (!connect && m_connected){ + m_satHandler->m_connected = 1; + m_satHandler->connect(0); + + + m_satHandler->m_connected = 1; + m_satHandler->connect(1); + + //if(connect && !m_connected){ + m_satHandler->m_connected = 0; + m_satHandler->connect(1); + + QVERIFY(verify()); +} +void UT_InfoWidgetSatHandler::t_handleIdleModeTxtMessage() +{ + m_satHandler->m_connected = 0; + m_satHandler->handleIdleModeTxtMessage(0); + m_satHandler->m_connected = 1; + m_satHandler->handleIdleModeTxtMessage(0); + + QVERIFY(verify()); +} +void UT_InfoWidgetSatHandler::t_handleSatError() +{ + m_satHandler->handleSatError(1,1); + + QVERIFY(verify()); +} + + QTEST_MAIN_S60(UT_InfoWidgetSatHandler) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/ut_infowidgetsathandler.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/ut_infowidgetsathandler.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/ut_infowidgetsathandler.pro Mon May 03 12:31:11 2010 +0300 @@ -41,7 +41,9 @@ # code to be tested HEADERS += ../../infowidget/inc/infowidgetsathandler.h -SOURCES += ../../infowidget/src/infowidgetsathandler.cpp +SOURCES += ../../infowidget/src/infowidgetsathandler.cpp # mocks needed for testing -#SOURCES += ../mocks/mock_networkhandlingproxy.cpp +SOURCES += ../mocks/mock_rsatservice.cpp \ + ../mocks/mock_RSatSession.cpp \ + ../mocks/mock_infowidgetsathandlerprivate.cpp \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/run_auto_tests_qt.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,194 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo off +setlocal +goto :startup + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function DEFAULT +:: +:: Modify this function +:: - TESTED_SRC can be changed to match tested code. +:: Specifies path from testcode group directory to +:: tested code +:: - Add test directories to be runned +:: ie. "call :build ut_projectdirectory" or use +:: "for /f %%a in ('dir /b ut_*') do call :build %%a" +:: which compiles, instruments and runs all test directories +:: starting with "ut_". +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:DEFAULT +set TESTED_SRC=..\..\infowidget\src\*.cpp + +for /f %%a in ('dir /b ut_*') do call :build %%a +if [%DOMODULESTESTS%] EQU [TRUE] ( +for /f %%a in ('dir /b mt_*') do call :build %%a +) + +call :finish +goto :END + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function STARTUP +:: +:: Initializing script +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:STARTUP + +set BUILDTESTS=TRUE +set RUNTESTS=TRUE +set INSTRUMENT=TRUE +set REMOVEINSTRUMENT=TRUE +set DOMODULESTESTS=TRUE +set ABLD_CALL= -2comp sbs.bat -c winscw_udeb --keepgoing +set PATH_TO_DLL=\epoc32\release\winscw\udeb +set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result + +if not exist %PATH_TO_COVERAGE_DATA% ( +mkdir %PATH_TO_COVERAGE_DATA% +) + +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + +if [%1] EQU [] ( goto default ) + +call :%1 +call :%2 +call :%3 +call :%4 +call :%5 +echo Running tests = %RUNTESTS% +echo Instrumenting tests = %INSTRUMENT% +goto default + +:/NOCLEANUP +set REMOVEINSTRUMENT=FALSE +goto end + +:/NORUN +set RUNTESTS=FALSE +set REMOVEINSTRUMENT=FALSE +goto end + +:/NOINSTRUMENT +set INSTRUMENT=FALSE +goto end + +:/NOBUILD +set BUILDTESTS=FALSE +goto end + +:/ONLYUNITTESTS +set DOMODULESTESTS=FALSE +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function FINISH +:: +:: Finishes run_auto_tests.bat +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:FINISH + +if [%RUNTESTS%] EQU [TRUE] ( +call :runtests +) + +if [%INSTRUMENT%] EQU [TRUE] ( +call :calculatecoverage +) + +if [%REMOVEINSTRUMENT%] EQU [TRUE] ( +call :removecoverage +) +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function BUILD +:: param directory +:: +:: builds test from given directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:BUILD +setlocal +if [%BUILDTESTS%] EQU [FALSE] ( goto end ) +echo Building %1 +if not exist %1 ( +echo %1 Not found! +goto end +) + +pushd . +call cd %1 +call qmake +call sbs -c winscw_udeb clean +if [%INSTRUMENT%] EQU [TRUE] ( +call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +) else ( +call %ABLD_CALL% +) + +popd +endlocal +goto end + + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function RUNTESTS +:: +:: NOTE! Function assumes that test binary is named according to test directory. +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:RUNTESTS +echo Running tests +call %PATH_TO_DLL%\ut_infowidgetsathandlerprivate.exe -dtextshell -- + +move \epoc32\winscw\c\data\ut_infowidgetsathandlerprivate.log %PATH_TO_RESULT%\ut_infowidgetsathandlerprivate.log + +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function CALCULATECOVERAGE +:: +:: Calculates test coverage. Generates html +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:CALCULATECOVERAGE +echo Calculating coverage +ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt +call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function REMOVECOVERAGE +:: +:: Removes data from coverage directory +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:REMOVECOVERAGE +echo Removing deleting coverage data +call del %PATH_TO_COVERAGE_DATA%\*.sym +call del %PATH_TO_COVERAGE_DATA%\*.dat +call del profile.txt +goto end + +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: function END +:: +:: Prints done +:::::::::::::::::::::::::::::::::::::::::::::::::::::: +:END +echo Done! \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/src/ut_infowidgetsathandlerprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/src/ut_infowidgetsathandlerprivate.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,221 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "ut_infowidgetsathandlerprivate.h" +#define private public +#include "infowidgetsathandlerprivate.h" +#include "infowidgetsathandler.h" +#include "infowidgetlogging.h" +#include "qtestmains60.h" + +void SimulateLeaveL() +{ + User::Leave(KErrGeneral); +} + +void FillData( HBufC * aText, + RSatService::TSatIconQualifier & aIconQualifier, + TUint8 & aRecordNumber) +{ + _LIT(KText,"Idle Text"); + TPtr p(aText->Des()); + p.Copy(KText); + aIconQualifier=RSatService::ESatIconNotSelfExplanatory; + aRecordNumber=1; +} + +void FillDataNoIcon( HBufC * aText, + RSatService::TSatIconQualifier & aIconQualifier, + TUint8 & aRecordNumber) +{ + Q_UNUSED(aIconQualifier); + Q_UNUSED(aRecordNumber); + _LIT(KText,"Idle Text"); + TPtr p(aText->Des()); + p.Copy(KText); +} + +void FillDataSelfExplIcon( HBufC * aText, + RSatService::TSatIconQualifier & aIconQualifier, + TUint8 & aRecordNumber) +{ + Q_UNUSED(aText); + aIconQualifier=RSatService::ESatIconSelfExplanatory; + aRecordNumber=1; +} + +/*! + UT_InfoWidgetSatHandlerPrivate ::UT_InfoWidgetSatHandlerPrivate + */ +UT_InfoWidgetSatHandlerPrivate::UT_InfoWidgetSatHandlerPrivate () //: +{ + DPRINT << "IN"; + + m_satHandler = 0; + m_iwSatHandler = 0; + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate ::~UT_InfoWidgetSatHandlerPrivate + */ +UT_InfoWidgetSatHandlerPrivate::~UT_InfoWidgetSatHandlerPrivate () +{ + DPRINT << "IN"; + + delete m_satHandler; + delete m_iwSatHandler; + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate ::init + */ +void UT_InfoWidgetSatHandlerPrivate::init() +{ + DPRINT << "IN"; + + initialize(); + m_iwSatHandler = new InfoWidgetSatHandler; + m_satHandler = new InfoWidgetSatHandlerPrivate( m_iwSatHandler, m_satService); + + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate ::cleanup + */ +void UT_InfoWidgetSatHandlerPrivate::cleanup() +{ + DPRINT << "IN"; + + reset(); + delete m_satHandler; + delete m_iwSatHandler; + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate::t_connect + */ +void UT_InfoWidgetSatHandlerPrivate::t_connect() +{ + DPRINT << "IN"; + + expect("RSatSession::ConnectL"); + expect("RSatService::OpenL"); + m_satHandler->connect(); + + expect("RSatSession::ConnectL") + .willOnce(invokeWithoutArguments(SimulateLeaveL)); + m_satHandler->connect(); + + expect("RSatService::OpenL") + .willOnce(invokeWithoutArguments(SimulateLeaveL)); + m_satHandler->connect(); + + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate::t_disconnect + */ +void UT_InfoWidgetSatHandlerPrivate::t_disconnect() +{ + DPRINT << "IN"; + + m_satHandler->disconnect(); + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate::t_startObserving + */ +void UT_InfoWidgetSatHandlerPrivate::t_startObserving() +{ + DPRINT << "IN"; + + int i = KErrGeneral; + expect("RSatService::NotifySetupIdleModeTextChange").returns(i); + expect("RSatService::GetSetupIdleModeTextL") + .willOnce(invoke(FillData)); + m_satHandler->startObserving(); + + expect("RSatService::NotifySetupIdleModeTextChange").returns(i); + expect("RSatService::GetSetupIdleModeTextL") + .willOnce(invoke(FillDataNoIcon)); + m_satHandler->startObserving(); + + expect("RSatService::NotifySetupIdleModeTextChange").returns(i); + expect("RSatService::GetSetupIdleModeTextL") + .willOnce(invoke(FillDataSelfExplIcon)); + m_satHandler->startObserving(); + + expect("RSatService::GetSetupIdleModeTextL") + .willOnce(invokeWithoutArguments(SimulateLeaveL)); + m_satHandler->startObserving(); + + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate::t_runL + */ +void UT_InfoWidgetSatHandlerPrivate::t_runL() +{ + DPRINT << "IN"; + + int i = 1; + expect("RSatService::GetSetupIdleModeTextL") + .willOnce(invoke(FillData)); + expect("RSatService::NotifySetupIdleModeTextChange").returns(i); + m_satHandler->RunL(); + + m_satHandler->iStatus = KErrGeneral; + expect("RSatService::NotifySetupIdleModeTextChange").returns(i); + m_satHandler->RunL(); + + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +/*! + UT_InfoWidgetSatHandlerPrivate::t_doCancel + */ +void UT_InfoWidgetSatHandlerPrivate::t_doCancel() +{ + DPRINT << "IN"; + + m_satHandler->DoCancel(); + QVERIFY(verify()); + + DPRINT << "OUT"; +} + +QTEST_MAIN_S60(UT_InfoWidgetSatHandlerPrivate ) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/ut_infowidgetsathandlerprivate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/ut_infowidgetsathandlerprivate.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,51 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += qtestlib hb +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../infowidget/src +INCLUDEPATH += . +INCLUDEPATH += ../common +INCLUDEPATH += ../../inc/ +INCLUDEPATH += ../../infowidget/inc/ + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib \ + -lsymbianmock \ + -lcpframework +} + +# test code +HEADERS += ./inc/ut_infowidgetsathandlerprivate.h +SOURCES += ./src/ut_infowidgetsathandlerprivate.cpp + +# code to be tested +HEADERS += ../../infowidget/inc/infowidgetsathandler.h +HEADERS += ../../infowidget/inc/infowidgetsathandlerprivate.h + +SOURCES += ../../infowidget/src/infowidgetsathandlerprivate.cpp + +# mocks needed for testing +SOURCES += ../mocks/mock_rsatservice.cpp \ + ../mocks/mock_RSatSession.cpp \ + ../mocks/mock_infowidgetsathandler.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.cpp --- a/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.cpp Mon May 03 12:31:11 2010 +0300 @@ -11,7 +11,8 @@ * * Contributors: * -* Description: Example of home screen widget +* Description: Infowidgetplugin service manager +* registration handler * */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.pro --- a/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.pro Mon May 03 12:31:11 2010 +0300 @@ -27,6 +27,7 @@ symbian { load(data_caging_paths) TARGET.CAPABILITY = ALL -TCB + TARGET.UID3 = 0x2002EA1E BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ "./rom/infowidgetproviderinstaller.iby CORE_APP_LAYER_IBY_EXPORT_PATH(infowidgetproviderinstaller.iby)" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/inc/api_headers.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/inc/api_headers.pri Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +PHONEINDICATORPLUGIN_API_HEADERS = \ + ./inc/phoneindicators.h \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/inc/phoneindicatorinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicatorinterface.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,54 @@ +/* + * 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 PHONEINDICATORINTERFACE_H +#define PHONEINDICATORINTERFACE_H + +#include +#include +#include +#include +#include "phoneindicators.h" + +class PhoneIndicatorInterface : public HbIndicatorInterface +{ +public: + PhoneIndicatorInterface(const QString &indicatorType, + int typeIndex, + Interaction interaction); + + ~PhoneIndicatorInterface(); + + bool handleInteraction(InteractionType type); + QVariant indicatorData(int role) const; + +protected: + + bool handleClientRequest(RequestType type, const QVariant ¶meter); + +private: + + int m_typeIndex; + Interaction m_interaction; + QString m_primaryText; + QString m_secondaryText; + QString m_icon; + QString m_icon2; + QVariant m_parameter; +}; + +#endif // PHONEINDICATORINTERFACE_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/inc/phoneindicatorplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicatorplugin.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,46 @@ +/* + * 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 PHONEINDICATORPLUGIN_H +#define PHONEINDICATORPLUGIN_H + +#include +#include + +class PhoneIndicatorPlugin : public QObject, public HbIndicatorPluginInterface +{ +Q_OBJECT +Q_INTERFACES(HbIndicatorPluginInterface) +public: + PhoneIndicatorPlugin(); + ~PhoneIndicatorPlugin(); + + QStringList indicatorTypes() const; + bool accessAllowed(const QString &indicatorType, + const QVariantMap &securityInfo) const; + HbIndicatorInterface* createIndicator(const QString &indicatorType); + int error() const; +private: + int typeIndex(const QString &indicatorType) const; + +private: + Q_DISABLE_COPY(PhoneIndicatorPlugin) + int m_error; + QStringList m_indicatorTypes; +}; + +#endif // PHONEINDICATORPLUGIN_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/inc/phoneindicators.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicators.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,60 @@ +/* + * 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 PHONEINDICATORS_H +#define PHONEINDICATORS_H + +#include +#include +#include + + +static const char *IndicatorNameTemplate = "PhoneIndicator_%1"; + +enum Interaction +{ + InteractionNone, + OpenMissedCallView, + Deactivate +}; + +enum PhoneIndicatorTypes +{ + PhoneMissedCallIndicator = 0 +}; + +inline QString indicatorName(int indicatorType) { + return QString(IndicatorNameTemplate).arg(indicatorType); +} + +struct PhoneIndicatorInfo +{ + const char *icon; + const char *primaryText; + const char *secondaryText; + HbIndicatorInterface::GroupPriority priority; + Interaction interaction; +}; + +Q_DECLARE_METATYPE(PhoneIndicatorInfo) + +static const int PhoneIndicatorCount = 1; +static const PhoneIndicatorInfo IndicatorInfos[PhoneIndicatorCount] = { + {"qtg_mono_info.svg", "Missed call", "Name/Number", HbIndicatorInterface::GroupPriorityHigh, OpenMissedCallView } // TODO: change icon +}; + +#endif // PHONEINDICATORS_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pri Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,19 @@ +# +# 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: +# + +HEADERS += ./inc/*.h + +SOURCES += ./src/*.cpp \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = phoneindicatorplugin +CONFIG += plugin hb + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + +symbian { + load(data_caging_paths) + include(./inc/api_headers.pri) + + headers.sources = $$PHONEINDICATORPLUGIN_API_HEADERS + headers.path = |../../inc + for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)" + + BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " \ + "./rom/phoneindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(phoneindicatorplugin.iby)" + + LIBS += -lxqservice + + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB + TARGET.UID3 = 0x2002E6B1 + + pluginstub.sources = phoneindicatorplugin.dll + pluginstub.path = /resource/plugins/indicators + DEPLOYMENT += pluginstub + +}else:win32 { + + # Put it to Hb/lib because it is in path + DESTDIR = c:/hb/lib + DLLDESTDIR = c:/hb/bin + INCLUDEPATH += c:/hb/include/hbcore \ + c:/hb/include/hbwidgets \ + c:/hb/include/hbtools +} + +OUTPUT_DIR = $$PWD/bin +SOURCE_DIR = $$PWD/inc +OBJECTS_DIR = $$OUTPUT_DIR/tmp/$$TARGET +DESTDIR = $$OUTPUT_DIR +MOC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/moc +RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc +UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui +DEPENDPATH += . $$SOURCE_DIR +INCLUDEPATH += . $$SOURCE_DIR +INCLUDEPATH += $$MOC_DIR + +include(phoneindicatorplugin.pri) + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/rom/phoneindicatorplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/rom/phoneindicatorplugin.iby Mon May 03 12:31:11 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 __PHONEINDICATORPLUGIN_IBY__ +#define __PHONEINDICATORPLUGIN_IBY__ + +#include + +file=ABI_DIR\UREL\phoneindicatorplugin.dll SHARED_LIB_DIR\phoneindicatorplugin.dll +data=\epoc32\data\z\resource\plugins\indicators\phoneindicatorplugin.qtplugin \resource\plugins\indicators\phoneindicatorplugin.qtplugin +#endif diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,109 @@ +/* + * 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 "Phoneindicatorinterface.h" +#include "phoneindicators.h" +#include +#include +#ifdef Q_OS_SYMBIAN +#include +#include +#endif + +PhoneIndicatorInterface::PhoneIndicatorInterface( + const QString &indicatorType, + int typeIndex, + Interaction interaction) : + HbIndicatorInterface( indicatorType, IndicatorInfos[typeIndex].priority, + (interaction == InteractionNone) ? NoInteraction : InteractionActivated), + m_typeIndex(typeIndex), + m_interaction(interaction), + m_primaryText(IndicatorInfos[typeIndex].primaryText), + m_secondaryText(IndicatorInfos[typeIndex].secondaryText), + m_icon(IndicatorInfos[typeIndex].icon) + +{ +} + +PhoneIndicatorInterface::~PhoneIndicatorInterface() +{ + +} + +bool PhoneIndicatorInterface::handleInteraction(InteractionType type) +{ + if (type == InteractionActivated) { + switch (m_interaction) { + + case OpenMissedCallView: { +#ifdef Q_OS_SYMBIAN + XQServiceRequest snd("com.nokia.services.logsservices.starter", + "start(int,bool)", false); + snd << (int)LogsServices::ViewMissed; + snd << false; + int retValue; + snd.send(retValue); + +// LogsServices::start( LogsServices::ViewMissed, false ); +#endif + } + break; + case Deactivate: + emit deactivate(); + break; + default: + return false; + } + emit dataChanged(); + } + return false; +} + +QVariant PhoneIndicatorInterface::indicatorData(int role) const +{ + QVariantMap map = m_parameter.value(); + + if (role == PrimaryTextRole) { + return map.value( (QVariant(PrimaryTextRole)).toString()).toString(); + } else if (role == SecondaryTextRole ) { + return map.value( (QVariant(SecondaryTextRole)).toString()).toString(); + } else if (role == IconNameRole) { + return m_icon; + } else if (role == DecorationNameRole) { + return map.value( (QVariant(DecorationNameRole)).toString()).toString(); + } + return QVariant(); +} + +bool PhoneIndicatorInterface::handleClientRequest(RequestType type, const QVariant ¶meter) +{ + bool handled(false); + switch (type) { + // TODO: + case RequestActivate: + if (m_parameter != parameter) { + m_parameter = parameter; + emit dataChanged(); + } + handled = true; + break; + default: + m_parameter.clear(); + } + + return handled; +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneplugins/phoneindicatorplugin/src/phoneindicatorplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/phoneindicatorplugin/src/phoneindicatorplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include + +#include "phoneindicatorplugin.h" +#include "phoneindicatorinterface.h" + +Q_EXPORT_PLUGIN(PhoneIndicatorPlugin) +PhoneIndicatorPlugin::PhoneIndicatorPlugin(): m_error(0) +{ + for (int i = 0; i < PhoneIndicatorCount; ++i) { + m_indicatorTypes.append(indicatorName(i)); + } +} + +PhoneIndicatorPlugin::~PhoneIndicatorPlugin() +{ +} + +QStringList PhoneIndicatorPlugin::indicatorTypes() const +{ + return m_indicatorTypes; +} + +bool PhoneIndicatorPlugin::accessAllowed(const QString &indicatorType, + const QVariantMap &securityInfo) const +{ + Q_UNUSED(indicatorType); + Q_UNUSED(securityInfo); + return true; // constant for hats =) +} + +int PhoneIndicatorPlugin::typeIndex(const QString &indicatorType) const +{ + for (int i = 0; i < m_indicatorTypes.count(); ++i) { + if (m_indicatorTypes.at(i) == indicatorType) { + return i; + } + } + return -1; +} + +HbIndicatorInterface* PhoneIndicatorPlugin::createIndicator( + const QString &indicatorType) +{ + HbIndicatorInterface *indicator = 0; + int index(typeIndex(indicatorType)); + if (index >= 0) { + indicator = new PhoneIndicatorInterface( + indicatorType, index, IndicatorInfos[index].interaction); + } + return indicator; +} + +int PhoneIndicatorPlugin::error() const +{ + return m_error; +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h --- a/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h Mon May 03 12:31:11 2010 +0300 @@ -24,10 +24,12 @@ class PSetWrapper; class QModelIndex; class CpPhoneNotes; +class QValidator; +class QTranslator; /*! \class CpBarringPluginGroup - \brief The class CpBarringPluginGroup defines items shown on UI. + \brief The class CpBarringPluginGroup defines barring items shown on UI. */ class CpBarringPluginGroup : public CpSettingFormItemData { @@ -45,17 +47,26 @@ private: void setupLocalization(); - void connectToWrapper(); + void setupConnectionsToWrapper(); - void createAllOutgoingBarringItem(); - void createOutgoingInternationalBarringItem(); - void createOutgoingInternationalExceptToHomeCountryBarringItem(); - void createAllIncomingBarringItem(); - void createIncomingWhenRoamingBarringItem(); + void createBarringItems(); + CpSettingFormItemData *createBarringItem( + const HbDataFormModelItem::DataItemType &itemType, + const QString &label, + const QString &widgetTextData, + const PSetCallBarringWrapper::BarringType &barringType); void processBarringStatusRequestQueue(); - void revertCheckStateForItem(CpSettingFormItemData *barringItem); - + bool updateDependentBarringProgramStatuses( + const CpSettingFormItemData &changedBarringItem); + CpSettingFormItemData &barringItemByProgram( + const PSetCallBarringWrapper::BarringType &barringProgram); + void revertCheckStateOfItem( + CpSettingFormItemData *barringItem); + void updateCheckStateOfItem( + CpSettingFormItemData &barringItem, + const Qt::CheckState &newState); + private slots: void barringStatusRequestCompleted( @@ -75,22 +86,25 @@ PSetCallBarringWrapper::BarringStatus barringStatus, bool plural); + void barringPasswordChangeRequestCompleted(int result); + void changeBarringStateRequested(int checkState); + void changeBarringPasswordRequested(bool checked = false); + private: CpItemDataHelper &m_helper; - PSetWrapper *m_pSetWrapper; + QScopedPointer m_translator; + QScopedPointer m_pSetWrapper; PSetCallBarringWrapper *m_barringWrapper; - CpSettingFormItemData *m_allOutgoingBarringItem; - CpSettingFormItemData *m_outgoingInternationalBarringItem; - CpSettingFormItemData *m_outgoingInternationalExceptToHomeCountryBarringItem; - CpSettingFormItemData *m_allIncomingBarringItem; - CpSettingFormItemData *m_incomingWhenRoamingBarringItem; + CpSettingFormItemData *m_editBarringPasswordItem; QQueue m_barringRequestQueue; bool m_barringStatusRequestOngoing; int m_activeNoteId; CpPhoneNotes* m_phoneNotes; + QValidator *m_barringPasswordValidator; + bool m_delayedBarringActivationNote; }; #endif // CPBARRINGPLUGINGROUP_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -30,10 +31,9 @@ #include "cpphonenotes.h" #include "cppluginlogging.h" -Q_DECLARE_METATYPE(PSetCallBarringWrapper::BarringType) +const int KMaxPasswordLength = 4; -// TODO: use logical identifiers for texts -// TODO: barring password implementation +Q_DECLARE_METATYPE(PSetCallBarringWrapper::BarringType) /*! CpBarringPluginGroup::CpBarringPluginGroup. @@ -41,18 +41,18 @@ CpBarringPluginGroup::CpBarringPluginGroup(CpItemDataHelper &helper) : CpSettingFormItemData( - HbDataFormModelItem::GroupItem, hbTrId("Call barring"), 0), + HbDataFormModelItem::GroupItem, + hbTrId("txt_phone_subhead_call_barring"), 0), m_helper(helper), + m_translator(0), m_pSetWrapper(0), m_barringWrapper(0), - m_allOutgoingBarringItem(0), - m_outgoingInternationalBarringItem(0), - m_outgoingInternationalExceptToHomeCountryBarringItem(0), - m_allIncomingBarringItem(0), - m_incomingWhenRoamingBarringItem(0), + m_editBarringPasswordItem(0), m_barringStatusRequestOngoing(false), m_activeNoteId(0), - m_phoneNotes(NULL) + m_phoneNotes(0), + m_barringPasswordValidator(0), + m_delayedBarringActivationNote(false) { DPRINT << ": IN"; @@ -63,23 +63,22 @@ setupLocalization(); - m_pSetWrapper = new PSetWrapper(this); + m_pSetWrapper.reset(new PSetWrapper(NULL)); m_barringWrapper = &m_pSetWrapper->callBarringWrapper(); - connectToWrapper(); + setupConnectionsToWrapper(); // itemShown signal is used to trigger barring status query process helper.connectToForm( SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex))); - createAllOutgoingBarringItem(); - createOutgoingInternationalBarringItem(); - createOutgoingInternationalExceptToHomeCountryBarringItem(); - createAllIncomingBarringItem(); - createIncomingWhenRoamingBarringItem(); + createBarringItems(); m_phoneNotes = CpPhoneNotes::instance(); + QRegExp regExpression("\\d{4}"); + m_barringPasswordValidator = new QRegExpValidator(regExpression, this); + DPRINT << ": OUT"; } @@ -106,7 +105,16 @@ static_cast( qobject_cast(model())->itemFromIndex(item)); - if (formItem->contentWidgetData("checkState").isValid()) { + if (!formItem->property("barringType").isValid()) { + // Shown item does not belong to the barring settings group. + return; + } + + if (formItem == m_editBarringPasswordItem) { + return; + } + + if (formItem->isEnabled()) { // Initial status for the barring item is already queried. Do not // start querying again if user does close/open for the barring group. return; @@ -115,6 +123,8 @@ // start barring status query m_barringRequestQueue.enqueue(formItem); processBarringStatusRequestQueue(); + + DPRINT << ": OUT"; } @@ -125,26 +135,28 @@ { DPRINT << ": IN"; - QTranslator translator; + m_translator.reset(new QTranslator); QString lang = QLocale::system().name(); QString path = "z:/resource/qt/translations/"; QString fullName = path + "telephone_cp_" + lang; DPRINT << ": loading translation:" << fullName; - bool translatorLoaded = translator.load(fullName); + bool translatorLoaded = m_translator->load(fullName); DPRINT << ": translator loaded: " << translatorLoaded; if (translatorLoaded) { - qApp->installTranslator(&translator); + qApp->installTranslator(m_translator.data()); DPRINT << ": translator installed"; } + + DPRINT << ": OUT"; } /*! - CpBarringPluginGroup::connectToWrapper. + CpBarringPluginGroup::setupConnectionsToWrapper. */ -void CpBarringPluginGroup::connectToWrapper() +void CpBarringPluginGroup::setupConnectionsToWrapper() { DPRINT << ": IN"; @@ -196,116 +208,94 @@ bool) ) ); -} - - -/*! - CpBarringPluginGroup::createAllOutgoingBarringItem. - */ -void CpBarringPluginGroup::createAllOutgoingBarringItem() -{ - DPRINT << ": IN"; - - m_allOutgoingBarringItem = new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId(""), this); - - m_allOutgoingBarringItem->setContentWidgetData( - "text", QVariant(hbTrId("Outgoing calls"))); - - QVariant value; - value.setValue(PSetCallBarringWrapper::BarringTypeAllOutgoing); - m_allOutgoingBarringItem->setProperty("barringType", value); - appendChild(m_allOutgoingBarringItem); -} - - -/*! - CpBarringPluginGroup::createOutgoingInternationalBarringItem. - */ -void CpBarringPluginGroup::createOutgoingInternationalBarringItem() -{ - DPRINT << ": IN"; + QObject::connect( + m_barringWrapper, + SIGNAL(barringPasswordChangeRequestCompleted(int)), + this, + SLOT(barringPasswordChangeRequestCompleted(int)) + ); - m_outgoingInternationalBarringItem = new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId(""), this); - - m_outgoingInternationalBarringItem->setContentWidgetData( - "text", QVariant(hbTrId("International calls"))); - - QVariant value; - value.setValue(PSetCallBarringWrapper::BarringTypeOutgoingInternational); - m_outgoingInternationalBarringItem->setProperty("barringType", value); - - appendChild(m_outgoingInternationalBarringItem); + DPRINT << ": OUT"; } /*! - CpBarringPluginGroup:: - createOutgoingInternationalExceptToHomeCountryBarringItem. + CpBarringPluginGroup::createBarringItems. */ -void CpBarringPluginGroup:: - createOutgoingInternationalExceptToHomeCountryBarringItem() +void CpBarringPluginGroup::createBarringItems() { DPRINT << ": IN"; - m_outgoingInternationalExceptToHomeCountryBarringItem = - new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId(""), this); + createBarringItem( + HbDataFormModelItem::CheckBoxItem, + QString(""), + hbTrId("txt_phone_list_outgoing_calls"), + PSetCallBarringWrapper::BarringTypeAllOutgoing); - m_outgoingInternationalExceptToHomeCountryBarringItem->setContentWidgetData( - "text", QVariant(hbTrId("International calls except to home country"))); + createBarringItem( + HbDataFormModelItem::CheckBoxItem, + QString(""), + hbTrId("txt_phone_list_international_calls"), + PSetCallBarringWrapper::BarringTypeOutgoingInternational); + + createBarringItem( + HbDataFormModelItem::CheckBoxItem, + QString(""), + hbTrId("txt_phone_list_international_calls_except_to_home"), + PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); - QVariant value; - value.setValue(PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); - m_outgoingInternationalExceptToHomeCountryBarringItem->setProperty( - "barringType", value); + createBarringItem( + HbDataFormModelItem::CheckBoxItem, + QString(""), + hbTrId("txt_phone_list_incoming_calls"), + PSetCallBarringWrapper::BarringTypeAllIncoming); + + createBarringItem( + HbDataFormModelItem::CheckBoxItem, + QString(""), + hbTrId("txt_phone_list_incoming_call_when_abroad"), + PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); - appendChild(m_outgoingInternationalExceptToHomeCountryBarringItem); + // Dummy BarringTypeAllServices is used to indicate that this item belongs + // to the barring settings group. Information is needed in itemShown(). + m_editBarringPasswordItem = createBarringItem( + HbDataFormModelItem::ToggleValueItem, + hbTrId("txt_phone_setlabel_edit_barring_password"), + hbTrId("txt_phone_setlabel_edit_barring_password_val_edit"), + PSetCallBarringWrapper::BarringTypeAllServices); + m_editBarringPasswordItem->setContentWidgetData( + QString("additionalText"), + hbTrId("txt_phone_setlabel_edit_barring_password_val_edit")); + DPRINT << ": OUT"; } /*! - CpBarringPluginGroup::createAllIncomingBarringItem. + CpBarringPluginGroup::createBarringItem. */ -void CpBarringPluginGroup::createAllIncomingBarringItem() +CpSettingFormItemData *CpBarringPluginGroup::createBarringItem( + const HbDataFormModelItem::DataItemType &itemType, + const QString &label, + const QString &widgetTextData, + const PSetCallBarringWrapper::BarringType &barringType) { DPRINT << ": IN"; - m_allIncomingBarringItem = new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId(""), this); + QScopedPointer barringItem( + new CpSettingFormItemData(itemType, label, this)); - m_allIncomingBarringItem->setContentWidgetData( - "text", QVariant(hbTrId("Incoming calls"))); + barringItem->setContentWidgetData("text", QVariant(widgetTextData)); + barringItem->setEnabled(false); QVariant value; - value.setValue(PSetCallBarringWrapper::BarringTypeAllIncoming); - m_allIncomingBarringItem->setProperty("barringType", value); + value.setValue(barringType); + barringItem->setProperty("barringType", value); - appendChild(m_allIncomingBarringItem); -} - - -/*! - CpBarringPluginGroup::createIncomingWhenRoamingBarringItem. - */ -void CpBarringPluginGroup::createIncomingWhenRoamingBarringItem() -{ - DPRINT << ": IN"; - - m_incomingWhenRoamingBarringItem = new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId(""), this); - - m_incomingWhenRoamingBarringItem->setContentWidgetData( - "text", QVariant(hbTrId("Incoming calls when abroad"))); - - QVariant value; - value.setValue(PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); - m_incomingWhenRoamingBarringItem->setProperty("barringType", value); - - appendChild(m_incomingWhenRoamingBarringItem); + appendChild(barringItem.data()); + DPRINT << ": OUT"; + return barringItem.take(); } @@ -314,10 +304,10 @@ */ void CpBarringPluginGroup::barringStatusRequestCompleted( int result, - const QList & basicServiceGroupIds, + const QList &basicServiceGroupIds, PSetCallBarringWrapper::BarringStatus status) { - DPRINT << ": IN"; + DPRINT << ": IN" << ": result:" << result << "status:" << status; Q_UNUSED(result) Q_UNUSED(basicServiceGroupIds) @@ -326,35 +316,58 @@ if (PSetCallBarringWrapper::BarringErrorNone != result) { // Stop status query process for this time. Statuses are tried to // query again for uncompleted items when user expands/opens barring - // view again. + // settings group again. m_phoneNotes->cancelNote(m_activeNoteId); m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); m_barringRequestQueue.clear(); return; } - // Update check state to correct value. After setting valid value here - // status query will not be started again for the item when user collapses - // and expands view again. + CpSettingFormItemData *itemForCompletedRequest = + m_barringRequestQueue.dequeue(); + + if (!itemForCompletedRequest->isEnabled()) { + // After enabling setting item here status query will not be started + // again for the item when user collapses and expands the barring + // settings group again. + itemForCompletedRequest->setEnabled(true); + // start to observe user initiated state changes + m_helper.addConnection( + itemForCompletedRequest, SIGNAL(stateChanged(int)), + this, SLOT(changeBarringStateRequested(int))); + } + Qt::CheckState checkState = (PSetCallBarringWrapper::BarringStatusActive == status) ? Qt::Checked : Qt::Unchecked; - CpSettingFormItemData *itemForCompletedRequest = - m_barringRequestQueue.dequeue(); - itemForCompletedRequest->setContentWidgetData( - "checkState", QVariant(checkState)); - - // start to observe user initiated state changes - m_helper.addConnection( - itemForCompletedRequest, SIGNAL(stateChanged(int)), - this, SLOT(changeBarringStateRequested(int))); + updateCheckStateOfItem(*itemForCompletedRequest, checkState); if (m_barringRequestQueue.isEmpty()) { m_phoneNotes->cancelNote(m_activeNoteId); + if (m_delayedBarringActivationNote) { + m_delayedBarringActivationNote = false; + m_phoneNotes->showGlobalNote( + m_activeNoteId, + hbTrId("txt_phone_info_barring_activated"), + HbMessageBox::MessageTypeInformation); + } + + // Password editing is enabled only after all barring statuses are + // queried. Otherwise user may be able to issue two requests + // simultaneously by hiding status query progress note and clicking + // edit password. + if (!m_editBarringPasswordItem->isEnabled()) { + m_editBarringPasswordItem->setEnabled(true); + m_helper.addConnection( + m_editBarringPasswordItem, SIGNAL(clicked(bool)), + this, SLOT(changeBarringPasswordRequested(bool))); + } } else { processBarringStatusRequestQueue(); } + + DPRINT << ": OUT"; } @@ -367,24 +380,33 @@ PSetCallBarringWrapper::BarringStatus barringStatus, bool plural) { - DPRINT << ": IN"; + DPRINT << ": IN: result:" << result << "barringType:" << barringType + << "barringStatus:" << barringStatus << "plural:" << plural; Q_UNUSED(barringType) Q_UNUSED(barringStatus) Q_UNUSED(plural) - m_phoneNotes->cancelNote(m_activeNoteId); - CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue(); if (PSetCallBarringWrapper::BarringErrorNone == result) { - m_phoneNotes->showGlobalNote( - m_activeNoteId, - hbTrId("Barring activated"), - HbMessageBox::MessageTypeInformation); + if (updateDependentBarringProgramStatuses(*barringItem)) { + // Indicate barring activation completion only when dependent + // barring items are also updated. + m_delayedBarringActivationNote = true; + } else { + m_phoneNotes->cancelNote(m_activeNoteId); + m_phoneNotes->showGlobalNote( + m_activeNoteId, + hbTrId("txt_phone_info_barring_activated"), + HbMessageBox::MessageTypeInformation); + } } else { - revertCheckStateForItem(barringItem); + revertCheckStateOfItem(barringItem); + m_phoneNotes->cancelNote(m_activeNoteId); m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); } + + DPRINT << ": OUT"; } @@ -397,7 +419,8 @@ PSetCallBarringWrapper::BarringStatus barringStatus, bool plural) { - DPRINT << ": IN"; + DPRINT << ": IN: result:" << result << "barringType:" << barringType + << "barringStatus:" << barringStatus << "plural:" << plural; Q_UNUSED(barringType) Q_UNUSED(barringStatus) Q_UNUSED(plural) @@ -408,13 +431,35 @@ if (PSetCallBarringWrapper::BarringErrorNone == result) { m_phoneNotes->showGlobalNote( m_activeNoteId, - hbTrId("Barring cancelled"), + hbTrId("txt_phone_info_barring_deactivated"), HbMessageBox::MessageTypeInformation); } else { - revertCheckStateForItem(barringItem); + revertCheckStateOfItem(barringItem); m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); } + + DPRINT << ": OUT"; +} + + +/*! + CpBarringPluginGroup::barringPasswordChangeRequestCompleted. + */ +void CpBarringPluginGroup::barringPasswordChangeRequestCompleted(int result) +{ + DPRINT << ": IN: result:" << result; + + m_phoneNotes->cancelNote(m_activeNoteId); + + if (PSetCallBarringWrapper::BarringErrorNone == result) { + m_phoneNotes->showGlobalNote( + m_activeNoteId, + hbTrId("txt_phone_info_password_changed"), + HbMessageBox::MessageTypeInformation); + } else { + m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); + } } @@ -424,7 +469,7 @@ void CpBarringPluginGroup::processBarringStatusRequestQueue() { DPRINT << ": IN"; - + if ((m_barringStatusRequestOngoing == false) && (!m_barringRequestQueue.isEmpty())) { @@ -436,37 +481,14 @@ m_barringStatusRequestOngoing = true; - if (0 == m_activeNoteId) { - // Status request note is very first note to show. Launch progress - // note only once for status update. + if (!m_phoneNotes->noteShowing()) { + // Launch progress note only once for status update. m_phoneNotes->showGlobalProgressNote( - m_activeNoteId, hbTrId("Requesting...")); + m_activeNoteId, hbTrId("txt_phone_info_requesting")); } } -} - - -/*! - CpBarringPluginGroup::revertCheckStateForItem. - */ -void CpBarringPluginGroup::revertCheckStateForItem( - CpSettingFormItemData *barringItem) -{ - m_helper.removeConnection( - barringItem, SIGNAL(stateChanged(int)), - this, SLOT(changeBarringStateRequested(int))); - HbDataFormModel *formModel = qobject_cast(model()); - QModelIndex modelIndex = formModel->indexFromItem(barringItem); - HbCheckBox *checkBox = static_cast( - m_helper.widgetFromModelIndex(modelIndex)); - Qt::CheckState revertedCheckState = - (checkBox->checkState() == Qt::Checked) ? Qt::Unchecked : Qt::Checked; - checkBox->setCheckState(revertedCheckState); - - m_helper.addConnection( - barringItem, SIGNAL(stateChanged(int)), - this, SLOT(changeBarringStateRequested(int))); + DPRINT << ": OUT"; } @@ -475,9 +497,10 @@ */ void CpBarringPluginGroup::changeBarringStateRequested(int checkState) { - QObject *signalSender = sender(); + DPRINT << ": IN"; // find form item for which user has requested barring status change + QObject *signalSender = sender(); HbDataFormModel *formModel = qobject_cast(model()); CpSettingFormItemData* barringItem = NULL; int numOfChilds = childCount(); @@ -489,26 +512,260 @@ } } - // TODO: remove hardcoded password when setting of password is implemented if (NULL != barringItem) { + QString barringPasswordQueryDialogTitle( + hbTrId("txt_phone_info_barring_password")); + QString barringPassword; + bool okPressed = false; + m_phoneNotes->showPasswordQueryDialog( + barringPasswordQueryDialogTitle, *m_barringPasswordValidator, + KMaxPasswordLength, barringPassword, okPressed); + if (!okPressed) { + revertCheckStateOfItem(barringItem); + return; + } + if (Qt::Checked == checkState) { m_barringWrapper->enableBarring( ServiceGroupVoice, qvariant_cast( barringItem->property("barringType")), - QString("1234")); + barringPassword); } else { m_barringWrapper->disableBarring( ServiceGroupVoice, qvariant_cast( barringItem->property("barringType")), - QString("1234")); + barringPassword); } m_barringRequestQueue.enqueue(barringItem); m_phoneNotes->showGlobalProgressNote( - m_activeNoteId, hbTrId("Requesting...")); + m_activeNoteId, hbTrId("txt_phone_info_requesting")); + } + + DPRINT << ": OUT"; +} + + +/*! + CpBarringPluginGroup::changeBarringPasswordRequested. + */ +void CpBarringPluginGroup::changeBarringPasswordRequested(bool checked) +{ + DPRINT << ": IN"; + Q_UNUSED(checked) + + bool okPressed = false; + + QString currentPassword; + QString currentPasswordQueryDialogTitle( + hbTrId("txt_phone_info_current_password")); + m_phoneNotes->showPasswordQueryDialog( + currentPasswordQueryDialogTitle, *m_barringPasswordValidator, + KMaxPasswordLength, currentPassword, okPressed); + if (!okPressed) { + return; + } + + QString newPassword; + QString newPasswordQueryDialogTitle( + hbTrId("txt_phone_info_new_password")); + m_phoneNotes->showPasswordQueryDialog( + newPasswordQueryDialogTitle, *m_barringPasswordValidator, + KMaxPasswordLength, newPassword, okPressed); + if (!okPressed) { + return; + } + + QString newPasswordVerifyDialogTitle( + hbTrId("txt_phone_info_verify_new_password")); + QString newPasswordVerified; + QRegExp regExpression(newPassword); + QScopedPointer verifyPasswordValidator( + new QRegExpValidator(regExpression, NULL)); + m_phoneNotes->showPasswordQueryDialog( + newPasswordVerifyDialogTitle, *verifyPasswordValidator.data(), + KMaxPasswordLength, newPasswordVerified, okPressed); + + if (okPressed) { + m_barringWrapper->changeBarringPassword( + currentPassword, + newPassword, + newPasswordVerified); + + m_phoneNotes->showGlobalProgressNote( + m_activeNoteId, hbTrId("txt_phone_info_requesting")); } + + DPRINT << ": OUT"; +} + + +/*! + CpBarringPluginGroup::updateDependentBarringProgramStatuses. + According to the ETSI TS 100 548 v7.0.0 specification only one outgoing + and one incoming barring program can be active at the same time. We must, + however, query barring statuses again because some networks do not conform + to the standards and allow multiple simultaneous barring programs. + */ +bool CpBarringPluginGroup::updateDependentBarringProgramStatuses( + const CpSettingFormItemData &changedBarringItem) +{ + DPRINT << ": IN"; + + CpSettingFormItemData* barringItem = NULL; + PSetCallBarringWrapper::BarringType barringType = + qvariant_cast( + changedBarringItem.property("barringType")); + QList itemCandidatesForUpdate; + switch (barringType) { + case PSetCallBarringWrapper::BarringTypeAllOutgoing: + { + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeOutgoingInternational); + itemCandidatesForUpdate.append(barringItem); + + barringItem = &barringItemByProgram( + PSetCallBarringWrapper:: + BarringTypeOutgoingInternationalExceptToHomeCountry); + itemCandidatesForUpdate.append(barringItem); + break; + } + case PSetCallBarringWrapper::BarringTypeOutgoingInternational: + { + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeAllOutgoing); + itemCandidatesForUpdate.append(barringItem); + + barringItem = &barringItemByProgram( + PSetCallBarringWrapper:: + BarringTypeOutgoingInternationalExceptToHomeCountry); + itemCandidatesForUpdate.append(barringItem); + break; + } + case PSetCallBarringWrapper:: + BarringTypeOutgoingInternationalExceptToHomeCountry: + { + // ETSI TS 100 548 v7.0.0, 1.1.2.2. BOIC barring will be activated + // instead of BOIC-exHC if roamed network does not suport BOIC-exHC + // => we must update statuses for all outgoing barring programs. + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeAllOutgoing); + itemCandidatesForUpdate.append(barringItem); + + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeOutgoingInternational); + itemCandidatesForUpdate.append(barringItem); + + barringItem = &barringItemByProgram( + PSetCallBarringWrapper:: + BarringTypeOutgoingInternationalExceptToHomeCountry); + itemCandidatesForUpdate.append(barringItem); + break; + } + case PSetCallBarringWrapper::BarringTypeAllIncoming: + { + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); + itemCandidatesForUpdate.append(barringItem); + break; + } + case PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming: + { + barringItem = &barringItemByProgram( + PSetCallBarringWrapper::BarringTypeAllIncoming); + itemCandidatesForUpdate.append(barringItem); + break; + } + default: + break; + } + + const int numOfItemCandidates = itemCandidatesForUpdate.count(); + for (int i = 0; i < numOfItemCandidates; i++) { + barringItem = itemCandidatesForUpdate[i]; + Qt::CheckState checkState = static_cast + (barringItem->contentWidgetData("checkState").toInt()); + if (Qt::Checked == checkState || + PSetCallBarringWrapper:: + BarringTypeOutgoingInternationalExceptToHomeCountry + == barringType) { + m_barringRequestQueue.enqueue(barringItem); + } + } + + processBarringStatusRequestQueue(); + DPRINT << ": OUT"; + return (0 < m_barringRequestQueue.count()); +} + + +/*! + CpBarringPluginGroup::barringItemByProgram. + */ +CpSettingFormItemData &CpBarringPluginGroup::barringItemByProgram( + const PSetCallBarringWrapper::BarringType &barringProgram) +{ + DPRINT << ": IN"; + + HbDataFormModel *formModel = qobject_cast(model()); + CpSettingFormItemData *item = NULL; + int numOfChilds = childCount(); + for (int childInd = 0; (childInd < numOfChilds) && (!item); childInd++) { + CpSettingFormItemData *itemCandidate = + static_cast(childAt(childInd)); + PSetCallBarringWrapper::BarringType candidateBarringProgram = + qvariant_cast( + itemCandidate->property("barringType")); + if (candidateBarringProgram == barringProgram) { + item = itemCandidate; + } + } + + Q_ASSERT(item); + DPRINT << ": OUT"; + return *item; +} + + +/*! + CpBarringPluginGroup::revertCheckStateOfItem. + */ +void CpBarringPluginGroup::revertCheckStateOfItem( + CpSettingFormItemData *barringItem) +{ + DPRINT << ": IN"; + + Qt::CheckState currentCheckState = static_cast + (barringItem->contentWidgetData("checkState").toInt()); + Qt::CheckState revertedCheckState = + (currentCheckState == Qt::Checked) ? Qt::Unchecked : Qt::Checked; + updateCheckStateOfItem(*barringItem, revertedCheckState); + + DPRINT << ": OUT"; +} + + +/*! + CpBarringPluginGroup::updateCheckStateOfItem. + */ +void CpBarringPluginGroup::updateCheckStateOfItem( + CpSettingFormItemData &barringItem, const Qt::CheckState &newState) +{ + DPRINT << ": IN"; + + m_helper.removeConnection( + &barringItem, SIGNAL(stateChanged(int)), + this, SLOT(changeBarringStateRequested(int))); + + barringItem.setContentWidgetData("checkState", QVariant(newState)); + + m_helper.addConnection( + &barringItem, SIGNAL(stateChanged(int)), + this, SLOT(changeBarringStateRequested(int))); + + DPRINT << ": OUT"; } // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe -dtextshell -- +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe -dtextshell -- + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -27,20 +27,75 @@ void setNoteIdentifier(int ¬eId, const QString& text) { + Q_UNUSED(text) + noteId = 1; } + +const QString KCurrentPassword = "1234"; +void setCurrentPasswordParams( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok) +{ + Q_UNUSED(title) + Q_UNUSED(validator) + Q_UNUSED(maxPasswordLength) + + password = KCurrentPassword; + ok = true; +} + + +const QString KNewAndVerifiedPassword = "4321"; +void setNewAndVerifiedPasswordParams( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok) +{ + Q_UNUSED(title) + Q_UNUSED(validator) + Q_UNUSED(maxPasswordLength) + + password = KNewAndVerifiedPassword; + ok = true; +} + + +void setPasswordParamsCancel( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok) +{ + Q_UNUSED(title) + Q_UNUSED(validator) + Q_UNUSED(maxPasswordLength) + Q_UNUSED(password) + + ok = false; +} + + /*! UT_CpBarringPluginGroup::UT_CpBarringPluginGroup */ UT_CpBarringPluginGroup::UT_CpBarringPluginGroup() : m_barringpluginGroup(NULL), - m_barringWrapperMock(NULL) + m_barringWrapperMock(NULL), + m_dataFormModel(NULL) { } + /*! UT_CpBarringPluginGroup::~UT_CpBarringPluginGroup */ @@ -50,16 +105,19 @@ delete m_barringWrapperMock; } + /*! UT_CpBarringPluginGroup::init */ void UT_CpBarringPluginGroup::init() { initialize(); + QT_TRAP_THROWING(SmcDefaultValue::SetL(QString(""))); CPsetContainer &dummyContainer = reinterpret_cast(*this); m_barringWrapperMock = new PSetCallBarringWrapper(dummyContainer); EXPECT(PSetWrapper::callBarringWrapper).returns(m_barringWrapperMock); + EXPECT(QTranslator::load).returns(true); CpItemDataHelper itemDataHelper; m_barringpluginGroup = new CpBarringPluginGroup(itemDataHelper); @@ -68,6 +126,10 @@ m_barringpluginGroup->setModel(m_dataFormModel); QVERIFY(verify()); + + connect( + this, SIGNAL(simulateCheckStateChange(int)), + m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); } @@ -78,12 +140,19 @@ { reset(); + disconnect( + this, SIGNAL(simulateCheckStateChange(int)), + m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); + delete m_barringpluginGroup; m_barringpluginGroup = NULL; delete m_barringWrapperMock; m_barringWrapperMock = NULL; + delete m_dataFormModel; + m_dataFormModel = NULL; } + /*! UT_CpBarringPluginGroup::t_memleak */ @@ -94,6 +163,126 @@ /*! + UT_CpBarringPluginGroup::t_translatorInstallationOk + */ +void UT_CpBarringPluginGroup::t_translatorInstallationOk() +{ + CPsetContainer &dummyContainer = reinterpret_cast(*this); + CpItemDataHelper itemDataHelper; + + EXPECT(PSetWrapper::callBarringWrapper).returns(m_barringWrapperMock); + EXPECT(QTranslator::load).returns(true); + + CpBarringPluginGroup *barringpluginGroup = + new CpBarringPluginGroup(itemDataHelper); + + QString expectedTranslation("translation"); + EXPECT(QTranslator::translate).returns(expectedTranslation); + QString actualTranslation = hbTrId("txt_sourcetext"); + QCOMPARE(actualTranslation, expectedTranslation); + + delete barringpluginGroup; + + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_translatorInstallationFails + */ +void UT_CpBarringPluginGroup::t_translatorInstallationFails() +{ + CPsetContainer &dummyContainer = reinterpret_cast(*this); + CpItemDataHelper itemDataHelper; + + EXPECT(PSetWrapper::callBarringWrapper).returns(m_barringWrapperMock); + EXPECT(QTranslator::load).returns(false); + + CpBarringPluginGroup *barringpluginGroup = + new CpBarringPluginGroup(itemDataHelper); + + QString translation = hbTrId("txt_sourcetext"); + QCOMPARE(translation, QString("txt_sourcetext")); + + delete barringpluginGroup; + + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_itemShownNotBarringItem + Tests that itemShown() for other setting group's item is not handled. + */ +void UT_CpBarringPluginGroup::t_itemShownNotBarringItem() +{ + EXPECT(PSetCallBarringWrapper::barringStatus).times(0); + + QScopedPointer item(new CpSettingFormItemData( + HbDataFormModelItem::CheckBoxItem, hbTrId(""), NULL)); + m_dataFormModel->appendDataFormItem(item.data(), m_barringpluginGroup); + m_barringpluginGroup->itemShown( + m_dataFormModel->indexFromItem(item.data())); + m_dataFormModel->removeItem(item.take()); + + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing + Tests that another progress note is not launched if one is already shown. + */ +void UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing() +{ + EXPECT(PSetCallBarringWrapper::barringStatus); + EXPECT(CpPhoneNotes::noteShowing).returns(true); + EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0); + + HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); + m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); + + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry + */ +void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry() +{ + // simulate successfull initial status inquiry + QList basicServiceGroupIds; + const int errorCode = 0; + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); + + m_barringpluginGroup->barringStatusRequestCompleted( + errorCode, + basicServiceGroupIds, + PSetCallBarringWrapper::BarringStatusActive); + } + + // simulate barring enable request + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + + // verify that already connected items are not enabled/connected again + EXPECT(CpItemDataHelper::removeConnection).times(1); + EXPECT(CpItemDataHelper::addConnection).times(1); + m_barringpluginGroup->barringStatusRequestCompleted( + errorCode, + basicServiceGroupIds, + PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError */ void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError() @@ -141,15 +330,20 @@ PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); EXPECT(CpPhoneNotes::showGlobalProgressNote) .willOnce(invoke(setNoteIdentifier)); - EXPECT(CpItemDataHelper::addConnection).times(5); + EXPECT(CpItemDataHelper::addConnection).times(6); int numOfChilds = m_barringpluginGroup->childCount(); for (int childIndex = 0; childIndex < numOfChilds; childIndex++) { HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); - m_dataFormModel->appendDataFormItem(item); m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); } + connect( + m_dataFormModel, + SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), + this, + SLOT(dataChanged(const QModelIndex &, const QModelIndex &))); + QSignalSpy spy( m_dataFormModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &))); @@ -169,8 +363,9 @@ m_barringpluginGroup->barringStatusRequestCompleted( PSetCallBarringWrapper::BarringErrorNone, basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusUnknown); + QCOMPARE(spy.count(), 11); - QCOMPARE(spy.count(), 5); + QVERIFY(verify()); // Verify that barring status checking is not started on item show if // status is already queried. @@ -188,12 +383,10 @@ */ void UT_CpBarringPluginGroup::t_enableBarringRequestCompleted() { - connect( - this, SIGNAL(simulateCheckStateChange(int)), - m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); - // request completed succesfully -case EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); EXPECT(CpPhoneNotes::cancelNote); EXPECT(CpPhoneNotes::showGlobalNote); @@ -205,13 +398,18 @@ false); QVERIFY(verify()); + QList basicServiceGroupIds; // request completed with an error -case - EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(2); + HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpItemDataHelper::removeConnection); + EXPECT(CpItemDataHelper::addConnection); EXPECT(CpPhoneNotes::cancelNote); EXPECT(CpPhoneNotes::showGlobalErrorNote); - EXPECT(HbCheckBox::checkState).returns(Qt::Checked); - EXPECT(HbCheckBox::setCheckState).with(Qt::Unchecked); emit simulateCheckStateChange(Qt::Checked); m_barringpluginGroup->enableBarringRequestCompleted( @@ -219,22 +417,277 @@ PSetCallBarringWrapper::BarringTypeAllBarrings, PSetCallBarringWrapper::BarringStatusActive, false); + + QVERIFY(verify()); + +// request completed successfully and dependent barring setting needs +// status inquiry + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + // some other (outgoing) barring is enabled, status inquiery for that + // should be done. + item = m_barringpluginGroup->childAt(1); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + EXPECT(PSetCallBarringWrapper::barringStatus); + EXPECT(CpPhoneNotes::cancelNote).times(0); + EXPECT(CpPhoneNotes::showGlobalNote).times(0); + + emit simulateCheckStateChange(Qt::Checked); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeAllBarrings, + PSetCallBarringWrapper::BarringStatusActive, + false); + + QVERIFY(verify()); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); +} + + +/*! + UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring + */ +void UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring() +{ + // something very weird has happened and enable request completes for unknown + // barring type. + HbDataFormModel *formModel = qobject_cast( + m_barringpluginGroup->model()); + HbDataFormModelItem *item = m_barringpluginGroup->childAt(5); + QModelIndex modelIndex = formModel->indexFromItem(item); + + EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpPhoneNotes::cancelNote); + EXPECT(CpPhoneNotes::showGlobalNote); + // completion of unknown barring type should not lead to updating + EXPECT(PSetCallBarringWrapper::barringStatus).times(0); + emit simulateCheckStateChange(Qt::Checked); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeAllBarrings, + PSetCallBarringWrapper::BarringStatusActive, + false); QVERIFY(verify()); } /*! + UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate + */ +void UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate() +{ + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + } + + QList basicServiceGroupIds; + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, PSetCallBarringWrapper::BarringTypeOutgoingInternational); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeAllOutgoing, + PSetCallBarringWrapper::BarringStatusActive, + false); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate + */ +void UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate() +{ + QModelIndex modelIndex; + HbDataFormModel *formModel = qobject_cast( + m_barringpluginGroup->model()); + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + if (childIndex == 1) { + modelIndex = formModel->indexFromItem(item); + } + } + + QList basicServiceGroupIds; + EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeAllOutgoing); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeOutgoingInternational, + PSetCallBarringWrapper::BarringStatusActive, + false); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate + */ +void UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate() +{ + QModelIndex modelIndex; + HbDataFormModel *formModel = qobject_cast( + m_barringpluginGroup->model()); + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + if (childIndex == 2) { + modelIndex = formModel->indexFromItem(item); + } + } + + QList basicServiceGroupIds; + EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeAllOutgoing); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeOutgoingInternational); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry, + PSetCallBarringWrapper::BarringStatusActive, + false); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate + */ +void UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate() +{ + QModelIndex modelIndex; + HbDataFormModel *formModel = qobject_cast( + m_barringpluginGroup->model()); + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + if (childIndex == 3) { + modelIndex = formModel->indexFromItem(item); + } + } + + QList basicServiceGroupIds; + EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeAllIncoming, + PSetCallBarringWrapper::BarringStatusActive, + false); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! + UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate + */ +void UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate() +{ + QModelIndex modelIndex; + HbDataFormModel *formModel = qobject_cast( + m_barringpluginGroup->model()); + int numOfChilds = m_barringpluginGroup->childCount(); + for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { + HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); + item->setContentWidgetData("checkState", QVariant(Qt::Checked)); + if (childIndex == 4) { + modelIndex = formModel->indexFromItem(item); + } + } + + QList basicServiceGroupIds; + EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + emit simulateCheckStateChange(Qt::Checked); + EXPECT(PSetCallBarringWrapper::barringStatus).with( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeAllIncoming); + m_barringpluginGroup->enableBarringRequestCompleted( + 0, + PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming, + PSetCallBarringWrapper::BarringStatusActive, + false); + m_barringpluginGroup->barringStatusRequestCompleted( + PSetCallBarringWrapper::BarringErrorNone, + basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); + QVERIFY(verify()); +} + + +/*! UT_CpBarringPluginGroup::t_disableBarringRequestCompleted */ void UT_CpBarringPluginGroup::t_disableBarringRequestCompleted() { - connect( - this, SIGNAL(simulateCheckStateChange(int)), - m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); - // request completed succesfully -case EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); EXPECT(CpPhoneNotes::cancelNote); EXPECT(CpPhoneNotes::showGlobalNote); emit simulateCheckStateChange(Qt::Unchecked); @@ -248,11 +701,15 @@ QVERIFY(verify()); // request completed with an error -case - EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(2); + HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); + item->setContentWidgetData("checkState", QVariant(Qt::Unchecked)); + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpItemDataHelper::removeConnection); + EXPECT(CpItemDataHelper::addConnection); EXPECT(CpPhoneNotes::cancelNote); EXPECT(CpPhoneNotes::showGlobalErrorNote); - EXPECT(HbCheckBox::checkState).returns(Qt::Unchecked); - EXPECT(HbCheckBox::setCheckState).with(Qt::Checked); emit simulateCheckStateChange(Qt::Unchecked); m_barringpluginGroup->disableBarringRequestCompleted( @@ -266,36 +723,126 @@ /*! + UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted + */ +void UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted() +{ +// request completed with no error + EXPECT(CpPhoneNotes::cancelNote); + EXPECT(CpPhoneNotes::showGlobalNote); + + m_barringpluginGroup->barringPasswordChangeRequestCompleted(0); + + QVERIFY(verify()); + +// request completed with an error + EXPECT(CpPhoneNotes::cancelNote); + EXPECT(CpPhoneNotes::showGlobalErrorNote); + + m_barringpluginGroup->barringPasswordChangeRequestCompleted(-1); + + QVERIFY(verify()); +} + + +/*! UT_CpBarringPluginGroup::t_changeBarringStateRequested */ void UT_CpBarringPluginGroup::t_changeBarringStateRequested() { // barring enable request case EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); EXPECT(PSetCallBarringWrapper::enableBarring) .with(ServiceGroupVoice, - PSetCallBarringWrapper::BarringTypeAllOutgoing, QString("1234")); + PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword); EXPECT(CpPhoneNotes::showGlobalProgressNote); - connect( - this, SIGNAL(simulateCheckStateChange(int)), - m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); emit simulateCheckStateChange(Qt::Checked); + QVERIFY(verify()); + // barring disable request case EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); EXPECT(PSetCallBarringWrapper::disableBarring) .with(ServiceGroupVoice, - PSetCallBarringWrapper::BarringTypeAllOutgoing, QString("1234")); + PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword); EXPECT(CpPhoneNotes::showGlobalProgressNote); + emit simulateCheckStateChange(Qt::Unchecked); + QVERIFY(verify()); + +// cancel pressed while querying barring password + EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setPasswordParamsCancel)); + EXPECT(CpItemDataHelper::removeConnection); + EXPECT(CpItemDataHelper::addConnection); + EXPECT(PSetCallBarringWrapper::disableBarring).times(0); + EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0); + + emit simulateCheckStateChange(Qt::Unchecked); + + QVERIFY(verify()); + // barring item not found case EXPECT(PSetCallBarringWrapper::enableBarring).times(0); EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0); + emit simulateCheckStateChange(Qt::Checked); QVERIFY(verify()); } + +/*! + UT_CpBarringPluginGroup::t_changeBarringPasswordRequested + */ +void UT_CpBarringPluginGroup::t_changeBarringPasswordRequested() +{ + connect( + this, SIGNAL(simulateEditPasswordButtonClicked(bool)), + m_barringpluginGroup, SLOT(changeBarringPasswordRequested(bool))); + + // cancel from current password query + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setPasswordParamsCancel)); + emit simulateEditPasswordButtonClicked(false); + QVERIFY(verify()); + + // cancel from new password query + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setPasswordParamsCancel)); + emit simulateEditPasswordButtonClicked(false); + QVERIFY(verify()); + + // cancel from verify new password query + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setNewAndVerifiedPasswordParams)); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setPasswordParamsCancel)); + emit simulateEditPasswordButtonClicked(false); + QVERIFY(verify()); + + // all data successfully queried + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setCurrentPasswordParams)); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setNewAndVerifiedPasswordParams)); + EXPECT(CpPhoneNotes::showPasswordQueryDialog) + .willOnce(invoke(setNewAndVerifiedPasswordParams)); + EXPECT(PSetCallBarringWrapper::changeBarringPassword) + .with(KCurrentPassword, KNewAndVerifiedPassword, KNewAndVerifiedPassword); + emit simulateEditPasswordButtonClicked(false); + QVERIFY(verify()); +} + QTEST_MAIN_S60(UT_CpBarringPluginGroup) diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h Mon May 03 12:31:11 2010 +0300 @@ -33,21 +33,35 @@ UT_CpBarringPluginGroup(); ~UT_CpBarringPluginGroup(); - + private slots: void init(); void cleanup(); void t_memleak(); + void t_translatorInstallationOk(); + void t_translatorInstallationFails(); + void t_itemShownNotBarringItem(); + void t_itemShownBarringStatusRequestOngoing(); + void t_barringStatusRequestCompletedForUpdateInquiry(); void t_barringStatusRequestCompletedWithAnError(); void t_getBarringStatuses(); void t_enableBarringRequestCompleted(); + void t_enableBarringRequestCompletedUnknownBarring(); + void t_enableBAOCRequestCompletedStatusUpdate(); + void t_enableBOICRequestCompletedStatusUpdate(); + void t_enableBOICexHCRequestCompletedStatusUpdate(); + void t_enableBAICRequestCompletedStatusUpdate(); + void t_enableBICRoamRequestCompletedStatusUpdate(); void t_disableBarringRequestCompleted(); + void t_barringPasswordChangeRequestCompleted(); void t_changeBarringStateRequested(); + void t_changeBarringPasswordRequested(); signals: void simulateCheckStateChange(int checkState); + void simulateEditPasswordButtonClicked(bool checked); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.pro --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.pro Mon May 03 12:31:11 2010 +0300 @@ -71,3 +71,4 @@ SOURCES += ../../../tsrc/mocks/mock_cpplugincommon.cpp SOURCES += ../../../tsrc/mocks/mock_cpitemdatahelper.cpp SOURCES += ../../../tsrc/mocks/mock_hbcheckbox.cpp +SOURCES += ../../../tsrc/mocks/mock_qtranslator.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def --- a/phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def Mon May 03 12:31:11 2010 +0300 @@ -9,33 +9,33 @@ ?getStaticMetaObject@Tools@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & Tools::getStaticMetaObject(void) ??1CpSettingsWrapper@@UAE@XZ @ 9 NONAME ; CpSettingsWrapper::~CpSettingsWrapper(void) ?qt_metacast@CpPhoneNotes@@UAEPAXPBD@Z @ 10 NONAME ; void * CpPhoneNotes::qt_metacast(char const *) - ?tr@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *, int) - ?instance@CpPhoneNotes@@SAPAV1@XZ @ 12 NONAME ; class CpPhoneNotes * CpPhoneNotes::instance(void) - ?tr@CpSettingsWrapper@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *, int) - ??1CpPhoneNotes@@EAE@XZ @ 14 NONAME ; CpPhoneNotes::~CpPhoneNotes(void) - ?formatPhoneNumber@CpPhoneNotes@@ABE?AVQString@@V2@@Z @ 15 NONAME ; class QString CpPhoneNotes::formatPhoneNumber(class QString) const - ?showGlobalNote@CpPhoneNotes@@QAEXAAHABVQString@@W4MessageBoxType@HbMessageBox@@@Z @ 16 NONAME ; void CpPhoneNotes::showGlobalNote(int &, class QString const &, enum HbMessageBox::MessageBoxType) - ?metaObject@Tools@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * Tools::metaObject(void) const - ?readSoftRejectText@CpSettingsWrapper@@QAEXAAVQString@@AA_N@Z @ 18 NONAME ; void CpSettingsWrapper::readSoftRejectText(class QString &, bool &) - ?getStaticMetaObject@CpSettingsWrapper@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & CpSettingsWrapper::getStaticMetaObject(void) - ?metaObject@CpSettingsWrapper@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * CpSettingsWrapper::metaObject(void) const - ?videoSupported@Tools@@SA_NXZ @ 21 NONAME ; bool Tools::videoSupported(void) - ?showCallDuration@CpSettingsWrapper@@QAE_NXZ @ 22 NONAME ; bool CpSettingsWrapper::showCallDuration(void) - ?isPhoneOffline@CpSettingsWrapper@@QBE_NXZ @ 23 NONAME ; bool CpSettingsWrapper::isPhoneOffline(void) const - ?errorCodeTextMapping@Tools@@SA_NHAAVQString@@@Z @ 24 NONAME ; bool Tools::errorCodeTextMapping(int, class QString &) - ?convertEtelMobileServiceCode@CpPhoneNotes@@ABE?AW4BasicServiceGroups@CpTelephonyUtils@@H@Z @ 25 NONAME ; enum CpTelephonyUtils::BasicServiceGroups CpPhoneNotes::convertEtelMobileServiceCode(int) const - ?trUtf8@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString CpPhoneNotes::trUtf8(char const *, char const *, int) - ?readCenrepString@CpSettingsWrapper@@ABE?AVQString@@JK@Z @ 27 NONAME ; class QString CpSettingsWrapper::readCenrepString(long, unsigned long) const - ?writeSoftRejectText@CpSettingsWrapper@@QAEHABVQString@@_N@Z @ 28 NONAME ; int CpSettingsWrapper::writeSoftRejectText(class QString const &, bool) - ?showBasicServiceList@CpPhoneNotes@@QAEXABVQString@@ABV?$QList@E@@@Z @ 29 NONAME ; void CpPhoneNotes::showBasicServiceList(class QString const &, class QList const &) - ?setShowCallDuration@CpSettingsWrapper@@QAEH_N@Z @ 30 NONAME ; int CpSettingsWrapper::setShowCallDuration(bool) - ?qt_metacall@CpPhoneNotes@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 31 NONAME ; int CpPhoneNotes::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@Tools@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 32 NONAME ; int Tools::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@CpPhoneNotes@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *) - ?getStaticMetaObject@CpPhoneNotes@@SAABUQMetaObject@@XZ @ 34 NONAME ; struct QMetaObject const & CpPhoneNotes::getStaticMetaObject(void) - ?convertEtelMobileServiceCode@Tools@@SA?AW4BasicServiceGroups@CpTelephonyUtils@@H@Z @ 35 NONAME ; enum CpTelephonyUtils::BasicServiceGroups Tools::convertEtelMobileServiceCode(int) - ?trUtf8@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString CpSettingsWrapper::trUtf8(char const *, char const *) - ??_ECpSettingsWrapper@@UAE@I@Z @ 37 NONAME ; CpSettingsWrapper::~CpSettingsWrapper(unsigned int) + ?passwordTextChanged@CpPhoneNotes@@AAEXXZ @ 11 NONAME ; void CpPhoneNotes::passwordTextChanged(void) + ?tr@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *, int) + ?instance@CpPhoneNotes@@SAPAV1@XZ @ 13 NONAME ; class CpPhoneNotes * CpPhoneNotes::instance(void) + ?tr@CpSettingsWrapper@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *, int) + ??1CpPhoneNotes@@EAE@XZ @ 15 NONAME ; CpPhoneNotes::~CpPhoneNotes(void) + ?formatPhoneNumber@CpPhoneNotes@@ABE?AVQString@@V2@@Z @ 16 NONAME ; class QString CpPhoneNotes::formatPhoneNumber(class QString) const + ?showGlobalNote@CpPhoneNotes@@QAEXAAHABVQString@@W4MessageBoxType@HbMessageBox@@@Z @ 17 NONAME ; void CpPhoneNotes::showGlobalNote(int &, class QString const &, enum HbMessageBox::MessageBoxType) + ?metaObject@Tools@@UBEPBUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const * Tools::metaObject(void) const + ?readSoftRejectText@CpSettingsWrapper@@QAEXAAVQString@@AA_N@Z @ 19 NONAME ; void CpSettingsWrapper::readSoftRejectText(class QString &, bool &) + ?getStaticMetaObject@CpSettingsWrapper@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & CpSettingsWrapper::getStaticMetaObject(void) + ?showPasswordQueryDialog@CpPhoneNotes@@QAEXABVQString@@ABVQValidator@@HAAV2@AA_N@Z @ 21 NONAME ; void CpPhoneNotes::showPasswordQueryDialog(class QString const &, class QValidator const &, int, class QString &, bool &) + ?metaObject@CpSettingsWrapper@@UBEPBUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const * CpSettingsWrapper::metaObject(void) const + ?videoSupported@Tools@@SA_NXZ @ 23 NONAME ; bool Tools::videoSupported(void) + ?showCallDuration@CpSettingsWrapper@@QAE_NXZ @ 24 NONAME ; bool CpSettingsWrapper::showCallDuration(void) + ?isPhoneOffline@CpSettingsWrapper@@QBE_NXZ @ 25 NONAME ; bool CpSettingsWrapper::isPhoneOffline(void) const + ?errorCodeTextMapping@Tools@@SA_NHAAVQString@@@Z @ 26 NONAME ; bool Tools::errorCodeTextMapping(int, class QString &) + ?trUtf8@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 27 NONAME ; class QString CpPhoneNotes::trUtf8(char const *, char const *, int) + ?readCenrepString@CpSettingsWrapper@@ABE?AVQString@@JK@Z @ 28 NONAME ; class QString CpSettingsWrapper::readCenrepString(long, unsigned long) const + ?writeSoftRejectText@CpSettingsWrapper@@QAEHABVQString@@_N@Z @ 29 NONAME ; int CpSettingsWrapper::writeSoftRejectText(class QString const &, bool) + ?showBasicServiceList@CpPhoneNotes@@QAEXABVQString@@ABV?$QList@E@@@Z @ 30 NONAME ; void CpPhoneNotes::showBasicServiceList(class QString const &, class QList const &) + ?setShowCallDuration@CpSettingsWrapper@@QAEH_N@Z @ 31 NONAME ; int CpSettingsWrapper::setShowCallDuration(bool) + ?qt_metacall@CpPhoneNotes@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 32 NONAME ; int CpPhoneNotes::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@Tools@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 33 NONAME ; int Tools::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 34 NONAME ; class QString CpSettingsWrapper::trUtf8(char const *, char const *) + ?tr@CpPhoneNotes@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *) + ??_ECpSettingsWrapper@@UAE@I@Z @ 36 NONAME ; CpSettingsWrapper::~CpSettingsWrapper(unsigned int) + ?getStaticMetaObject@CpPhoneNotes@@SAABUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const & CpPhoneNotes::getStaticMetaObject(void) ?progressNoteCanceled@CpPhoneNotes@@IAEXXZ @ 38 NONAME ; void CpPhoneNotes::progressNoteCanceled(void) ?trUtf8@CpSettingsWrapper@@SA?AVQString@@PBD0H@Z @ 39 NONAME ; class QString CpSettingsWrapper::trUtf8(char const *, char const *, int) ?staticMetaObject@CpPhoneNotes@@2UQMetaObject@@B @ 40 NONAME ; struct QMetaObject const CpPhoneNotes::staticMetaObject @@ -58,8 +58,7 @@ ?isFeatureCallWaitingDistiquishNotProvisionedEnabled@CpSettingsWrapper@@QAE_NXZ @ 57 NONAME ; bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled(void) ?writeCenrepValue@CpSettingsWrapper@@ABEHJKABVQVariant@@@Z @ 58 NONAME ; int CpSettingsWrapper::writeCenrepValue(long, unsigned long, class QVariant const &) const ?staticMetaObject@Tools@@2UQMetaObject@@B @ 59 NONAME ; struct QMetaObject const Tools::staticMetaObject - ?showBasicServiceCallDivertList@CpPhoneNotes@@QAEXABVQString@@ABV?$QList@PAVPSCallDivertingStatus@@@@AAHW4CallDivertType@CpTelephonyUtils@@AAW445@@Z @ 60 NONAME ; void CpPhoneNotes::showBasicServiceCallDivertList(class QString const &, class QList const &, int &, enum CpTelephonyUtils::CallDivertType, enum CpTelephonyUtils::CallDivertType &) - ?trUtf8@Tools@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString Tools::trUtf8(char const *, char const *) - ?staticMetaObject@CpSettingsWrapper@@2UQMetaObject@@B @ 62 NONAME ; struct QMetaObject const CpSettingsWrapper::staticMetaObject - ??0CpSettingsWrapper@@QAE@PAVQObject@@@Z @ 63 NONAME ; CpSettingsWrapper::CpSettingsWrapper(class QObject *) + ?trUtf8@Tools@@SA?AVQString@@PBD0@Z @ 60 NONAME ; class QString Tools::trUtf8(char const *, char const *) + ?staticMetaObject@CpSettingsWrapper@@2UQMetaObject@@B @ 61 NONAME ; struct QMetaObject const CpSettingsWrapper::staticMetaObject + ??0CpSettingsWrapper@@QAE@PAVQObject@@@Z @ 62 NONAME ; CpSettingsWrapper::CpSettingsWrapper(class QObject *) diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -457,18 +457,13 @@ if (m_callWaitingDistinguishEnabled && status == PSetCallWaitingWrapper::StatusNotProvisioned) { emit showGlobalNote(m_activeNoteId, - hbTrId("cw not provisioned"), HbMessageBox::MessageTypeInformation); + hbTrId("txt_phone_info_request_not_completed"), HbMessageBox::MessageTypeInformation); } else if (status != PSetCallWaitingWrapper::StatusActive) { emit showGlobalNote(m_activeNoteId, - hbTrId("cw disabled"), HbMessageBox::MessageTypeInformation); + hbTrId("txt_phone_info_call_waiting_deactivated"), HbMessageBox::MessageTypeInformation); } else { - if (basicServiceGroupIds.count() != 0) { - emit showBasicServiceList( - hbTrId("Active for:"), basicServiceGroupIds); - } else { - emit showGlobalNote(m_activeNoteId, - hbTrId("cw active"), HbMessageBox::MessageTypeInformation); - } + emit showGlobalNote(m_activeNoteId, + hbTrId("txt_phone_info_call_waiting_activated"), HbMessageBox::MessageTypeInformation); } DPRINT << ": OUT"; @@ -485,23 +480,23 @@ emit cancelNote(m_activeNoteId); if (result) { emit showGlobalNote(m_activeNoteId, - hbTrId("Request failed"), + hbTrId("txt_phone_info_request_not_confirmed"), HbMessageBox::MessageTypeWarning); } else { switch (command){ case PSetCallWaitingWrapper::ActivateCallWaiting: emit showGlobalNote(m_activeNoteId, - hbTrId("Call waiting activated"), + hbTrId("txt_phone_info_call_waiting_activated"), HbMessageBox::MessageTypeInformation); break; case PSetCallWaitingWrapper::DeactivateCallWaiting: emit showGlobalNote(m_activeNoteId, - hbTrId("Call waiting disabled"), + hbTrId("txt_phone_info_call_waiting_deactivated"), HbMessageBox::MessageTypeInformation); break; default: emit showGlobalNote(m_activeNoteId, - hbTrId("default"), + hbTrId("txt_phone_info_result_unknown"), HbMessageBox::MessageTypeInformation); break; } @@ -519,7 +514,7 @@ Q_ASSERT(!(ongoing && interrupted)); if (ongoing) { - emit showGlobalProgressNote(m_activeNoteId, hbTrId("Requesting")); + emit showGlobalProgressNote(m_activeNoteId, hbTrId("txt_phone_info_requesting")); } if (interrupted) { diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/callsplugin/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe -dtextshell -- +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe -dtextshell -- + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -252,13 +252,6 @@ EXPECT(CpPhoneNotes::showGlobalNote); m_callspluginGroup->handleCallWaitingGetStatus( PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds); - - EXPECT(CpPhoneNotes::cancelNote); - EXPECT(CpPhoneNotes::showBasicServiceList); - basicServiceGroupIds << 0; - m_callspluginGroup->handleCallWaitingGetStatus( - PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds); - QVERIFY(verify()); } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pri --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pri Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pri Mon May 03 12:31:11 2010 +0300 @@ -15,10 +15,14 @@ # # Input -HEADERS += src/cpnetworkplugin.h \ +HEADERS += src/cellulardatasettings.h \ + src/cellulardatasettings_s60_p.h \ + src/cpnetworkplugin.h \ src/cpnetworkpluginview.h \ src/cpnetworkpluginform.h -SOURCES += src/cpnetworkplugin.cpp \ +SOURCES += src/cellulardatasettings.cpp \ + src/cellulardatasettings_s60.cpp \ + src/cpnetworkplugin.cpp \ src/cpnetworkpluginview.cpp \ src/cpnetworkpluginform.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pro Mon May 03 12:31:11 2010 +0300 @@ -17,7 +17,7 @@ TEMPLATE = lib TARGET = cpnetworkplugin CONFIG += hb plugin -INCLUDEPATH += ../cptelephonyutils/inc +INCLUDEPATH += ../cptelephonyutils/inc MOC_DIR = moc OBJECTS_DIR = obj @@ -29,6 +29,8 @@ -lpsetwrapper \ -lcptelephonyutils +symbian*::LIBS += -lcmmanager + include(../cpplugincommon.pri) include (cpnetworkplugin.pri) diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,113 @@ +/* +* 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: +*/ + +// System includes + +// User includes + +#include "cellulardatasettings.h" +#include "cellulardatasettings_s60_p.h" +#include "cppluginlogging.h" + +/*! + \class CellularDataSettings + \brief Class for maintaining and updating the Cellular Data Settings. + +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ + +CellularDataSettings::CellularDataSettings() : + QObject(), + d_ptr(new CellularDataSettingsPrivate(this)) +{ + DPRINT; +} + +/*! + Destructor. +*/ + +CellularDataSettings::~CellularDataSettings() +{ + DPRINT << ": IN"; + + delete d_ptr; + + DPRINT << ": OUT"; +} + +/*! + Getter for setting "Cellular data usage in home network". +*/ + +int CellularDataSettings::dataUseHome() +{ + DPRINT; + + return d_ptr->dataUseHome(); +} + +/*! + Setter for setting "Cellular data usage in home network". +*/ + +void CellularDataSettings::setDataUseHome(int value) +{ + DPRINT << ": IN"; + + // The value must be valid + Q_ASSERT(value <= DataUsageHomeWlanOnly); + d_ptr->setDataUseHome(value); + + DPRINT << ": OUT"; +} + +/*! + Getter for setting "Cellular data usage when roaming". +*/ + +int CellularDataSettings::dataUseRoam() +{ + DPRINT; + + return d_ptr->dataUseRoam(); +} + +/*! + Getter for setting "Cellular data usage when roaming". +*/ + +void CellularDataSettings::setDataUseRoam(int value) +{ + DPRINT << ": IN"; + + // The value must be valid + Q_ASSERT(value <= DataUsageAbroadWlanOnly); + d_ptr->setDataUseRoam(value); + + DPRINT << ": OUT"; +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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 CELLULARDATASETTINGS_H +#define CELLULARDATASETTINGS_H + +// System includes + +#include + +// User includes + +// Forward declarations + +class CellularDataSettingsPrivate; + +// External data types + +// Constants + +// Class declaration + +class CellularDataSettings : public QObject +{ + Q_OBJECT + +public: + + // Data types + + // Setting values for "Data usage in home network" + enum DataUsageHome { + DataUsageHomeAutomatic = 0, // These values must match the indexes in dropdown menu + DataUsageHomeConfirm, + DataUsageHomeWlanOnly + }; + + // Setting values for "Data usage when roaming" + enum DataUsageAbroad { + DataUsageAbroadAutomatic = 0, // These values must match the indexes in dropdown menu + DataUsageAbroadConfirm, + DataUsageAbroadWlanOnly + }; + + explicit CellularDataSettings(); + virtual ~CellularDataSettings(); + + int dataUseHome(); + void setDataUseHome(int value); + + int dataUseRoam(); + void setDataUseRoam(int value); + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CellularDataSettings) + +private slots: + +private: // data + + // Friend classes + + // Private implementation + CellularDataSettingsPrivate *d_ptr; +}; + +#endif // CELLULARDATASETTINGS_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,221 @@ +/* +* 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: +*/ + +// System includes + +#include "cmmanager.h" + +// User includes + +#include "cellulardatasettings.h" +#include "cellulardatasettings_s60_p.h" +#include "cppluginlogging.h" + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ + +CellularDataSettingsPrivate::CellularDataSettingsPrivate(CellularDataSettings *q_pointer) : + q_ptr(q_pointer) +{ + DPRINT; +} + +/*! + Destructor. +*/ + +CellularDataSettingsPrivate::~CellularDataSettingsPrivate() +{ + DPRINT; +} + +/*! + Getter for setting "Cellular data usage in home network". +*/ + +int CellularDataSettingsPrivate::dataUseHome() +{ + DPRINT << ": IN"; + + int result = 0; + + // Read the setting + TCmGenConnSettings settings; + readSettings(&settings); + + // Map the settings read result + switch (settings.iCellularDataUsageHome) { + case ECmCellularDataUsageAutomatic: + result = CellularDataSettings::DataUsageHomeAutomatic; + break; + + case ECmCellularDataUsageConfirm: + result = CellularDataSettings::DataUsageHomeConfirm; + break; + + case ECmCellularDataUsageDisabled: + result = CellularDataSettings::DataUsageHomeWlanOnly; + break; + } + + DPRINT << ": OUT"; + + return result; +} + +/*! + Setter for setting "Cellular data usage in home network". +*/ + +void CellularDataSettingsPrivate::setDataUseHome(int value) +{ + DPRINT << ": IN"; + + TCmGenConnSettings settings; + + readSettings(&settings); + switch (value) { + case CellularDataSettings::DataUsageHomeAutomatic: + settings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; + break; + + case CellularDataSettings::DataUsageHomeConfirm: + settings.iCellularDataUsageHome = ECmCellularDataUsageConfirm; + break; + + case CellularDataSettings::DataUsageHomeWlanOnly: + settings.iCellularDataUsageHome = ECmCellularDataUsageDisabled; + break; + } + writeSettings(&settings); + + DPRINT << ": OUT"; +} + +/*! + Getter for setting "Cellular data usage when roaming". +*/ + +int CellularDataSettingsPrivate::dataUseRoam() +{ + DPRINT << ": IN"; + + int result = 0; + + // Read the setting + TCmGenConnSettings settings; + readSettings(&settings); + + // Map the settings read result + switch (settings.iCellularDataUsageVisitor) { + case ECmCellularDataUsageAutomatic: + result = CellularDataSettings::DataUsageAbroadAutomatic; + break; + + case ECmCellularDataUsageConfirm: + result = CellularDataSettings::DataUsageAbroadConfirm; + break; + + case ECmCellularDataUsageDisabled: + result = CellularDataSettings::DataUsageAbroadWlanOnly; + break; + } + + DPRINT << ": OUT"; + + return result; +} + +/*! + Getter for setting "Cellular data usage when roaming". +*/ + +void CellularDataSettingsPrivate::setDataUseRoam(int value) +{ + DPRINT << ": IN"; + + TCmGenConnSettings settings; + + readSettings(&settings); + switch (value) { + case CellularDataSettings::DataUsageAbroadAutomatic: + settings.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic; + break; + + case CellularDataSettings::DataUsageAbroadConfirm: + settings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; + break; + + case CellularDataSettings::DataUsageAbroadWlanOnly: + settings.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled; + break; + } + writeSettings(&settings); + + DPRINT << ": OUT"; +} + +/*! + Cellular data settings reading from CM Manager. +*/ + +void CellularDataSettingsPrivate::readSettings(TCmGenConnSettings *settings) +{ + DPRINT << ": IN"; + + QT_TRAP_THROWING( + RCmManager CmManager; + CmManager.CreateTablesAndOpenL(); + CleanupClosePushL(CmManager); + CmManager.ReadGenConnSettingsL(*settings); + CleanupStack::PopAndDestroy(1)); + + DPRINT << ": Read: iCellularDataUsageHome= " << settings->iCellularDataUsageHome; + DPRINT << ": Read: iCellularDataUsageVisitor= " << settings->iCellularDataUsageVisitor; + + DPRINT << ": OUT"; + +} + +/*! + Cellular data settings writing to CM Manager. +*/ + +void CellularDataSettingsPrivate::writeSettings(TCmGenConnSettings *settings) +{ + DPRINT << ": IN"; + + DPRINT << ": Write: iCellularDataUsageHome= " << settings->iCellularDataUsageHome; + DPRINT << ": Write: iCellularDataUsageVisitor=" << settings->iCellularDataUsageVisitor; + + QT_TRAP_THROWING( + RCmManager CmManager; + CmManager.CreateTablesAndOpenL(); + CleanupClosePushL(CmManager); + CmManager.WriteGenConnSettingsL(*settings); + CleanupStack::PopAndDestroy(1);); + + DPRINT << ": OUT"; +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60_p.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,78 @@ +/* +* 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 CELLULARDATASETTINGS_S60_P_H +#define CELLULARDATASETTINGS_S60_P_H + +// System includes + +// User includes + +// Forward declarations + +class CellularDataSettings; +class TCmGenConnSettings; + +// External data types + +// Constants + +// Class declaration + +class CellularDataSettingsPrivate +{ + +public: + + // Data types + + explicit CellularDataSettingsPrivate(CellularDataSettings *q_pointer); + virtual ~CellularDataSettingsPrivate(); + + int dataUseHome(); + void setDataUseHome(int value); + + int dataUseRoam(); + void setDataUseRoam(int value); + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CellularDataSettingsPrivate) + + void readSettings(TCmGenConnSettings *settings); + + void writeSettings(TCmGenConnSettings *settings); + +private slots: + +private: // data + + // Friend classes + + // Public implementation pointer + CellularDataSettings *q_ptr; +}; + +#endif // CELLULARDATASETTINGS_S60_P_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -48,8 +48,8 @@ QList ret; ret.append(new CpSettingFormEntryItemDataImpl( itemDataHelper, - hbTrId("Mobile network"), - hbTrId("Mobile network settings"))); + hbTrId("txt_cp_dblist_mobile_network"), + hbTrId(""))); return ret; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp Mon May 03 12:31:11 2010 +0300 @@ -30,6 +30,7 @@ #include "cpplugincommon.h" #include "cppluginlogging.h" #include "cpphonenotes.h" +#include "cellulardatasettings.h" /*! CpNetworkPluginForm::CpNetworkPluginForm @@ -39,14 +40,16 @@ m_activeNoteId(0), m_activeProgressNoteId(0), m_pSetWrapper(NULL), - m_cpSettingsWrapper(NULL) + m_cpSettingsWrapper(NULL), + mCellularSettings() { DPRINT << ": IN"; - setHeading(hbTrId("Mobile network")); + setHeading(hbTrId("txt_cp_subhead_mobile_network")); QScopedPointer pSetWrapperGuard(new PSetWrapper); m_psetNetworkWrapper = &pSetWrapperGuard->networkWrapper(); + mCellularSettings = QSharedPointer(new CellularDataSettings); connectToNetworkWrapper(*m_psetNetworkWrapper); connectToPhoneNotes(*CpPhoneNotes::instance()); @@ -57,6 +60,10 @@ model->appendDataFormItem(createNetworkModeItem()); // #2 Use phone settings for operator selection model->appendDataFormItem(createOperatorSelectionItem()); + // Home network cellular data usage + model->appendDataFormItem(createHomeDataUsageItem()); + // Cellular network data usage when roaming + model->appendDataFormItem(createRoamDataUsageItem()); setModel(model.take()); m_pSetWrapper = pSetWrapperGuard.take(); m_cpSettingsWrapper = cpSettingsWrapperGuard.take(); @@ -89,12 +96,14 @@ m_NetworkModeOptionsItemData = new CpSettingFormItemData( HbDataFormModelItem::ComboBoxItem, - hbTrId("Network mode"), + hbTrId("txt_cp_setlabel_network_mode"), NULL ); QScopedPointer settingFormItemGuard( m_NetworkModeOptionsItemData); - mNetworkModeOptions << hbTrId("Dual mode") << hbTrId("UMTS") << hbTrId("GSM"); + mNetworkModeOptions << hbTrId("txt_cp_setlabel_network_mode_val_dual_mode") + << hbTrId("txt_cp_setlabel_network_mode_val_umts") + << hbTrId("txt_cp_setlabel_network_mode_val_gsm"); m_NetworkModeOptionsItemData->setContentWidgetData( "items", QVariant(mNetworkModeOptions)); @@ -133,7 +142,7 @@ m_NetworkOperatorSelectionItemData = new CpSettingFormItemData( HbDataFormModelItem::ToggleValueItem, - hbTrId("Operator selection"), + hbTrId("txt_cp_setlabel_operator_selection"), NULL); QScopedPointer settingFormItemGuard( m_NetworkOperatorSelectionItemData); @@ -145,11 +154,11 @@ switch (mode) { case PSetNetworkWrapper::SelectionModeAutomatic: m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Automatic"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); break; case PSetNetworkWrapper::SelectionModeManual: m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Manual"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); break; default: break; @@ -166,6 +175,108 @@ } /*! + CpNetworkPluginForm::createHomeDataUsageItem + */ +HbDataFormModelItem *CpNetworkPluginForm::createHomeDataUsageItem() +{ + DPRINT << ": IN"; + + mCellularUseHomeSelectionItemData = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_cp_setlabel_data_usage_in_home_network"), + NULL); + QScopedPointer settingFormItemGuard( + mCellularUseHomeSelectionItemData); + + // Populate the dropdown with selection items + mCellularUseHomeOptions + << hbTrId("txt_cp_setlabel_data_usage_in_val_automatic") + << hbTrId("txt_cp_setlabel_data_usage_in_val_confirm") + << hbTrId("txt_cp_setlabel_data_usage_in_val_disabled"); + mCellularUseHomeSelectionItemData->setContentWidgetData( + "items", + QVariant(mCellularUseHomeOptions)); + + // Set initial selection based on current setting + mCellularUseHomeSelectionItemData->setContentWidgetData( + "currentIndex", + mCellularSettings->dataUseHome()); // NOTE: Indexes must match! + + addConnection( + mCellularUseHomeSelectionItemData, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(cellularDataUseHomeStateChanged(int))); + + settingFormItemGuard.take(); + DPRINT << ": OUT"; + return mCellularUseHomeSelectionItemData; +} + +/*! + CpNetworkPluginForm::cellularDataUseHomeStateChanged + */ +void CpNetworkPluginForm::cellularDataUseHomeStateChanged(int index) +{ + DPRINT << ": IN : index: " << index; + + mCellularSettings->setDataUseHome(index); + + DPRINT << ": OUT"; +} + +/*! + CpNetworkPluginForm::createRoamDataUsageItem + */ +HbDataFormModelItem *CpNetworkPluginForm::createRoamDataUsageItem() +{ + DPRINT << ": IN"; + + mCellularUseRoamSelectionItemData = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_cp_setlabel_data_usage_when_roaming"), + NULL); + QScopedPointer settingFormItemGuard( + mCellularUseRoamSelectionItemData); + + // Populate the dropdown with selection items + mCellularUseRoamOptions + << hbTrId("txt_cp_setlabel_data_usage_when_val_automatic") + << hbTrId("txt_cp_setlabel_data_usage_when_val_confirm") + << hbTrId("txt_cp_setlabel_data_usage_when_val_disabled"); + mCellularUseRoamSelectionItemData->setContentWidgetData( + "items", + QVariant(mCellularUseRoamOptions)); + + // Set initial selection based on current setting + mCellularUseRoamSelectionItemData->setContentWidgetData( + "currentIndex", + mCellularSettings->dataUseRoam()); // NOTE: Indexes must match! + + addConnection( + mCellularUseRoamSelectionItemData, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(cellularDataUseRoamStateChanged(int))); + + settingFormItemGuard.take(); + DPRINT << ": OUT"; + return mCellularUseRoamSelectionItemData; +} + +/*! + CpNetworkPluginForm::cellularDataUseRoamStateChanged + */ +void CpNetworkPluginForm::cellularDataUseRoamStateChanged(int index) +{ + DPRINT << ": IN : index: " << index; + + mCellularSettings->setDataUseRoam(index); + + DPRINT << ": OUT"; +} + +/*! CpNetworkPluginForm::networkModeStateChanged */ void CpNetworkPluginForm::networkModeStateChanged(int index) @@ -174,7 +285,7 @@ DPRINT << ": IN : index: " << index; if(isPhoneOnLine()) { - if(index == 0){ + if(index == 0) { dualModeSelection(); } else if(index == 1) { umtsSelection(); @@ -208,12 +319,12 @@ case PSetNetworkWrapper::SelectionModeAutomatic: manualOperatorSelection(); m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Manual"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); break; case PSetNetworkWrapper::SelectionModeManual: automaticOperatorSelection(); m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Automatic"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); break; default: break; @@ -391,16 +502,16 @@ QString text; switch(error) { case PSetNetworkWrapper::ErrCauseCallActive: - text = hbTrId("Call in progress"); + text = hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo"); break; case PSetNetworkWrapper::ErrNoNetworkService: - text = hbTrId("No network found"); + text = hbTrId("txt_cp_info_no_operators_found"); break; case PSetNetworkWrapper::ErrOfflineOpNotAllowed: - text = hbTrId("Off-line, not alloowed"); + text = hbTrId("Off-line, not allowed"); break; case PSetNetworkWrapper::ErrNoNetworkAccess: - text = hbTrId("No access"); + text = hbTrId("txt_cp_info_no_access_to_selected_operators_netwo"); break; default: break; @@ -452,7 +563,7 @@ QObject::connect( CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), this, SLOT(userCancel())); - emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("Searching...")); + emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("txt_cp_info_updating")); } else { QObject::disconnect( CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), @@ -524,7 +635,7 @@ { DPRINT << ": IN"; - HbDialog *dialog = createDialog(hbTrId("Available networks")); + HbDialog *dialog = createDialog(hbTrId("txt_cp_title_select_operator")); HbListWidget *list = new HbListWidget(dialog); //then insert found networks int itemsCount = m_networkInfoList->count(); @@ -540,7 +651,7 @@ list, SIGNAL(activated(HbListWidgetItem*)), dialog, SLOT(close())); // Sets the "Cancel"-action/button - HbAction *cancelAction = new HbAction(hbTrId("Cancel")); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); dialog->setPrimaryAction(cancelAction); dialog->setContentWidget(list); // Launch popup and handle the response @@ -594,11 +705,11 @@ switch (mode) { case PSetNetworkWrapper::SelectionModeAutomatic: m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Automatic"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); break; case PSetNetworkWrapper::SelectionModeManual: m_NetworkOperatorSelectionItemData->setContentWidgetData( - "text", QVariant(hbTrId("Manual"))); + "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); break; default: break; @@ -720,4 +831,17 @@ return onLine; } +/*! + CpNetworkPluginForm::SearchAvailableNetworks + */ +void CpNetworkPluginForm::SearchAvailableNetworks() +{ + DPRINT << ": IN"; + + m_psetNetworkWrapper->cancelRequest(); + manualOperatorSelection(); + + DPRINT << ": OUT"; +} + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h Mon May 03 12:31:11 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -30,6 +31,7 @@ class PSetNetworkWrapper; class CpSettingFormItemData; class CpPhoneNotes; +class CellularDataSettings; class CpNetworkPluginForm : public HbDataForm { @@ -41,6 +43,8 @@ virtual ~CpNetworkPluginForm(); + void SearchAvailableNetworks(); + signals: void showGlobalProgressNote(int ¬eId, const QString& text); @@ -50,6 +54,8 @@ public slots: + void cellularDataUseHomeStateChanged(int index); + void cellularDataUseRoamStateChanged(int index); void networkModeStateChanged(int index); void operatorSelectionStateChanged(bool index); void networkAccessModeGot(int mode); @@ -68,6 +74,8 @@ private: HbDataFormModelItem *createNetworkModeItem(); HbDataFormModelItem *createOperatorSelectionItem(); + HbDataFormModelItem *createHomeDataUsageItem(); + HbDataFormModelItem *createRoamDataUsageItem(); void automaticOperatorSelection(); void manualOperatorSelection(); @@ -94,16 +102,21 @@ QStringList mNetworkModeOptions; QStringList mOperatorSelectionOptions; + QStringList mCellularUseHomeOptions; + QStringList mCellularUseRoamOptions; int m_activeNoteId; int m_activeProgressNoteId; // Own PSetWrapper *m_pSetWrapper; CpSettingsWrapper *m_cpSettingsWrapper; + QSharedPointer mCellularSettings; // Not own PSetNetworkWrapper *m_psetNetworkWrapper; CpSettingFormItemData *m_NetworkModeOptionsItemData; CpSettingFormItemData *m_NetworkOperatorSelectionItemData; + CpSettingFormItemData *mCellularUseHomeSelectionItemData; + CpSettingFormItemData *mCellularUseRoamSelectionItemData; QList *m_networkInfoList; }; diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp Mon May 03 12:31:11 2010 +0300 @@ -60,4 +60,16 @@ DPRINT << ": OUT"; } +/*! + CpNetworkPluginView::SearchAvailableNetworks + */ +void CpNetworkPluginView::SearchAvailableNetworks() +{ + DPRINT << ": IN"; + + m_networkSettingsForm->SearchAvailableNetworks(); + + DPRINT << ": OUT"; +} + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.h Mon May 03 12:31:11 2010 +0300 @@ -31,6 +31,10 @@ explicit CpNetworkPluginView(QGraphicsItem *parent = 0); virtual ~CpNetworkPluginView(); + +public slots: + + void SearchAvailableNetworks(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/qtestmains60.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/qtestmains60.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef QTESTMAINS60 +#define QTESTMAINS60 + +#define QTEST_MAIN_S60(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ +char *new_argv[3]; \ +QCoreApplication app(argc, argv); \ +\ +QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ +QByteArray bytes = str.toAscii(); \ +\ +char arg1[] = "-o"; \ +\ +new_argv[0] = argv[0]; \ +new_argv[1] = arg1; \ +new_argv[2] = bytes.data(); \ +\ +TestObject tc; \ +return QTest::qExec(&tc, 3, new_argv); \ +} + +#endif \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "ut_cellulardatasettings.h" +#include "qtestmains60.h" +#include "cmmanager.h" +#define private public +#include "cellulardatasettings.h" + +TCmGenConnSettings g_settings; + +void fillSettings(TCmGenConnSettings& aGenConnSettings) +{ + aGenConnSettings = g_settings; +} + +/*! + UT_CellularDataSettings::UT_CellularDataSettings + */ +UT_CellularDataSettings::UT_CellularDataSettings() + : m_cellularDataSettings(NULL) +{ + +} + + +/*! + UT_CellularDataSettings::~UT_CellularDataSettings + */ +UT_CellularDataSettings::~UT_CellularDataSettings() +{ + delete m_cellularDataSettings; +} + + +/*! + UT_CellularDataSettings::init + */ +void UT_CellularDataSettings::init() +{ + initialize(); + m_cellularDataSettings = new CellularDataSettings; +} + + +/*! + UT_CellularDataSettings::cleanup + */ +void UT_CellularDataSettings::cleanup() +{ + reset(); + + delete m_cellularDataSettings; + m_cellularDataSettings = NULL; +} + +/*! + UT_CellularDataSettings::t_memleak + */ +void UT_CellularDataSettings::t_memleak() +{ + +} + +/*! + UT_CellularDataSettings::t_dataUseHome + */ +void UT_CellularDataSettings::t_dataUseHome() +{ + g_settings.iCellularDataUsageVisitor = TCmCellularDataUsage(-1); + g_settings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageHomeAutomatic == m_cellularDataSettings->dataUseHome()); + QVERIFY(verify()); + + g_settings.iCellularDataUsageHome = ECmCellularDataUsageConfirm; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageHomeConfirm == m_cellularDataSettings->dataUseHome()); + QVERIFY(verify()); + + g_settings.iCellularDataUsageHome = ECmCellularDataUsageDisabled; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageHomeWlanOnly == m_cellularDataSettings->dataUseHome()); + QVERIFY(verify()); +} + + +/*! + UT_CellularDataSettings::t_setDataUseHome + */ +void UT_CellularDataSettings::t_setDataUseHome() +{ + TCmGenConnSettings res; + res.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeAutomatic); + QVERIFY(verify()); + + res.iCellularDataUsageHome = ECmCellularDataUsageConfirm; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeConfirm); + QVERIFY(verify()); + + res.iCellularDataUsageHome = ECmCellularDataUsageDisabled; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeWlanOnly); + QVERIFY(verify()); +} + +/*! + UT_CellularDataSettings::t_dataUseRoam + */ +void UT_CellularDataSettings::t_dataUseRoam() +{ + g_settings.iCellularDataUsageHome = TCmCellularDataUsage(-1); + g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageAbroadAutomatic == m_cellularDataSettings->dataUseRoam()); + QVERIFY(verify()); + + g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageAbroadConfirm == m_cellularDataSettings->dataUseRoam()); + QVERIFY(verify()); + + g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings)); + expect("RCmManager::Close"); + QVERIFY(CellularDataSettings::DataUsageAbroadWlanOnly == m_cellularDataSettings->dataUseRoam()); + QVERIFY(verify()); +} + +/*! + UT_CellularDataSettings::t_setDataUseRoam + */ +void UT_CellularDataSettings::t_setDataUseRoam() +{ + TCmGenConnSettings res; + res.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadAutomatic); + QVERIFY(verify()); + + res.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadConfirm); + QVERIFY(verify()); + + res.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled; + expect("RCmManager::CreateTablesAndOpenL"); + expect("RCmManager::WriteGenConnSettingsL").with(res); + expect("RCmManager::Close"); + m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadWlanOnly); + QVERIFY(verify()); +} + +QTEST_MAIN_S60(UT_CellularDataSettings) diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_CELLULARDATASETTINGS_H +#define UT_CELLULARDATASETTINGS_H + +#include +#include + +class CellularDataSettings; + +class UT_CellularDataSettings : public QObject, MockService +{ + Q_OBJECT + +public: + UT_CellularDataSettings(); + ~UT_CellularDataSettings(); + +private slots: + + void init(); + + void t_memleak(); + void t_dataUseHome(); + void t_setDataUseHome(); + void t_dataUseRoam(); + void t_setDataUseRoam(); + void cleanup(); + +private: + CellularDataSettings *m_cellularDataSettings; + +}; + +#endif // UT_CELLULARDATASETTINGS_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,49 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +CONFIG += qtestlib hb +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../src/ +INCLUDEPATH += . +INCLUDEPATH +=../../../inc +INCLUDEPATH +=../../../cptelephonyutils/inc + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += /epoc32/include/mw/QtTest \ + /epoc32/include/platform/mw \ + /epoc32/include/mw/qt + LIBS += -lmocklib \ + -lsymbianmock +} + +# test code +HEADERS += ut_cellulardatasettings.h +SOURCES += ut_cellulardatasettings.cpp + +# code to be tested +HEADERS += ../../src/cellulardatasettings.h + +SOURCES += ../../src/cellulardatasettings.cpp +SOURCES += ../../src/cellulardatasettings_s60.cpp + +# mocks needed for testing +SOURCES += ../../../tsrc/mocks/mock_cmmanager.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro Mon May 03 12:31:11 2010 +0300 @@ -49,3 +49,4 @@ # mocks needed for testing SOURCES += ../../../tsrc/mocks/mock_cpnetworkpluginview.cpp +SOURCES += ../../../tsrc/mocks/mock_hbicon.cpp diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/qtestmains60.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/qtestmains60.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef QTESTMAINS60 -#define QTESTMAINS60 - -#define QTEST_MAIN_S60(TestObject) \ -int main(int argc, char *argv[]) \ -{ \ -char *new_argv[3]; \ -QCoreApplication app(argc, argv); \ -\ -QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ -QByteArray bytes = str.toAscii(); \ -\ -char arg1[] = "-o"; \ -\ -new_argv[0] = argv[0]; \ -new_argv[1] = arg1; \ -new_argv[2] = bytes.data(); \ -\ -TestObject tc; \ -return QTest::qExec(&tc, 3, new_argv); \ -} - -#endif \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro Mon May 03 12:31:11 2010 +0300 @@ -47,6 +47,7 @@ # code to be tested HEADERS += ../../src/cpnetworkplugin.h \ ../../src/cpnetworkpluginform.h \ + ../../src/cellulardatasettings.h \ ../../../cptelephonyutils/inc/cpplugincommon.h \ ../../../cptelephonyutils/inc/cpphonenotes.h \ /epoc32/include/platform/mw/psetwrapper.h \ @@ -55,7 +56,7 @@ /epoc32/include/platform/mw/psetcalldivertingwrapper.h \ /epoc32/include/platform/mw/psetnetworkwrapper.h -SOURCES += ../../src/cpnetworkpluginform.cpp +SOURCES += ../../src/cpnetworkpluginform.cpp # mocks needed for testing SOURCES += ../../../tsrc/mocks/mock_cpnetworkplugin.cpp \ @@ -75,5 +76,6 @@ ../../../tsrc/mocks/mock_hbaction.cpp \ ../../../tsrc/mocks/mock_qaction.cpp \ ../../../tsrc/mocks/mock_qobject.cpp \ - ../../../tsrc/mocks/mock_hblistwidgetitem.cpp + ../../../tsrc/mocks/mock_hblistwidgetitem.cpp \ + ../../../tsrc/mocks/mock_cellulardatasettings.cpp \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60.h Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef QTESTMAINS60 -#define QTESTMAINS60 - -#define QTEST_MAIN_S60(TestObject) \ -int main(int argc, char *argv[]) \ -{ \ -char *new_argv[3]; \ -QCoreApplication app(argc, argv); \ -\ -QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ -QByteArray bytes = str.toAscii(); \ -\ -char arg1[] = "-o"; \ -\ -new_argv[0] = argv[0]; \ -new_argv[1] = arg1; \ -new_argv[2] = bytes.data(); \ -\ -TestObject tc; \ -return QTest::qExec(&tc, 3, new_argv); \ -} - -#endif \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60ui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60ui.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef QTESTMAINS60 +#define QTESTMAINS60 + +#include +#include + +char *new_argv[3]; +HbMainWindow *mainWindow; +#define QTEST_MAIN_S60UI(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ +HbApplication *app = new HbApplication(argc, argv); \ +QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ +QByteArray bytes = str.toAscii(); \ +\ +char arg1[] = "-o"; \ +\ +new_argv[0] = argv[0]; \ +new_argv[1] = arg1; \ +new_argv[2] = bytes.data(); \ +\ +TestObject tc; \ +QResource::registerResource("../hbcore.rcc"); \ +mainWindow = new HbMainWindow;\ +mainWindow->show(); \ +int ret = QTest::qExec(&tc, 3, new_argv); \ +delete mainWindow; \ +delete app; \ +return ret; \ +} + +#endif diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.cpp Mon May 03 12:31:11 2010 +0300 @@ -16,7 +16,7 @@ */ #include "ut_cpnetworkpluginview.h" -#include "qtestmains60.h" +#include "qtestmains60ui.h" #define private public #include "cpnetworkpluginview.h" @@ -68,4 +68,4 @@ } -QTEST_MAIN_S60(ut_cpnetworkpluginview) +QTEST_MAIN_S60UI(ut_cpnetworkpluginview) diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.pro Mon May 03 12:31:11 2010 +0300 @@ -26,7 +26,7 @@ QT += testlib symbian: { - CONFIG += no_icon + #CONFIG += no_icon INCLUDEPATH += /epoc32/include/mw/QtTest \ /epoc32/include/platform/mw \ /epoc32/include/mw/qt diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h Mon May 03 12:31:11 2010 +0300 @@ -25,6 +25,8 @@ #include "cptelephonyutilsdefs.h" class CpSettingsWrapper; +class HbInputDialog; +class QValidator; using namespace CpTelephonyUtils; @@ -91,24 +93,6 @@ const QList &basicServiceGroupIds); /** - Shows the basic service list associated with the call divert status check. - @param title Heading for the service list. - @param divertStatuses Divert status information to show. - @param selectionIndex User selected item on divert statuses list. - @param divertType Divert type specifying what kind of - divert details user is able to request on divert service group. - @param divertDetailType On return contains info about what kind - of call divert detail user wants to know about selected divert service - group. - */ - void showBasicServiceCallDivertList( - const QString &title, - const QList &divertStatuses, - int &selectionIndex, - CallDivertType divertType, - CallDivertType &divertDetailType); - - /** Shows detailed call divert information about the selected divert service group. @param divertStatus Divert status information. @@ -117,6 +101,24 @@ const PSCallDivertingStatus &divertStatus); /** + Shows password query dialog with OK & Cancel buttons and returns user + given password unless user has canceled query. Only valid password is + accepted. + @param title Title for the query dialog. + @param validator Password validator. + @param maxPasswordLength Maximum length for the password. + @param password On return contains user given password. + @param ok True if the user pressed OK, false if the user + pressed Cancel. + */ + void showPasswordQueryDialog( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok); + + /** Cancels specified note. @param noteId Note identifier. */ @@ -127,18 +129,6 @@ */ bool noteShowing(); -private slots: - - /** - Handler method for notes' about to close signal. - */ - void activeNoteAboutToClose(); - - /** - Handler method for notes' canceled signal. - */ - void handleProgressNoteCanceled(); - private: /** @@ -149,12 +139,6 @@ QString basicServiceGroupName(BasicServiceGroups basicServiceGroupId) const; /** - Converts etel mobile service code into basic service group enumeration. - @param serviceCode Etel mobilde service code. - */ - BasicServiceGroups convertEtelMobileServiceCode(int serviceCode) const; - - /** Formats phone number according to locale specific rules. @param number Unformatted phone number. @return Formatted number. @@ -166,6 +150,24 @@ note currently. */ void launchNextNoteIfReady(); + +private slots: + + /** + Handler method for notes' about to close signal. + */ + void activeNoteAboutToClose(); + + /** + Handler method for notes' canceled signal. + */ + void handleProgressNoteCanceled(); + + /** + Used for dynamic enable/disable of password dialog's OK button according + to validity of the currently inputted password. + */ + void passwordTextChanged(); private: // Data: @@ -183,6 +185,15 @@ Indicates whether note controller is busy with some note showing. */ bool m_isNoteShowingOngoing; + + /** + Password query dialog. Not own. + */ + HbInputDialog *m_passwordDialog; + /** + Password validator. Not own. + */ + const QValidator *m_passwordValidator; }; #endif // CPPHONENOTES_H diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h Mon May 03 12:31:11 2010 +0300 @@ -45,11 +45,6 @@ static bool videoSupported(); /*! - Service code conversion - */ - static BasicServiceGroups convertEtelMobileServiceCode(int serviceCode); - - /*! Error code text conversion */ static bool errorCodeTextMapping(const int errorcode, QString &errorText); diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include +#include /*! CpPhoneNotes::instance. @@ -48,10 +52,12 @@ CpPhoneNotes::CpPhoneNotes(): QObject(NULL), m_notesQueue(NULL), - m_isNoteShowingOngoing(false) + m_isNoteShowingOngoing(false), + m_passwordDialog(NULL), + m_passwordValidator(NULL) { DPRINT << ": IN"; - + m_notesQueue = new QQueue(); m_cpSettingsWrapper = new CpSettingsWrapper; @@ -167,7 +173,7 @@ serviceListPopup->setContentWidget(serviceList.take()); HbAction *backAction = - new HbAction(hbTrId("Back"), serviceListPopup.data()); + new HbAction(hbTrId("txt_common_button_back"), serviceListPopup.data()); serviceListPopup->setPrimaryAction(backAction); serviceListPopup->exec(); @@ -175,85 +181,6 @@ } /*! - CpPhoneNotes::showBasicServiceCallDivertList. - */ -void CpPhoneNotes::showBasicServiceCallDivertList( - const QString &title, - const QList &divertStatuses, - int &selectionIndex, - CallDivertType divertType, - CallDivertType &divertDetailType) -{ - DPRINT << ": IN"; - - Q_ASSERT(title != ""); - Q_ASSERT(0 < divertStatuses.size()); - - HbDialog *serviceListPopup = new HbDialog(); - serviceListPopup->setDismissPolicy(HbDialog::NoDismiss); - serviceListPopup->setTimeout(HbPopup::NoTimeout); - - HbLabel *heading = new HbLabel(title, serviceListPopup); - heading->setAlignment(Qt::AlignLeft | Qt::AlignTop); - serviceListPopup->setHeadingWidget(heading); - - HbListView *serviceList = new HbListView(serviceListPopup); - QStandardItemModel *serviceListModel = new QStandardItemModel(serviceList); - for (int i = 0; i < divertStatuses.size(); i++) { - PSCallDivertingStatus *divertStatus = divertStatuses.at(i); - QString groupName = - basicServiceGroupName( - convertEtelMobileServiceCode(divertStatus->iServiceGroup) ); - QStandardItem *listItem = new QStandardItem(groupName); - serviceListModel->appendRow(listItem); - } - serviceList->setModel(serviceListModel); - serviceList->setSelectionMode(HbAbstractItemView::SingleSelection); - if (0 != serviceListModel->rowCount()) { - QModelIndex firstItem = serviceList->nextIndex(QModelIndex()); - serviceList->setCurrentIndex(firstItem, QItemSelectionModel::Select); - } - serviceListPopup->setContentWidget(serviceList); - - HbAction *backAction = new HbAction(hbTrId("Back"), serviceListPopup); - HbAction *numberQueryAction = new HbAction(hbTrId("Number"), serviceListPopup); - HbAction *detailsAction = new HbAction(hbTrId("Details"), serviceListPopup); - serviceListPopup->setSecondaryAction(backAction); - - switch (divertType) { - case NoCallDivert: - break; - case CallDivertWithNumber: - serviceListPopup->setPrimaryAction(numberQueryAction); - break; - case CallDivertWithNumberAndTimeout: - serviceListPopup->setPrimaryAction(detailsAction); - break; - default: - DPRINT << ", DEFAULT"; - Q_ASSERT(false); - break; - } - - HbAction *userAction = serviceListPopup->exec(); - if (userAction == numberQueryAction) { - divertDetailType = CallDivertWithNumber; - } else if (userAction == detailsAction) { - divertDetailType = CallDivertWithNumberAndTimeout; - } else if (userAction == backAction) { - divertDetailType = NoCallDivert; - } else { - DPRINT << ", WEIRD ACTION"; - Q_ASSERT(false); - } - - selectionIndex = serviceList->currentIndex().row(); - delete serviceListPopup; - - DPRINT << ": OUT"; -} - -/*! CpPhoneNotes::cancelNote. */ void CpPhoneNotes::cancelNote(int noteId) @@ -297,30 +224,6 @@ } /*! - CpPhoneNotes::activeNoteAboutToClose. - */ -void CpPhoneNotes::activeNoteAboutToClose() -{ - DPRINT << ": IN"; - - if (m_isNoteShowingOngoing) { - m_isNoteShowingOngoing = false; - QObject* note(NULL); - if (!m_notesQueue->isEmpty()) { - note = m_notesQueue->dequeue(); - } - if(note) { - launchNextNoteIfReady(); - note->disconnect(this); - DPRINT << ", delete note: " << reinterpret_cast(note); - note->deleteLater(); - } - } - - DPRINT << ": OUT"; -} - -/*! CpPhoneNotes::basicServiceGroupName. Resolves basic service group name by group identifier. */ @@ -392,15 +295,6 @@ } /*! - CpPhoneNotes::convertEtelMobileServiceCode. -*/ -BasicServiceGroups CpPhoneNotes::convertEtelMobileServiceCode(int serviceCode) const -{ - DPRINT << "serviceCode: " << serviceCode; - return Tools::convertEtelMobileServiceCode(serviceCode); -} - -/*! CpPhoneNotes::showGlobalErrorNote. */ void CpPhoneNotes::showGlobalErrorNote(int ¬eId, int errorcode) @@ -439,15 +333,15 @@ // TODO: Orbit layout support is insufficient currently and all text // is not shown. QString content = ""; - content.append(hbTrId("To number: ")); + content.append(hbTrId("txt_phone_info_number")); content.append(formatPhoneNumber(divertStatus.iNumber)); if (0 < divertStatus.iTimeout) { - content.append(hbTrId(" Delay time: ")); + content.append(hbTrId("txt_phone_setlabel_delay")); content.append(QString::number(divertStatus.iTimeout)); content.append(hbTrId(" seconds")); } divertInfo->setText(content); - HbAction *backAction = new HbAction(hbTrId("Back"), divertInfo); + HbAction *backAction = new HbAction(hbTrId("txt_common_button_back"), divertInfo); divertInfo->setPrimaryAction(backAction); divertInfo->exec(); delete divertInfo; @@ -456,6 +350,55 @@ } /*! + CpPhoneNotes::showPasswordQueryDialog. + */ +void CpPhoneNotes::showPasswordQueryDialog( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok) +{ + DPRINT << ": IN"; + + QScopedPointer passwordDialog(new HbInputDialog()); + + // configure editor so that only digits can be inputted + passwordDialog->setPromptText(title); + passwordDialog->setEchoMode(HbLineEdit::Password); + passwordDialog->setInputMethodHints(Qt::ImhDigitsOnly); + HbLineEdit *hbLineEdit = passwordDialog->lineEdit(); + hbLineEdit->setMaxLength(maxPasswordLength); + HbEditorInterface editorInterface(hbLineEdit); + editorInterface.setInputMode(HbInputModeNumeric); + editorInterface.setConstraints(HbEditorConstraintFixedInputMode); + editorInterface.setFilter(HbDigitsOnlyFilter::instance()); + + m_passwordDialog = passwordDialog.data(); + m_passwordValidator = &validator; + passwordDialog->primaryAction()->setEnabled(false); + connect( + hbLineEdit, SIGNAL(contentsChanged()), + this, SLOT(passwordTextChanged())); + + HbAction* action = passwordDialog->exec(); + if (action == passwordDialog->secondaryAction()) { + ok = false; + } else { + ok = true; + password = passwordDialog->value().toString(); + } + + m_passwordDialog = NULL; + m_passwordValidator = NULL; + disconnect( + hbLineEdit, SIGNAL(contentsChanged()), + this, SLOT(passwordTextChanged())); + + DPRINT << ": OUT"; +} + +/*! CpPhoneNotes::formatPhoneNumber. Formats phone number according to locale specific rules. */ @@ -511,6 +454,29 @@ DPRINT << ": OUT"; } +/*! + CpPhoneNotes::activeNoteAboutToClose. + */ +void CpPhoneNotes::activeNoteAboutToClose() +{ + DPRINT << ": IN"; + + if (m_isNoteShowingOngoing) { + m_isNoteShowingOngoing = false; + QObject* note(NULL); + if (!m_notesQueue->isEmpty()) { + note = m_notesQueue->dequeue(); + } + if(note) { + launchNextNoteIfReady(); + note->disconnect(this); + DPRINT << ", delete note: " << reinterpret_cast(note); + note->deleteLater(); + } + } + + DPRINT << ": OUT"; +} /*! CpPhoneNotes::handleProgressNoteCanceled(). @@ -524,4 +490,23 @@ DPRINT << ": OUT"; } +/*! + CpPhoneNotes::passwordTextChanged(). + */ +void CpPhoneNotes::passwordTextChanged() +{ + DPRINT << ": IN"; + Q_ASSERT(m_passwordDialog && m_passwordValidator); + + HbLineEdit *hbLineEdit = m_passwordDialog->lineEdit(); + int position = 0; + QString password = hbLineEdit->text(); + bool isPasswordValid = + (QValidator::Acceptable == m_passwordValidator->validate( + password, position)); + m_passwordDialog->primaryAction()->setEnabled(isPasswordValid); + + DPRINT << ": OUT"; +} + // End of File. diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp Mon May 03 12:31:11 2010 +0300 @@ -57,121 +57,6 @@ } /*! - Tools::convertEtelMobileServiceCode -*/ -BasicServiceGroups Tools::convertEtelMobileServiceCode(int serviceCode) -{ - DPRINT; - - switch (serviceCode) { - case RMobilePhone::EAllServices: - return AllTeleAndBearer; - case RMobilePhone::EAllTele: - return AllTele; - case RMobilePhone::EVoiceService: - case RMobilePhone::ETelephony: - return Telephony; - case RMobilePhone::EAllDataTele: - return AllDataTele; - case RMobilePhone::EFaxService: - return Fax; - case RMobilePhone::EShortMessageService: - return Sms; - case RMobilePhone::EAllDataExSms: - return AllDataExSms; - case RMobilePhone::EAllTeleExcSms: - return AllTeleExcSms; - case RMobilePhone::EAllPlmnTele: - return AllPlmnTele; - case RMobilePhone::EPlmnTele1: - return PlmnTele1; - case RMobilePhone::EPlmnTele2: - return PlmnTele2; - case RMobilePhone::EPlmnTele3: - return PlmnTele3; - case RMobilePhone::EPlmnTele4: - return PlmnTele4; - case RMobilePhone::EPlmnTele5: - return PlmnTele5; - case RMobilePhone::EPlmnTele6: - return PlmnTele6; - case RMobilePhone::EPlmnTele7: - return PlmnTele7; - case RMobilePhone::EPlmnTele8: - return PlmnTele8; - case RMobilePhone::EPlmnTele9: - return PlmnTele9; - case RMobilePhone::EPlmnTeleA: - return PlmnTeleA; - case RMobilePhone::EPlmnTeleB: - return PlmnTeleB; - case RMobilePhone::EPlmnTeleC: - return PlmnTeleC; - case RMobilePhone::EPlmnTeleD: - return PlmnTeleD; - case RMobilePhone::EPlmnTeleE: - return PlmnTeleE; - case RMobilePhone::EPlmnTeleF: - return PlmnTeleF; - case RMobilePhone::EAllBearer: - return AllBearer; - case RMobilePhone::EAllAsync: - return AllAsync; - case RMobilePhone::EAllSync: - return AllSync; - case RMobilePhone::ECircuitDataService: - case RMobilePhone::ESyncData: - return SyncData; - case RMobilePhone::EPacketDataService: - case RMobilePhone::EAsyncData: - return AsyncData; - case RMobilePhone::EPacketData: - return PacketData; - case RMobilePhone::EPadAccess: - return PadAccess; - case RMobilePhone::EAllPlmnBearer: - return AllPlmnBearer; - case RMobilePhone::EPlmnBearerServ1: - return PlmnBearerServ1; - case RMobilePhone::EPlmnBearerServ2: - return PlmnBearerServ2; - case RMobilePhone::EPlmnBearerServ3: - return PlmnBearerServ3; - case RMobilePhone::EPlmnBearerServ4: - return PlmnBearerServ4; - case RMobilePhone::EPlmnBearerServ5: - return PlmnBearerServ5; - case RMobilePhone::EPlmnBearerServ6: - return PlmnBearerServ6; - case RMobilePhone::EPlmnBearerServ7: - return PlmnBearerServ7; - case RMobilePhone::EPlmnBearerServ8: - return PlmnBearerServ8; - case RMobilePhone::EPlmnBearerServ9: - return PlmnBearerServ9; - case RMobilePhone::EPlmnBearerServA: - return PlmnBearerServA; - case RMobilePhone::EPlmnBearerServB: - return PlmnBearerServB; - case RMobilePhone::EPlmnBearerServC: - return PlmnBearerServC; - case RMobilePhone::EPlmnBearerServD: - return PlmnBearerServD; - case RMobilePhone::EPlmnBearerServE: - return PlmnBearerServE; - case RMobilePhone::EPlmnBearerServF: - return PlmnBearerServF; - case RMobilePhone::EAuxVoiceService: - case RMobilePhone::EAltTele: - return AltTele; - case RMobilePhone::EServiceUnspecified: - default: - qDebug() << "CpPhoneNotes::convertEtelMobileServiceCode, DEFAULT"; - return Unknown; - } -} - -/*! Tools::errorCodeTextMapping. */ bool Tools::errorCodeTextMapping(const int errorcode, QString &errorText) @@ -182,7 +67,7 @@ switch(errorcode){ case KErrGsmSSSubscriptionViolation: - errorText = hbTrId("Barring operation not successful. Contact your service provider"); + errorText = hbTrId("txt_phone_info_barring_operation_not_successful"); break; case KErrGsmSSUnknownSubscriber: case KErrGsmSSAbsentSubscriber: @@ -191,24 +76,24 @@ case KErrGsmSSIllegalEquipment: case KErrGsmSSCallBarred: case KErrGsmSSDataMissing: - errorText = hbTrId("Not allowed"); + errorText = hbTrId("txt_phone_info_not_allowed"); break; case KErrGsmSSIncompatibility: errorText = hbTrId("Services in conflict"); break; case KErrGsmSSSystemFailure: - errorText = hbTrId("Result unknown"); + errorText = hbTrId("txt_phone_info_result_unknown"); break; case KErrGsmSSUnexpectedDataValue: case KErrGsmSSResourcesUnavailable: - errorText = hbTrId("Request rejected"); + errorText = hbTrId("txt_phone_info_request_rejected"); break; case KErrGsmSSNegativePasswordCheck: case KErrGsmSSPasswordRegistrationFailure: errorText = hbTrId("Password error"); break; case KErrGsmSSPasswordAttemptsViolation: - errorText = hbTrId("Password blocked"); + errorText = hbTrId("txt_phone_info_barring_password_blocked"); break; case KErrGsmSMSNoNetworkService: case KErrGsmNoService: @@ -233,14 +118,14 @@ errorText = hbTrId("Operation not possible in Off-line mode"); } } else { - errorText = hbTrId("Not done"); + errorText = hbTrId("txt_phone_info_request_not_completed"); } break; case KErrGsmSSUnknownAlphabet: - errorText = hbTrId("Invalid phone number"); + errorText = hbTrId("txt_phone_info_invalid_phone_number"); break; default: - errorText = hbTrId("Not done"); + errorText = hbTrId("txt_phone_info_request_not_completed"); break; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -32,7 +32,7 @@ :: starting with "ut_". :::::::::::::::::::::::::::::::::::::::::::::::::::::: :DEFAULT -set TESTED_SRC=..\..\src\* +set TESTED_SRC=..\..\src\*.cpp for /f %%a in ('dir /b ut_*') do call :build %%a if [%DOMODULESTESTS%] EQU [TRUE] ( @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 @@ -106,136 +106,6 @@ } /*! - UT_CpPhoneNotes::appendAllEtelServices - */ -void UT_CpPhoneNotes::appendAllEtelServices(QList& list) -{ - /** The call service has not been specified. */ - appendService(list, RMobilePhone::EServiceUnspecified); - /** The API request applies to voice call services. */ - appendService(list, RMobilePhone::EVoiceService); - /** The API request applies to auxiliary voice call services. */ - appendService(list, RMobilePhone::EAuxVoiceService); - /** The API request applies to circuit switched data call services. */ - appendService(list, RMobilePhone::ECircuitDataService); - /** The API request applies to packet data services. */ - appendService(list, RMobilePhone::EPacketDataService); - /** The API request applies to fax call services. */ - appendService(list, RMobilePhone::EFaxService); - /** The API request applies to short message services. */ - appendService(list, RMobilePhone::EShortMessageService); - /** The API request applies to all mobile services. */ - appendService(list, RMobilePhone::EAllServices); - /** All teleservices */ - appendService(list, RMobilePhone::EAllTele); - /** Telephony */ - appendService(list, RMobilePhone::ETelephony); - /** All data teleservices */ - appendService(list, RMobilePhone::EAllDataTele); - /** Voice Broadcast Service (VBS) Bearer Service */ - appendService(list, RMobilePhone::EAllDataExSms); - /** All teleservices except SMS */ - appendService(list, RMobilePhone::EAllTeleExcSms); - /** All PLMN specific teleservices */ - appendService(list, RMobilePhone::EAllPlmnTele); - /** PLMN specific teleservice 1 */ - appendService(list, RMobilePhone::EPlmnTele1); - /** PLMN specific teleservice 2 */ - appendService(list, RMobilePhone::EPlmnTele2); - /** PLMN specific teleservice 3 */ - appendService(list, RMobilePhone::EPlmnTele3); - /** PLMN specific teleservice 4 */ - appendService(list, RMobilePhone::EPlmnTele4); - /** PLMN specific teleservice 5 */ - appendService(list, RMobilePhone::EPlmnTele5); - /** PLMN specific teleservice 6 */ - appendService(list, RMobilePhone::EPlmnTele6); - /** PLMN specific teleservice 7 */ - appendService(list, RMobilePhone::EPlmnTele7); - /** PLMN specific teleservice 8 */ - appendService(list, RMobilePhone::EPlmnTele8); - /** PLMN specific teleservice 9 */ - appendService(list, RMobilePhone::EPlmnTele9); - /** PLMN specific teleservice 10 */ - appendService(list, RMobilePhone::EPlmnTeleA); - /** PLMN specific teleservice 11 */ - appendService(list, RMobilePhone::EPlmnTeleB); - /** PLMN specific teleservice 12 */ - appendService(list, RMobilePhone::EPlmnTeleC); - /** PLMN specific teleservice 13 */ - appendService(list, RMobilePhone::EPlmnTeleD); - /** PLMN specific teleservice 14 */ - appendService(list, RMobilePhone::EPlmnTeleE); - /** PLMN specific teleservice 15 */ - appendService(list, RMobilePhone::EPlmnTeleF); - /** All bearer services */ - appendService(list, RMobilePhone::EAllBearer); - /** All async services */ - appendService(list, RMobilePhone::EAllAsync); - /** All sync services */ - appendService(list, RMobilePhone::EAllSync); - /** All data circuit sync */ - appendService(list, RMobilePhone::ESyncData); - /** All data circuit async */ - appendService(list, RMobilePhone::EAsyncData); - /** All packet data services */ - appendService(list, RMobilePhone::EPacketData); - /** All pad access services */ - appendService(list, RMobilePhone::EPadAccess); - /** All PLMN specific bearer services */ - appendService(list, RMobilePhone::EAllPlmnBearer); - /** PLMN specific bearer service 1 */ - appendService(list, RMobilePhone::EPlmnBearerServ1); - /** PLMN specific bearer service 2 */ - appendService(list, RMobilePhone::EPlmnBearerServ2); - /** PLMN specific bearer service 3 */ - appendService(list, RMobilePhone::EPlmnBearerServ3); - /** PLMN specific bearer service 4 */ - appendService(list, RMobilePhone::EPlmnBearerServ4); - /** PLMN specific bearer service 5 */ - appendService(list, RMobilePhone::EPlmnBearerServ5); - /** PLMN specific bearer service 6 */ - appendService(list, RMobilePhone::EPlmnBearerServ6); - /** PLMN specific bearer service 7 */ - appendService(list, RMobilePhone::EPlmnBearerServ7); - /** PLMN specific bearer service 8 */ - appendService(list, RMobilePhone::EPlmnBearerServ8); - /** PLMN specific bearer service 9 */ - appendService(list, RMobilePhone::EPlmnBearerServ9); - /** PLMN specific bearer service 10 */ - appendService(list, RMobilePhone::EPlmnBearerServA); - /** PLMN specific bearer service 11 */ - appendService(list, RMobilePhone::EPlmnBearerServB); - /** PLMN specific bearer service 12 */ - appendService(list, RMobilePhone::EPlmnBearerServC); - /** PLMN specific bearer service 13 */ - appendService(list, RMobilePhone::EPlmnBearerServD); - /** PLMN specific bearer service 14 */ - appendService(list, RMobilePhone::EPlmnBearerServE); - /** PLMN specific bearer service 15 */ - appendService(list, RMobilePhone::EPlmnBearerServF); - /** Alternative tele services */ - appendService(list, RMobilePhone::EAltTele); - /** Voice Group Call Service (VGCS) */ - appendService(list, RMobilePhone::EVoiceGroupCall); - /** Voice Broadcast Service (VBS) */ - appendService(list, RMobilePhone::EVoiceBroadcast); - /** All GPRS Bearer Services */ - appendService(list, RMobilePhone::EAllGprsBearer); -} - -/*! - UT_CpPhoneNotes::appendService - */ -void UT_CpPhoneNotes::appendService( - QList& list, RMobilePhone::TMobileService service ) -{ - PSCallDivertingStatus* item = new PSCallDivertingStatus; - item->iServiceGroup = service; - list.append(item); -} - -/*! UT_CpPhoneNotes::init */ void UT_CpPhoneNotes::init() @@ -323,158 +193,6 @@ } /*! - UT_CpPhoneNotes::t_showBasicServiceCallDivertList - */ -void UT_CpPhoneNotes::t_showBasicServiceCallDivertList() -{ - QList statusList; - int selection = 0; - CallDivertType divertType = NoCallDivert; - CallDivertType divertDetailType = NoCallDivert; - CpPhoneNotes::instance()->showBasicServiceCallDivertList( - "title", statusList, selection, divertType, divertDetailType ); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllServices).returns(AllTeleAndBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllTele).returns(AllTele); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceService).returns(Telephony); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ETelephony).returns(Telephony); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllDataTele).returns(AllDataTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EFaxService).returns(Fax); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EShortMessageService).returns(Sms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllDataExSms).returns(AllDataExSms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllTeleExcSms).returns(AllTeleExcSms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllPlmnTele).returns(AllPlmnTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele1).returns(PlmnTele1); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele2).returns(PlmnTele2); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele3).returns(PlmnTele3); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele4).returns(PlmnTele4); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele5).returns(PlmnTele5); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele6).returns(PlmnTele6); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele7).returns(PlmnTele7); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele8).returns(PlmnTele8); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele9).returns(PlmnTele9); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleA).returns(PlmnTeleA); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleB).returns(PlmnTeleB); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleC).returns(PlmnTeleC); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleD).returns(PlmnTeleD); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleE).returns(PlmnTeleE); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleF).returns(PlmnTeleF); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllBearer).returns(AllBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllAsync).returns(AllAsync); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllSync).returns(AllSync); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ECircuitDataService).returns(SyncData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ESyncData).returns(SyncData); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPacketDataService).returns(AsyncData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAsyncData).returns(AsyncData); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPacketData).returns(PacketData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPadAccess).returns(PadAccess); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllPlmnBearer).returns(AllPlmnBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ1).returns(PlmnBearerServ1); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ2).returns(PlmnBearerServ2); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ3).returns(PlmnBearerServ3); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ4).returns(PlmnBearerServ4); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ5).returns(PlmnBearerServ5); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ6).returns(PlmnBearerServ6); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ7).returns(PlmnBearerServ7); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ8).returns(PlmnBearerServ8); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ9).returns(PlmnBearerServ9); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServA).returns(PlmnBearerServA); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServB).returns(PlmnBearerServB); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServC).returns(PlmnBearerServC); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServD).returns(PlmnBearerServD); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServE).returns(PlmnBearerServE); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServF).returns(PlmnBearerServF); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAuxVoiceService).returns(AltTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAltTele).returns(AltTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EServiceUnspecified).returns(Unknown); - // ?? - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceGroupCall).returns(Unknown); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceBroadcast).returns(Unknown); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllGprsBearer).returns(Unknown); - - expect("Tools::videoSupported").returns(true); - appendAllEtelServices( statusList ); - divertType = CallDivertWithNumber; - CpPhoneNotes::instance()->showBasicServiceCallDivertList( - "title", statusList, selection, divertType, divertDetailType ); - QVERIFY( verify() ); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllServices).returns(AllTeleAndBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllTele).returns(AllTele); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceService).returns(Telephony); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ETelephony).returns(Telephony); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllDataTele).returns(AllDataTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EFaxService).returns(Fax); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EShortMessageService).returns(Sms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllDataExSms).returns(AllDataExSms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllTeleExcSms).returns(AllTeleExcSms); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllPlmnTele).returns(AllPlmnTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele1).returns(PlmnTele1); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele2).returns(PlmnTele2); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele3).returns(PlmnTele3); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele4).returns(PlmnTele4); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele5).returns(PlmnTele5); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele6).returns(PlmnTele6); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele7).returns(PlmnTele7); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele8).returns(PlmnTele8); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTele9).returns(PlmnTele9); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleA).returns(PlmnTeleA); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleB).returns(PlmnTeleB); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleC).returns(PlmnTeleC); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleD).returns(PlmnTeleD); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleE).returns(PlmnTeleE); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnTeleF).returns(PlmnTeleF); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllBearer).returns(AllBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllAsync).returns(AllAsync); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllSync).returns(AllSync); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ECircuitDataService).returns(SyncData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::ESyncData).returns(SyncData); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPacketDataService).returns(AsyncData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAsyncData).returns(AsyncData); - - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPacketData).returns(PacketData); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPadAccess).returns(PadAccess); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllPlmnBearer).returns(AllPlmnBearer); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ1).returns(PlmnBearerServ1); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ2).returns(PlmnBearerServ2); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ3).returns(PlmnBearerServ3); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ4).returns(PlmnBearerServ4); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ5).returns(PlmnBearerServ5); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ6).returns(PlmnBearerServ6); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ7).returns(PlmnBearerServ7); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ8).returns(PlmnBearerServ8); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServ9).returns(PlmnBearerServ9); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServA).returns(PlmnBearerServA); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServB).returns(PlmnBearerServB); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServC).returns(PlmnBearerServC); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServD).returns(PlmnBearerServD); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServE).returns(PlmnBearerServE); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EPlmnBearerServF).returns(PlmnBearerServF); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAuxVoiceService).returns(AltTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAltTele).returns(AltTele); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EServiceUnspecified).returns(Unknown); - // ?? - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceGroupCall).returns(Unknown); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EVoiceBroadcast).returns(Unknown); - expect("Tools::convertEtelMobileServiceCode").with(RMobilePhone::EAllGprsBearer).returns(Unknown); - - expect("Tools::videoSupported").returns(false); - divertType = CallDivertWithNumberAndTimeout; - CpPhoneNotes::instance()->showBasicServiceCallDivertList( - "title", statusList, selection, divertType, divertDetailType ); - QVERIFY( verify() ); -} - -/*! UT_CpPhoneNotes::t_showCallDivertDetails */ void UT_CpPhoneNotes::t_showCallDivertDetails() @@ -491,6 +209,22 @@ } /*! + UT_CpPhoneNotes::t_showPasswordQueryDialog + */ +void UT_CpPhoneNotes::t_showPasswordQueryDialog() +{ + QString queryTitle("Password query title"); + QString password = ""; + bool okPressed = false; + QRegExp regExpression("\\d{4}"); + QRegExpValidator validator(regExpression, this); + CpPhoneNotes::instance()->showPasswordQueryDialog( + queryTitle, validator, 5, password, okPressed); + +} + + +/*! UT_CpPhoneNotes::t_cancelNote */ void UT_CpPhoneNotes::t_cancelNote() diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.h Mon May 03 12:31:11 2010 +0300 @@ -58,8 +58,8 @@ void t_showGlobalNote(); void t_showGlobalErrorNote(); void t_showBasicServiceList(); - void t_showBasicServiceCallDivertList(); void t_showCallDivertDetails(); + void t_showPasswordQueryDialog(); void t_cancelNote(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp Mon May 03 12:31:11 2010 +0300 @@ -162,172 +162,45 @@ /*! UT_CpPluginCommon::t_memleak */ -void UT_CpPluginCommon::t_convertEtelMobileServiceCode() -{ - // - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllServices), AllTeleAndBearer); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllTele), AllTele); - - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EVoiceService), Telephony); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::ETelephony), Telephony); - - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllDataTele), AllDataTele); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EFaxService), Fax); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EShortMessageService), Sms); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllDataExSms), AllDataExSms); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllTeleExcSms), AllTeleExcSms); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllPlmnTele), AllPlmnTele); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele1), PlmnTele1); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele2), PlmnTele2); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele3), PlmnTele3); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele4), PlmnTele4); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele5), PlmnTele5); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele6), PlmnTele6); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele7), PlmnTele7); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele8), PlmnTele8); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTele9), PlmnTele9); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleA), PlmnTeleA); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleB), PlmnTeleB); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleC), PlmnTeleC); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleD), PlmnTeleD); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleE), PlmnTeleE); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnTeleF), PlmnTeleF); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllBearer), AllBearer); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllAsync), AllAsync); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllSync), AllSync); - - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::ECircuitDataService), SyncData); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::ESyncData), SyncData); - - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPacketDataService), AsyncData); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAsyncData), AsyncData); - - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPacketData), PacketData); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPadAccess), PadAccess); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllPlmnBearer), AllPlmnBearer); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ1), PlmnBearerServ1); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ2), PlmnBearerServ2); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ3), PlmnBearerServ3); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ4), PlmnBearerServ4); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ5), PlmnBearerServ5); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ6), PlmnBearerServ6); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ7), PlmnBearerServ7); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ8), PlmnBearerServ8); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServ9), PlmnBearerServ9); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServA), PlmnBearerServA); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServB), PlmnBearerServB); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServC), PlmnBearerServC); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServD), PlmnBearerServD); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServE), PlmnBearerServE); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EPlmnBearerServF), PlmnBearerServF); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAuxVoiceService), AltTele); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAltTele), AltTele); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EServiceUnspecified), Unknown); - // ?? - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EVoiceGroupCall), Unknown); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EVoiceBroadcast), Unknown); - QCOMPARE(Tools::convertEtelMobileServiceCode( - RMobilePhone::EAllGprsBearer), Unknown); - -} - -/*! - UT_CpPluginCommon::t_memleak - */ void UT_CpPluginCommon::t_errorCodeTextMapping() { QString text = ""; Tools::errorCodeTextMapping(KErrGsmSSSubscriptionViolation, text); QCOMPARE( text, QString( - "Barring operation not successful. Contact your service provider")); + "txt_phone_info_barring_operation_not_successful")); Tools::errorCodeTextMapping(KErrGsmSSUnknownSubscriber, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSAbsentSubscriber, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSIllegalOperation, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSIllegalSubscriber, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSIllegalEquipment, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSCallBarred, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSDataMissing, text); QCOMPARE( text, QString( - "Not allowed")); + "txt_phone_info_not_allowed")); Tools::errorCodeTextMapping(KErrGsmSSIncompatibility, text); QCOMPARE( text, QString( "Services in conflict")); Tools::errorCodeTextMapping(KErrGsmSSSystemFailure, text); QCOMPARE( text, QString( - "Result unknown")); + "txt_phone_info_result_unknown")); Tools::errorCodeTextMapping(KErrGsmSSUnexpectedDataValue, text); QCOMPARE( text, QString( - "Request rejected")); + "txt_phone_info_request_rejected")); Tools::errorCodeTextMapping(KErrGsmSSResourcesUnavailable, text); QCOMPARE( text, QString( - "Request rejected")); + "txt_phone_info_request_rejected")); Tools::errorCodeTextMapping(KErrGsmSSNegativePasswordCheck, text); QCOMPARE( text, QString( "Password error")); @@ -336,7 +209,7 @@ "Password error")); Tools::errorCodeTextMapping(KErrGsmSSPasswordAttemptsViolation, text); QCOMPARE( text, QString( - "Password blocked")); + "txt_phone_info_barring_password_blocked")); Tools::errorCodeTextMapping(KErrGsmSMSNoNetworkService, text); QCOMPARE( text, QString( "No network coverage")); @@ -347,12 +220,12 @@ QCOMPARE( text, QString( "Check network services")); Tools::errorCodeTextMapping(KErrGsmSSUnknownAlphabet, text); - QCOMPARE( text, QString("Invalid phone number")); + QCOMPARE( text, QString("txt_phone_info_invalid_phone_number")); expect("XQSysInfo::isSupported").returns(false); Tools::errorCodeTextMapping(KErrGsmOfflineOpNotAllowed, text); QCOMPARE( text, QString( - "Not done")); + "txt_phone_info_request_not_completed")); QVERIFY( verify() ); expect("XQSysInfo::isSupported").returns(true); @@ -370,7 +243,7 @@ Tools::errorCodeTextMapping(-1, text); QCOMPARE( text, QString( - "Not done")); + "txt_phone_info_request_not_completed")); QVERIFY( verify() ); diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.h Mon May 03 12:31:11 2010 +0300 @@ -46,7 +46,6 @@ void t_voipSupported(); void t_videoSupported(); - void t_convertEtelMobileServiceCode(); void t_errorCodeTextMapping(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.cpp Mon May 03 12:31:11 2010 +0300 @@ -19,21 +19,13 @@ CpDivertItemData::CpDivertItemData( - PsCallDivertingCondition condition, - PsServiceGroup serviceGroup, + HbDataFormModelItem::DataItemType type, const QString &label, - const QString &queryLabel, - bool needTimeoutInfo, CpItemDataHelper &helper, const HbDataFormModelItem *parent) : CpSettingFormItemData( - static_cast( - CpDivertSelectionItem::CpDivertSelectionItemId), + static_cast(type), label, parent ), - m_serviceGroup(serviceGroup), - m_condition(condition), - m_queryLabel(queryLabel), - m_needTimeoutInfo(needTimeoutInfo), m_helper(helper) { m_helper.addConnection( @@ -46,29 +38,10 @@ } -PsServiceGroup CpDivertItemData::service() -{ - return m_serviceGroup; -} - -PsCallDivertingCondition CpDivertItemData::condition() -{ - return m_condition; -} - -QString CpDivertItemData::queryLabel() -{ - return m_queryLabel; -} - -bool CpDivertItemData::needTimeoutInfo() -{ - return m_needTimeoutInfo; -} - void CpDivertItemData::thisItemClicked() { emit itemClicked(*this); } + // end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.h Mon May 03 12:31:11 2010 +0300 @@ -26,23 +26,12 @@ Q_OBJECT public: CpDivertItemData( - PsCallDivertingCondition condition, - PsServiceGroup serviceGroup, + HbDataFormModelItem::DataItemType type, const QString &label, - const QString &queryLabel, - bool needTimeoutInfo, CpItemDataHelper &helper, const HbDataFormModelItem *parent = 0); - ~CpDivertItemData(); - - PsServiceGroup service(); - - PsCallDivertingCondition condition(); - - QString queryLabel(); - - bool needTimeoutInfo(); + virtual ~CpDivertItemData(); public slots: void thisItemClicked(); @@ -51,11 +40,8 @@ void itemClicked(CpDivertItemData &item); private: - PsServiceGroup m_serviceGroup; - PsCallDivertingCondition m_condition; - QString m_queryLabel; - bool m_needTimeoutInfo; CpItemDataHelper &m_helper; }; + #endif /* DIVERTINGITEMDATA_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -39,23 +39,40 @@ #include "cpdivertitemdata.h" #include "cpdivertselectioncustomitem.h" +Q_DECLARE_METATYPE(PsCallDivertingCondition) +Q_DECLARE_METATYPE(PsServiceGroup) + /*! CpDivertPluginGroup::CpDivertPluginGroup. */ CpDivertPluginGroup::CpDivertPluginGroup(CpItemDataHelper &helper) : CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId("txt_phone_subhead_call_divert"),0), - m_csVoiceCallPage(NULL), - m_DataItemAllVoiceCalls(NULL), - m_DataItemIfBusy(NULL), - m_DataItemIfNotAnswered(NULL), - m_DataItemIfOutOfReach(NULL), - m_DataItemIfNotAvailable(NULL), + m_DataItemVoiceAllCalls(NULL), + m_DataItemVoiceIfBusy(NULL), + m_DataItemVoiceIfNotAnswered(NULL), + m_DataItemVoiceIfOutOfReach(NULL), + m_DataItemVoiceIfNotAvailable(NULL), + m_DataItemVideoAllCalls(NULL), + m_DataItemVideoIfBusy(NULL), + m_DataItemVideoIfNotAnswered(NULL), + m_DataItemVideoIfOutOfReach(NULL), + m_DataItemVideoIfNotAvailable(NULL), m_activeNoteId(0), + m_activeProgressNoteId(0), + m_divertToVoiceMailBox(false), m_helper(helper) { DPRINT << ": IN"; + // Registration needed, because PsCallDivertingCondition and PsServiceGroup + // is used as a custom meta information for barring items. + qRegisterMetaType( + "PsCallDivertingCondition"); + + qRegisterMetaType( + "PsServiceGroup"); + // Localization file loading QTranslator translator; QString lang = QLocale::system().name(); @@ -105,9 +122,8 @@ SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex))); // Create grouped setting items - createVoiceCallItems(); - createVideoCallItems(); - createVoIPCallItems(); + createVoiceCallItems(this); + createVideoCallItems(this); DPRINT << ": OUT"; } @@ -127,89 +143,143 @@ /*! CpDivertPluginGroup::createVoiceCallItems. */ -void CpDivertPluginGroup::createVoiceCallItems() +void CpDivertPluginGroup::createVoiceCallItems(CpSettingFormItemData *parent) { DPRINT << ": IN"; - m_csVoiceCallPage = new CpSettingFormItemData( + CpSettingFormItemData *page = new CpSettingFormItemData( HbDataFormModelItem::GroupPageItem, hbTrId("txt_phone_setlabel_service_val_voice_divert")); - appendChild(m_csVoiceCallPage); + parent->appendChild(page); - m_DataItemAllVoiceCalls = new CpDivertItemData( + m_DataItemVoiceAllCalls = createDivertItem( DivertConditionUnconditional, ServiceGroupVoice, hbTrId("txt_phone_setlabel_all_calls"), - hbTrId("All voice calls:"), false, - m_helper, - m_csVoiceCallPage); - - addDivertDataItem(m_DataItemAllVoiceCalls, m_csVoiceCallPage); + hbTrId("txt_phone_setlabel_all_calls"), false, + page); - m_DataItemIfBusy = new CpDivertItemData( + m_DataItemVoiceIfBusy = createDivertItem( DivertConditionBusy, ServiceGroupVoice, hbTrId("txt_phone_setlabel_if_busy"), - hbTrId("If busy:"), false, - m_helper, - m_csVoiceCallPage); - - addDivertDataItem(m_DataItemIfBusy, m_csVoiceCallPage); + hbTrId("txt_phone_setlabel_if_busy"), false, + page); - m_DataItemIfNotAnswered = new CpDivertItemData( + m_DataItemVoiceIfNotAnswered = createDivertItem( DivertConditionNoReply, ServiceGroupVoice, hbTrId("txt_phone_setlabel_if_not_answered"), - hbTrId("If not answered:"), true, - m_helper, - m_csVoiceCallPage); - - addDivertDataItem(m_DataItemIfNotAnswered, m_csVoiceCallPage); - m_DataItemIfNotAnswered->setContentWidgetData("timeoutText", hbTrId("txt_phone_setlabel_delay")); + hbTrId("txt_phone_setlabel_if_not_answered"), true, + page); + m_DataItemVoiceIfNotAnswered->setContentWidgetData( + "timeoutText", hbTrId("txt_phone_setlabel_delay")); - m_DataItemIfOutOfReach = new CpDivertItemData( + m_DataItemVoiceIfOutOfReach = createDivertItem( DivertConditionNotReachable, ServiceGroupVoice, hbTrId("txt_phone_setlabel_if_out_of_reach"), - hbTrId("If out of reach:"), false, - m_helper, - m_csVoiceCallPage); - - addDivertDataItem(m_DataItemIfOutOfReach, m_csVoiceCallPage); + hbTrId("txt_phone_setlabel_if_out_of_reach"), false, + page); - m_DataItemIfNotAvailable = new CpDivertItemData( + m_DataItemVoiceIfNotAvailable = createDivertItem( DivertConditionAllConditionalCases, ServiceGroupVoice, hbTrId("txt_phone_setlabel_if_not_available"), - hbTrId("If not available:"), true, - m_helper, - m_csVoiceCallPage); - - addDivertDataItem(m_DataItemIfNotAvailable, m_csVoiceCallPage); + hbTrId("txt_phone_setlabel_if_not_available"), true, + page); + DPRINT << ": OUT"; } /*! CpDivertPluginGroup::createVideoCallItems */ -void CpDivertPluginGroup::createVideoCallItems() +void CpDivertPluginGroup::createVideoCallItems(CpSettingFormItemData *parent) { DPRINT << ": IN"; - appendChild( new CpSettingFormItemData( - HbDataFormModelItem::GroupPageItem, - hbTrId("txt_phone_setlabel_service_val_video_divert")) ); + CpSettingFormItemData *page = new CpSettingFormItemData( + HbDataFormModelItem::GroupPageItem, + hbTrId("txt_phone_setlabel_service_val_video_divert")); + + parent->appendChild(page); + + m_DataItemVideoAllCalls = createDivertItem( + DivertConditionUnconditional, + ServiceGroupData, + hbTrId("txt_phone_setlabel_all_calls"), + hbTrId("txt_phone_setlabel_all_calls"), false, + page); + + m_DataItemVideoIfBusy = createDivertItem( + DivertConditionBusy, + ServiceGroupData, + hbTrId("txt_phone_setlabel_if_busy"), + hbTrId("txt_phone_setlabel_if_busy"), false, + page); + + m_DataItemVideoIfNotAnswered = createDivertItem( + DivertConditionNoReply, + ServiceGroupData, + hbTrId("txt_phone_setlabel_if_not_answered"), + hbTrId("txt_phone_setlabel_if_not_answered"), true, + page); + m_DataItemVideoIfNotAnswered->setContentWidgetData( + "timeoutText", hbTrId("txt_phone_setlabel_delay")); + + m_DataItemVideoIfOutOfReach = createDivertItem( + DivertConditionNotReachable, + ServiceGroupData, + hbTrId("txt_phone_setlabel_if_out_of_reach"), + hbTrId("txt_phone_setlabel_if_out_of_reach"), false, + page); + + m_DataItemVideoIfNotAvailable = createDivertItem( + DivertConditionAllConditionalCases, + ServiceGroupData, + hbTrId("txt_phone_setlabel_if_not_available"), + hbTrId("txt_phone_setlabel_if_not_available"), true, + page); + DPRINT << ": OUT"; } /*! - CpDivertPluginGroup::createVoIPCallItems + CpDivertPluginGroup::createDivertItem */ -void CpDivertPluginGroup::createVoIPCallItems() +CpDivertItemData *CpDivertPluginGroup::createDivertItem( + PsCallDivertingCondition condition, + PsServiceGroup serviceGroup, + const QString &label, + const QString &queryLabel, + bool needTimeoutInfo, + CpSettingFormItemData *parent) { DPRINT << ": IN"; - appendChild( new CpSettingFormItemData( - HbDataFormModelItem::GroupPageItem, - hbTrId("VoIP")) ); + + CpDivertItemData *item = new CpDivertItemData( + static_cast + (CpDivertSelectionItem::CpDivertSelectionItemId), + label, + m_helper, + parent); + QVariant conditionVar; + conditionVar.setValue(condition); + item->setProperty("condition", conditionVar); + QVariant serviceGroupVar; + serviceGroupVar.setValue(serviceGroup); + item->setProperty("serviceGroup", serviceGroupVar); + item->setProperty("queryLabel", queryLabel); + item->setProperty("needTimeoutInfo", needTimeoutInfo); + item->setEnabled(false); + + // Connect signals + QObject::connect( + item, SIGNAL(itemClicked(CpDivertItemData&)), + this, SLOT(changeDivertingStateRequested(CpDivertItemData&))); + + parent->appendChild(item); DPRINT << ": OUT"; + return item; } /*! @@ -222,35 +292,20 @@ HbDataFormModelItem* modelItem = qobject_cast(model())->itemFromIndex(item); - if (!modelItem->contentWidgetData("number").isValid()) { - if (modelItem==m_DataItemAllVoiceCalls) { - addToDivertingRequestQueue(CheckDivertStatus, *m_DataItemAllVoiceCalls); - } else if (modelItem==m_DataItemIfBusy) { - addToDivertingRequestQueue(CheckDivertStatus, *m_DataItemIfBusy); - } else if (modelItem==m_DataItemIfNotAnswered) { - addToDivertingRequestQueue(CheckDivertStatus, *m_DataItemIfNotAnswered); - } else if (modelItem==m_DataItemIfOutOfReach) { - addToDivertingRequestQueue(CheckDivertStatus, *m_DataItemIfOutOfReach); - } // do not update m_DataItemIfNotAvailable + if (!modelItem->contentWidgetData("number").isValid() && + (static_cast + (CpDivertSelectionItem::CpDivertSelectionItemId == modelItem->type()))){ + CpDivertItemData *item = static_cast(modelItem); + if(qvariant_cast(item->property("condition")) != + DivertConditionAllConditionalCases) { + addToDivertingRequestQueue(CheckDivertStatus, *item); + } } - DPRINT << ": OUT"; } /*! - CpDivertPluginGroup::addDivertDataItem. - */ -void CpDivertPluginGroup::addDivertDataItem( - CpDivertItemData *item, CpSettingFormItemData *parent) -{ - parent->appendChild(item); - QObject::connect( - item, SIGNAL(itemClicked(CpDivertItemData&)), - this, SLOT(changeDivertingStateRequested(CpDivertItemData&))); -} - -/*! CpDivertPluginGroup::addToDivertingRequestQueue. */ void CpDivertPluginGroup::addToDivertingRequestQueue( @@ -299,7 +354,9 @@ CpDivertPluginGroup::changeItemData. */ void CpDivertPluginGroup::changeItemData( - PsCallDivertingCondition condition, PsCallDivertingStatus status, + PsServiceGroup serviceGroup, + PsCallDivertingCondition condition, + PsCallDivertingStatus status, const QString& number, int timeout) { DPRINT << ": IN"; @@ -315,43 +372,31 @@ } switch (condition) { - case DivertConditionUnconditional: - m_DataItemAllVoiceCalls->setContentWidgetData("number", number); - m_DataItemAllVoiceCalls->setContentWidgetData("timeout", timeout); - m_DataItemAllVoiceCalls->setContentWidgetData("state", itemState); - break; - case DivertConditionBusy: - m_DataItemIfBusy->setContentWidgetData("number", number); - m_DataItemIfBusy->setContentWidgetData("timeout", timeout); - m_DataItemIfBusy->setContentWidgetData("state", itemState); - break; - case DivertConditionNoReply: - m_DataItemIfNotAnswered->setContentWidgetData("number", number); - m_DataItemIfNotAnswered->setContentWidgetData("timeout", timeout); - m_DataItemIfNotAnswered->setContentWidgetData("state", itemState); - break; - case DivertConditionNotReachable: - m_DataItemIfOutOfReach->setContentWidgetData("number", number); - m_DataItemIfOutOfReach->setContentWidgetData("timeout", timeout); - m_DataItemIfOutOfReach->setContentWidgetData("state", itemState); - break; case DivertConditionAllConditionalCases: DPRINT << ": DivertConditionAllConditionalCases"; - m_DataItemIfNotAvailable->setContentWidgetData("number", number); - m_DataItemIfNotAvailable->setContentWidgetData("timeout", timeout); - m_DataItemIfNotAvailable->setContentWidgetData("state", itemState); + // If not available effects also conditions below + changeItemData(serviceGroup, DivertConditionBusy, status, number, timeout); + changeItemData(serviceGroup, DivertConditionNoReply, status, number, timeout); + changeItemData(serviceGroup, DivertConditionNotReachable, status, number, timeout); + // Fall trough + case DivertConditionUnconditional: + case DivertConditionBusy: + case DivertConditionNoReply: + case DivertConditionNotReachable: + if (serviceGroup & ServiceGroupVoice) { + item(ServiceGroupVoice, condition)->setContentWidgetData("number", number); + item(ServiceGroupVoice, condition)->setContentWidgetData("timeout", timeout); + item(ServiceGroupVoice, condition)->setContentWidgetData("state", itemState); + item(ServiceGroupVoice, condition)->setEnabled(true); + } - // If not available effects also conditions below - m_DataItemIfBusy->setContentWidgetData("number", number); - m_DataItemIfBusy->setContentWidgetData("timeout", timeout); - m_DataItemIfBusy->setContentWidgetData("state", itemState); - m_DataItemIfNotAnswered->setContentWidgetData("number", number); - m_DataItemIfNotAnswered->setContentWidgetData("timeout", timeout); - m_DataItemIfNotAnswered->setContentWidgetData("state", itemState); - m_DataItemIfOutOfReach->setContentWidgetData("number", number); - m_DataItemIfOutOfReach->setContentWidgetData("timeout", timeout); - m_DataItemIfOutOfReach->setContentWidgetData("state", itemState); + if (serviceGroup & ServiceGroupData) { + item(ServiceGroupData, condition)->setContentWidgetData("number", number); + item(ServiceGroupData, condition)->setContentWidgetData("timeout", timeout); + item(ServiceGroupData, condition)->setContentWidgetData("state", itemState); + item(ServiceGroupData, condition)->setEnabled(true); + } break; case DivertConditionAllCalls: case DivertConditionUnknown: @@ -363,37 +408,73 @@ /*! CpDivertPluginGroup::revertItemData. */ -void CpDivertPluginGroup::revertItemData(PsCallDivertingCondition condition) +void CpDivertPluginGroup::revertItemData( + PsServiceGroup serviceGroup, PsCallDivertingCondition condition) { DPRINT << ": IN"; + if (serviceGroup & ServiceGroupVoice) { + item(ServiceGroupVoice, condition)->setContentWidgetData("state", + item(ServiceGroupVoice, condition)->contentWidgetData("state")); + } + if (serviceGroup & ServiceGroupData) { + item(ServiceGroupData, condition)->setContentWidgetData("state", + item(ServiceGroupData, condition)->contentWidgetData("state")); + } + + DPRINT << ": OUT"; +} + +/*! + CpDivertPluginGroup::item. + */ +CpSettingFormItemData* CpDivertPluginGroup::item( + PsService service, PsCallDivertingCondition condition) +{ + CpSettingFormItemData *ret = 0; switch (condition) { case DivertConditionUnconditional: - m_DataItemAllVoiceCalls->setContentWidgetData("state", - m_DataItemAllVoiceCalls->contentWidgetData("state")); + if (service == ServiceGroupVoice) { + ret = m_DataItemVoiceAllCalls; + } else { + ret = m_DataItemVideoAllCalls; + } break; case DivertConditionBusy: - m_DataItemIfBusy->setContentWidgetData("state", - m_DataItemIfBusy->contentWidgetData("state")); + if (service == ServiceGroupVoice) { + ret = m_DataItemVoiceIfBusy; + } else { + ret = m_DataItemVideoIfBusy; + } break; case DivertConditionNoReply: - m_DataItemIfNotAnswered->setContentWidgetData("state", - m_DataItemIfNotAnswered->contentWidgetData("state")); + if (service == ServiceGroupVoice) { + ret = m_DataItemVoiceIfNotAnswered; + } else { + ret = m_DataItemVideoIfNotAnswered; + } break; case DivertConditionNotReachable: - m_DataItemIfOutOfReach->setContentWidgetData("state", - m_DataItemIfOutOfReach->contentWidgetData("state")); + if (service == ServiceGroupVoice) { + ret = m_DataItemVoiceIfOutOfReach; + } else { + ret = m_DataItemVideoIfOutOfReach; + } break; case DivertConditionAllConditionalCases: - DPRINT << ": DivertConditionAllConditionalCases"; - m_DataItemIfNotAvailable->setContentWidgetData("state", - m_DataItemIfNotAvailable->contentWidgetData("state")); + if (service == ServiceGroupVoice) { + ret = m_DataItemVoiceIfNotAvailable; + } else { + ret = m_DataItemVideoIfNotAvailable; + } break; case DivertConditionAllCalls: case DivertConditionUnknown: default: break; } + Q_CHECK_PTR(ret); + return ret; } /*! @@ -409,10 +490,12 @@ CpDivertRequestQueueItem request = m_divertRequestQueue.head(); // Command param PSCallDivertingCommand divertCommand; - divertCommand.iServiceGroup = request.item->service(); - divertCommand.iCondition = request.item->condition(); + divertCommand.iServiceGroup = qvariant_cast( + request.item->property("serviceGroup")); + divertCommand.iCondition = qvariant_cast( + request.item->property("condition")); divertCommand.iStatus = DivertingStatusUnknown; - divertCommand.iNumber = hbTrId(""); + divertCommand.iNumber = ""; divertCommand.iNoReplyTimer = 0; switch (request.request) { @@ -420,16 +503,17 @@ DPRINT << "activate"; divertCommand.iSetting = RegisterDiverting; if (popUpVoiceNumberListQuery( - request.item->queryLabel(), divertCommand.iNumber)) { - if (request.item->needTimeoutInfo()) { + request.item->property("queryLabel").toString(), + divertCommand.iNumber, + divertCommand.iServiceGroup)) { + if (request.item->property("needTimeoutInfo").toBool()) { if (popUpTimerQuery(divertCommand.iNoReplyTimer)) { setCallDiverting(divertCommand); } else { // Query was cancelled - request.item->setContentWidgetData("number", - request.item->contentWidgetData("number").toString()); - request.item->setContentWidgetData("timeout", - request.item->contentWidgetData("timeout").toInt()); + revertItemData( + divertCommand.iServiceGroup, + divertCommand.iCondition); m_divertRequestQueue.clear(); } } else { @@ -437,10 +521,9 @@ } } else { // Query was cancelled - request.item->setContentWidgetData("number", - request.item->contentWidgetData("number").toString()); - request.item->setContentWidgetData("timeout", - request.item->contentWidgetData("timeout").toInt()); + revertItemData( + divertCommand.iServiceGroup, + divertCommand.iCondition); m_divertRequestQueue.clear(); } } @@ -456,11 +539,11 @@ m_callDivertingWrapper->getCallDivertingStatus( divertCommand.iServiceGroup, divertCommand.iCondition, - bscParam() ); + bscParam(divertCommand.iServiceGroup) ); if (!CpPhoneNotes::instance()->noteShowing()) { CpPhoneNotes::instance()->showGlobalProgressNote( - m_activeProgressNoteId, hbTrId("Requesting")); + m_activeProgressNoteId, hbTrId("txt_phone_info_requesting")); } } break; @@ -511,20 +594,23 @@ DPRINT << "iStatus:" << aSetting.iStatus; changeItemData( + aSetting.iServiceGroup, aSetting.iCondition, aSetting.iStatus, aSetting.iNumber, aSetting.iNoReplyTimer); - updateDependentDivertOptions(); + updateDependentDivertOptions( + (DivertConditionUnconditional == aSetting.iCondition) && + (DivertingStatusActive != aSetting.iStatus) ); switch(aSetting.iStatus) { case DivertingStatusActive: if (aPlural) { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Diverts activated"), + hbTrId("txt_phone_info_diverts_activated"), HbMessageBox::MessageTypeInformation); } else { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Divert activated"), + hbTrId("txt_phone_info_divert_activated"), HbMessageBox::MessageTypeInformation); } if (!m_divertToVoiceMailBox) { @@ -533,21 +619,21 @@ } // Diverting calls does not affect Internet calls if (Tools::voipSupported() && - aSetting.iServiceGroup == ServiceGroupVoice) { + (aSetting.iServiceGroup & ServiceGroupVoice)) { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, hbTrId("Diverting calls does not affect Internet calls"), HbMessageBox::MessageTypeInformation); } break; - case DivertingStatusNotRegistered: + case DivertingStatusNotRegistered: case DivertingStatusInactive: if (aPlural) { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Diverts cancelled"), + hbTrId("txt_phone_info_diverts_deactivated"), HbMessageBox::MessageTypeInformation); } else { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Divert cancelled"), + hbTrId("txt_phone_info_divert_deactivated"), HbMessageBox::MessageTypeInformation); } break; @@ -555,34 +641,10 @@ case DivertingStatusUnknown: default: CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Not done"), + hbTrId("txt_phone_info_request_not_completed"), HbMessageBox::MessageTypeInformation); } - if ((DivertConditionUnconditional == aSetting.iCondition) && - (DivertingStatusActive != aSetting.iStatus)) { - // Must query data for diverts depending on all calls divert, because - // data may have been lost for registered diverts, which were - // automatically deactivated due to the activation of all calls divert. - if (CpDivertSelectionCustomitem::Deactivated == - m_DataItemIfBusy->contentWidgetData("state").toInt()) { - addToDivertingRequestQueue( - CheckDivertStatus, *m_DataItemIfBusy); - } - - if (CpDivertSelectionCustomitem::Deactivated == - m_DataItemIfNotAnswered->contentWidgetData("state").toInt()) { - addToDivertingRequestQueue( - CheckDivertStatus, *m_DataItemIfNotAnswered); - } - - if (CpDivertSelectionCustomitem::Deactivated == - m_DataItemIfOutOfReach->contentWidgetData("state").toInt()) { - addToDivertingRequestQueue( - CheckDivertStatus, *m_DataItemIfOutOfReach); - } - } - DPRINT << ": OUT"; } @@ -604,8 +666,10 @@ DPRINT << status->iStatus; DPRINT << status->iTimeout; changeItemData( + status->iServiceGroup, status->iCondition, status->iStatus, status->iNumber, status->iTimeout); + } updateDependentDivertOptions(); @@ -622,7 +686,11 @@ // Update view item for failed request if (m_divertRequestQueue.count()) { - revertItemData(m_divertRequestQueue.head().item->condition()); + revertItemData( + qvariant_cast( + m_divertRequestQueue.head().item->property("serviceGroup")), + qvariant_cast( + m_divertRequestQueue.head().item->property("condition"))); } // Clear queue @@ -641,45 +709,53 @@ CpDivertPluginGroup::popUpVoiceNumberListQuery. */ bool CpDivertPluginGroup::popUpVoiceNumberListQuery( - const QString& heading, QString& result) + const QString& heading, QString& result, PsServiceGroup serviceGroup) { DPRINT << ": IN"; + const QString KVoiceMail("voiceMail"); + const QString KVideoMail("voiceMail"); + const QString KOtherNumber("otherNumber"); bool requestOK(false); m_divertToVoiceMailBox = false; QStringList defNumbers; HbDialog *dialog = createDialog(heading); HbListWidget *list = new HbListWidget(dialog); - addItemToListWidget( - list, hbTrId("txt_phone_setlabel_voice_mbx"), hbTrId("txt_phone_setlabel_voice_mbx") ); + if (serviceGroup == ServiceGroupVoice) { + addItemToListWidget( + list, hbTrId("txt_phone_setlabel_voice_mbx"), KVoiceMail ); + } else if(serviceGroup == ServiceGroupData) { + // TODO: Implement video voicemail + } + // Add "old" divert number to list m_callDivertingWrapper->getDefaultNumbers(defNumbers); int count(defNumbers.count()); for (int i = 0; i < count; i++) { addItemToListWidget(list, defNumbers[i], defNumbers[i]); } - addItemToListWidget(list, hbTrId("Other number"), hbTrId("Other number") ); + addItemToListWidget(list, hbTrId("txt_phone_list_enter_number_manually"), KOtherNumber ); // Connect list item activation signal to close the popup connect( list, SIGNAL(activated(HbListWidgetItem*)), dialog, SLOT(close())); // Sets the "Cancel"-action/button - HbAction *cancelAction = new HbAction("Cancel"); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); dialog->setPrimaryAction(cancelAction); dialog->setContentWidget(list); // Launch popup and handle the response if (dialog->exec() != cancelAction) { // Update the view with selected text QString data = list->currentItem()->data().toString(); - if (data == hbTrId("txt_phone_setlabel_voice_mbx")) { + if (data == KVoiceMail) { m_callDivertingWrapper->getVoiceMailBoxNumber(result); if (result.size()) { // voicemailboxnumber found m_divertToVoiceMailBox = true; requestOK = true; } - } else if (data == hbTrId("Other number")) { - requestOK = popUpNumberEditor(hbTrId("Number:"), result); + } else if (data == KOtherNumber) { + requestOK = popUpNumberEditor(hbTrId("txt_phone_info_number"), result); } else { //TODO if matched contact name not work result = data; @@ -712,9 +788,9 @@ HbEditorInterface editorInterface(editor); editorInterface.setUpAsPhoneNumberEditor(); dialog->setContentWidget(editor); - HbAction *okAction = new HbAction(hbTrId("OK")); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); dialog->addAction(okAction); - HbAction *cancelAction = new HbAction(hbTrId("Cancel")); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); dialog->setSecondaryAction(cancelAction); HbAction *resultAction = dialog->exec(); @@ -730,7 +806,7 @@ } else { CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("Enter number"), HbMessageBox::MessageTypeWarning); + hbTrId("txt_phone_info_invalid_phone_number"), HbMessageBox::MessageTypeWarning); } } delete dialog; @@ -752,11 +828,12 @@ DPRINT << "iSetting:" << command.iSetting; DPRINT << "iStatus:" << command.iStatus; - int result = m_callDivertingWrapper->setCallDiverting(command, bscParam()); + int result = m_callDivertingWrapper->setCallDiverting( + command, bscParam(command.iServiceGroup)); if (0 == result) { if (!CpPhoneNotes::instance()->noteShowing()) { CpPhoneNotes::instance()->showGlobalProgressNote( - m_activeProgressNoteId, hbTrId("Requesting")); + m_activeProgressNoteId, hbTrId("txt_phone_info_requesting")); } } else { handleDivertingError(result); @@ -786,7 +863,7 @@ list, SIGNAL(activated(HbListWidgetItem*)), dialog, SLOT(close())); // Sets the "Cancel"-action/button - HbAction *cancelAction = new HbAction(hbTrId("Cancel")); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); dialog->setPrimaryAction(cancelAction); dialog->setContentWidget(list); // Launch popup and handle the response @@ -813,24 +890,34 @@ /*! CpDivertPluginGroup::setbscParam. */ -int CpDivertPluginGroup::bscParam() +int CpDivertPluginGroup::bscParam(PsServiceGroup serviceGroup) { DPRINT << ": IN"; int bsc = AllTeleAndBearer; - int alsLine(AlsNotSupported); - m_ssSettingsWrapper->get(Als,alsLine); - DPRINT << ": alsLine " << alsLine; - if ((alsLine == AlsNotSupported) || (alsLine == AlsPrimary)) { - // Etelephony only activates voice service nothing else or causes - // voice service status request. - bsc = Telephony; + + if (serviceGroup & ServiceGroupVoice) { + int alsLine(AlsNotSupported); + m_ssSettingsWrapper->get(Als,alsLine); + DPRINT << ": alsLine " << alsLine; + + if ((alsLine == AlsNotSupported) || (alsLine == AlsPrimary)) { + // Etelephony only activates voice service nothing else or causes + // voice service status request. + bsc = Telephony; + } + else { // ESSSettingsAlsAlternate + // EAltTele only activates alternate service nothing else or causes + // alternate service status request. + bsc = AltTele; + } } - else { // ESSSettingsAlsAlternate - // EAltTele only activates alternate service nothing else or causes - // alternate service status request. - bsc = AltTele; + + if (serviceGroup & ServiceGroupData) { + bsc = AllBearer; } + + DPRINT << ": OUT : bsc :" << bsc; return bsc; @@ -895,34 +982,40 @@ Enabling/disabling that options changes all the aforementioned diverts at once. */ -void CpDivertPluginGroup::updateDependentDivertOptions() +void CpDivertPluginGroup::updateDependentDivertOptions(bool fetchFromNetwork) { DPRINT << ": IN"; // all calls divert activation deactivates automatically other diverts - QVariant itemState = m_DataItemAllVoiceCalls->contentWidgetData("state"); + QVariant itemState = m_DataItemVoiceAllCalls->contentWidgetData("state"); if ((itemState.isValid()) && (itemState.toInt() == CpDivertSelectionCustomitem::Enabled)) { - itemState = m_DataItemIfBusy->contentWidgetData("state"); - if ((itemState.isValid()) && - (itemState == CpDivertSelectionCustomitem::Enabled)) { - m_DataItemIfBusy->setContentWidgetData( - "state", CpDivertSelectionCustomitem::Deactivated); - } - - itemState = m_DataItemIfNotAnswered->contentWidgetData("state"); - if ((itemState.isValid()) && - (itemState == CpDivertSelectionCustomitem::Enabled)) { - m_DataItemIfNotAnswered->setContentWidgetData( - "state", CpDivertSelectionCustomitem::Deactivated); - } - - itemState = m_DataItemIfOutOfReach->contentWidgetData("state"); - if ((itemState.isValid()) && - (itemState == CpDivertSelectionCustomitem::Enabled)) { - m_DataItemIfOutOfReach->setContentWidgetData( - "state", CpDivertSelectionCustomitem::Deactivated); - } + deActivateDependentDivertOption(m_DataItemVoiceIfBusy); + deActivateDependentDivertOption(m_DataItemVoiceIfNotAnswered); + deActivateDependentDivertOption(m_DataItemVoiceIfOutOfReach); + } else { + // Must query data for diverts depending on all calls divert, because + // data may have been lost for registered diverts, which were + // automatically deactivated due to the activation of all calls divert. + activateDependentDivertOption(m_DataItemVoiceIfBusy, fetchFromNetwork); + activateDependentDivertOption(m_DataItemVoiceIfNotAnswered, fetchFromNetwork); + activateDependentDivertOption(m_DataItemVoiceIfOutOfReach, fetchFromNetwork); + } + + // all calls divert activation deactivates automatically other diverts + itemState = m_DataItemVideoAllCalls->contentWidgetData("state"); + if ((itemState.isValid()) && + (itemState.toInt() == CpDivertSelectionCustomitem::Enabled)) { + deActivateDependentDivertOption(m_DataItemVideoIfBusy); + deActivateDependentDivertOption(m_DataItemVideoIfNotAnswered); + deActivateDependentDivertOption(m_DataItemVideoIfOutOfReach); + } else { + // Must query data for diverts depending on all calls divert, because + // data may have been lost for registered diverts, which were + // automatically deactivated due to the activation of all calls divert. + activateDependentDivertOption(m_DataItemVideoIfBusy, fetchFromNetwork); + activateDependentDivertOption(m_DataItemVideoIfNotAnswered, fetchFromNetwork); + activateDependentDivertOption(m_DataItemVideoIfOutOfReach, fetchFromNetwork); } // update not available divert option @@ -932,6 +1025,36 @@ } /*! + CpDivertPluginGroup::deActivateDependentDivertOption. +*/ +void CpDivertPluginGroup::deActivateDependentDivertOption( + CpDivertItemData* item) const +{ + QVariant itemState = item->contentWidgetData("state"); + if ((itemState.isValid()) && + (itemState == CpDivertSelectionCustomitem::Enabled)) { + item->setContentWidgetData( + "state", CpDivertSelectionCustomitem::Deactivated); + } + item->setEnabled(false); +} + +/*! + CpDivertPluginGroup::activateDependentDivertOption. +*/ +void CpDivertPluginGroup::activateDependentDivertOption( + CpDivertItemData* item, bool fetchFromNetwork) +{ + if ((CpDivertSelectionCustomitem::Deactivated == + item->contentWidgetData("state").toInt()) && + fetchFromNetwork) { + addToDivertingRequestQueue( + CheckDivertStatus, *item); + } + item->setEnabled(true); +} + +/*! CpDivertPluginGroup::updateNotAvailableDivertOption. */ void CpDivertPluginGroup::updateNotAvailableDivertOption() @@ -942,32 +1065,77 @@ // CFNrc before concluding that not available divert is enabled, because // some networks may not return divert number for inactive diverts. int cfbState = - m_DataItemIfBusy->contentWidgetData("state").toInt(); + m_DataItemVoiceIfBusy->contentWidgetData("state").toInt(); int cfnryState = - m_DataItemIfNotAnswered->contentWidgetData("state").toInt(); + m_DataItemVoiceIfNotAnswered->contentWidgetData("state").toInt(); int cfnrcState = - m_DataItemIfOutOfReach->contentWidgetData("state").toInt(); + m_DataItemVoiceIfOutOfReach->contentWidgetData("state").toInt(); QVariant cfbNumber = - m_DataItemIfBusy->contentWidgetData("number"); + m_DataItemVoiceIfBusy->contentWidgetData("number"); QVariant cfnryNumber = - m_DataItemIfNotAnswered->contentWidgetData("number"); + m_DataItemVoiceIfNotAnswered->contentWidgetData("number"); QVariant cfnrcNumber = - m_DataItemIfOutOfReach->contentWidgetData("number"); + m_DataItemVoiceIfOutOfReach->contentWidgetData("number"); if ((cfbNumber == cfnryNumber) && (cfbNumber == cfnrcNumber) && (cfbState == cfnryState) && (cfbState == cfnrcState)) { - m_DataItemIfNotAvailable->setContentWidgetData( - "number", m_DataItemIfBusy->contentWidgetData("number")); - m_DataItemIfNotAvailable->setContentWidgetData( - "timeout", m_DataItemIfNotAnswered->contentWidgetData("timeout")); - m_DataItemIfNotAvailable->setContentWidgetData( - "state", m_DataItemIfBusy->contentWidgetData("state")); + m_DataItemVoiceIfNotAvailable->setContentWidgetData( + "number", m_DataItemVoiceIfBusy->contentWidgetData("number")); + m_DataItemVoiceIfNotAvailable->setContentWidgetData( + "timeout", m_DataItemVoiceIfNotAnswered->contentWidgetData("timeout")); + m_DataItemVoiceIfNotAvailable->setContentWidgetData( + "state", m_DataItemVoiceIfBusy->contentWidgetData("state")); } else { - m_DataItemIfNotAvailable->setContentWidgetData("number", ""); - m_DataItemIfNotAvailable->setContentWidgetData("timeout", 0); - m_DataItemIfNotAvailable->setContentWidgetData( + m_DataItemVoiceIfNotAvailable->setContentWidgetData("number", ""); + m_DataItemVoiceIfNotAvailable->setContentWidgetData("timeout", 0); + m_DataItemVoiceIfNotAvailable->setContentWidgetData( "state", CpDivertSelectionCustomitem::Disabled); + } + // Item dimming + m_DataItemVoiceIfNotAvailable->setEnabled( + m_DataItemVoiceIfBusy->isEnabled() && + m_DataItemVoiceIfNotAnswered->isEnabled() && + m_DataItemVoiceIfOutOfReach->isEnabled()); + + + // We must check that both states & numbers match amongst CFB, CRNry and + // CFNrc before concluding that not available divert is enabled, because + // some networks may not return divert number for inactive diverts. + cfbState = + m_DataItemVideoIfBusy->contentWidgetData("state").toInt(); + cfnryState = + m_DataItemVideoIfNotAnswered->contentWidgetData("state").toInt(); + cfnrcState = + m_DataItemVideoIfOutOfReach->contentWidgetData("state").toInt(); + cfbNumber = + m_DataItemVideoIfBusy->contentWidgetData("number"); + cfnryNumber = + m_DataItemVideoIfNotAnswered->contentWidgetData("number"); + cfnrcNumber = + m_DataItemVideoIfOutOfReach->contentWidgetData("number"); + + if ((cfbNumber == cfnryNumber) && (cfbNumber == cfnrcNumber) && + (cfbState == cfnryState) && (cfbState == cfnrcState)) { + m_DataItemVideoIfNotAvailable->setContentWidgetData( + "number", m_DataItemVideoIfBusy->contentWidgetData("number")); + m_DataItemVideoIfNotAvailable->setContentWidgetData( + "timeout", m_DataItemVideoIfNotAnswered->contentWidgetData("timeout")); + m_DataItemVideoIfNotAvailable->setContentWidgetData( + "state", m_DataItemVideoIfBusy->contentWidgetData("state")); + } else { + m_DataItemVideoIfNotAvailable->setContentWidgetData("number", ""); + m_DataItemVideoIfNotAvailable->setContentWidgetData("timeout", 0); + m_DataItemVideoIfNotAvailable->setContentWidgetData( + "state", CpDivertSelectionCustomitem::Disabled); + + } + + // Item dimming + m_DataItemVideoIfNotAvailable->setEnabled( + m_DataItemVideoIfBusy->isEnabled() && + m_DataItemVideoIfNotAnswered->isEnabled() && + m_DataItemVideoIfOutOfReach->isEnabled()); DPRINT << ": OUT"; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h Mon May 03 12:31:11 2010 +0300 @@ -106,23 +106,29 @@ /** Creates group items. */ - void createVoiceCallItems(); + void createVoiceCallItems(CpSettingFormItemData *group); /** Creates group items. */ - void createVideoCallItems(); + void createVideoCallItems(CpSettingFormItemData *parent); /** - Creates group items. + Creates single item. */ - void createVoIPCallItems(); + CpDivertItemData *createDivertItem( + PsCallDivertingCondition condition, + PsServiceGroup serviceGroup, + const QString &label, + const QString &queryLabel, + bool needTimeoutInfo, + CpSettingFormItemData *parent = 0); /** Show to user divert number query list. */ bool popUpVoiceNumberListQuery( - const QString& heading, QString& result); + const QString& heading, QString& result, PsServiceGroup serviceGroup); /** Show to user number query. @@ -144,12 +150,13 @@ /** Desides which bsc parameters to use. */ - int bscParam(); + int bscParam(PsServiceGroup serviceGroup); /** Adds divert data item for wanted parent. */ - void addDivertDataItem(CpDivertItemData* item, CpSettingFormItemData *parent); + void addDivertDataItem( + CpDivertItemData* item, CpSettingFormItemData *parent); /** Process next divert request. @@ -167,6 +174,7 @@ Changes divertItemData data. */ void changeItemData( + PsServiceGroup serviceGroup, PsCallDivertingCondition condition, PsCallDivertingStatus status, const QString& number, @@ -175,8 +183,14 @@ /** Reverts divertItemData data to the last known valid values. */ - void revertItemData(PsCallDivertingCondition condition); + void revertItemData( + PsServiceGroup serviceGroup, PsCallDivertingCondition condition); + /** + Helper function which fetches model item according service and condition. + */ + CpSettingFormItemData* item( + PsService service, PsCallDivertingCondition condition); private: /** @@ -200,7 +214,9 @@ Synchronizes content and status of divert options dependent from the status of some other divert. */ - void updateDependentDivertOptions(); + void updateDependentDivertOptions(bool fetchFromNetwork = false); + void activateDependentDivertOption(CpDivertItemData* item, bool fetchFromNetwork); + void deActivateDependentDivertOption(CpDivertItemData* item) const; /** Synchronizes content and status of not available divert option based on @@ -218,12 +234,18 @@ PSetCallDivertingWrapper* m_callDivertingWrapper; // Not owned objects - CpSettingFormItemData *m_csVoiceCallPage; - CpDivertItemData *m_DataItemAllVoiceCalls; - CpDivertItemData *m_DataItemIfBusy; - CpDivertItemData *m_DataItemIfNotAnswered; - CpDivertItemData *m_DataItemIfOutOfReach; - CpDivertItemData *m_DataItemIfNotAvailable; + CpDivertItemData *m_DataItemVoiceAllCalls; + CpDivertItemData *m_DataItemVoiceIfBusy; + CpDivertItemData *m_DataItemVoiceIfNotAnswered; + CpDivertItemData *m_DataItemVoiceIfOutOfReach; + CpDivertItemData *m_DataItemVoiceIfNotAvailable; + + CpDivertItemData *m_DataItemVideoAllCalls; + CpDivertItemData *m_DataItemVideoIfBusy; + CpDivertItemData *m_DataItemVideoIfNotAnswered; + CpDivertItemData *m_DataItemVideoIfOutOfReach; + CpDivertItemData *m_DataItemVideoIfNotAvailable; + int m_activeNoteId; int m_activeProgressNoteId; diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,15 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -echo Expected user interactions! -echo 1) User cancels -echo 2) User selects vmb and inserts number -echo 3) User selects one of the default numbers -echo 4) User selects other number, inserts number and cancels -echo 5) User selects othernumber and find -echo 6) User selects other number and inserts number and timeout -echo 7) User selects default number and and cancels in timeout query -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -37,7 +37,7 @@ #include "cpdivertplugingroup.h" - +Q_DECLARE_METATYPE(PsCallDivertingCondition) Q_EXTERN_C const char * qt_plugin_query_verification_data(); Q_EXTERN_C ::QObject * qt_plugin_instance(); @@ -48,6 +48,12 @@ ~CPsetContainer(){}; }; +void fillNumber(QString& number) +{ + number = "1234567"; +} + + /*! UT_CpDivertPlugin::UT_CpDivertPlugin */ @@ -55,6 +61,8 @@ : m_divertplugin(NULL) { const char * verificationData = qt_plugin_query_verification_data(); + qRegisterMetaType( + "PsCallDivertingCondition"); } /*! @@ -62,6 +70,8 @@ */ UT_CpDivertPlugin::~UT_CpDivertPlugin() { + delete m_divertpluginGroup; + delete m_helper; delete m_divertplugin; } @@ -95,15 +105,15 @@ void UT_CpDivertPlugin::cleanup() { reset(); + delete m_divertpluginGroup; + m_divertpluginGroup = NULL; + + delete m_helper; + m_helper = NULL; delete m_divertplugin; m_divertplugin = NULL; - - delete m_divertpluginGroup; - m_divertpluginGroup = NULL; - - delete m_helper; - m_helper = NULL; + } /*! @@ -125,7 +135,7 @@ expect("PSetWrapper::callDivertingWrapper").returns(&tmpDivWrapper); - CpDivertPlugin* p = (CpDivertPlugin*)qt_plugin_instance(); + CpDivertPlugin* p = (CpDivertPlugin*)qt_plugin_instance(); // Get static QList list; list.append(p->createSettingFormItemData(itemDataHelper)); qDeleteAll(list); @@ -140,35 +150,37 @@ //except user cancels appendAction("All voice calls:", selectAction, "Cancel"); expect("PSetCallDivertingWrapper::getDefaultNumbers"); - m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData("number", ""); - m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData( + m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData("number", ""); + m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData( "state", CpDivertSelectionCustomitem::Disabled); - m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked(); QVERIFY(verify()); - //except user selects vmb and inserts number + //except user selects vmb appendAction("All voice calls:", selectItem, "txt_phone_setlabel_voice_mbx"); - appendAction("Voice mail box number:", insertText, "12345"); - appendAction("Voice mail box number:", selectAction, "OK"); expect("PSetCallDivertingWrapper::getDefaultNumbers"); + expect("PSetCallDivertingWrapper::getVoiceMailBoxNumber").willOnce(invoke(fillNumber)); expect("SsSettingsWrapper::get"); expect("PSetCallDivertingWrapper::setCallDiverting"); expect("CpPhoneNotes::noteShowing").returns(false); expect("CpPhoneNotes::showGlobalProgressNote"); - m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked(); + QVERIFY(verify()); // Verify item click PSCallDivertingCommand command; command.iNumber = "12345"; command.iStatus = DivertingStatusActive; - command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); + command.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition")); + command.iServiceGroup = ServiceGroupVoice; expect("CpPhoneNotes::showGlobalNote"); m_divertpluginGroup->handleDivertingChanged(command, false); expect("CpPhoneNotes::cancelNote"); m_divertpluginGroup->divertRequestProcessed(); - QVERIFY(verify()); + QVERIFY(verify()); // Verify result processing //except user selects one of the default numbers - m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData("number",""); - m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData( + m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData("number",""); + m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData( "state", CpDivertSelectionCustomitem::Disabled); appendAction("All voice calls:", selectItem, "0401234567"); expect("PSetCallDivertingWrapper::getDefaultNumbers"); @@ -176,10 +188,12 @@ expect("PSetCallDivertingWrapper::setCallDiverting"); expect("CpPhoneNotes::noteShowing").returns(false); expect("CpPhoneNotes::showGlobalProgressNote"); - m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked(); command.iNumber = "0401234567"; command.iStatus = DivertingStatusActive; - command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); + command.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition")); + command.iServiceGroup = ServiceGroupVoice; expect("CpPhoneNotes::cancelNote"); expect("CpPhoneNotes::showGlobalNote"); expect("PSetCallDivertingWrapper::setNewDefaultNumber").with(QString("0401234567")); @@ -194,10 +208,12 @@ expect("PSetCallDivertingWrapper::setCallDiverting"); // Disable divert expect("CpPhoneNotes::noteShowing").returns(false); expect("CpPhoneNotes::showGlobalProgressNote"); - m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked(); command.iNumber = ""; command.iStatus = DivertingStatusInactive; - command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); + command.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition")); + command.iServiceGroup = ServiceGroupVoice; expect("CpPhoneNotes::showGlobalNote"); m_divertpluginGroup->handleDivertingChanged(command, false); expect("CpPhoneNotes::cancelNote"); @@ -209,7 +225,7 @@ appendAction("Number:", insertText, "12345"); appendAction("Number:", selectAction, "Cancel"); expect("PSetCallDivertingWrapper::getDefaultNumbers"); - m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked(); QVERIFY(verify()); } @@ -225,32 +241,37 @@ expect("CpPhoneNotes::noteShowing").returns(false); expect("CpPhoneNotes::showGlobalProgressNote"); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemAllVoiceCalls)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceAllCalls)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfBusy)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfBusy)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAnswered)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAnswered)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfOutOfReach)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfOutOfReach)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAvailable)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAvailable)); QList list; PSCallDivertingStatus divertStatus; list.append(&divertStatus); - divertStatus.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); + divertStatus.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition")); m_divertpluginGroup->handleDivertingStatus(list, true); m_divertpluginGroup->divertRequestProcessed(); - divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfBusy->condition(); + divertStatus.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfBusy->property("condition")); m_divertpluginGroup->handleDivertingStatus(list, true); m_divertpluginGroup->divertRequestProcessed(); - divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); + divertStatus.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition")); m_divertpluginGroup->handleDivertingStatus(list, true); m_divertpluginGroup->divertRequestProcessed(); - divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfOutOfReach->condition(); + divertStatus.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfOutOfReach->property("condition")); m_divertpluginGroup->handleDivertingStatus(list, true); m_divertpluginGroup->divertRequestProcessed(); - divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfNotAvailable->condition(); + divertStatus.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfNotAvailable->property("condition")); m_divertpluginGroup->handleDivertingStatus(list, true); m_divertpluginGroup->divertRequestProcessed(); @@ -258,15 +279,15 @@ // Test, Do not check status again m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemAllVoiceCalls)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceAllCalls)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfBusy)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfBusy)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAnswered)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAnswered)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfOutOfReach)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfOutOfReach)); m_divertpluginGroup->itemShown( - model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAvailable)); + model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAvailable)); QVERIFY(verify()); @@ -280,10 +301,10 @@ appendAction("If not answered:", selectItem, "0401234567"); appendAction("Time out", selectAction, "Cancel"); expect("PSetCallDivertingWrapper::getDefaultNumbers"); - m_divertpluginGroup->m_DataItemIfNotAnswered->setContentWidgetData("number", ""); - m_divertpluginGroup->m_DataItemIfNotAnswered->setContentWidgetData( + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->setContentWidgetData("number", ""); + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->setContentWidgetData( "state", CpDivertSelectionCustomitem::Disabled); - m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked(); QVERIFY(verify()); appendAction("If not answered:", selectItem, "Other number"); @@ -294,12 +315,14 @@ expect("PSetCallDivertingWrapper::getDefaultNumbers"); expect("SsSettingsWrapper::get"); expect("PSetCallDivertingWrapper::setCallDiverting"); - m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked(); PSCallDivertingCommand command; command.iNumber = "12345"; command.iNoReplyTimer = 15; command.iStatus = DivertingStatusActive; - command.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); + command.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition")); + command.iServiceGroup = ServiceGroupVoice; expect("CpPhoneNotes::showGlobalNote"); m_divertpluginGroup->handleDivertingChanged(command, false); expect("CpPhoneNotes::cancelNote"); @@ -308,11 +331,13 @@ expect("SsSettingsWrapper::get"); expect("PSetCallDivertingWrapper::setCallDiverting"); - m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked(); command.iNumber = ""; command.iNoReplyTimer = 0; command.iStatus = DivertingStatusInactive; - command.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); + command.iCondition = qvariant_cast( + m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition")); + command.iServiceGroup = ServiceGroupVoice; expect("CpPhoneNotes::showGlobalNote"); m_divertpluginGroup->handleDivertingChanged(command, false); expect("CpPhoneNotes::cancelNote"); @@ -329,31 +354,42 @@ PSCallDivertingCommand c; c.iStatus = DivertingStatusActive; + c.iServiceGroup = ServiceGroupAllTeleservices; bool bRet = false; expect("PSetCallDivertingWrapper::setNewDefaultNumber"); expect("Tools::voipSupported").returns(bRet); m_divertpluginGroup->handleDivertingChanged(c, true); - expect("PSetCallDivertingWrapper::setNewDefaultNumber"); + QVERIFY(verify()); + bRet = true; - c.iServiceGroup = ServiceGroupVoice; + c.iServiceGroup = ServiceGroupAllTeleservices; + c.iCondition = DivertConditionUnconditional; + expect("PSetCallDivertingWrapper::setNewDefaultNumber"); expect("Tools::voipSupported").returns(bRet); m_divertpluginGroup->handleDivertingChanged(c, false); + QVERIFY(verify()); + c.iStatus = DivertingStatusInactive; + c.iCondition = DivertConditionBusy; m_divertpluginGroup->handleDivertingChanged(c, true); m_divertpluginGroup->handleDivertingChanged(c, false); c.iStatus = DivertingStatusNotRegistered; + c.iCondition = DivertConditionNoReply; m_divertpluginGroup->handleDivertingChanged(c, true); c.iStatus = DivertingStatusNotProvisioned; + c.iCondition = DivertConditionNotReachable; m_divertpluginGroup->handleDivertingChanged(c, true); c.iStatus = DivertingStatusUnknown; + c.iCondition = DivertConditionAllCalls; m_divertpluginGroup->handleDivertingChanged(c, true); c.iStatus = (PsCallDivertingStatus)5; + c.iCondition = DivertConditionAllConditionalCases; m_divertpluginGroup->handleDivertingChanged(c, true); QVERIFY(verify()); @@ -415,6 +451,7 @@ if (!actionQueue.count()) { startTimer(2000); } + qDebug() << "appendAction(" << dialog << actionType << action <<")"; actionQueue.append(new dialogAction(dialog, actionType, action)); } @@ -423,6 +460,7 @@ */ void UT_CpDivertPlugin::executeAction( const dialogAction &action ) { + qDebug() << "executeAction(" << action.dialog << action.type << action.item <<")"; switch (action.type) { case selectAction: doAndVerifyAction(action.dialog, action.item); diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.cpp Mon May 03 12:31:11 2010 +0300 @@ -110,14 +110,6 @@ } /*! - UT_CpDivertSelectionItem::t_restore - */ -void UT_CpDivertSelectionItem::t_restore() -{ - m_item->restore(); -} - -/*! UT_CpDivertSelectionItem::t_createCustomWidget */ void UT_CpDivertSelectionItem::t_createCustomWidget() diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.h Mon May 03 12:31:11 2010 +0300 @@ -42,7 +42,6 @@ void t_createItem(); void t_canSetModelIndex(); - void t_restore(); void t_createCustomWidget(); private: // Not own diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def --- a/phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def Mon May 03 12:31:11 2010 +0300 @@ -1,63 +1,62 @@ EXPORTS _ZN12CpPhoneNotes10cancelNoteEi @ 1 NONAME - _ZN12CpPhoneNotes11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME - _ZN12CpPhoneNotes11qt_metacastEPKc @ 3 NONAME - _ZN12CpPhoneNotes14showGlobalNoteERiRK7QStringN12HbMessageBox14MessageBoxTypeE @ 4 NONAME - _ZN12CpPhoneNotes16staticMetaObjectE @ 5 NONAME DATA 16 - _ZN12CpPhoneNotes19getStaticMetaObjectEv @ 6 NONAME - _ZN12CpPhoneNotes19showGlobalErrorNoteERii @ 7 NONAME - _ZN12CpPhoneNotes20progressNoteCanceledEv @ 8 NONAME - _ZN12CpPhoneNotes20showBasicServiceListERK7QStringRK5QListIhE @ 9 NONAME - _ZN12CpPhoneNotes21launchNextNoteIfReadyEv @ 10 NONAME - _ZN12CpPhoneNotes21showCallDivertDetailsERK21PSCallDivertingStatus @ 11 NONAME - _ZN12CpPhoneNotes22activeNoteAboutToCloseEv @ 12 NONAME - _ZN12CpPhoneNotes22showGlobalProgressNoteERiRK7QString @ 13 NONAME - _ZN12CpPhoneNotes26handleProgressNoteCanceledEv @ 14 NONAME - _ZN12CpPhoneNotes30showBasicServiceCallDivertListERK7QStringRK5QListIP21PSCallDivertingStatusERiN16CpTelephonyUtils14CallDivertTypeERSB_ @ 15 NONAME - _ZN12CpPhoneNotes8instanceEv @ 16 NONAME - _ZN12CpPhoneNotesC1Ev @ 17 NONAME - _ZN12CpPhoneNotesC2Ev @ 18 NONAME - _ZN12CpPhoneNotesD0Ev @ 19 NONAME - _ZN12CpPhoneNotesD1Ev @ 20 NONAME - _ZN12CpPhoneNotesD2Ev @ 21 NONAME - _ZN17CpSettingsWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 22 NONAME - _ZN17CpSettingsWrapper11qt_metacastEPKc @ 23 NONAME - _ZN17CpSettingsWrapper16showCallDurationEv @ 24 NONAME - _ZN17CpSettingsWrapper16staticMetaObjectE @ 25 NONAME DATA 16 - _ZN17CpSettingsWrapper18readSoftRejectTextER7QStringRb @ 26 NONAME - _ZN17CpSettingsWrapper19getStaticMetaObjectEv @ 27 NONAME - _ZN17CpSettingsWrapper19setShowCallDurationEb @ 28 NONAME - _ZN17CpSettingsWrapper19writeSoftRejectTextERK7QStringb @ 29 NONAME - _ZN17CpSettingsWrapper51isFeatureCallWaitingDistiquishNotProvisionedEnabledEv @ 30 NONAME - _ZN17CpSettingsWrapperC1EP7QObject @ 31 NONAME - _ZN17CpSettingsWrapperC2EP7QObject @ 32 NONAME - _ZN17CpSettingsWrapperD0Ev @ 33 NONAME - _ZN17CpSettingsWrapperD1Ev @ 34 NONAME - _ZN17CpSettingsWrapperD2Ev @ 35 NONAME - _ZN5Tools11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME - _ZN5Tools11qt_metacastEPKc @ 37 NONAME - _ZN12CpPhoneNotes11noteShowingEv @ 38 NONAME - _ZN5Tools13voipSupportedEv @ 39 NONAME - _ZN5Tools14videoSupportedEv @ 40 NONAME - _ZN5Tools16staticMetaObjectE @ 41 NONAME DATA 16 - _ZN5Tools19getStaticMetaObjectEv @ 42 NONAME - _ZN5Tools20errorCodeTextMappingEiR7QString @ 43 NONAME - _ZN5Tools28convertEtelMobileServiceCodeEi @ 44 NONAME + _ZN12CpPhoneNotes11noteShowingEv @ 2 NONAME + _ZN12CpPhoneNotes11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME + _ZN12CpPhoneNotes11qt_metacastEPKc @ 4 NONAME + _ZN12CpPhoneNotes14showGlobalNoteERiRK7QStringN12HbMessageBox14MessageBoxTypeE @ 5 NONAME + _ZN12CpPhoneNotes16staticMetaObjectE @ 6 NONAME DATA 16 + _ZN12CpPhoneNotes19getStaticMetaObjectEv @ 7 NONAME + _ZN12CpPhoneNotes19passwordTextChangedEv @ 8 NONAME + _ZN12CpPhoneNotes19showGlobalErrorNoteERii @ 9 NONAME + _ZN12CpPhoneNotes20progressNoteCanceledEv @ 10 NONAME + _ZN12CpPhoneNotes20showBasicServiceListERK7QStringRK5QListIhE @ 11 NONAME + _ZN12CpPhoneNotes21launchNextNoteIfReadyEv @ 12 NONAME + _ZN12CpPhoneNotes21showCallDivertDetailsERK21PSCallDivertingStatus @ 13 NONAME + _ZN12CpPhoneNotes22activeNoteAboutToCloseEv @ 14 NONAME + _ZN12CpPhoneNotes22showGlobalProgressNoteERiRK7QString @ 15 NONAME + _ZN12CpPhoneNotes23showPasswordQueryDialogERK7QStringRK10QValidatoriRS0_Rb @ 16 NONAME + _ZN12CpPhoneNotes26handleProgressNoteCanceledEv @ 17 NONAME + _ZN12CpPhoneNotes8instanceEv @ 18 NONAME + _ZN12CpPhoneNotesC1Ev @ 19 NONAME + _ZN12CpPhoneNotesC2Ev @ 20 NONAME + _ZN12CpPhoneNotesD0Ev @ 21 NONAME + _ZN12CpPhoneNotesD1Ev @ 22 NONAME + _ZN12CpPhoneNotesD2Ev @ 23 NONAME + _ZN17CpSettingsWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME + _ZN17CpSettingsWrapper11qt_metacastEPKc @ 25 NONAME + _ZN17CpSettingsWrapper16showCallDurationEv @ 26 NONAME + _ZN17CpSettingsWrapper16staticMetaObjectE @ 27 NONAME DATA 16 + _ZN17CpSettingsWrapper18readSoftRejectTextER7QStringRb @ 28 NONAME + _ZN17CpSettingsWrapper19getStaticMetaObjectEv @ 29 NONAME + _ZN17CpSettingsWrapper19setShowCallDurationEb @ 30 NONAME + _ZN17CpSettingsWrapper19writeSoftRejectTextERK7QStringb @ 31 NONAME + _ZN17CpSettingsWrapper51isFeatureCallWaitingDistiquishNotProvisionedEnabledEv @ 32 NONAME + _ZN17CpSettingsWrapperC1EP7QObject @ 33 NONAME + _ZN17CpSettingsWrapperC2EP7QObject @ 34 NONAME + _ZN17CpSettingsWrapperD0Ev @ 35 NONAME + _ZN17CpSettingsWrapperD1Ev @ 36 NONAME + _ZN17CpSettingsWrapperD2Ev @ 37 NONAME + _ZN5Tools11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME + _ZN5Tools11qt_metacastEPKc @ 39 NONAME + _ZN5Tools13voipSupportedEv @ 40 NONAME + _ZN5Tools14videoSupportedEv @ 41 NONAME + _ZN5Tools16staticMetaObjectE @ 42 NONAME DATA 16 + _ZN5Tools19getStaticMetaObjectEv @ 43 NONAME + _ZN5Tools20errorCodeTextMappingEiR7QString @ 44 NONAME _ZNK12CpPhoneNotes10metaObjectEv @ 45 NONAME _ZNK12CpPhoneNotes17formatPhoneNumberE7QString @ 46 NONAME _ZNK12CpPhoneNotes21basicServiceGroupNameEN16CpTelephonyUtils18BasicServiceGroupsE @ 47 NONAME - _ZNK12CpPhoneNotes28convertEtelMobileServiceCodeEi @ 48 NONAME - _ZNK17CpSettingsWrapper10metaObjectEv @ 49 NONAME - _ZNK17CpSettingsWrapper14isPhoneOfflineEv @ 50 NONAME - _ZNK17CpSettingsWrapper15readCenrepValueElm @ 51 NONAME - _ZNK17CpSettingsWrapper16readCenrepStringElm @ 52 NONAME - _ZNK17CpSettingsWrapper16writeCenrepValueElmRK8QVariant @ 53 NONAME - _ZNK17CpSettingsWrapper23numberGroupingSupportedEv @ 54 NONAME - _ZNK5Tools10metaObjectEv @ 55 NONAME - _ZTI12CpPhoneNotes @ 56 NONAME - _ZTI17CpSettingsWrapper @ 57 NONAME - _ZTI5Tools @ 58 NONAME - _ZTV12CpPhoneNotes @ 59 NONAME - _ZTV17CpSettingsWrapper @ 60 NONAME - _ZTV5Tools @ 61 NONAME + _ZNK17CpSettingsWrapper10metaObjectEv @ 48 NONAME + _ZNK17CpSettingsWrapper14isPhoneOfflineEv @ 49 NONAME + _ZNK17CpSettingsWrapper15readCenrepValueElm @ 50 NONAME + _ZNK17CpSettingsWrapper16readCenrepStringElm @ 51 NONAME + _ZNK17CpSettingsWrapper16writeCenrepValueElmRK8QVariant @ 52 NONAME + _ZNK17CpSettingsWrapper23numberGroupingSupportedEv @ 53 NONAME + _ZNK5Tools10metaObjectEv @ 54 NONAME + _ZTI12CpPhoneNotes @ 55 NONAME + _ZTI17CpSettingsWrapper @ 56 NONAME + _ZTI5Tools @ 57 NONAME + _ZTV12CpPhoneNotes @ 58 NONAME + _ZTV17CpSettingsWrapper @ 59 NONAME + _ZTV5Tools @ 60 NONAME diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -44,7 +44,7 @@ QList ret; ret.append(new CpSettingFormEntryItemDataImpl( - itemDataHelper, hbTrId("Telephony"), hbTrId(""))); + itemDataHelper, hbTrId("txt_cp_dblist_telephone"), hbTrId(""))); return ret; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp Mon May 03 12:31:11 2010 +0300 @@ -49,7 +49,7 @@ HbDataForm *form = qobject_cast(widget()); if (form) { HbDataFormModel *model = new HbDataFormModel; - form->setHeading(hbTrId("Telephone settings")); + form->setHeading(hbTrId("txt_phone_subhead_telephone")); // Create and initialize plugin's item data helper m_helper = initializeItemDataHelper(); QList items; @@ -62,11 +62,14 @@ DPRINT << ": Loading cpdivertsplugin"; items.append(groupItemFromPlugin("cpdivertplugin")); - // Load call mailboxes plugin DPRINT << ": Loading vmbxcpplugin"; items.append(groupItemFromPlugin("vmbxcpplugin")); + // Load barring plugin + DPRINT << ": Loading cpbarringplugin"; + items.append(groupItemFromPlugin("cpbarringplugin")); + // Insert items to form model foreach (CpSettingFormItemData* i, items) { model->appendDataFormItem(i); diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/run_auto_tests_qt.bat --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/run_auto_tests_qt.bat Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/run_auto_tests_qt.bat Mon May 03 12:31:11 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cellulardatasettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cellulardatasettings.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CellularDataSettings::CellularDataSettings +// ----------------------------------------------------------------------------- +// +CellularDataSettings::CellularDataSettings( ) + //: + //QObject( /**/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// CellularDataSettings::~CellularDataSettings +// ----------------------------------------------------------------------------- +// +CellularDataSettings::~CellularDataSettings( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CellularDataSettings::dataUseHome +// ----------------------------------------------------------------------------- +// +int CellularDataSettings::dataUseHome( ) + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// CellularDataSettings::setDataUseHome +// ----------------------------------------------------------------------------- +// +void CellularDataSettings::setDataUseHome( + int value ) + { + SMC_MOCK_METHOD1( void, int, value ) + } + + +// ----------------------------------------------------------------------------- +// CellularDataSettings::dataUseRoam +// ----------------------------------------------------------------------------- +// +int CellularDataSettings::dataUseRoam( ) + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// CellularDataSettings::setDataUseRoam +// ----------------------------------------------------------------------------- +// +void CellularDataSettings::setDataUseRoam( + int value ) + { + SMC_MOCK_METHOD1( void, int, value ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cmmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cmmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,435 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include "cmmanager.h" + +class RCmConnectionMethod +{ +public: + RCmConnectionMethod(){}; +}; + +class RCmDestination +{ +public: + RCmDestination(){}; +}; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// RCmManager::OpenL +// ----------------------------------------------------------------------------- +// +void RCmManager::OpenL( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::OpenLC +// ----------------------------------------------------------------------------- +// +void RCmManager::OpenLC( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::Close +// ----------------------------------------------------------------------------- +// +void RCmManager::Close( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoIntL +// ----------------------------------------------------------------------------- +// +TUint32 RCmManager::GetBearerInfoIntL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( TUint32, TUint32, aBearerType, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoBoolL +// ----------------------------------------------------------------------------- +// +TBool RCmManager::GetBearerInfoBoolL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( TBool, TUint32, aBearerType, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoStringL +// ----------------------------------------------------------------------------- +// +HBufC * RCmManager::GetBearerInfoStringL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( HBufC *, TUint32, aBearerType, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoString8L +// ----------------------------------------------------------------------------- +// +HBufC8 * RCmManager::GetBearerInfoString8L( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( HBufC8 *, TUint32, aBearerType, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoIntL +// ----------------------------------------------------------------------------- +// +TUint32 RCmManager::GetConnectionMethodInfoIntL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( TUint32, TUint32, aIapId, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoBoolL +// ----------------------------------------------------------------------------- +// +TBool RCmManager::GetConnectionMethodInfoBoolL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( TBool, TUint32, aIapId, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoStringL +// ----------------------------------------------------------------------------- +// +HBufC * RCmManager::GetConnectionMethodInfoStringL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( HBufC *, TUint32, aIapId, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoString8L +// ----------------------------------------------------------------------------- +// +HBufC8 * RCmManager::GetConnectionMethodInfoString8L( + TUint32 aIapId, + TUint32 aAttribute ) const + { + SMC_MOCK_METHOD2( HBufC8 *, TUint32, aIapId, + TUint32, aAttribute ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::ConnectionMethodL +// ----------------------------------------------------------------------------- +// +RCmConnectionMethod RCmManager::ConnectionMethodL( + TUint32 aConnectionMethodId ) const + { + SMC_MOCK_METHOD1( RCmConnectionMethod, TUint32, aConnectionMethodId ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::ConnectionMethodL +// ----------------------------------------------------------------------------- +// +void RCmManager::ConnectionMethodL( + RArray & aCMArray, + TBool aCheckBearerType, + TBool aLegacyOnly, + TBool aEasyWlan ) const + { + SMC_MOCK_METHOD4( void, RArray &, aCMArray, + TBool, aCheckBearerType, + TBool, aLegacyOnly, + TBool, aEasyWlan ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::AllDestinationsL +// ----------------------------------------------------------------------------- +// +void RCmManager::AllDestinationsL( + RArray & aDestArray ) const + { + SMC_MOCK_METHOD1( void, RArray &, aDestArray ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::DestinationL +// ----------------------------------------------------------------------------- +// +RCmDestination RCmManager::DestinationL( + TUint32 aDestinationId ) const + { + SMC_MOCK_METHOD1( RCmDestination, TUint32, aDestinationId ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::BearerPriorityArrayL +// ----------------------------------------------------------------------------- +// +void RCmManager::BearerPriorityArrayL( + RArray & aArray ) const + { + SMC_MOCK_METHOD1( void, RArray &, aArray ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CleanupGlobalPriorityArray +// ----------------------------------------------------------------------------- +// +void RCmManager::CleanupGlobalPriorityArray( + RArray & aArray ) const + { + SMC_MOCK_METHOD1( void, RArray &, aArray ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::EasyWlanIdL +// ----------------------------------------------------------------------------- +// +TUint32 RCmManager::EasyWlanIdL( ) const + { + SMC_MOCK_METHOD0( TUint32 ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::ReadDefConnL +// ----------------------------------------------------------------------------- +// +void RCmManager::ReadDefConnL( + TCmDefConnValue & ) + { + //SMC_MOCK_METHOD1( void, TCmDefConnValue &, aDCSetting ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::WriteDefConnL +// ----------------------------------------------------------------------------- +// +void RCmManager::WriteDefConnL( + const TCmDefConnValue & ) + { + //SMC_MOCK_METHOD1( void, const TCmDefConnValue &, aDCSetting ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::ReadGenConnSettingsL +// ----------------------------------------------------------------------------- +// +void RCmManager::ReadGenConnSettingsL( + TCmGenConnSettings & aGenConnSettings ) + { + SMC_MOCK_METHOD1( void, TCmGenConnSettings &, aGenConnSettings ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::WriteGenConnSettingsL +// ----------------------------------------------------------------------------- +// +void RCmManager::WriteGenConnSettingsL( + const TCmGenConnSettings & aGenConnSettings ) + { + SMC_MOCK_METHOD1( void, const TCmGenConnSettings &, aGenConnSettings ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CreateTablesAndOpenL +// ----------------------------------------------------------------------------- +// +void RCmManager::CreateTablesAndOpenL( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CreateDestinationL +// ----------------------------------------------------------------------------- +// +RCmDestination RCmManager::CreateDestinationL( + const TDesC & aName ) + { + SMC_MOCK_METHOD1( RCmDestination, const TDesC &, aName ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CreateConnectionMethodL +// ----------------------------------------------------------------------------- +// +RCmConnectionMethod RCmManager::CreateConnectionMethodL( + TUint32 aBearerType ) + { + SMC_MOCK_METHOD1( RCmConnectionMethod, TUint32, aBearerType ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CopyConnectionMethodL +// ----------------------------------------------------------------------------- +// +TInt RCmManager::CopyConnectionMethodL( + RCmDestination & aTargetDestination, + RCmConnectionMethod & aConnectionMethod ) + { + SMC_MOCK_METHOD2( TInt, RCmDestination &, aTargetDestination, + RCmConnectionMethod &, aConnectionMethod ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::MoveConnectionMethodL +// ----------------------------------------------------------------------------- +// +TInt RCmManager::MoveConnectionMethodL( + RCmDestination & aSourceDestination, + RCmDestination & aTargetDestination, + RCmConnectionMethod & aConnectionMethod ) + { + SMC_MOCK_METHOD3( TInt, RCmDestination &, aSourceDestination, + RCmDestination &, aTargetDestination, + RCmConnectionMethod &, aConnectionMethod ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::RemoveConnectionMethodL +// ----------------------------------------------------------------------------- +// +void RCmManager::RemoveConnectionMethodL( + RCmDestination & aDestination, + RCmConnectionMethod & aConnectionMethod ) + { + SMC_MOCK_METHOD2( void, RCmDestination &, aDestination, + RCmConnectionMethod &, aConnectionMethod ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::RemoveAllReferencesL +// ----------------------------------------------------------------------------- +// +void RCmManager::RemoveAllReferencesL( + RCmConnectionMethod & aConnectionMethod ) + { + SMC_MOCK_METHOD1( void, RCmConnectionMethod &, aConnectionMethod ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::UpdateBearerPriorityArrayL +// ----------------------------------------------------------------------------- +// +void RCmManager::UpdateBearerPriorityArrayL( + const RArray & aArray ) + { + SMC_MOCK_METHOD1( void, const RArray &, aArray ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CreateDestinationL +// ----------------------------------------------------------------------------- +// +RCmDestination RCmManager::CreateDestinationL( + const TDesC & aName, + TUint32 aDestId ) + { + SMC_MOCK_METHOD2( RCmDestination, const TDesC &, aName, + TUint32, aDestId ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::CreateConnectionMethodL +// ----------------------------------------------------------------------------- +// +RCmConnectionMethod RCmManager::CreateConnectionMethodL( + TUint32 aImplementationUid, + TUint32 aConnMethodId ) + { + SMC_MOCK_METHOD2( RCmConnectionMethod, TUint32, aImplementationUid, + TUint32, aConnMethodId ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::SupportedBearersL +// ----------------------------------------------------------------------------- +// +void RCmManager::SupportedBearersL( + RArray & aArray ) const + { + SMC_MOCK_METHOD1( void, RArray &, aArray ) + } + + +// ----------------------------------------------------------------------------- +// RCmManager::UncategorizedIconL +// ----------------------------------------------------------------------------- +// +CGulIcon * RCmManager::UncategorizedIconL( ) const + { + SMC_MOCK_METHOD0( CGulIcon * ) + } + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include #include "cpbarringplugingroup.h" // ============================ MEMBER FUNCTIONS =============================== @@ -111,6 +112,15 @@ bool, plural) } +// ----------------------------------------------------------------------------- +// CpBarringPluginGroup::barringPasswordChangeRequestCompleted +// ----------------------------------------------------------------------------- +// +void CpBarringPluginGroup::barringPasswordChangeRequestCompleted(int result) +{ + SMC_MOCK_METHOD1( void, int, result) +} + // ----------------------------------------------------------------------------- // CpBarringPluginGroup::changeBarringStateRequested @@ -123,6 +133,16 @@ // ----------------------------------------------------------------------------- +// CpBarringPluginGroup::changeBarringPasswordRequested +// ----------------------------------------------------------------------------- +// +void CpBarringPluginGroup::changeBarringPasswordRequested(bool checked) +{ + SMC_MOCK_METHOD1( void, bool, checked) +} + + +// ----------------------------------------------------------------------------- // CpBarringPluginGroup::processBarringStatusRequestQueue // ----------------------------------------------------------------------------- // diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp Mon May 03 12:31:11 2010 +0300 @@ -20,7 +20,11 @@ #include #include "cpnetworkpluginform.h" - +class CellularDataSettings +{ +public: + CellularDataSettings(); +}; // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -46,6 +50,28 @@ } // ----------------------------------------------------------------------------- +// CpNetworkPluginForm::cellularDataUseHomeStateChanged +// ----------------------------------------------------------------------------- +// +void CpNetworkPluginForm::cellularDataUseHomeStateChanged( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- +// CpNetworkPluginForm::cellularDataUseRoamStateChanged +// ----------------------------------------------------------------------------- +// +void CpNetworkPluginForm::cellularDataUseRoamStateChanged( + int index ) + { + SMC_MOCK_METHOD1( void, int, index ) + } + + +// ----------------------------------------------------------------------------- // CpNetworkPluginForm::networkModeStateChanged // ----------------------------------------------------------------------------- // diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkplugingroup.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include -#include "cpnetworkplugingroup.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::CpNetworkPluginGroup -// ----------------------------------------------------------------------------- -// -CpNetworkPluginGroup::CpNetworkPluginGroup( - CpItemDataHelper & helper ) - : - m_helper(helper) - { - - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::~CpNetworkPluginGroup -// ----------------------------------------------------------------------------- -// -CpNetworkPluginGroup::~CpNetworkPluginGroup( ) - { - - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::networkModeStateChanged -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::networkModeStateChanged( - int index ) - { - SMC_MOCK_METHOD1( void, int, index ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::operatorSelectionStateChanged -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::operatorSelectionStateChanged( - int index ) - { - SMC_MOCK_METHOD1( void, int, index ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::networkAccessModeGot -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::networkAccessModeGot( - int mode ) - { - SMC_MOCK_METHOD1( void, int, mode ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::availableNetworksGot -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::availableNetworksGot( - QList & m_networkInfoList ) - { - SMC_MOCK_METHOD1( void, QList &, m_networkInfoList ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::networkReqestFailed -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::networkReqestFailed( - PSetNetworkWrapper::ErrorCode error, - PSetNetworkWrapper::RequestType type ) - { - SMC_MOCK_METHOD2( void, PSetNetworkWrapper::ErrorCode, error, - PSetNetworkWrapper::RequestType, type ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::userCancel -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::userCancel( ) - { - SMC_MOCK_METHOD0( void ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::handleSearchingNetworks -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::handleSearchingNetworks( - PSetNetworkWrapper::RequestType & type ) - { - SMC_MOCK_METHOD1( void, PSetNetworkWrapper::RequestType &, type ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::handleRequestingSelectedNetwork -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::handleRequestingSelectedNetwork( - bool ongoing ) - { - SMC_MOCK_METHOD1( void, bool, ongoing ) - } - - -// ----------------------------------------------------------------------------- -// CpNetworkPluginGroup::handleNetworkChanged -// ----------------------------------------------------------------------------- -// -void CpNetworkPluginGroup::handleNetworkChanged( - PSetNetworkWrapper::NetworkInfo & currentInfo, - PSetNetworkWrapper::RegistrationStatus & status ) - { - SMC_MOCK_METHOD2( void, PSetNetworkWrapper::NetworkInfo &, currentInfo, - PSetNetworkWrapper::RegistrationStatus &, status ) - } - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp Mon May 03 12:31:11 2010 +0300 @@ -27,7 +27,7 @@ CpNetworkPluginView::CpNetworkPluginView( QGraphicsItem * parent ) : - CpBaseSettingView(0, parent), + /*CpBaseSettingView(0, parent),*/ m_networkSettingsForm(0) { diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 @@ -97,25 +97,6 @@ } // ----------------------------------------------------------------------------- -// CpPhoneNotes::showBasicServiceCallDivertList -// ----------------------------------------------------------------------------- -// -void CpPhoneNotes::showBasicServiceCallDivertList( - const QString & title, - const QList & divertStatuses, - int & selectionIndex, - CallDivertType divertType, - CallDivertType & divertDetailType ) - { - SMC_MOCK_METHOD5( void, const QString &, title, - const QList &, divertStatuses, - int &, selectionIndex, - CallDivertType, divertType, - CallDivertType &, divertDetailType ) - } - - -// ----------------------------------------------------------------------------- // CpPhoneNotes::showCallDivertDetails // ----------------------------------------------------------------------------- // @@ -127,6 +108,26 @@ // ----------------------------------------------------------------------------- +// CpPhoneNotes::showPasswordQueryDialog +// ----------------------------------------------------------------------------- +// +void CpPhoneNotes::showPasswordQueryDialog( + const QString &title, + const QValidator &validator, + int maxPasswordLength, + QString &password, + bool &ok) +{ + SMC_MOCK_METHOD5( void, + const QString &, title, + const QValidator &, validator, + int, maxPasswordLength, + QString &, password, + bool &, ok) +} + + +// ----------------------------------------------------------------------------- // CpPhoneNotes::cancelNote // ----------------------------------------------------------------------------- // @@ -137,6 +138,16 @@ // ----------------------------------------------------------------------------- +// CpPhoneNotes::noteShowing +// ----------------------------------------------------------------------------- +// +bool CpPhoneNotes::noteShowing() +{ + SMC_MOCK_METHOD0( bool ) +} + + +// ----------------------------------------------------------------------------- // CpPhoneNotes::activeNoteAboutToClose // ----------------------------------------------------------------------------- // @@ -145,6 +156,7 @@ SMC_MOCK_METHOD0( void ) } + // ----------------------------------------------------------------------------- // CpPhoneNotes::handleProgressNoteCanceled // ----------------------------------------------------------------------------- @@ -154,11 +166,13 @@ SMC_MOCK_METHOD0( void ) } + // ----------------------------------------------------------------------------- -// CpPhoneNotes::noteShowing +// CpPhoneNotes::passwordTextChanged // ----------------------------------------------------------------------------- // -bool CpPhoneNotes::noteShowing() + +void CpPhoneNotes::passwordTextChanged() { - SMC_MOCK_METHOD0( bool ) + SMC_MOCK_METHOD0( void ) } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpplugincommon.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpplugincommon.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpplugincommon.cpp Mon May 03 12:31:11 2010 +0300 @@ -138,18 +138,6 @@ SMC_MOCK_METHOD0( bool ) } - -// ----------------------------------------------------------------------------- -// Tools::convertEtelMobileServiceCode -// ----------------------------------------------------------------------------- -// -BasicServiceGroups Tools::convertEtelMobileServiceCode( - int serviceCode ) - { - SMC_MOCK_METHOD1( BasicServiceGroups, int, serviceCode ) - } - - // ----------------------------------------------------------------------------- // Tools::errorCodeTextMapping // ----------------------------------------------------------------------------- diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformentryitemdataimpl.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformentryitemdataimpl.cpp Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +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: -* -*/ - diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbabstractitemview.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbabstractitemview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbabstractitemview.cpp Mon May 03 12:31:11 2010 +0300 @@ -459,9 +459,8 @@ // ----------------------------------------------------------------------------- // QItemSelectionModel::SelectionFlags HbAbstractItemView::selectionCommand( - const HbAbstractViewItem * item, - const QEvent * event, - bool contiguousArea ) + const HbAbstractViewItem *item, + const QEvent *event ) { } @@ -477,29 +476,6 @@ } - -// ----------------------------------------------------------------------------- -// HbAbstractItemView::keyPressEvent -// ----------------------------------------------------------------------------- -// -void HbAbstractItemView::keyPressEvent( - QKeyEvent * event ) - { - - } - - -// ----------------------------------------------------------------------------- -// HbAbstractItemView::keyReleaseEvent -// ----------------------------------------------------------------------------- -// -void HbAbstractItemView::keyReleaseEvent( - QKeyEvent * event ) - { - - } - - // ----------------------------------------------------------------------------- // HbAbstractItemView::mousePressEvent // ----------------------------------------------------------------------------- diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbcheckbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbcheckbox.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include "hbcheckbox.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbCheckBox::HbCheckBox +// ----------------------------------------------------------------------------- +// +HbCheckBox::HbCheckBox( + const QString & text, + QGraphicsItem * parent ) + : + HbAbstractButton( parent ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::~HbCheckBox +// ----------------------------------------------------------------------------- +// +HbCheckBox::~HbCheckBox( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::setText +// ----------------------------------------------------------------------------- +// +void HbCheckBox::setText( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::text +// ----------------------------------------------------------------------------- +// +QString HbCheckBox::text( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::setTristate +// ----------------------------------------------------------------------------- +// +void HbCheckBox::setTristate( + bool isTristate ) + { + SMC_MOCK_METHOD1( void, bool, isTristate ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::isTristate +// ----------------------------------------------------------------------------- +// +bool HbCheckBox::isTristate( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::checkState +// ----------------------------------------------------------------------------- +// +Qt::CheckState HbCheckBox::checkState( ) const + { + SMC_MOCK_METHOD0( Qt::CheckState ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::primitive +// ----------------------------------------------------------------------------- +// +QGraphicsItem * HbCheckBox::primitive( + HbStyle::Primitive primitive ) const + { + SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::setCheckState +// ----------------------------------------------------------------------------- +// +void HbCheckBox::setCheckState( + Qt::CheckState state ) + { + SMC_MOCK_METHOD1( void, Qt::CheckState, state ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::updatePrimitives +// ----------------------------------------------------------------------------- +// +void HbCheckBox::updatePrimitives( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::initStyleOption +// ----------------------------------------------------------------------------- +// +void HbCheckBox::initStyleOption( + HbStyleOptionCheckBox * option ) const + { + SMC_MOCK_METHOD1( void, HbStyleOptionCheckBox *, option ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::resizeEvent +// ----------------------------------------------------------------------------- +// +void HbCheckBox::resizeEvent( + QGraphicsSceneResizeEvent * event ) + { + SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::hitButton +// ----------------------------------------------------------------------------- +// +bool HbCheckBox::hitButton( + const QPointF & pos ) const + { + SMC_MOCK_METHOD1( bool, const QPointF &, pos ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::checkStateSet +// ----------------------------------------------------------------------------- +// +void HbCheckBox::checkStateSet( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::nextCheckState +// ----------------------------------------------------------------------------- +// +void HbCheckBox::nextCheckState( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::mouseReleaseEvent +// ----------------------------------------------------------------------------- +// +void HbCheckBox::mouseReleaseEvent( + QGraphicsSceneMouseEvent * event ) + { + SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::mouseMoveEvent +// ----------------------------------------------------------------------------- +// +void HbCheckBox::mouseMoveEvent( + QGraphicsSceneMouseEvent * event ) + { + SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::keyPressEvent +// ----------------------------------------------------------------------------- +// +void HbCheckBox::keyPressEvent( + QKeyEvent * keyEvent ) + { + SMC_MOCK_METHOD1( void, QKeyEvent *, keyEvent ) + } + + +// ----------------------------------------------------------------------------- +// HbCheckBox::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbCheckBox::itemChange( + GraphicsItemChange change, + const QVariant & value ) + { + SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, + const QVariant &, value ) + } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbicon.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbicon.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbicon.cpp Mon May 03 12:31:11 2010 +0300 @@ -18,6 +18,15 @@ #include #include +class HbIconPrivate +{ +public: + HbIconPrivate(){}; + ~HbIconPrivate(){}; + + QAtomicInt ref; +}; + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -62,40 +71,6 @@ } - -// ----------------------------------------------------------------------------- -// HbIcon::= -// ----------------------------------------------------------------------------- -// -HbIcon & operator HbIcon::=( - const HbIcon & other ) - { -// SMC_MOCK_METHOD1( HbIcon & operator, const HbIcon &, other ) - } - - -// ----------------------------------------------------------------------------- -// HbIcon::= -// ----------------------------------------------------------------------------- -// -bool operator = HbIcon::=( - const HbIcon & other ) const - { -// SMC_MOCK_METHOD1( bool operator =, const HbIcon &, other ) - } - - -// ----------------------------------------------------------------------------- -// HbIcon::= -// ----------------------------------------------------------------------------- -// -bool operator HbIcon::=( - const HbIcon & other ) const - { -// SMC_MOCK_METHOD1( bool operator, const HbIcon &, other ) - } - - // ----------------------------------------------------------------------------- // HbIcon::~HbIcon // ----------------------------------------------------------------------------- @@ -278,17 +253,6 @@ // SMC_MOCK_METHOD0( qreal ) } - -// ----------------------------------------------------------------------------- -// HbIcon::mirroringMode -// ----------------------------------------------------------------------------- -// -MirroringMode HbIcon::mirroringMode( ) const - { -// SMC_MOCK_METHOD0( MirroringMode ) - } - - // ----------------------------------------------------------------------------- // HbIcon::setMirroringMode // ----------------------------------------------------------------------------- @@ -299,17 +263,6 @@ // SMC_MOCK_METHOD1( void, MirroringMode, mode ) } - -// ----------------------------------------------------------------------------- -// HbIcon::flags -// ----------------------------------------------------------------------------- -// -Flags HbIcon::flags( ) const - { -// SMC_MOCK_METHOD0( Flags ) - } - - // ----------------------------------------------------------------------------- // HbIcon::setFlags // ----------------------------------------------------------------------------- @@ -343,16 +296,6 @@ // ----------------------------------------------------------------------------- -// HbIcon::QVariant -// ----------------------------------------------------------------------------- -// -operator HbIcon::QVariant( ) const - { -// SMC_MOCK_METHOD0( operator ) - } - - -// ----------------------------------------------------------------------------- // HbIcon::qicon // ----------------------------------------------------------------------------- // @@ -362,13 +305,3 @@ } -// ----------------------------------------------------------------------------- -// HbIcon::animator -// ----------------------------------------------------------------------------- -// -HbIconAnimator & HbIcon::animator( ) - { - // SMC_MOCK_METHOD0( HbIconAnimator & ) - } - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidgetitem.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidgetitem.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidgetitem.cpp Mon May 03 12:31:11 2010 +0300 @@ -108,90 +108,6 @@ // ----------------------------------------------------------------------------- -// HbListWidgetItem::decorationText -// ----------------------------------------------------------------------------- -// -QString HbListWidgetItem::decorationText( ) const - { - SMC_MOCK_METHOD0( QString ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::setDecorationText -// ----------------------------------------------------------------------------- -// -void HbListWidgetItem::setDecorationText( - const QString & text ) - { - SMC_MOCK_METHOD1( void, const QString &, text ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::decorationIcon -// ----------------------------------------------------------------------------- -// -HbIcon HbListWidgetItem::decorationIcon( ) const - { -// SMC_MOCK_METHOD0( HbIcon ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::setDecorationIcon -// ----------------------------------------------------------------------------- -// -void HbListWidgetItem::setDecorationIcon( - const HbIcon & icon ) - { -// SMC_MOCK_METHOD1( void, const HbIcon &, icon ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::secondaryDecorationText -// ----------------------------------------------------------------------------- -// -QString HbListWidgetItem::secondaryDecorationText( ) const - { - SMC_MOCK_METHOD0( QString ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::setSecondaryDecorationText -// ----------------------------------------------------------------------------- -// -void HbListWidgetItem::setSecondaryDecorationText( - const QString & text ) - { - SMC_MOCK_METHOD1( void, const QString &, text ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::secondaryDecorationIcon -// ----------------------------------------------------------------------------- -// -HbIcon HbListWidgetItem::secondaryDecorationIcon( ) const - { -// SMC_MOCK_METHOD0( HbIcon ) - } - - -// ----------------------------------------------------------------------------- -// HbListWidgetItem::setSecondaryDecorationIcon -// ----------------------------------------------------------------------------- -// -void HbListWidgetItem::setSecondaryDecorationIcon( - const HbIcon & icon ) - { -// SMC_MOCK_METHOD1( void, const HbIcon &, icon ) - } - - -// ----------------------------------------------------------------------------- // HbListWidgetItem::setEnabled // ----------------------------------------------------------------------------- // diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidgetbase.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidgetbase.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidgetbase.cpp Mon May 03 12:31:11 2010 +0300 @@ -27,7 +27,7 @@ HbWidgetBase::HbWidgetBase( HbWidgetBasePrivate & dd, QGraphicsItem * parent, - Qt::WindowFlags wFlags ) + Qt::WindowFlags wFlags ) :d_ptr() //: //HbAbstractItem( /*dd, parent, wFlags*/ ) { @@ -36,19 +36,6 @@ // ----------------------------------------------------------------------------- -// HbWidgetBase::Q_PROPERTY -// ----------------------------------------------------------------------------- -// -void HbWidgetBase::Q_PROPERTY( - HbFontSpec fontSpec READ fontSpec WRITE setFontSpec ):HbWidgetBase ( QGraphicsItem * parent, - Qt::WindowFlags wFlags ) - { - SMC_MOCK_METHOD2( void, HbFontSpec fontSpec READ fontSpec WRITE setFontSpec ):HbWidgetBase ( QGraphicsItem *, parent, - Qt::WindowFlags, wFlags ) - } - - -// ----------------------------------------------------------------------------- // HbWidgetBase::~HbWidgetBase // ----------------------------------------------------------------------------- // diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallbarringwrapper.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallbarringwrapper.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallbarringwrapper.cpp Mon May 03 12:31:11 2010 +0300 @@ -94,3 +94,18 @@ SMC_MOCK_METHOD3( void, int/*PsServiceGroup*/, static_cast(serviceGroup), BarringType, barringType, QString, barringPassword ) } + +// ----------------------------------------------------------------------------- +// PSetCallBarringWrapper::changeBarringPassword +// ----------------------------------------------------------------------------- +// +void PSetCallBarringWrapper::changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword) +{ + SMC_MOCK_METHOD3( void, + const QString &, oldPassword, + const QString &, newPassword, + const QString &, verifiedPassword ) +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper.cpp Mon May 03 12:31:11 2010 +0300 @@ -117,5 +117,5 @@ // void PSetCallDivertingWrapper::getVoiceMailBoxNumber(QString &number) { - SMC_MOCK_METHOD1( void, QString, number ) + SMC_MOCK_METHOD1( void, QString&, number ) } \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qtranslator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qtranslator.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include "qtranslator.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// QTranslator::QTranslator +// ----------------------------------------------------------------------------- +// +QTranslator::QTranslator( + QObject * parent ) + : + QObject( parent ) + { + + } + + +// ----------------------------------------------------------------------------- +// QTranslator::~QTranslator +// ----------------------------------------------------------------------------- +// +QTranslator::~QTranslator( ) + { + if (QCoreApplication::instance()) + { + QCoreApplication::removeTranslator(this); + } + } + + +// ----------------------------------------------------------------------------- +// QTranslator::translate +// ----------------------------------------------------------------------------- +// +QString QTranslator::translate( + const char * aContext, + const char * sourceText, + const char * disambiguation ) const + { + SMC_MOCK_METHOD3( QString, const char *, aContext, + const char *, sourceText, + const char *, disambiguation ) + } + + +// ----------------------------------------------------------------------------- +// QTranslator::translate +// ----------------------------------------------------------------------------- +// +QString QTranslator::translate( + const char * aContext, + const char * sourceText, + const char * disambiguation, + int n ) const + { + SMC_MOCK_METHOD4( QString, const char *, aContext, + const char *, sourceText, + const char *, disambiguation, + int, n ) + } + + +// ----------------------------------------------------------------------------- +// QTranslator::isEmpty +// ----------------------------------------------------------------------------- +// +bool QTranslator::isEmpty( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// QTranslator::load +// ----------------------------------------------------------------------------- +// +bool QTranslator::load( + const QString & filename, + const QString & directory, + const QString & search_delimiters, + const QString & suffix ) + { + SMC_MOCK_METHOD4( bool, const QString &, filename, + const QString &, directory, + const QString &, search_delimiters, + const QString &, suffix ) + } + + +// ----------------------------------------------------------------------------- +// QTranslator::load +// ----------------------------------------------------------------------------- +// +bool QTranslator::load( + const uchar * data, + int len ) + { + SMC_MOCK_METHOD2( bool, const uchar *, data, + int, len ) + } diff -r 6bb1b21d2484 -r 2f8f8080a020 phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.pro --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.pro Mon May 03 12:31:11 2010 +0300 @@ -17,13 +17,14 @@ CONFIG += qtestlib hb TEMPLATE = app TARGET = +MOC_DIR = moc INCLUDEPATH += . INCLUDEPATH += ../../barringplugin/inc INCLUDEPATH += ../../callsplugin/src INCLUDEPATH += ../../cptelephonyutils/inc INCLUDEPATH += ../../divertplugin/src -INCLUDEPATH += ../../networkplugin/src +INCLUDEPATH += ../../cpnetworkplugin/src INCLUDEPATH += ../../cpnetworkplugin/src INCLUDEPATH += ../../telephonyplugin/src INCLUDEPATH += /sf/mw/phonesrv/cellular/telephonysettings/xqbindings/psetwrapper/src @@ -43,7 +44,6 @@ } HEADERS += ut_mockintegrity.h -SOURCES += ut_mockintegrity.cpp HEADERS += ../../callsplugin/src/cpcallsplugin.h \ ../../cptelephonyutils/inc/cpphonenotes.h \ @@ -59,29 +59,6 @@ /epoc32/include/mw/xqsettingsmanager.h \ /epoc32/include/mw/xqsysinfo.h -SOURCES += \ - mock_cpbarringplugin.cpp \ - mock_cpbarringplugingroup.cpp \ - mock_cpcallsplugin.cpp \ - mock_cpcallsplugingroup.cpp \ - mock_cpnetworkplugin.cpp \ - mock_cpnetworkpluginview.cpp \ - mock_cpnetworkplugingroup.cpp \ - mock_cpphonenotes.cpp \ - mock_cpplugincommon.cpp \ - mock_cptelephonypluginview.cpp \ - mock_psetcalldivertingwrapper.cpp \ - mock_psetcalldivertingwrapper_p.cpp \ - mock_psetcallwaitingwrapper.cpp \ - mock_psetcallwaitingwrapper_p.cpp \ - mock_psetcliwrapper.cpp \ - mock_psetcliwrapper_p.cpp \ - mock_psetnetworkwrapper.cpp \ - mock_psetnetworkwrapper_p.cpp \ - mock_psetwrapper.cpp \ - mock_sssettingswrapper.cpp \ - mock_xqsettingskey.cpp \ - mock_xqsettingsmanager.cpp \ - mock_xqsysinfo.cpp \ - mock_psetcallbarringwrapper.cpp +SOURCES += *.cpp + \ No newline at end of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/bubblecore.pro --- a/phoneuis/bubblemanager2/bubblecore/bubblecore.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/bubblecore.pro Mon May 03 12:31:11 2010 +0300 @@ -34,6 +34,8 @@ "$${LITERAL_HASH}endif" MMP_RULES += defFiles + + LIBS += -lthumbnailmanagerqt } else:win32 { # Put it to Hb/lib because it is in path diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/bubblecore.qrc --- a/phoneuis/bubblemanager2/bubblecore/bubblecore.qrc Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/bubblecore.qrc Mon May 03 12:31:11 2010 +0300 @@ -46,12 +46,12 @@ themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg themes/icons/hbdefault/scalable/qtg_large_active_call.svg themes/icons/hbdefault/scalable/qtg_large_end_call.svg - themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg - themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg - themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg - themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg - themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg - themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg + themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg + themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg + themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg + themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg + effects/bubble_muted_disappear.fxml + effects/bubble_muted_appear.fxml diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/bwins/bubblecoreu.def --- a/phoneuis/bubblemanager2/bubblecore/bwins/bubblecoreu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/bwins/bubblecoreu.def Mon May 03 12:31:11 2010 +0300 @@ -61,4 +61,5 @@ ?setCallFlags@BubbleManager@@UAEXHH@Z @ 60 NONAME ; void BubbleManager::setCallFlags(int, int) ?addRowToConference@BubbleManager@@UAEXH@Z @ 61 NONAME ; void BubbleManager::addRowToConference(int) ?setLabel@BubbleManager@@UAEXHABVQString@@W4TextElideMode@Qt@@@Z @ 62 NONAME ; void BubbleManager::setLabel(int, class QString const &, enum Qt::TextElideMode) + ?releaseImageIfNotUsed@BubbleManager@@AAEXABVQString@@@Z @ 63 NONAME ; void BubbleManager::releaseImageIfNotUsed(class QString const &) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/eabi/bubblecoreu.def --- a/phoneuis/bubblemanager2/bubblecore/eabi/bubblecoreu.def Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/eabi/bubblecoreu.def Mon May 03 12:31:11 2010 +0300 @@ -105,4 +105,5 @@ _ZThn28_NK13BubbleManager23selectionIdInConferenceEv @ 104 NONAME _ZThn8_N13BubbleManagerD0Ev @ 105 NONAME _ZThn8_N13BubbleManagerD1Ev @ 106 NONAME + _ZN13BubbleManager21releaseImageIfNotUsedERK7QString @ 107 NONAME diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_appear.fxml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,13 @@ + + + + + 0.2 + + 0 + 1 + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_disappear.fxml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,12 @@ + + + + + 0.2 + + 1 + 0 + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri --- a/phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri Mon May 03 12:31:11 2010 +0300 @@ -28,7 +28,11 @@ src/bubblehandler.h \ src/bubbleexpandedhandler.h \ src/bubblecollapsedhandler.h \ - src/bubbleconferencehandler.h + src/bubbleconferencehandler.h \ + src/bubbleimagemanager.h \ + src/bubbleimagemanager_p.h \ + src/bubbleeffecthandler.h + SOURCES += src/bubblemanager2.cpp \ src/bubbleheader.cpp \ src/bubbleimagewidget.cpp \ @@ -44,4 +48,12 @@ src/bubblehandler.cpp \ src/bubbleexpandedhandler.cpp \ src/bubblecollapsedhandler.cpp \ - src/bubbleconferencehandler.cpp + src/bubbleconferencehandler.cpp \ + src/bubbleimagemanager.cpp \ + src/bubbleeffecthandler.cpp + +symbian { + SOURCES += src/bubbleimagemanager_p.cpp +} else:win32 { + SOURCES += src/bubbleimagemanager_p_stub.cpp +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,105 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "bubbleeffecthandler.h" + +const char *BUBBLE_MUTED_APPEAR_FXML = ":/bubble_muted_appear.fxml"; +const char *BUBBLE_MUTED_DISAPPEAR_FXML = ":/bubble_muted_disappear.fxml"; +const char *BUBBLE_APPEAR_EVENT = "appear"; +const char *BUBBLE_DISAPPEAR_EVENT = "disappear"; + + +BubbleEffectHandler::BubbleEffectHandler(QObject* parent) + : QObject(parent) +{ +} + +BubbleEffectHandler::~BubbleEffectHandler() +{ +} + +void BubbleEffectHandler::addEffect(QGraphicsItem* item, BubbleEffect effect) +{ + switch (effect) { + case BubbleMutedAppear: + HbEffect::add(item, BUBBLE_MUTED_APPEAR_FXML, BUBBLE_APPEAR_EVENT); + mEffectItem.insert(effect,item); + break; + case BubbleMutedDisappear: + HbEffect::add(item, BUBBLE_MUTED_DISAPPEAR_FXML, BUBBLE_DISAPPEAR_EVENT); + mEffectItem.insert(effect,item); + break; + default: + break; + } +} + +void BubbleEffectHandler::removeEffect(QGraphicsItem* item, BubbleEffect effect) +{ + switch (effect) { + case BubbleMutedAppear: + HbEffect::remove(item, BUBBLE_MUTED_APPEAR_FXML, BUBBLE_APPEAR_EVENT); + mEffectItem.remove(effect); + break; + case BubbleMutedDisappear: + HbEffect::remove(item, BUBBLE_MUTED_DISAPPEAR_FXML, BUBBLE_DISAPPEAR_EVENT); + mEffectItem.remove(effect); + break; + default: + break; + } +} + +void BubbleEffectHandler::startEffect(BubbleEffect effect) +{ + QGraphicsItem* item; + + switch (effect) { + case BubbleMutedAppear: + item = mEffectItem.value(effect); + Q_ASSERT(item); + item->setVisible(true); + HbEffect::start(item, BUBBLE_APPEAR_EVENT); + break; + case BubbleMutedDisappear: + item = mEffectItem.value(effect); + Q_ASSERT(item); + item->setVisible(true); + HbEffect::start(item, BUBBLE_DISAPPEAR_EVENT, + this, "handleEffectFinished", QVariant(effect)); + break; + default: + break; + } +} + +void BubbleEffectHandler::handleEffectFinished( + const HbEffect::EffectStatus &status) +{ + int effect = status.userData.toInt(); + + switch (effect) { + case BubbleMutedDisappear: + if (status.item) { + status.item->setVisible(false); + } + break; + default: + break; + } +} diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,53 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef BUBBLEEFFECTHANDLER_H_ +#define BUBBLEEFFECTHANDLER_H_ + +#include +#include +#include + +class QGraphicsItem; + +enum BubbleEffect + { + BubbleMutedAppear = 1, + BubbleMutedDisappear + }; + +class BubbleEffectHandler : public QObject + { + Q_OBJECT + +public: + explicit BubbleEffectHandler(QObject* parent = 0); + virtual ~BubbleEffectHandler(); + + void addEffect(QGraphicsItem* item, BubbleEffect effect); + void removeEffect(QGraphicsItem* item, BubbleEffect effect); + + void startEffect(BubbleEffect effect); + +protected slots: + void handleEffectFinished(const HbEffect::EffectStatus &status); + +protected: + QMap mEffectItem; + }; + +#endif /* BUBBLEEFFECTHANDLER_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -82,9 +82,12 @@ mHeading->readBubbleHeader(header); - if (header.callImage().length()) { + if (!mHeader->callImage().isEmpty() || + header.showDefaultAvatar()) { mImage->setImage(header.callImage()); mImage->show(); + } else { + mImage->hide(); } setButtons(mHeader->actions()); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleheader.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.cpp Mon May 03 12:31:11 2010 +0300 @@ -43,6 +43,7 @@ mCallImage.clear(); mIsInConference = false; mExpandAction = 0; + mShowDefaultAvatar = false; } void BubbleHeader::setIsUsed( bool used ) @@ -200,6 +201,16 @@ return mCallImage; } +void BubbleHeader::setShowDefaultAvatar(bool show) +{ + mShowDefaultAvatar = show; +} + +bool BubbleHeader::showDefaultAvatar() const +{ + return mShowDefaultAvatar; +} + void BubbleHeader::addAction ( HbAction* action ) { mActions.append( action ); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleheader.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.h Mon May 03 12:31:11 2010 +0300 @@ -85,6 +85,10 @@ // caller image void setCallImage( const QString& image ); const QString& callImage() const; + + // default avatar + void setShowDefaultAvatar(bool show); + bool showDefaultAvatar() const; // actions void addAction( HbAction* action ); @@ -120,6 +124,7 @@ QList mActions; HbAction* mExpandAction; bool mIsInConference; + bool mShowDefaultAvatar; }; #endif /* BUBBLEHEADER_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,53 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "bubbleimagemanager.h" +#include "bubbleimagemanager_p.h" + +BubbleImageManager::BubbleImageManager(QObject* parent) + : QObject(parent), + d_ptr(new BubbleImageManagerPrivate(this)) +{ +} + +BubbleImageManager::~BubbleImageManager() +{ + delete d_ptr; +} + +const QPixmap* BubbleImageManager::pixmap( + const QString& imageFileName) +{ + return d_ptr->pixmap(imageFileName); +} + +void BubbleImageManager::loadImage(const QString& imageFileName) +{ + d_ptr->loadImage(imageFileName); +} + +void BubbleImageManager::unloadImage(const QString& imageFileName) +{ + d_ptr->unloadImage(imageFileName); +} + +void BubbleImageManager::releasePixmaps() +{ + d_ptr->releasePixmaps(); +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,50 @@ +/*! +* 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 BUBBLEIMAGEMANAGER_H_ +#define BUBBLEIMAGEMANAGER_H_ + +#include +#include + +class BubbleImageManagerPrivate; + +class BubbleImageManager : public QObject + { + Q_OBJECT + +public: + explicit BubbleImageManager(QObject* parent = 0); + virtual ~BubbleImageManager(); + + const QPixmap* pixmap(const QString& imageFileName); + + void loadImage(const QString& imageFileName); + + void unloadImage(const QString& imageFileName); + + void releasePixmaps(); + +signals: + void pixmapReady(const QString& imageFileName); + +protected: + BubbleImageManagerPrivate* const d_ptr; + Q_DECLARE_PRIVATE(BubbleImageManager) + }; + +#endif /* BUBBLEIMAGEMANAGER_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,171 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "bubbleimagemanager_p.h" +#include "bubbleimagemanager.h" +#include + +//#define BUBBLE_IMAGEMANAGER_DEBUG +#if defined(BUBBLE_IMAGEMANAGER_DEBUG) + #define BUBBLE_QDEBUG( a ) + #define BUBBLE_QDEBUG_2( a, b) +#else + #define BUBBLE_QDEBUG( a )\ + qDebug() << a; + + #define BUBBLE_QDEBUG_2( a, b)\ + qDebug() << a << b; +#endif + +BubbleImageManagerPrivate::BubbleImageManagerPrivate( + BubbleImageManager* parent) + : q_ptr(parent), + mInitialized(false) +{ +} + +BubbleImageManagerPrivate::~BubbleImageManagerPrivate() +{ +} + +void BubbleImageManagerPrivate::initialize() +{ + mThumbnailManager = new ThumbnailManager(this); + + mThumbnailManager->setMode(ThumbnailManager::Default); + + mThumbnailManager->setQualityPreference( + ThumbnailManager::OptimizeForPerformance); + + mThumbnailManager->setThumbnailSize( + ThumbnailManager::ThumbnailLarge); + + connect(mThumbnailManager, + SIGNAL(thumbnailReady(QPixmap, void *, int, int)), + this, + SLOT(thumbnailReady(QPixmap, void *, int, int))); + + mInitialized = true; +} + +const QPixmap* BubbleImageManagerPrivate::pixmap( + const QString& imageFileName) +{ + if (mImageCache.contains(imageFileName)) { + return mImageCache.value(imageFileName); + } else { + return 0; + } +} + +void BubbleImageManagerPrivate::loadImage(const QString& imageFileName) +{ + if (mImageCache.contains(imageFileName) || + isLoading(imageFileName)) { + return; + } + + if (!mInitialized) { + // connect to thumbnail server + initialize(); + } + + BUBBLE_QDEBUG_2("loading image: ", imageFileName); + + QString* data = new QString(imageFileName); + int reqId = mThumbnailManager->getThumbnail(imageFileName, data); + mRequestQueue.enqueue(qMakePair(imageFileName,reqId)); +} + +void BubbleImageManagerPrivate::unloadImage(const QString& imageFileName) +{ + BUBBLE_QDEBUG_2("unloading image: ", imageFileName); + + // returns null, if key doesn't exists + QPixmap* pixmap = mImageCache.take(imageFileName); + delete pixmap; + + // cancel possible outstanding request + QMutableListIterator< QPair > requests(mRequestQueue); + while(requests.hasNext()) { + QPair& request = requests.next(); + + if (request.first==imageFileName) { + BUBBLE_QDEBUG_2("cancelling request: ", imageFileName); + mThumbnailManager->cancelRequest(request.second); + requests.remove(); + break; + } + } +} + +void BubbleImageManagerPrivate::releasePixmaps() +{ + BUBBLE_QDEBUG_2("releasing all pixmaps: ", mImageCache.count()); + + // release all cached pixmaps + QList pixmaps = mImageCache.values(); + qDeleteAll(pixmaps); + mImageCache.clear(); +} + +void BubbleImageManagerPrivate::thumbnailReady( + const QPixmap& pixmap, void *data, int id, int error) +{ + QString* fileName = (QString*)data; + + if (error==0 && fileName) { + QPixmap *p = new QPixmap(pixmap); + mImageCache.insert(*fileName,p); + emit q_ptr->pixmapReady(*fileName); + BUBBLE_QDEBUG_2("thumbnailReady: ", *fileName); + } + + // request complete, remove it from queue + QMutableListIterator< QPair > requests(mRequestQueue); + while(requests.hasNext()) { + QPair& request = requests.next(); + if (request.second==id) { + BUBBLE_QDEBUG_2("deleting completed request: ", *fileName); + requests.remove(); + break; + } + } + + delete fileName; +} + +void BubbleImageManagerPrivate::thumbnailReady() +{ +} + +bool BubbleImageManagerPrivate::isLoading(const QString& imageFileName) const +{ + bool loading = false; + + QListIterator< QPair > requests(mRequestQueue); + while(requests.hasNext()) { + if (requests.next().first==imageFileName) { + loading = true; + break; + } + } + + return loading; +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,67 @@ +/*! +* 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 BUBBLEIMAGEMANAGER_P_H_ +#define BUBBLEIMAGEMANAGER_P_H_ + +#include +#include +#include +#include +#include + +class ThumbnailManager; +class BubbleImageManager; + +class BubbleImageManagerPrivate : public QObject + { + Q_OBJECT + + Q_DECLARE_PUBLIC( BubbleImageManager ) + +public: + explicit BubbleImageManagerPrivate(BubbleImageManager* parent = 0); + virtual ~BubbleImageManagerPrivate(); + + const QPixmap* pixmap(const QString& imageFileName); + + void loadImage(const QString& imageFileName); + + void unloadImage(const QString& imageFileName); + + void releasePixmaps(); + +protected: + void initialize(); + bool isLoading(const QString& imageFileName) const; + +protected slots: + void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); + void thumbnailReady(); // for stub + +signals: + void pixmapReady(const QString& imageFileName); + +private: + BubbleImageManager* q_ptr; + ThumbnailManager* mThumbnailManager; + QMap mImageCache; + QQueue< QPair > mRequestQueue; + bool mInitialized; + }; + +#endif /* BUBBLEIMAGEMANAGER_P_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p_stub.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,143 @@ +/*! +* 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: Stub implementation for desktop environment. +* +*/ + +#include +#include +#include +#include "bubbleimagemanager.h" +#include "bubbleimagemanager_p.h" + +BubbleImageManagerPrivate::BubbleImageManagerPrivate( + BubbleImageManager* parent) + : q_ptr(parent), mInitialized(false) +{ +} + +BubbleImageManagerPrivate::~BubbleImageManagerPrivate() +{ +} + +void BubbleImageManagerPrivate::initialize() +{ + mInitialized = true; +} + +const QPixmap* BubbleImageManagerPrivate::pixmap( + const QString& imageFileName) +{ + if (mImageCache.contains(imageFileName)) { + return mImageCache.value(imageFileName); + } else { + return 0; + } +} + +void BubbleImageManagerPrivate::loadImage(const QString& imageFileName) +{ + if (mImageCache.contains(imageFileName) || + isLoading(imageFileName)) { + return; + } + + if (!mInitialized) { + // connect to thumbnail server + initialize(); + } + + qDebug() << "loading image: " << imageFileName; + + mRequestQueue.enqueue(qMakePair(imageFileName,0)); + QTimer::singleShot(100,this,SLOT(thumbnailReady())); +} + +void BubbleImageManagerPrivate::unloadImage(const QString& imageFileName) +{ + qDebug() << "unloading image: " << imageFileName; + + // returns null, if key doesn't exists + QPixmap* pixmap = mImageCache.take(imageFileName); + delete pixmap; + + // cancel possible outstanding request + QMutableListIterator< QPair > requests(mRequestQueue); + while(requests.hasNext()) { + if (requests.next().first==imageFileName) { + qDebug() << "cancelling request: " << imageFileName; + //requests.remove(); + requests.value().second = 1; // mark as cancelled + break; + } + } +} + +void BubbleImageManagerPrivate::releasePixmaps() +{ + qDebug() << "releasing all pixmaps: " << mImageCache.count(); + // release all cached pixmaps + QList pixmaps = mImageCache.values(); + qDeleteAll(pixmaps); + mImageCache.clear(); +} + +void BubbleImageManagerPrivate::thumbnailReady( + const QPixmap& pixmap, void *data, int id, int error) +{ + Q_UNUSED(pixmap); + Q_UNUSED(data); + Q_UNUSED(id); + Q_UNUSED(error); +} + +void BubbleImageManagerPrivate::thumbnailReady() +{ + QPair request = mRequestQueue.dequeue(); + + if (request.second==1) { + // canceled + return; + } + + QString readFile = request.first; + qDebug() << "reading: " << readFile; + + QImageReader reader(readFile); + QSize size(reader.size()); + QImage *image = new QImage(); + if (reader.read(image)) { + QPixmap *pixmap = new QPixmap(); + *pixmap = QPixmap::fromImage(*image); + mImageCache.insert(readFile,pixmap); + emit q_ptr->pixmapReady(readFile); + } + delete image; +} + +bool BubbleImageManagerPrivate::isLoading(const QString& imageFileName) const +{ + bool loading = false; + + QListIterator< QPair > requests(mRequestQueue); + while(requests.hasNext()) { + if (requests.next().first==imageFileName) { + loading = true; + break; + } + } + + return loading; +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -12,36 +12,98 @@ * Contributors: * * Description: Widget to display contact image. +* Displays default avatar, when image is not set. * */ -#include +#include +#include +#include "bubbleimagemanager.h" #include "bubbleimagewidget.h" +#include "bubbleprimitives.h" +#include "bubblestyleoption.h" -BubbleImageWidget::BubbleImageWidget(QGraphicsItem* parent) - : HbWidget(parent), mLabel(new HbLabel(this)) +BubbleImageWidget::BubbleImageWidget(const QString& stylePluginName, + BubbleImageManager& imageManager, QGraphicsItem* parent) + : HbWidget(parent), mStylePluginName(stylePluginName), + mImageManager(imageManager), mDefaultAvatar(0) { - mLabel->setAlignment(Qt::AlignCenter); - mLabel->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); + setPluginBaseId(style()->registerPlugin(mStylePluginName)); + Q_ASSERT(pluginBaseId()!=-1); + + // create avatar + delete mDefaultAvatar; + mDefaultAvatar = style()->createPrimitive( + (HbStyle::Primitive)(pluginBaseId()+BP_DefaultAvatar_icon), this); + style()->setItemName( mDefaultAvatar, "default_avatar" ); + + connect(&mImageManager,SIGNAL(pixmapReady(QString)), + this,SLOT(imageLoaded(QString))); } BubbleImageWidget::~BubbleImageWidget() { + style()->unregisterPlugin(mStylePluginName); } void BubbleImageWidget::setImage(const QString& name) { - if (name != mImageName) { - HbIcon icon(name); - mLabel->setIcon(icon); + mImageName = name; + + if (!mImageName.isEmpty()) { + mDefaultAvatar->setVisible(false); + mImageManager.loadImage(mImageName); + } else { + BubbleStyleOption option; + style()->updatePrimitive( + mDefaultAvatar, + (HbStyle::Primitive)(pluginBaseId()+BP_DefaultAvatar_icon), + &option); + mDefaultAvatar->setVisible(true); + } +} + +void BubbleImageWidget::imageLoaded(QString imageFileName) +{ + if (imageFileName==mImageName) { + update(); // does nothing if invisible } } -void BubbleImageWidget::resizeEvent( - QGraphicsSceneResizeEvent *event) +void BubbleImageWidget::paint( + QPainter* painter, + const QStyleOptionGraphicsItem* option, + QWidget* widget) { - Q_UNUSED(event); - // set geometry without layout manager, because - // image size is not defined in docml - mLabel->setGeometry(rect()); + Q_UNUSED(option); + Q_UNUSED(widget); + + if (mImageName.isEmpty()) + return; + + const QPixmap* pixmap = + mImageManager.pixmap(mImageName); + + if (pixmap) { + // up or downscales images to fill image area + QSize imageSize(pixmap->size()); + QSize sourceSize(rect().size().toSize()); + sourceSize.scale(imageSize,Qt::KeepAspectRatio); + QRect sourceRect(QPoint(0,0),sourceSize); + int xOff = (imageSize.width() - sourceSize.width())/2; + int yOff = (imageSize.height() - sourceSize.height())/2; + sourceRect.moveLeft(xOff); + sourceRect.moveTop(yOff); + // qDebug() << "imageSize:" << imageSize; + // qDebug() << "sourceRect:" << sourceRect; + painter->setRenderHint(QPainter::SmoothPixmapTransform); + +#ifdef __WINS__ + // sourceRect crashes emulator, RC ou1cimx1#320113 + painter->drawPixmap(rect().toRect(),*pixmap); +#else + painter->drawPixmap(rect().toRect(),*pixmap,sourceRect); +#endif + + } } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h Mon May 03 12:31:11 2010 +0300 @@ -20,24 +20,35 @@ #include -class HbLabel; +class BubbleImageManager; class BubbleImageWidget : public HbWidget { Q_OBJECT public: - explicit BubbleImageWidget( QGraphicsItem* parent = 0 ); + explicit BubbleImageWidget( + const QString& stylePluginName, + BubbleImageManager& imageManager, + QGraphicsItem* parent = 0 ); virtual ~BubbleImageWidget(); void setImage(const QString& name); - void resizeEvent( - QGraphicsSceneResizeEvent * event ); - +protected slots: + void imageLoaded(QString imageFileName); + +protected: + void paint( + QPainter* painter, + const QStyleOptionGraphicsItem* option, + QWidget* widget); + private: + QString mStylePluginName; + BubbleImageManager& mImageManager; QString mImageName; - HbLabel* mLabel; + QGraphicsItem* mDefaultAvatar; }; #endif /* BUBBLEIMAGEWIDGET_H_ */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp Mon May 03 12:31:11 2010 +0300 @@ -30,7 +30,9 @@ #include "bubbleconferenceheader.h" #include "bubbleutils.h" #include "bubblewidgetmanager.h" +#include "bubbleimagemanager.h" #include "bubblehandler.h" +#include "bubbleeffecthandler.h" BubbleManager::BubbleManager( QGraphicsItem *parent ) : @@ -53,7 +55,12 @@ mConferenceHeader = new BubbleConferenceHeader(); mConferenceHeader->setBubbleId(BUBBLE_CONF_CALL_ID); - mWidgetManager = new BubbleWidgetManager(mDefaultStyleBaseId,this); + mBubbleImageManager = new BubbleImageManager(this); + + mEffectHandler = new BubbleEffectHandler(this); + + mWidgetManager = new BubbleWidgetManager( + *mBubbleImageManager, mDefaultStyleBaseId, this); mWidgetManager->setStylePluginName( BubbleUtils::stylePluginNameWithPath("bubblestyleplugin.dll")); @@ -139,6 +146,10 @@ view->show(); } + if (!mActiveHeaders.count()) { + mBubbleImageManager->releasePixmaps(); + } + // restore mute state setPhoneMuted(mMuted); @@ -269,8 +280,10 @@ for ( int i=0; i < mActiveHeaders.size(); i++ ) { if ( mActiveHeaders[i]->bubbleId() == bubbleId ) { + QString image = mActiveHeaders[i]->callImage(); mActiveHeaders[i]->reset(); mActiveHeaders.remove( i ); + releaseImageIfNotUsed(image); break; } } @@ -458,7 +471,7 @@ findActiveHeader( bubbleId, header ); Q_ASSERT( header ); - header->setCallImage("qtg_large_avatar"); + header->setShowDefaultAvatar(true); } /** @@ -527,12 +540,22 @@ Q_ASSERT(mMutedIcon); addToLayout(mMutedIcon); mMutedIcon->setZValue(10.0); + mEffectHandler->addEffect(mMutedIcon,BubbleMutedAppear); + mEffectHandler->addEffect(mMutedIcon,BubbleMutedDisappear); + } + + if (mMutedIcon) { + // run effect when mute status changes + if (muted && !mMuted) { + mEffectHandler->startEffect(BubbleMutedAppear); + } else if (!muted && mMuted) { + mEffectHandler->startEffect(BubbleMutedDisappear); + } else { + mMutedIcon->setVisible(muted); + } } mMuted = muted; - if (mMutedIcon) { - mMutedIcon->setVisible(mMuted); - } } /** @@ -597,6 +620,9 @@ Q_ASSERT( !header->isConference() ); mConferenceHeader->addHeader(header); + + // release image while in conference + releaseImageIfNotUsed(header->callImage()); } /** @@ -873,4 +899,23 @@ } } +void BubbleManager::releaseImageIfNotUsed( + const QString& imageFileName) +{ + bool used = false; + if (!imageFileName.isEmpty()) { + foreach(BubbleHeader* header, mActiveHeaders) { + if (!header->isInConference() && + header->callImage()==imageFileName) { + used = true; + break; + } + } + + if (!used) { + mBubbleImageManager->unloadImage(imageFileName); + } + } +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -18,6 +18,7 @@ #include #include #include +#include #include "bubblewidgetmanager.h" #include "bubblecontainerwidget.h" #include "bubbleimagewidget.h" @@ -36,16 +37,20 @@ class BubbleDocumentLoader : public HbDocumentLoader { public: - BubbleDocumentLoader(const QString& stylePluginName); + BubbleDocumentLoader(BubbleImageManager& imageManager, + const QString& stylePluginName); virtual QObject *createObject(const QString& type, const QString &name); private: - QString mStylePluginName; + BubbleImageManager& mImageManager; + QString mStylePluginName; }; -BubbleWidgetManager::BubbleWidgetManager(int style, QObject* parent) - : QObject(parent), mStyleBaseId(style),mOrientation(Qt::Vertical) +BubbleWidgetManager::BubbleWidgetManager( + BubbleImageManager& imageManager, int style, QObject* parent) + : QObject(parent), mImageManager(imageManager), mStyleBaseId(style), + mOrientation(Qt::Vertical) { // .docml mappings mFileNames.insert(SingleCallView,":/xml/bubble_layout_1.docml"); @@ -70,6 +75,7 @@ mWidgetName.insert(RightButton, "rightButton"); mWidgetName.insert(ConferenceTimer,"callTimer"); mWidgetName.insert(ParticipantList,"participantList"); + mWidgetName.insert(MutedIcon, "mutedIcon"); mButtonStyle.insert(LeftButton, new BubbleButtonStyle()); mButtonStyle.insert(CenterButton, new BubbleButtonStyle()); @@ -113,7 +119,7 @@ Qt::Orientation orientation) { BubbleDocumentLoader* loader = - new BubbleDocumentLoader(mStylePluginName); + new BubbleDocumentLoader(mImageManager,mStylePluginName); bool ok; loader->load(mFileNames[view],&ok); @@ -144,6 +150,8 @@ setButtonStyle(LeftButton, widget(view,ExpandedBubble,LeftButton)); setButtonStyle(CenterButton, widget(view,ExpandedBubble,CenterButton)); setButtonStyle(RightButton, widget(view,ExpandedBubble,RightButton)); + + setBackground(widget(view,None,MutedIcon)); } void BubbleWidgetManager::setButtonStyle(Widget widget, QGraphicsWidget* button) @@ -156,6 +164,17 @@ } } +void BubbleWidgetManager::setBackground(QGraphicsWidget* widget) +{ + HbWidget* w; + w = qobject_cast(widget); + if (w) { + HbFrameItem* item = + new HbFrameItem("qtg_fr_popup_trans",HbFrameDrawer::NinePieces); + w->setBackgroundItem(item); // takes ownership + } +} + void BubbleWidgetManager::createDocumentHandlers(View view) { Q_ASSERT(mDocumentLoaders.contains(view)); @@ -256,8 +275,9 @@ } // custom widget loading -BubbleDocumentLoader::BubbleDocumentLoader(const QString& stylePluginName) - : mStylePluginName(stylePluginName) +BubbleDocumentLoader::BubbleDocumentLoader( + BubbleImageManager& imageManager, const QString& stylePluginName) + : mImageManager(imageManager), mStylePluginName(stylePluginName) { } @@ -272,7 +292,8 @@ } if ( type == BubbleImageWidget::staticMetaObject.className() ) { - QObject *object = new BubbleImageWidget(); + QObject *object = new BubbleImageWidget( + mStylePluginName, mImageManager); object->setObjectName(name); return object; } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h Mon May 03 12:31:11 2010 +0300 @@ -25,6 +25,7 @@ class BubbleDocumentLoader; class BubbleHandler; class BubbleButtonStyle; +class BubbleImageManager; class BubbleWidgetManager : public QObject { @@ -58,11 +59,15 @@ ConferenceTimer, ParticipantList, ParticipantListItem, - ParticipantListButton + ParticipantListButton, + MutedIcon }; public: - BubbleWidgetManager(int style, QObject* parent=0); + BubbleWidgetManager( + BubbleImageManager& imageManager, + int style, + QObject* parent=0); virtual ~BubbleWidgetManager(); QGraphicsWidget* view(View view); @@ -90,8 +95,10 @@ void createDocumentHandlers(View view); void applyCustomStyles(View view); void setButtonStyle(Widget widget, QGraphicsWidget* button); + void setBackground(QGraphicsWidget* widget); private: + BubbleImageManager& mImageManager; int mStyleBaseId; QString mStylePluginName; Qt::Orientation mOrientation; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg --- a/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg Fri Apr 16 14:58:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblestyle/bubblestyle.qrc --- a/phoneuis/bubblemanager2/bubblestyle/bubblestyle.qrc Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblestyle/bubblestyle.qrc Mon May 03 12:31:11 2010 +0300 @@ -5,5 +5,7 @@ layout/bubbleparticipantlistitem.css layout/bubbleheadingwidget.widgetml layout/bubbleheadingwidget.css + layout/bubbleimagewidget.widgetml + layout/bubbleimagewidget.css diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.css Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,7 @@ + + +BubbleImageWidget +{ + layout: avatar_layout; +} + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.widgetml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.cpp --- a/phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -94,6 +94,10 @@ item = icon; } break; + case BP_DefaultAvatar_icon: { + HbIconItem* icon = new HbIconItem(parent); + item = icon; + } default: break; } // switch @@ -178,6 +182,13 @@ } break; + case BP_DefaultAvatar_icon: { + HbIconItem* icon = static_cast(item); + icon->setIconName("qtg_large_avatar"); + icon->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); + icon->setAlignment(Qt::AlignCenter); + } + default: break; } // switch @@ -255,11 +266,11 @@ case BubbleManagerIF::Alerting: case BubbleManagerIF::Waiting: if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_voip_received_call"); - anim->appendIcon("qtg_large_voip_dialled_call"); + anim->appendIcon("qtg_large_voip_call_active"); + anim->appendIcon("qtg_large_voip_call_waiting"); } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_video_received_call"); - anim->appendIcon("qtg_large_video_dialled_call"); + anim->appendIcon("qtg_large_video_call_active"); + anim->appendIcon("qtg_large_video_call_waiting"); } else { anim->appendIcon("qtg_large_active_call"); anim->appendIcon("qtg_large_waiting_call"); @@ -268,18 +279,18 @@ case BubbleManagerIF::Outgoing: case BubbleManagerIF::Active: if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_voip_received_call"); + anim->appendIcon("qtg_large_voip_call_active"); } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_video_received_call"); + anim->appendIcon("qtg_large_video_call_active"); } else { anim->appendIcon("qtg_large_active_call"); } break; case BubbleManagerIF::OnHold: if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_voip_dialled_call"); + anim->appendIcon("qtg_large_voip_call_waiting"); } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_video_dialled_call"); + anim->appendIcon("qtg_large_video_call_waiting"); } else { anim->appendIcon("qtg_large_waiting_call"); } @@ -287,9 +298,9 @@ case BubbleManagerIF::Disconnected: case BubbleManagerIF::AlertToDisconnected: if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_voip_missed_call"); + anim->appendIcon("qtg_large_end_call"); } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_video_missed_call"); + anim->appendIcon("qtg_large_end_call"); } else { anim->appendIcon("qtg_large_end_call"); } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/inc/bubblemanager2.h --- a/phoneuis/bubblemanager2/inc/bubblemanager2.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/inc/bubblemanager2.h Mon May 03 12:31:11 2010 +0300 @@ -33,9 +33,11 @@ class BubbleHeader; class BubbleConferenceHeader; class BubbleWidgetManager; +class BubbleImageManager; class HbAction; class HbStackedLayout; class BubbleHandler; +class BubbleEffectHandler; static const int BUBBLE_MAX_CALL_COUNT = 7; static const int BUBBLE_CONF_CALL_ID = 10; @@ -341,6 +343,7 @@ bool findActiveHeader(int bubbleId, BubbleHeader*& header); void findNextDrawableHeader(int& index) const; void polishEvent(); + void releaseImageIfNotUsed(const QString& imageFileName); private slots: void showExpanded( int bubbleId ); @@ -357,9 +360,11 @@ QGraphicsWidget* mMutedIcon; bool mSortHeaders; BubbleWidgetManager* mWidgetManager; + BubbleImageManager* mBubbleImageManager; HbStackedLayout* mMainLayout; bool mInitialized; bool mBubbleSelectionDisabled; + BubbleEffectHandler* mEffectHandler; }; #endif /* BUBBLEMANAGER2_H */ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/inc/bubbleprimitives.h --- a/phoneuis/bubblemanager2/inc/bubbleprimitives.h Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/inc/bubbleprimitives.h Mon May 03 12:31:11 2010 +0300 @@ -27,6 +27,7 @@ BP_CallStatus_icon, BP_NumberType_icon, BP_Ciphering_icon, + BP_DefaultAvatar_icon, BP_Bubble_primitive_count }; diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.cpp --- a/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.cpp Mon May 03 12:31:11 2010 +0300 @@ -75,6 +75,7 @@ BubbleTestView::~BubbleTestView() { + toolBar()->clearActions(); delete mBubbleTester; } @@ -868,7 +869,7 @@ connect( mUnmute, SIGNAL(triggered()), this, SLOT(setMuted()), Qt::QueuedConnection ); // not connected to anywhere - mActivateLoudspeaker = new HbAction(HbIcon("qtg_mono_loudspeaker"), "", this); + mActivateLoudspeaker = new HbAction(HbIcon("qtg_mono_speaker"), "", this); mActivateHandset = new HbAction(HbIcon("qtg_mono_mobile"), "", this); mSendMessage = new HbAction(HbIcon("qtg_mono_send"), "", this); mSilence = new HbAction(HbIcon("qtg_mono_speaker_off"), "", this); diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/checkcoverage.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/checkcoverage.cmd Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,42 @@ +@echo off +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo on +:FINAL + +@echo off + +rmdir /q /s coverage +mkdir coverage +cd coverage + +if not "%1"=="mt_bubblemanager2" ( +echo Instrumenting %1 +call qmake^ + ..\%1\%1.pro +call ctcwrap^ + mingw32-make debug +call %1.exe +) + +call ctcpost^ + mon.sym mon.dat^ + -p profile.txt +call ctc2html -i profile.txt +cd .. +echo All done! + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.cpp Mon May 03 12:31:11 2010 +0300 @@ -37,13 +37,10 @@ void initTestCase(); void cleanupTestCase(); - void testConferenceCall(); - -private: void testBasicMtCall(); void testBasicMoCall(); void testWaitingCall(); - + void testConferenceCall(); void testEmergencyCall(); private: diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/unit.pro --- a/phoneuis/bubblemanager2/tsrc/unit/unit.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/unit.pro Mon May 03 12:31:11 2010 +0300 @@ -23,9 +23,11 @@ SUBDIRS += ut_bubblestyleoption SUBDIRS += ut_bubblecontainerwidget SUBDIRS += ut_bubbleheadingwidget +SUBDIRS += ut_bubbleimagemanager SUBDIRS += ut_bubbleimagewidget SUBDIRS += ut_bubbleparticipantlistitem SUBDIRS += ut_bubblebuttonstyle SUBDIRS += ut_bubbleanimiconitem SUBDIRS += ut_bubblestyleplugin +SUBDIRS += ut_bubbleeffecthandler SUBDIRS += mt_bubblemanager2 diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_appear.fxml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,13 @@ + + + + + 0.2 + + 0 + 1 + + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_disappear.fxml Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,12 @@ + + + + + 0.2 + + 1 + 0 + + + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,122 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "bubbletest.h" +#include "bubbleeffecthandler.h" + +class Container : public HbWidget +{ +public: + Container(); + ~Container(); + + HbLabel *mLabel; +}; + +Container::Container() +{ + mLabel = new HbLabel(this); + mLabel->setAlignment(Qt::AlignCenter); + HbFontSpec spec; + spec.setRole(HbFontSpec::Primary); + spec.setTextHeight(30); + mLabel->setFontSpec(spec); + QGraphicsLinearLayout* layout = + new QGraphicsLinearLayout(Qt::Vertical); + layout->addItem(mLabel); + + setLayout(layout); +} + +Container::~Container() +{ +} + +class ut_BubbleEffectHandler : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void testMuteAppearEffect(); + void testMuteDisappearEffect(); + +private: + HbMainWindow* mWindow; + BubbleEffectHandler *mEffectHandler; + Container *mContainer; +}; + +void ut_BubbleEffectHandler::initTestCase() +{ + mWindow = new HbMainWindow(); + mEffectHandler = new BubbleEffectHandler(); + mContainer = new Container(); + mContainer->mLabel->setVisible(false); + mWindow->addView(mContainer); + mWindow->show(); +} + +void ut_BubbleEffectHandler::cleanupTestCase() +{ + delete mEffectHandler; + delete mWindow; +} + +void ut_BubbleEffectHandler::testMuteAppearEffect() +{ + QVERIFY(mContainer->mLabel->isVisible()==false); + QTest::qWait(500); + + mContainer->mLabel->setPlainText("Appearing"); + + mEffectHandler->addEffect(mContainer->mLabel,BubbleMutedAppear); + mEffectHandler->startEffect(BubbleMutedAppear); + QTest::qWait(1000); + + QVERIFY(mContainer->mLabel->isVisible()==true); + + mEffectHandler->removeEffect(mContainer->mLabel,BubbleMutedAppear); +} + +void ut_BubbleEffectHandler::testMuteDisappearEffect() +{ + QVERIFY(mContainer->mLabel->isVisible()==true); + + mContainer->mLabel->setPlainText("Disappearing"); + + mEffectHandler->addEffect(mContainer->mLabel,BubbleMutedDisappear); + mEffectHandler->startEffect(BubbleMutedDisappear); + QTest::qWait(1000); + + QVERIFY(mContainer->mLabel->isVisible()==false); + + mEffectHandler->removeEffect(mContainer->mLabel,BubbleMutedDisappear); +} + +BUBBLE_TEST_MAIN(ut_BubbleEffectHandler) +#include "ut_bubbleeffecthandler.moc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,36 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../../bubblecore/src +INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared +CONFIG += hb qtestlib + +symbian { + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE +} else:win32 { + DESTDIR = ./ +} + +# +HEADERS += bubbleeffecthandler.h +SOURCES += ut_bubbleeffecthandler.cpp \ + bubbleeffecthandler.cpp +RESOURCES += ut_bubbleeffecthandler.qrc + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.qrc Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,6 @@ + + + resources/bubble_muted_disappear.fxml + resources/bubble_muted_appear.fxml + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.cpp Mon May 03 12:31:11 2010 +0300 @@ -43,6 +43,7 @@ void testSecondaryCli(); void testTimerCost(); void testCallImage(); + void testShowDefaultAvatar(); void testAddActions(); void testIsConference(); void testIsInConference(); @@ -165,6 +166,14 @@ QVERIFY( bubbleHeader->callImage() == "image.png" ); } +void ut_BubbleHeader::testShowDefaultAvatar() +{ + bubbleHeader->setShowDefaultAvatar(true); + QVERIFY( bubbleHeader->showDefaultAvatar() == true); + bubbleHeader->setShowDefaultAvatar(false); + QVERIFY( bubbleHeader->showDefaultAvatar() == false); +} + void ut_BubbleHeader::testAddActions() { for ( int i=0; i < 4; i++ ) diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic1.png Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic1.png has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic2.jpg Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic2.jpg has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,230 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "bubbletest.h" +#include "bubbleimagemanager.h" + +static const int WAIT_TIME = 500; + +class ut_BubbleImageManager : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void testLoadImage(); + void testLoadImageQueued(); + void testLoadNonExistingImage(); + + void testUnloadImageOutstandingRequest(); + + void testReleasePixmaps(); + +private: + QString fileNameWithPath(const QString& fileName); + +private: + BubbleImageManager* mImageManager; +}; + +void ut_BubbleImageManager::initTestCase() +{ + mImageManager = new BubbleImageManager(); +} + +void ut_BubbleImageManager::cleanupTestCase() +{ + delete mImageManager; +} + +QString ut_BubbleImageManager::fileNameWithPath(const QString& fileName) +{ +#ifdef __WINS__ + return "c:/data/images/" + fileName; +#else + return ":/resources/" + fileName; +#endif +} + +void ut_BubbleImageManager::testLoadImage() +{ + QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString))); + + QString imageFile1 = fileNameWithPath("testpic1.png"); + qDebug() << imageFile1; + mImageManager->loadImage(imageFile1); + + // wait loading to finish + QTest::qWait(2*WAIT_TIME); + + QVERIFY(spy.count()==1); + QList arguments = spy.takeFirst(); + QVERIFY(arguments.at(0).toString() == imageFile1); + + const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1!=0); + + // try to load cached image + mImageManager->loadImage(imageFile1); + QVERIFY(spy.count()==0); + + QString imageFile2 = fileNameWithPath("testpic2.jpg"); + qDebug() << imageFile2; + mImageManager->loadImage(imageFile2); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + QVERIFY(spy.count()==1); + arguments.clear(); + arguments = spy.takeFirst(); + QVERIFY(arguments.at(0).toString() == imageFile2); + + const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2); + QVERIFY(pixmap2!=0); + + mImageManager->unloadImage(imageFile1); + mImageManager->unloadImage(imageFile2); +} + +void ut_BubbleImageManager::testLoadImageQueued() +{ + QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString))); + + QString imageFile1 = fileNameWithPath("testpic1.png"); + qDebug() << imageFile1; + mImageManager->loadImage(imageFile1); + + QString imageFile2 = fileNameWithPath("testpic2.jpg"); + qDebug() << imageFile2; + mImageManager->loadImage(imageFile2); + + // try to load images that are being loaded + mImageManager->loadImage(imageFile1); + mImageManager->loadImage(imageFile2); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + QVERIFY(spy.count()==2); + + const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1!=0); + + const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2); + QVERIFY(pixmap2!=0); + + mImageManager->unloadImage(imageFile1); + mImageManager->unloadImage(imageFile2); +} + +void ut_BubbleImageManager::testLoadNonExistingImage() +{ + QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString))); + + QString imageFile1 = fileNameWithPath("foobar.png"); + qDebug() << imageFile1; + mImageManager->loadImage(imageFile1); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + QVERIFY(spy.count()==0); + + const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1==0); + + mImageManager->unloadImage(imageFile1); +} + +void ut_BubbleImageManager::testUnloadImageOutstandingRequest() +{ + QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString))); + + QString imageFile1 = fileNameWithPath("testpic1.png"); + qDebug() << imageFile1; + mImageManager->loadImage(imageFile1); + QTest::qWait(50); + mImageManager->unloadImage(imageFile1); + mImageManager->unloadImage("foobar.png"); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + QVERIFY(spy.count()==0); + + const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1==0); + + QString imageFile2 = fileNameWithPath("testpic2.jpg");; + qDebug() << imageFile2; + mImageManager->loadImage(imageFile2); + + QTest::qWait(50); + mImageManager->unloadImage(imageFile2); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + QVERIFY(spy.count()==0); + + const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2); + QVERIFY(pixmap2==0); +} + +void ut_BubbleImageManager::testReleasePixmaps() +{ + QString imageFile1 = fileNameWithPath("testpic1.png"); + qDebug() << imageFile1; + mImageManager->loadImage(imageFile1); + + QString imageFile2 = fileNameWithPath("testpic2.jpg"); + qDebug() << imageFile2; + mImageManager->loadImage(imageFile2); + + // wait loading to finish + QTest::qWait(WAIT_TIME); + + const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1!=0); + + const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2); + QVERIFY(pixmap2!=0); + + mImageManager->releasePixmaps(); + + pixmap1 = mImageManager->pixmap(imageFile1); + QVERIFY(pixmap1==0); + + pixmap2 = mImageManager->pixmap(imageFile2); + QVERIFY(pixmap2==0); +} + +BUBBLE_TEST_MAIN(ut_BubbleImageManager) +#include "ut_bubbleimagemanager.moc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,51 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../../bubblecore/src +INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared +CONFIG += hb qtestlib + +symbian { + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB + + BLD_INF_RULES.prj_exports += \ + "./resources/testpic1.png /epoc32/winscw/c/data/images/testpic1.png" + BLD_INF_RULES.prj_exports += \ + "./resources/testpic2.jpg /epoc32/winscw/c/data/images/testpic2.jpg" + +} else:win32 { + DESTDIR = ./ +} + +HEADERS += ../../../bubblecore/src/bubbleimagemanager.h \ + ../../../bubblecore/src/bubbleimagemanager_p.h +SOURCES += ut_bubbleimagemanager.cpp \ + ../../../bubblecore/src/bubbleimagemanager.cpp + +symbian { + SOURCES += ../../../bubblecore/src/bubbleimagemanager_p.cpp + LIBS += -lthumbnailmanagerqt +} else:win32 { + SOURCES += ../../../bubblecore/src/bubbleimagemanager_p_stub.cpp +} + +RESOURCES += ut_bubbleimagemanager.qrc + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.qrc Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,6 @@ + + + resources/testpic1.png + resources/testpic2.jpg + + diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp Mon May 03 12:31:11 2010 +0300 @@ -27,6 +27,7 @@ #include "bubbletest.h" #include "bubbleimagewidget.h" +#include "bubbleimagemanager.h" class ut_BubbleImageWidget : public QObject { @@ -38,18 +39,33 @@ void testPixmap(); void testWidePixmap(); - void testVector(); + void testDefaultAvatar(); + +private: + QString fileNameWithPath(const QString& fileName); private: BubbleImageWidget* mImage; HbMainWindow* mMainWindow; int mStyleBaseId; + BubbleImageManager* mImageManager; }; +QString ut_BubbleImageWidget::fileNameWithPath(const QString& fileName) +{ +#ifdef __WINS__ + return "c:/data/images/" + fileName; +#else + return ":/data/" + fileName; +#endif +} + void ut_BubbleImageWidget::initTestCase() { mMainWindow = new HbMainWindow(); - mImage = new BubbleImageWidget(); + mImageManager = new BubbleImageManager(); + mImage = new BubbleImageWidget( + BUBBLE_STYLE_PLUGIN,*mImageManager); mMainWindow->addView(mImage); mMainWindow->show(); } @@ -57,31 +73,34 @@ void ut_BubbleImageWidget::cleanupTestCase() { delete mMainWindow; + delete mImageManager; } void ut_BubbleImageWidget::testPixmap() { - mImage->setImage(":/data/pixmap.png"); - mImage->update(); + mImage->hide(); + mImage->setImage(fileNameWithPath("pixmap.png")); + mImage->show(); // set same image again - mImage->setImage(":/data/pixmap.png"); - QTest::qWait(100); + QTest::qWait(500); // there is now way to verify using public API } void ut_BubbleImageWidget::testWidePixmap() { - mImage->setImage(":/data/pixmap_wide.png"); - mImage->update(); - QTest::qWait(100); + mImage->hide(); + mImage->setImage(fileNameWithPath("pixmap_wide.png")); + mImage->show(); + QTest::qWait(500); // there is now way to verify using public API } -void ut_BubbleImageWidget::testVector() +void ut_BubbleImageWidget::testDefaultAvatar() { - mImage->setImage(":/data/vector.svg"); - mImage->update(); - QTest::qWait(100); + mImage->hide(); + mImage->setImage(""); + mImage->show(); + QTest::qWait(500); // there is now way to verify using public API } diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro Mon May 03 12:31:11 2010 +0300 @@ -23,14 +23,34 @@ symbian { INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = ALL -TCB + + + BLD_INF_RULES.prj_exports += \ + "./data/pixmap.png /epoc32/winscw/c/data/images/pixmap.png" + BLD_INF_RULES.prj_exports += \ + "./data/pixmap_wide.png /epoc32/winscw/c/data/images/pixmap_wide.png" + } else:win32 { DESTDIR = ./ } # -HEADERS += ../../../bubblecore/src/bubbleimagewidget.h +HEADERS += ../../../bubblecore/src/bubbleimagewidget.h \ + ../../../bubblecore/src/bubbleimagemanager.h \ + ../../../bubblecore/src/bubbleimagemanager_p.h SOURCES += ut_bubbleimagewidget.cpp \ ../../../bubblecore/src/bubbleimagewidget.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp + ../../../bubblecore/src/bubblestyleoption.cpp \ + ../../../bubblecore/src/bubbleimagemanager.cpp + +symbian { + SOURCES += ../../../bubblecore/src/bubbleimagemanager_p.cpp + LIBS += -lthumbnailmanagerqt +} else:win32 { + SOURCES += ../../../bubblecore/src/bubbleimagemanager_p_stub.cpp +} + RESOURCES += ut_bubbleimagewidget.qrc diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.cpp Fri Apr 16 14:58:25 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.cpp Mon May 03 12:31:11 2010 +0300 @@ -53,6 +53,7 @@ void testVoipCallStatusIcon(); void testNumberTypeIcon(); void testCipheringIcon(); + void testAvatar(); private: BubbleStylePlugin* mPluginInstance; @@ -365,5 +366,21 @@ QVERIFY(icon->icon().iconName()==""); } +void ut_BubbleStylePlugin::testAvatar() +{ + QGraphicsItem *item = mPlugin->createPrimitive( + (HbStyle::Primitive)(BP_DefaultAvatar_icon),mParent); + QVERIFY(item); + QVERIFY(item->parentItem()==mParent); + + HbIconItem* icon = qgraphicsitem_cast(item); + QVERIFY(icon); + BubbleStyleOption option; + mPlugin->updatePrimitive( + item, (HbStyle::Primitive)(BP_DefaultAvatar_icon), + &option); + QVERIFY(icon->icon().iconName()=="qtg_large_avatar"); +} + BUBBLE_TEST_MAIN(ut_BubbleStylePlugin) #include "ut_bubblestyleplugin.moc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/inc/tflogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/inc/tflogger.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2002-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 __TFLOGGER_H__ +#define __TFLOGGER_H__ + +#include +#include + +_LIT(KTfLogFolder, "ussd"); +_LIT(KTfLogFile, "ussdeditor.txt"); + +/** +* ------------------------------------------------------------------------------ +* +* Remove #define LOGGING_ENABLED from comments to enable logging +* +* ------------------------------------------------------------------------------ +*/ + +#ifdef _DEBUG +#define LOGGING_ENABLED +#endif + +/** +* ------------------------------------------------------------------------------ +* +* LOGGING MACROs +* +* USE THESE MACROS IN YOUR CODE +* +* Example: TFLOGTEXT(own_desc) +* Example: TFLOGSTRING("Test") +* Example: TFLOGSTRING("Test %i", aValue) +* Example: TFLOGSTRING("Test %i %i", aValue1, aValue2) +* +* ------------------------------------------------------------------------------ +*/ + +#ifdef LOGGING_ENABLED + + #define TFLOGTEXT(TEXT) \ + { \ + RFileLogger::Write(KTfLogFolder,KTfLogFile, \ + EFileLoggingModeAppend, TEXT); \ + RDebug::Print(TEXT); \ + } + + #define TFLOGSTRING(TEXT) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::Write(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + tempLogDes()); \ + RDebug::Print(_L(TEXT)); \ + } + + #define TFLOGSTRING2(TEXT, VAR1) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::WriteFormat(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + TRefByValue(tempLogDes()), VAR1); \ + RDebug::Print(_L(TEXT), VAR1); \ + } + + #define TFLOGSTRING3(TEXT, VAR1, VAR2) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::WriteFormat(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + TRefByValue(tempLogDes()), VAR1, VAR2); \ + RDebug::Print(_L(TEXT), VAR1, VAR2); \ + } + +#else + + #define TFLOGTEXT(TEXT) + #define TFLOGSTRING(TEXT) + #define TFLOGSTRING2(TEXT, VAR1) + #define TFLOGSTRING3(TEXT, VAR1, VAR2) + +#endif // LOGGING_ENABLED + +#endif // __TFLOGGER_H__ diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/inc/ussdcomms.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/inc/ussdcomms.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 USSDCOMMS_H +#define USSDCOMMS_H + +#include + +class CPhCltUssdInt; + +class CUssdComms: public QObject +{ + Q_OBJECT + +public: + CUssdComms(QObject* parent); + ~CUssdComms(); + +public slots: + void appStarting(); + void appTerminating(); + void appToBackground(); + void appToForeground(); + void informExitReason(int aExitReason); + +public: + int send( const QString& message ); + void cancel(); + int errorCode(); + +private: // Data + + /** USSD server client api */ + CPhCltUssdInt *mUssd; + + /** error code */ + int mErrorCode; +}; + +#endif // USSDCOMMS_H + +// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/inc/ussdeditorquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/inc/ussdeditorquery.h Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,46 @@ +/* +* 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 USSDEDITORQUERY_H +#define USSDEDITORQUERY_H + +// INCLUDES +#include + +class CUssdComms; + +class UssdEditorQuery: public HbInputDialog +{ + Q_OBJECT + +public: + UssdEditorQuery( CUssdComms &ussd, QGraphicsItem *parent = 0); + ~UssdEditorQuery(); + +private slots: + void sendUssdString(); + void cancelUssdString(); + void updateButtonVisible( const QString &text ); +private: + // From main.cpp + CUssdComms &mComms; +}; + +#endif // USSDEDITORQUERY_H + +// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/rom/ussdeditor.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/rom/ussdeditor.iby Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,26 @@ +; +; 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: IBY file for satapp application +; +; + +#ifndef __USSDEDITOR_IBY__ +#define __USSDEDITOR_IBY__ + +#include + +file=ABI_DIR\BUILD_DIR\ussdeditor.exe SHARED_LIB_DIR\ussdeditor.exe +data=ZSYSTEM\install\ussdeditor_stub.sis system\install\ussdeditor_stub.sis + +#endif diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/rom/ussdeditor.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/rom/ussdeditor.pkg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,34 @@ +; +; 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: For packing sat application update. +; + +; Language +&EN + +; SIS header: name, uid, version +#{"ussdeditor"},(0x10005955),10,1,0, TYPE=PU + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + +; Executable and default resource files +"/epoc32/release/armv5/urel/ussdeditor.exe" - "!:\sys\bin\ussdeditor.exe" +"/epoc32/data/z/resource/apps/ussdeditor.rsc" - "!:\resource\apps\ussdeditor.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/ussdeditor_reg.rsc" - "!:\private\10003a3f\import\apps\ussdeditor_reg.rsc" + +; Manual PKG post-rules from PRO files diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/rom/ussdeditor_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/rom/ussdeditor_stub.pkg Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,31 @@ +; +; 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: For packing sat application stub. +; +; Languages +&EN + +; Header +#{"ussdeditor"}, (0x10005955), 1, 0, 0, TYPE=SA + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Files +""-"z:\sys\bin\ussdeditor.exe" +""-"z:\resource\apps\ussdeditor.rsc" +""-"z:\private\10003a3f\import\apps\ussdeditor_reg.rsc" diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/rom/ussdeditor_stub.sis Binary file phoneuis/ussdeditor/rom/ussdeditor_stub.sis has changed diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/rom/ussdeditorresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/rom/ussdeditorresources.iby Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,29 @@ +/* +* 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: Ussdeditor Resources iby file +* +*/ + + +#ifndef __USSDEDITOR_RESOURCES_IBY__ +#define __USSDEDITOR_RESOURCES_IBY__ + +#include + +data=DATAZ_\RESOURCE_FILES_DIR\ussdeditor.rsc RESOURCE_FILES_DIR\ussdeditor.rsc +data=ZPRIVATE\10003a3f\import\apps\ussdeditor_reg.rsc private\10003a3f\import\apps\ussdeditor_reg.rsc + +//data=DATAZ_\QT_TRANSLATIONS_DIR\phcltsrvussd.qm QT_TRANSLATIONS_DIR\phcltsrvussd.qm + +#endif diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/src/main.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,72 @@ +/* +* 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 FILES +#include +#include +#include + +#include "ussdeditorquery.h" +#include "ussdcomms.h" +#include "tflogger.h" + +// --------------------------------------------------------- +// main() +// Entry point function +// Returns: 0: success +// --------------------------------------------------------- +// +int main(int argc, char *argv[]) +{ + TFLOGSTRING("USSDEDITOR: main IN") + + // Create application instance + HbApplication application(argc, argv); + TFLOGSTRING("USSDEDITOR: main app") + + // Create main widow + HbMainWindow window; + window.show(); + TFLOGSTRING("USSDEDITOR: main window") + + // Add a virtual view and hidden it + HbView *view = new HbView(); + // TODO: Still show + view->setViewFlags(HbView::ViewStatusBarHidden); + view->setViewFlags(HbView::ViewTitleBarHidden); + window.addView(view); + TFLOGSTRING("USSDEDITOR: main addView") + + // Create CUssdComms - ussd client + CUssdComms *ussdComms = new CUssdComms(view); + TFLOGSTRING("USSDEDITOR: main ussdComms") + + // Create HbInputDialog + UssdEditorQuery *query = new UssdEditorQuery(*ussdComms); + query->show(); + TFLOGSTRING("USSDEDITOR: main query") + + // Execute application loop + int result = application.exec(); + TFLOGSTRING2("USSDEDITOR: main application OUT %d", result) + delete query; + query = 0; + return result; +} + +// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/src/ussdcomms.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/src/ussdcomms.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,154 @@ +/* +* 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 FILES +#include +#include + +#include "ussdcomms.h" +#include "tflogger.h" + +// The maximum length of editor lines. +const TInt KUssdEditorMaxLength = 182; + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CUssdComms::CUssdComms +// Constructor. +// ----------------------------------------------------------------------------- +// +CUssdComms::CUssdComms(QObject *parent) + : QObject(parent), + mUssd(NULL), + mErrorCode(static_cast(EPhCltExitReasonUnknown)) +{ + // Default value - ETrue + TRAP_IGNORE(mUssd = CPhCltUssdInt::NewL()); + TFLOGSTRING("USSDEDITOR: CUssdComms::CUssdComms") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::~CUssdComms +// ~CUssdComms. +// ----------------------------------------------------------------------------- +// +CUssdComms::~CUssdComms() +{ + if (mUssd){ + mErrorCode = mUssd->AppTerminating( + static_cast(mErrorCode)); + delete mUssd; + mUssd = NULL; + TFLOGSTRING2("USSDEDITOR: CUssdComms::~CUssdComms %d", mErrorCode) + } + TFLOGSTRING("USSDEDITOR: CUssdComms::~CUssdComms") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::appStarting +// appStarting. +// ----------------------------------------------------------------------------- +// +void CUssdComms::appStarting() +{ + mErrorCode = mUssd->AppStarting(); + TFLOGSTRING("USSDEDITOR: CUssdComms::appStarting") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::appTerminating +// appTerminating. +// ----------------------------------------------------------------------------- +// +void CUssdComms::appTerminating() +{ + mErrorCode = mUssd->AppTerminating(EPhCltUserExit); + TFLOGSTRING("USSDEDITOR: CUssdComms::appTerminating") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::appToBackground +// appToBackground. +// ----------------------------------------------------------------------------- +// +void CUssdComms::appToBackground() +{ + mErrorCode = mUssd->AppToBackground(); + TFLOGSTRING("USSDEDITOR: CUssdComms::appToBackground") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::appToForeground +// appToForeground. +// ----------------------------------------------------------------------------- +// +void CUssdComms::appToForeground() +{ + mErrorCode = mUssd->AppToForeground(); + TFLOGSTRING("USSDEDITOR: CUssdComms::appToForeground") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::send +// send. +// ----------------------------------------------------------------------------- +// +int CUssdComms::send( const QString& message ) +{ + TBuf buf16; + buf16.Copy((const TUint16*)message.constData(), message.length()); + mErrorCode = mUssd->SendUssd(buf16); + TFLOGSTRING("USSDEDITOR: CUssdComms::send") + return mErrorCode; +} + +// ----------------------------------------------------------------------------- +// CUssdComms::cancel +// cancel. +// ----------------------------------------------------------------------------- +// +void CUssdComms::cancel() +{ + mUssd->SendUssdCancel(); + TFLOGSTRING("USSDEDITOR: CUssdComms::cancel") +} + +// ----------------------------------------------------------------------------- +// CUssdComms::errorCode +// errorCode. +// ----------------------------------------------------------------------------- +// +int CUssdComms::errorCode() +{ + TFLOGSTRING("USSDEDITOR: CUssdComms::send") + return mErrorCode; +} + +// ----------------------------------------------------------------------------- +// CUssdComms::informExitReason +// informExitReason. +// ----------------------------------------------------------------------------- +// +void CUssdComms::informExitReason(int aExitReason) +{ + TFLOGSTRING2("USSDEDITOR: CUssdComms::informExitReason \ + %d", aExitReason) + mErrorCode = aExitReason; +} + +// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/src/ussdeditorquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/src/ussdeditorquery.cpp Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,144 @@ +/* +* 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 FILES +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tflogger.h" +#include "ussdcomms.h" +#include "ussdeditorquery.h" + +// CONSTANTS +// The maximum number of editor lines method NumberOfEditorLines can return. +const TInt KUssdMaxNumberOfEditorLines = 16; +// The maximum length of editor lines. +const TInt KUssdEditorMaxLength = 182; + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// UssdEditorQuery::UssdEditorQuery +// Constructor. +// ----------------------------------------------------------------------------- +// +UssdEditorQuery::UssdEditorQuery(CUssdComms &ussd, QGraphicsItem *parent) + :HbInputDialog(parent), mComms(ussd) +{ + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::UssdEditorQuery IN") + setPromptText(hbTrId("Reply")); + + if (lineEdit()){ + // Set max length and rows + lineEdit()->setMaxLength(KUssdEditorMaxLength); + lineEdit()->setMaxRows(KUssdMaxNumberOfEditorLines); + lineEdit()->setText(QString()); + + // 0-9, *, +, # + HbEditorInterface interface(lineEdit()); + interface.setFilter(HbPhoneNumberFilter::instance()); + // TODO: cannot open keypad + interface.vkbHost()->openKeypad(); + + mComms.appStarting(); + // Disable Ok key by default + primaryAction()->setEnabled(false); + + bool ret(false); + ret = connect(primaryAction(), SIGNAL(triggered(bool)), + this, SLOT(sendUssdString())); + TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \ + connect send %d", ret); + + ret = connect(lineEdit(), SIGNAL(textChanged(QString)), + this, SLOT(updateButtonVisible(QString))); + TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \ + connect ok button %d", ret); + + // Connect cancel + ret = connect(secondaryAction(), SIGNAL(triggered(bool)), + this, SLOT(cancelUssdString())); + TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \ + connect send %d", ret); + } + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::UssdEditorQuery OUT") +} + +// ----------------------------------------------------------------------------- +// UssdEditorQuery::~UssdEditorQuery +// ~UssdEditorQuery. +// ----------------------------------------------------------------------------- +// +UssdEditorQuery::~UssdEditorQuery() +{ + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::~UssdEditorQuery IN-OUT") +} + +// ----------------------------------------------------------------------------- +// UssdEditorQuery::sendUssdString +// sendUssdString. +// ----------------------------------------------------------------------------- +// +void UssdEditorQuery::sendUssdString() +{ + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::sendUssdString IN"); + if (lineEdit() && + 0 < lineEdit()->text().length() && + KUssdEditorMaxLength >= lineEdit()->text().length()) { + int ret = mComms.send(lineEdit()->text()); + TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::sendUssdString %d", ret); + mComms.informExitReason(static_cast(EPhCltSendCompleted)); + } + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::sendUssdString OUT"); + HbApplication::quit(); +} + +// ----------------------------------------------------------------------------- +// UssdEditorQuery::cancelUssdString +// cancelUssdString. +// ----------------------------------------------------------------------------- +// +void UssdEditorQuery::cancelUssdString() +{ + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::cancelUssdString IN-OUT"); + mComms.informExitReason((EPhCltUserExit)); + HbApplication::quit(); +} + +// ----------------------------------------------------------------------------- +// UssdEditorQuery::updateButtonVisible +// updateButtonVisible. +// ----------------------------------------------------------------------------- +// +void UssdEditorQuery::updateButtonVisible( const QString &text ) +{ + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::updateButtonVisible IN"); + if (text.length() > 0) { + primaryAction()->setEnabled(true); + } else { + primaryAction()->setEnabled(false); + } + TFLOGSTRING("USSDEDITOR: UssdEditorQuery::updateOkButton OUT"); +} + +// End of file diff -r 6bb1b21d2484 -r 2f8f8080a020 phoneuis/ussdeditor/ussdeditor.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/ussdeditor/ussdeditor.pro Mon May 03 12:31:11 2010 +0300 @@ -0,0 +1,57 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# +# + +TEMPLATE = app +#the application will be "invisible" +CONFIG += no_icon + +TARGET = ussdeditor +DEPENDPATH += . +HEADERS += $$PUBLIC_HEADERS +MOC_DIR = moc + +CONFIG += hb + +symbian: { + +TARGET.CAPABILITY = CAP_GENERAL_DLL +TARGET.UID3 = 0x10005955 + +INCLUDEPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +INCLUDEPATH += MOC_DIR + +LIBS += -lphoneclient +LIBS += -lflogger + +SOURCES += src\main.cpp +SOURCES += src\ussdeditorquery.cpp +SOURCES += src\ussdcomms.cpp + +HEADERS += inc\ussdeditorquery.h +HEADERS += inc\ussdcomms.h +HEADERS += inc\tflogger.h + +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "rom/ussdeditor.iby CORE_APP_LAYER_IBY_EXPORT_PATH(ussdeditor.iby)" \ + "rom/ussdeditorresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(ussdeditorresources.iby)" \ + "rom/ussdeditor_stub.sis /epoc32/data/z/system/install/ussdeditor_stub.sis" + +#The next line will be opened when the official translations already +#TRANSLATIONS = phcltsrvussd.ts +}