# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273841517 -10800 # Node ID ebdbd102c78a717ed67348bf975d8cdc277be338 # Parent 2f8f8080a020cbea98163f0d22ed075704e2eaed Revision: 201017 Kit: 201019 diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneui2/src/main.cpp --- a/phoneapp/phoneui2/src/main.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneui2/src/main.cpp Fri May 14 15:51:57 2010 +0300 @@ -25,7 +25,7 @@ int main (int argc, char *argv[]) { - HbApplication app (argc, argv); + HbApplication app (argc, argv, Hb::NoSplash); HbPhoneMainWindow window; return app.exec (); } diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneui2/src/phoneuihousehold_p.cpp --- a/phoneapp/phoneui2/src/phoneuihousehold_p.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneui2/src/phoneuihousehold_p.cpp Fri May 14 15:51:57 2010 +0300 @@ -38,6 +38,8 @@ #include "phoneuicommandadapter.h" #include "phonenotecontroller.h" #include "qtphonelog.h" +#include "cphoneclearblacklist.h" +#include "hbinstance.h" PhoneUiHouseHoldPrivate::PhoneUiHouseHoldPrivate(HbMainWindow &window) : iAppsReady (0), iStartupSignalRecoveryId (0), iLightIdleReached (EFalse), @@ -209,13 +211,7 @@ delete translator3; 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); @@ -232,6 +228,8 @@ QObject::connect(view, SIGNAL(keyReleased (QKeyEvent *)), iKeyEventAdapter, SLOT(keyReleased (QKeyEvent *))); QObject::connect(view, SIGNAL(command (int)), iCommandAdapter, SLOT(handleCommand (int)), Qt::QueuedConnection); // async to enable deletion of widget during signal handling + QObject::connect(view, SIGNAL(windowActivated()), iViewAdapter, SLOT(handleWindowActivated())); + QObject::connect(view, SIGNAL(windowDeactivated()), iViewAdapter, SLOT(handleWindowDeactivated())); QObject::connect(iViewAdapter->noteController(), SIGNAL(command (int)), iCommandAdapter, SLOT(handleCommand (int))); @@ -364,5 +362,15 @@ { iOnScreenDialer = ETrue; } + + HbMainWindow *main = hbInstance->allMainWindows().at(0); + RWindow *win = static_cast(main->effectiveWinId()->DrawableWindow()); + + CEikonEnv* env = CEikonEnv::Static(); + if ( env ) { + env->SetSystem(ETrue); + // Blacklist singleton is initialized here + CPhoneClearBlacklist::CreateL( env->WsSession(), *win); + } } diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuicontrol/group/phoneuicontrol.mmp --- a/phoneapp/phoneuicontrol/group/phoneuicontrol.mmp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuicontrol/group/phoneuicontrol.mmp Fri May 14 15:51:57 2010 +0300 @@ -70,6 +70,7 @@ USERINCLUDE ../../phoneui2/srcdata USERINCLUDE ../../phoneuistates/inc USERINCLUDE ../../phonemediatorcenter/inc +USERINCLUDE ../../phoneuiutils/inc APP_LAYER_SYSTEMINCLUDE // Application layer domain APIs SYSTEMINCLUDE ../../../inc // Telephony internal headers diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuicontrol/src/cphonestate.cpp --- a/phoneapp/phoneuicontrol/src/cphonestate.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuicontrol/src/cphonestate.cpp Fri May 14 15:51:57 2010 +0300 @@ -102,6 +102,8 @@ #include "cphonenumberentrymanager.h" #include "tphonecmdparamsfidata.h" #include "mphonestorage.h" +#include "phoneconstants.h" +#include "cphoneclearblacklist.h" // ================= MEMBER FUNCTIONS ======================= @@ -810,6 +812,9 @@ default: break; } + + // clear call blacklist if call failure occurs + CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); } // ----------------------------------------------------------- @@ -880,6 +885,8 @@ iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, &callHeaderParam ); + + CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey(); } // ----------------------------------------------------------- @@ -1138,7 +1145,7 @@ { HBufC* phoneNumber = PhoneNumberFromEntryLC(); // Save the phone number - __PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber->Des() ); + __PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber ); iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); // Convert key code to western. @@ -2848,39 +2855,29 @@ void CPhoneState::HandleShowImeiL() { __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowImeiL( ) "); - - if ( IsOnScreenDialerSupported() ) - { - NumberEntryClearL(); - } - else - { - // Remove number entry from screen - iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); - } - + // Fetch IMEI TBuf serialNumber; - TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine-> - PhoneEngineInfo()->PhoneIdentityParameters(); + TPEPhoneIdentityParameters phoneIdentityParameters = + iStateMachine->PhoneEngineInfo()->PhoneIdentityParameters(); serialNumber = phoneIdentityParameters.iSerialNumber; - - // Add it to the resource string - HBufC* buf = StringLoader::LoadLC( + + HBufC* imeiNoteText = StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()-> ResolveResourceID( EPhonePhoneImeiString ), serialNumber ); - - TPhoneCmdParamNote noteParam; - noteParam.SetType( EPhoneNoteCustom ); - noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> - ResolveResourceID( EPhoneInformationWaitNote ) ); - noteParam.SetText( *buf ); - - // Display note - iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); - - CleanupStack::PopAndDestroy( buf ); + + TPhoneCmdParamGlobalNote noteParam; + noteParam.SetType( EAknGlobalInformationNote ); + noteParam.SetTone( EAvkonSIDInformationTone ); + noteParam.SetText( *imeiNoteText ); + noteParam.SetTimeout( KPhoneNoteNoTimeout ); + + iViewCommandHandle->ExecuteCommandL( + EPhoneViewShowGlobalNote, + ¬eParam ); + + CleanupStack::PopAndDestroy( imeiNoteText ); } // ----------------------------------------------------------- @@ -2918,51 +2915,43 @@ void CPhoneState::HandleShowLifeTimerL() { __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowLifeTimerL( ) "); - if ( IsOnScreenDialerSupported() ) - { - NumberEntryClearL(); - } - else - { - // Remove number entry from screen - iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); - } - + // Fetch LifeTime - TPELifeTimeData lifeTimeData = iStateMachine-> - PhoneEngineInfo()->LifeTimerData(); - + TPELifeTimeData lifeTimeData = + iStateMachine->PhoneEngineInfo()->LifeTimerData(); + TLocale locale; TBuf lifetimerText; lifetimerText.NumFixedWidth( lifeTimeData.iHours, EDecimal, KPhoneLifeTimerHoursLength ); - - lifetimerText.Append(locale.TimeSeparator( KTimerMinuteSeparator ) ); // minute seperator - + + lifetimerText.Append(locale.TimeSeparator( KTimerMinuteSeparator ) ); + TBuf mins; mins.NumFixedWidth( lifeTimeData.iMinutes, EDecimal, KPhoneLifeTimerMinutesLength ); - + lifetimerText.Append(mins); - - // Add it to the resource string + HBufC* buf = StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()-> ResolveResourceID( EPhoneLifeTimeFormat ), lifetimerText ); - TPhoneCmdParamNote noteParam; - noteParam.SetType( EPhoneNoteCustom ); - noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> - ResolveResourceID( EPhoneInformationWaitNote ) ); + + TPhoneCmdParamGlobalNote noteParam; + noteParam.SetType( EAknGlobalInformationNote ); + noteParam.SetTone( EAvkonSIDInformationTone ); noteParam.SetText( *buf ); - - // Display note - iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); - + noteParam.SetTimeout( KPhoneNoteNoTimeout ); + + iViewCommandHandle->ExecuteCommandL( + EPhoneViewShowGlobalNote, + ¬eParam ); + CleanupStack::PopAndDestroy( buf ); } diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp --- a/phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp Fri May 14 15:51:57 2010 +0300 @@ -121,6 +121,10 @@ switch( aCommand ) { + case EPhoneInCallCmdDialer: + iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer ); + break; + case EPhoneNumberAcqCmdAddToContacts: { // If call setup is ongoing then add to contacts query should @@ -581,10 +585,10 @@ BeginUiUpdateLC(); // Remove the number entry if it isn't DTMF dialer - if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() ) + /*if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() ) { iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); - } + }*/ // Update the single call CPhoneState::UpdateSingleActiveCallL( aCallId ); diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def --- a/phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def Fri May 14 15:51:57 2010 +0300 @@ -93,4 +93,6 @@ ?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) + ?handleWindowDeactivated@PhoneUIQtViewAdapter@@AAEXXZ @ 95 NONAME ; void PhoneUIQtViewAdapter::handleWindowDeactivated(void) + ?handleWindowActivated@PhoneUIQtViewAdapter@@AAEXXZ @ 96 NONAME ; void PhoneUIQtViewAdapter::handleWindowActivated(void) diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def --- a/phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def Fri May 14 15:51:57 2010 +0300 @@ -106,4 +106,6 @@ _ZN20PhoneUIQtViewAdapter10SetHiddenLEb @ 105 NONAME _ZN20PhoneUIQtViewAdapter9setHiddenEb @ 106 NONAME _ZN20PhoneUIQtViewAdapter12openContactsEv @ 107 NONAME + _ZN20PhoneUIQtViewAdapter21handleWindowActivatedEv @ 108 NONAME + _ZN20PhoneUIQtViewAdapter23handleWindowDeactivatedEv @ 109 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h --- a/phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h Fri May 14 15:51:57 2010 +0300 @@ -32,6 +32,11 @@ PhoneIndicatorController(QObject *parent = 0); virtual ~PhoneIndicatorController(); + void setActiveCallData( const TDesC &text, const TDesC &icon ); + void clearActiveCallData(); + void enableActiveCallIndicator(); + void disableActiveCallIndicator(); + private slots: void updateMissedCallIndicator(const XQSettingsKey &key, const QVariant &value); void setMissedallIndicatorData(); @@ -41,6 +46,9 @@ LogsModel *m_logsModel; LogsFilter *m_missedCallsFilter; XQSettingsManager * m_setManager; + + QString m_cli; + QString m_callImage; }; #endif /* PHONEINDICATORCONTROLLER_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h --- a/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h Fri May 14 15:51:57 2010 +0300 @@ -180,6 +180,20 @@ */ void keyReleased(QKeyEvent *event); + /*! + \fn void PhoneUIQtViewAdapter::handleWindowActivated () + + PhoneView calls this method when window is activated; + */ + void handleWindowActivated(); + + /*! + \fn void PhoneUIQtViewAdapter::handleWindowDeactivated () + + PhoneView calls this method when window is deactivated. + */ + void handleWindowDeactivated(); + private: /*! diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp Fri May 14 15:51:57 2010 +0300 @@ -29,7 +29,7 @@ #endif PhoneIndicatorController::PhoneIndicatorController(QObject *parent): - QObject(parent), m_missedCallsFilter(0), m_logsModel(0) + QObject(parent), m_logsModel(0), m_missedCallsFilter(0) { #ifdef Q_OS_SYMBIAN m_setManager = new XQSettingsManager(this); @@ -63,6 +63,42 @@ #endif } +void PhoneIndicatorController::setActiveCallData( + const TDesC &text, const TDesC &icon ) +{ + m_cli = QString::fromUtf16 (text.Ptr (), text.Length ()); + m_callImage = QString::fromUtf16 (icon.Ptr (), icon.Length ()); +} + +void PhoneIndicatorController::clearActiveCallData() +{ + m_cli.clear(); + m_callImage.clear(); + disableActiveCallIndicator(); +} + +void PhoneIndicatorController::enableActiveCallIndicator() +{ + if (!m_cli.isEmpty()){ + QString indicatorType(indicatorName(PhoneActiveCallIndicator)); + QVariantMap parameters; + + parameters.insert( + QVariant(HbIndicatorInterface::PrimaryTextRole ).toString(), + m_cli); + + parameters.insert(QVariant( HbIndicatorInterface::DecorationNameRole).toString(), + m_callImage); + + m_indicator.activate(indicatorType, parameters); + } +} +void PhoneIndicatorController::disableActiveCallIndicator() +{ + QString indicatorType(indicatorName(PhoneActiveCallIndicator)); + m_indicator.deactivate(indicatorType); +} + void PhoneIndicatorController::updateMissedCallIndicator( const XQSettingsKey &key, const QVariant &value) { diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp Fri May 14 15:51:57 2010 +0300 @@ -69,33 +69,36 @@ QString noteString = globalNoteText(globalNoteParam); if (false == noteString.isNull()) { - if (globalNoteParam->WaitForReady()) { - HbDeviceMessageBox messageBox(noteString, type); - messageBox.setTimeout(HbDialog::StandardTimeout); - messageBox.exec(); - } else { - bool showNote(true); - for (int i = 0;itext()) { - showNote = false; - break; - } + bool showNote(true); + for (int i = 0; i < m_messageBoxList.count(); ++i) { + // Do not show same note/text several times, e.g when user hits + // the end button several times we should show only one "not allowed" + // note. + if (noteString == m_messageBoxList.at(i)->text()) { + showNote = false; + break; + } + } + + if (showNote) { + QScopedPointer messageBox( + new HbDeviceMessageBox(noteString, type)); + + int timeout = globalNoteParam->Timeout(); + if (timeout == 0) { + messageBox->setTimeout(HbDialog::StandardTimeout); + } else { + messageBox->setTimeout(timeout); } - 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(); - } + HbDeviceMessageBox *messageBoxPtr = messageBox.data(); + m_messageBoxList.append(messageBoxPtr); + messageBox.take(); + + if (1 == m_messageBoxList.size()) { + QObject::connect(messageBoxPtr, SIGNAL(aboutToClose()), + this, SLOT(destroyDialog())); + messageBoxPtr->show(); } } } @@ -163,7 +166,7 @@ if (m_progressDialog) { m_queryCanceledCommand = -1; - m_progressDialog->cancel(); + m_progressDialog->close(); } } @@ -222,7 +225,7 @@ int sendCommand = m_timeoutCommand; if (m_progressDialog) { m_queryCanceledCommand = -1; - m_progressDialog->cancel(); + m_progressDialog->close(); } if (sendCommand != -1) { emit command(sendCommand); @@ -274,7 +277,15 @@ noteParam->Text().Length()) ); connect(hbactions.at(0), SIGNAL(triggered()), m_signalMapper, SLOT(map())); - m_dtmfNote->setPrimaryAction(hbactions.at(0)); + + int count = m_dtmfNote->actions().count(); + for (int i=count;0actions().at(i-1); + m_dtmfNote->removeAction(action); + //TODO + //delete action; + } + m_dtmfNote->addAction(hbactions.at(0)); m_signalMapper->setMapping(hbactions.at(0), hbactions.at(0)->data().toInt()); QObject::connect(m_dtmfNote, SIGNAL(aboutToClose()), @@ -309,11 +320,16 @@ m_actions.append(hbactions.at(i)); } - if (hbactions.count() == 1) { - m_queryNote->setPrimaryAction(hbactions.at(0)); - } else if (hbactions.count() > 1) { - m_queryNote->setPrimaryAction(hbactions.at(0)); - m_queryNote->setSecondaryAction(hbactions.at(1)); + int count = m_queryNote->actions().count(); + for (int i=count;0actions().at(i-1); + m_queryNote->removeAction(action); + //TODO + //delete action; + } + + for (int i=0;iaddAction(hbactions.at(i)); } m_queryNote->show(); diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp Fri May 14 15:51:57 2010 +0300 @@ -286,7 +286,7 @@ VA_LIST list; VA_START (list, symbianResourceId); int intValue = VA_ARG (list, int); - text->setText(hbTrId("txt_phone_other_call_ln", intValue)); + text->setText(hbTrId("txt_phone_other_call_ln").arg(intValue)); translatedActions [PhoneAction::Text] = text; VA_END (list); } @@ -383,7 +383,32 @@ VA_END (list); } break; - + case R_PHONE_IMEI_STRING: + { + QScopedPointer text(new PhoneAction); + VA_LIST list; + VA_START(list, symbianResourceId); + const TDesC *string = static_cast(VA_ARG(list, TDesC*)); + QString serialNumber = + QString::fromUtf16(string->Ptr(), string->Length()); + text->setText(hbTrId("txt_phone_info_serial_no").arg(serialNumber)); + translatedActions[PhoneAction::Text] = text.take(); + VA_END(list); + } + break; + case R_PHONEUI_LIFE_TIMER_STRING: + { + QScopedPointer text(new PhoneAction); + VA_LIST list; + VA_START(list, symbianResourceId); + const TDesC *string = static_cast(VA_ARG(list, TDesC*)); + QString lifeTimerText = + QString::fromUtf16(string->Ptr(), string->Length()); + text->setText(hbTrId("txt_phone_info_life_timer").arg(lifeTimerText)); + translatedActions[PhoneAction::Text] = text.take(); + VA_END(list); + } + break; default: break; } @@ -523,7 +548,7 @@ int PhoneResourceAdapter::defaultToolbarResourceId() const { - return R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA; + return R_PHONEUI_INCALL_DIALER_CBA; //R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA; } QString PhoneResourceAdapter::convertCommandToString( diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp --- a/phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp Fri May 14 15:51:57 2010 +0300 @@ -209,6 +209,7 @@ m_view.removeExpandAction(bubble); m_bubbleWrapper->removeCallHeader (aCallId); m_bubbleWrapper->bubbleManager().endChanges(); + m_indicatorController->clearActiveCallData(); } break; case EPhoneViewRemoveFromConference: @@ -484,6 +485,16 @@ } } +void PhoneUIQtViewAdapter::handleWindowActivated() +{ + m_indicatorController->disableActiveCallIndicator(); +} + +void PhoneUIQtViewAdapter::handleWindowDeactivated() +{ + m_indicatorController->enableActiveCallIndicator(); +} + void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *commandParam) { TPhoneCmdParamInteger *integerParam = static_cast (commandParam); @@ -548,6 +559,7 @@ if (1 == m_bubbleWrapper->bubbles().keys().count()) { setHidden(false); } + m_indicatorController->setActiveCallData( data.CLIText(), KNullDesC ); } void PhoneUIQtViewAdapter::createEmergencyCallHeader( @@ -1028,6 +1040,7 @@ m_bubbleWrapper->bubbleManager().endChanges(); } } + m_indicatorController->clearActiveCallData(); } void PhoneUIQtViewAdapter::getNumberFromDialpad( @@ -1074,13 +1087,15 @@ void PhoneUIQtViewAdapter::setCallMenu() { - int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); - int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); - m_uiCommandController->setCallMenuActions( - m_bubbleWrapper->callStates(), - m_bubbleWrapper->serviceIds(), - m_bubbleWrapper->serviceIdByCallId(callId), - callId ); + if ( 0callStates().keys().size() ) { + int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); + int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); + m_uiCommandController->setCallMenuActions( + m_bubbleWrapper->callStates(), + m_bubbleWrapper->serviceIds(), + m_bubbleWrapper->serviceIdByCallId(callId), + callId ); + } } diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -26,6 +26,7 @@ #include "tphonecmdparamglobalnote.h" #include "tphonecmdparamquery.h" #include "phoneresourceadapter.h" +#include "phoneconstants.h" #define PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestObject) \ int main(int argc, char *argv[]) \ @@ -100,11 +101,14 @@ void TestPhoneNoteController::testShowGlobalNoteDefault () { TPhoneCmdParamGlobalNote globalNoteParam; + globalNoteParam.SetTimeout(0); globalNoteParam.SetWaitForReady(ETrue); - m_noteController->showGlobalNote(&globalNoteParam); + QTest::qWait(2500); - QTest::qWait(5000); + globalNoteParam.SetTimeout(KPhoneNoteNoTimeout); + m_noteController->showGlobalNote(&globalNoteParam); + QTest::qWait(2500); } void TestPhoneNoteController::testShowGlobalInfoNoteWithResourceId () diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp --- a/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -233,6 +233,16 @@ action = map[PhoneAction::Text]; QVERIFY( false == action->text().isEmpty() ); + map = m_resourceAdapter->convert(R_PHONE_IMEI_STRING, &buffer); + QCOMPARE(map.size(), 1); + action = map[PhoneAction::Text]; + QVERIFY( false == action->text().isEmpty() ); + + map = m_resourceAdapter->convert(R_PHONEUI_LIFE_TIMER_STRING, &buffer); + QCOMPARE(map.size(), 1); + action = map[PhoneAction::Text]; + QVERIFY( false == action->text().isEmpty() ); + // TODO map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA); diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuistates/src/cphonecallsetup.cpp --- a/phoneapp/phoneuistates/src/cphonecallsetup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuistates/src/cphonecallsetup.cpp Fri May 14 15:51:57 2010 +0300 @@ -175,12 +175,12 @@ &callHeaderParam ); // Remove the number entry if it isn't DTMF dialer - if ( !iOnScreenDialer || + /*if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() ) { iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); - } + }*/ SetToolbarButtonLoudspeakerEnabled(); diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp --- a/phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp Fri May 14 15:51:57 2010 +0300 @@ -166,7 +166,10 @@ case MEngineMonitor::EPEMessageIdle: HandleIdleL( aCallId ); break; - + case MEngineMonitor::EPEMessageConnected: + UpdateInCallCbaL(); + CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); + break; default: CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); break; diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiutils/bwins/phoneuiutilsu.def --- a/phoneapp/phoneuiutils/bwins/phoneuiutilsu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiutils/bwins/phoneuiutilsu.def Fri May 14 15:51:57 2010 +0300 @@ -313,4 +313,6 @@ ?Bitmap@TPhoneCmdParamBitmap@@QBEPAVCFbsBitmap@@XZ @ 312 NONAME ; class CFbsBitmap * TPhoneCmdParamBitmap::Bitmap(void) const ?SetTone@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 313 NONAME ; void TPhoneCmdParamGlobalNote::SetTone(int) ?After@CPhoneTimer@@QAEXVTTimeIntervalMicroSeconds32@@VTCallBack@@@Z @ 314 NONAME ; void CPhoneTimer::After(class TTimeIntervalMicroSeconds32, class TCallBack) + ?SetTimeout@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 315 NONAME ; void TPhoneCmdParamGlobalNote::SetTimeout(int) + ?Timeout@TPhoneCmdParamGlobalNote@@QBEHXZ @ 316 NONAME ; int TPhoneCmdParamGlobalNote::Timeout(void) const diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiutils/eabi/phoneuiutilsu.def --- a/phoneapp/phoneuiutils/eabi/phoneuiutilsu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiutils/eabi/phoneuiutilsu.def Fri May 14 15:51:57 2010 +0300 @@ -416,4 +416,6 @@ _ZThn4_N26CPhoneResourceResolverBaseD1Ev @ 415 NONAME _ZThn4_NK13CPhoneStorage17GetBlockedKeyListEv @ 416 NONAME _ZThn4_NK26CPhoneResourceResolverBase17ResolveResourceIDERKi @ 417 NONAME + _ZN24TPhoneCmdParamGlobalNote10SetTimeoutEi @ 418 NONAME + _ZNK24TPhoneCmdParamGlobalNote7TimeoutEv @ 419 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiutils/inc/phoneconstants.h --- a/phoneapp/phoneuiutils/inc/phoneconstants.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiutils/inc/phoneconstants.h Fri May 14 15:51:57 2010 +0300 @@ -223,6 +223,7 @@ // From CPhoneNoteUtilities const TInt KPhoneNoteSoftkeysUseDefault = 0; const TInt KPhoneNoteGraphicNone = -1; +const TInt KPhoneNoteNoTimeout = -1; // State machine ordinal number static const TInt KPhoneUiStateMachineOrdinal = 1; diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiutils/inc/tphonecmdparamglobalnote.h --- a/phoneapp/phoneuiutils/inc/tphonecmdparamglobalnote.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiutils/inc/tphonecmdparamglobalnote.h Fri May 14 15:51:57 2010 +0300 @@ -80,6 +80,13 @@ */ IMPORT_C void SetSoftkeys( TInt aSoftkeys ); + /** + * Sets timeout for a note. + * @param aTimeout Timeout in milliseconds. If timeout == 0 then + * default timeout is used. If timeout < 0 the note is not closed + * automatically. + */ + IMPORT_C void SetTimeout( TInt aTimeout ); /** * Returns the global note type @@ -115,8 +122,14 @@ * Returns the global note softkeys. * @return Returns the global note softkeys */ - IMPORT_C TInt Softkeys() const; - + IMPORT_C TInt Softkeys() const; + + /** + * Returns the timeout value. + * @return Timeout value. + */ + IMPORT_C TInt Timeout() const; + private: /** @@ -148,7 +161,11 @@ * Global note softkeys */ TInt iSoftkeys; - + + /** + * Timeout for a note. + */ + TInt iTimeout; }; #endif // __TPHONECMDPARAMGLOBALNOTE_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiutils/src/tphonecmdparamglobalnote.cpp --- a/phoneapp/phoneuiutils/src/tphonecmdparamglobalnote.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiutils/src/tphonecmdparamglobalnote.cpp Fri May 14 15:51:57 2010 +0300 @@ -35,8 +35,9 @@ iTextResourceId( 0 ), iText( KNullDesC ), iTone( EAvkonSIDErrorTone ), - iWaitforReady ( EFalse ) - ,iSoftkeys( 0 ) + iWaitforReady ( EFalse ), + iSoftkeys( 0 ), + iTimeout( 0 ) { iParamId = EPhoneParamIdGlobalNote; } @@ -112,6 +113,17 @@ } // --------------------------------------------------------- +// TPhoneCmdParamGlobalNote::SetTimeout +// Sets the timeout value for a note. +// (other items were commented in a header). +// --------------------------------------------------------- +// +EXPORT_C void TPhoneCmdParamGlobalNote::SetTimeout( TInt aTimeout ) +{ + iTimeout = aTimeout; +} + +// --------------------------------------------------------- // TPhoneCmdParamGlobalNote::Type // Returns the global note type // (other items were commented in a header). @@ -177,4 +189,14 @@ return iSoftkeys; } +// --------------------------------------------------------- +// TPhoneCmdParamGlobalNote::Timeout +// Returns the timeout value. +// --------------------------------------------------------- +// +EXPORT_C TInt TPhoneCmdParamGlobalNote::Timeout() const + { + return iTimeout; + } + // End of File diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def --- a/phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def Fri May 14 15:51:57 2010 +0300 @@ -1,4 +1,5 @@ -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) @@ -59,4 +60,5 @@ ?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 + ?networkNameChanged@PhoneUIQtView@@QAEXW4NetworkMode@QSystemNetworkInfo@QtMobility@@ABVQString@@@Z @ 62 NONAME ; void PhoneUIQtView::networkNameChanged(enum QtMobility::QSystemNetworkInfo::NetworkMode, class QString const &) diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def --- a/phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def Fri May 14 15:51:57 2010 +0300 @@ -89,4 +89,7 @@ _ZThn28_N13PhoneUIQtView27clearParticipantListActionsEv @ 88 NONAME _ZThn8_N13PhoneUIQtViewD0Ev @ 89 NONAME _ZThn8_N13PhoneUIQtViewD1Ev @ 90 NONAME + _ZN13PhoneUIQtView18networkNameChangedEN10QtMobility18QSystemNetworkInfo11NetworkModeERK7QString @ 91 NONAME + _ZN13PhoneUIQtView15windowActivatedEv @ 92 NONAME + _ZN13PhoneUIQtView17windowDeactivatedEv @ 93 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/inc/phoneuiqtview.h --- a/phoneapp/phoneuiview2/inc/phoneuiqtview.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/inc/phoneuiqtview.h Fri May 14 15:51:57 2010 +0300 @@ -22,6 +22,7 @@ #include #include "phoneuiqtviewif.h" #include +#include class BubbleManager; class HbAction; @@ -37,6 +38,9 @@ #define PHONEUIQTVIEW_EXPORT Q_DECL_IMPORT #endif +using namespace QtMobility; + + class PHONEUIQTVIEW_EXPORT PhoneUIQtView : public HbView, public PhoneUIQtViewIF { Q_OBJECT @@ -265,6 +269,13 @@ */ void shutdownPhoneApp(); + /*! + \fn void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName) + + Network name change is informed via this method. + */ + void networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName); + signals: @@ -296,6 +307,19 @@ */ void dialpadIsAboutToClose(); + /*! + \fn void windowActivated(); + + This signal is emitted when window is activated + */ + void windowActivated(); + + /*! + \fn void windowDeactivated(); + + This signal is emitted when window is deactivated + */ + void windowDeactivated(); protected: @@ -346,6 +370,7 @@ Dialpad *m_dialpad; QSignalMapper *m_menuSignalMapper; XqKeyCapture *m_keyCapture; + QSystemNetworkInfo *m_networkInfo; }; #endif // PHONEUIQTVIEW_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/phoneuiview2.pro --- a/phoneapp/phoneuiview2/phoneuiview2.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/phoneuiview2.pro Fri May 14 15:51:57 2010 +0300 @@ -17,7 +17,8 @@ TEMPLATE = lib TARGET = phoneuiqtview -CONFIG += hb +CONFIG += hb mobility +MOBILITY += systeminfo symbian { TARGET.CAPABILITY = ALL -TCB diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/src/phoneuiqtview.cpp --- a/phoneapp/phoneuiview2/src/phoneuiqtview.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/src/phoneuiqtview.cpp Fri May 14 15:51:57 2010 +0300 @@ -39,9 +39,14 @@ m_expandSignalMapper(0), m_participantListSignalMapper(0), m_volumeCommandId(0), - m_keyCapture(0) + m_keyCapture(0), + m_networkInfo(0) { - setTitle(hbTrId("txt_phone_title_telephone")); + // Set network name + m_networkInfo = new QSystemNetworkInfo(this); + QString networkName = m_networkInfo->networkName(QSystemNetworkInfo::GsmMode); + connect(m_networkInfo, SIGNAL (networkNameChanged(QSystemNetworkInfo::NetworkMode,QString)), this, SLOT(networkNameChanged(QSystemNetworkInfo::NetworkMode, QString))); + setTitle(networkName); // Capturing long press of end key m_keyCapture = new XqKeyCapture(); @@ -439,7 +444,15 @@ keyEvent->accept(); return false; - } else { + } else if (event->type() == QEvent::WindowActivate){ + PHONE_DEBUG("PhoneUIQtView::eventFilter WindowActivate"); + emit windowActivated(); + return false; + } else if (event->type() == QEvent::WindowDeactivate){ + PHONE_DEBUG("PhoneUIQtView::eventFilter WindowDeactivate"); + emit windowDeactivated(); + return false; + }else{ return false; } } @@ -500,3 +513,10 @@ setNavigationAction(0); } } + +void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName) +{ + if(mode == QSystemNetworkInfo::GsmMode) { + setTitle(netName); + } +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "qsysteminfo.h" + +QSystemNetworkInfo::QSystemNetworkInfo(QObject *parent) : QObject(parent) +{ + +} + +QString QSystemNetworkInfo::networkName(QSystemNetworkInfo::NetworkMode mode) +{ + QString networkName = "Unit test network"; + return networkName; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.h Fri May 14 15:51:57 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 QSYSTEMINFO_H +#define QSYSTEMINFO_H + +#include + +namespace QtMobility { + +} + +class QSystemNetworkInfo : public QObject +{ + Q_OBJECT + +public: + + enum NetworkMode { + UnknownMode=0, + GsmMode, + CdmaMode, + WcdmaMode, + WlanMode, + EthernetMode, + BluetoothMode, + WimaxMode + }; + + QSystemNetworkInfo (QObject *parent = 0); + virtual ~QSystemNetworkInfo () {}; + static QString networkName(QSystemNetworkInfo::NetworkMode mode); + +signals: + void networkNameChanged(QSystemNetworkInfo::NetworkMode,const QString &); + +private: + +}; + +#endif // QSYSTEMINFO_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp --- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -43,7 +43,7 @@ static const int KVOLUMECOMMAND = 5; bool m_qtimer_stop_called; - +QString m_networkName; #define PHONE_QT_VIEW_TEST_MAIN(TestObject) \ int main(int argc, char *argv[]) \ @@ -93,6 +93,7 @@ void testDialpadText(); void testSetMenuActions(); void testLongEndKeyPressEventOutsideTelephony(); + void testNetworkNameChanged(); private: int createCallHeader(); @@ -118,8 +119,9 @@ void TestPhoneUIQtView::initTestCase () { - m_main_window = new HbMainWindow(); + m_main_window = new HbMainWindow(); m_view = new PhoneUIQtView(*m_main_window); + QCOMPARE(m_networkName, QString("Unit test network")); } void TestPhoneUIQtView::cleanupTestCase () @@ -401,6 +403,22 @@ QCOMPARE(spy.count(), 1);*/ } +void TestPhoneUIQtView::testNetworkNameChanged() +{ + // Title is changed only for GmsMode + m_view->networkNameChanged(QSystemNetworkInfo::GsmMode, QString("test")); + QCOMPARE(m_networkName, QString("test")); + + // Other modes shouldn't affect the title + m_view->networkNameChanged(QSystemNetworkInfo::CdmaMode, QString("another operator")); + QCOMPARE(m_networkName, QString("test")); +} + +void HbView::setTitle (const QString &title) +{ + m_networkName = title; +} + PHONE_QT_VIEW_TEST_MAIN(TestPhoneUIQtView) Q_DECLARE_METATYPE(QKeyEvent *) #include "unit_tests.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro --- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro Fri May 14 15:51:57 2010 +0300 @@ -20,7 +20,8 @@ TARGET.UID3 = 0xEA9BEF3F DEPENDPATH += . ../../src/ INCLUDEPATH += . -CONFIG += hb qtestlib +CONFIG += hb qtestlib //mobility +//MOBILITY += systeminfo symbian { @@ -55,10 +56,12 @@ ../../inc/phoneuiqtviewif.h \ ../../inc/phoneaction.h \ hbtoolbar.h \ - hbvolumesliderpopup.h + hbvolumesliderpopup.h \ + qsysteminfo.h SOURCES += ../../src/phoneuiqtview.cpp \ ../../src/phoneaction.cpp \ unit_tests.cpp \ hbtoolbar.cpp \ - hbvolumesliderpopup.cpp + hbvolumesliderpopup.cpp \ + qsysteminfo.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/callhandling/src/cpecallhandling.cpp --- a/phoneengine/callhandling/src/cpecallhandling.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/callhandling/src/cpecallhandling.cpp Fri May 14 15:51:57 2010 +0300 @@ -2407,15 +2407,13 @@ if ( callType == CCPCall::ECallTypeCSVoice || callType == CCPCall::ECallTypeVideo ) { const CCCECallParameters& params = static_cast( parameters ); - - // do not overwrite if it's client call, which CCE is not aware of - if ( iModel.DataStore()->CallOrigin( aCallId ) == EPECallOriginPhone ) - { - if ( params.Origin() == CCCECallParameters::ECCECallOriginSAT ) - { - iModel.DataStore()->SetCallOrigin( EPECallOriginSAT, aCallId ); - } - } + + if ( params.Origin() == CCCECallParameters::ECCECallOriginSAT ) + { + iModel.DataStore()->SetCallOrigin( EPECallOriginSAT, aCallId ); + iModel.DataStore()->SetRemoteName( params.AlphaId(), aCallId ); + iModel.DataStore()->SetRemotePhoneNumber( KNullDesC(), aCallId ); + } } } diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/networkhandlingstarter/src/main.cpp --- a/phoneengine/networkhandlingstarter/src/main.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/networkhandlingstarter/src/main.cpp Fri May 14 15:51:57 2010 +0300 @@ -15,7 +15,7 @@ * */ #include -#include +#include #include #include #include @@ -27,23 +27,19 @@ { 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); - } + // Load translators + HbTranslator *commonTranslator = new HbTranslator("common"); + HbTranslator *control_panelTranslator = new HbTranslator("control_panel"); + HbTranslator *telephone_cpTranslator = new HbTranslator("telephone_cp"); HbMainWindow mainWindow; NetworkHandlingStarter service; - return app.exec(); + int err = app.exec(); + + delete commonTranslator; + delete control_panelTranslator; + delete telephone_cpTranslator; + + return err; } diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp --- a/phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp Fri May 14 15:51:57 2010 +0300 @@ -70,9 +70,9 @@ 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); + m_note->setAction(primaryAction, HbDeviceMessageBox::AcceptButtonRole); HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_no"), m_note); - m_note->setSecondaryAction(secondaryAction); + m_note->setAction(secondaryAction,HbDeviceMessageBox::RejectButtonRole); QObject::connect( primaryAction, SIGNAL(triggered()), this, SLOT(LaunchCpNetworkPluginView())); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/bwins/parserrecognizeru.def --- a/phoneengine/parserrecognizer/bwins/parserrecognizeru.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/bwins/parserrecognizeru.def Fri May 14 15:51:57 2010 +0300 @@ -12,4 +12,6 @@ ??1ParserRecognizer@@UAE@XZ @ 11 NONAME ; ParserRecognizer::~ParserRecognizer(void) ?qt_metacall@ParserRecognizer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int ParserRecognizer::qt_metacall(enum QMetaObject::Call, int, void * *) ?trUtf8@ParserRecognizer@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString ParserRecognizer::trUtf8(char const *, char const *, int) + ?requestCompleted@ParserRecognizer@@AAEXABVQVariant@@@Z @ 14 NONAME ; void ParserRecognizer::requestCompleted(class QVariant const &) + ?requestError@ParserRecognizer@@AAEXH@Z @ 15 NONAME ; void ParserRecognizer::requestError(int) diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/eabi/parserrecognizeru.def --- a/phoneengine/parserrecognizer/eabi/parserrecognizeru.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/eabi/parserrecognizeru.def Fri May 14 15:51:57 2010 +0300 @@ -12,4 +12,6 @@ _ZNK16ParserRecognizer10metaObjectEv @ 11 NONAME _ZTI16ParserRecognizer @ 12 NONAME _ZTV16ParserRecognizer @ 13 NONAME + _ZN16ParserRecognizer16requestCompletedERK8QVariant @ 14 NONAME + _ZN16ParserRecognizer12requestErrorEi @ 15 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/inc/parserrecognizer.h --- a/phoneengine/parserrecognizer/inc/parserrecognizer.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/inc/parserrecognizer.h Fri May 14 15:51:57 2010 +0300 @@ -1,5 +1,5 @@ /*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -11,15 +11,15 @@ * * Contributors: * -* Description: Recognizes the parser messages that needs to be notified to the world -* using QtHighway. -* +* Description: Recognizes the parser messages that needs to be notified to +* the world using QtHighway. */ #ifndef PARSERRECOGNIZER_H #define PARSERRECOGNIZER_H #include +#include #ifdef BUILD_PARSERRECOGNIZER #define PARSERRECOGNIZER_EXPORT Q_DECL_EXPORT @@ -30,6 +30,7 @@ class PARSERRECOGNIZER_EXPORT ParserRecognizer : public QObject { Q_OBJECT + public: ParserRecognizer(QObject *parent = 0); ~ParserRecognizer(); @@ -42,7 +43,13 @@ QtHighway. If message isn't recognized it doesn't do anything. */ void sendMessage(const int message, const int callId); + +private slots: + void requestCompleted(const QVariant &returnValue); + void requestError(int error); +private: + XQServiceRequest *m_currentRequest; }; #endif // PARSERRECOGNIZER_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/src/parserrecognizer.cpp --- a/phoneengine/parserrecognizer/src/parserrecognizer.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/src/parserrecognizer.cpp Fri May 14 15:51:57 2010 +0300 @@ -1,5 +1,5 @@ /*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -11,9 +11,8 @@ * * Contributors: * -* Description: Recognizes the parser messages that needs to be notified to the world -* using QtHighway. -* +* Description: Recognizes the parser messages that needs to be notified to +* the world using QtHighway. */ #include @@ -21,12 +20,16 @@ #include "parserrecognizer.h" #include "qtphonelog.h" -ParserRecognizer::ParserRecognizer(QObject* parent) : QObject (parent) +ParserRecognizer::ParserRecognizer(QObject* parent) + : + QObject(parent), + m_currentRequest(0) { } ParserRecognizer::~ParserRecognizer() { + delete m_currentRequest; } void ParserRecognizer::sendMessage(const int message, const int callId) @@ -42,62 +45,83 @@ api = "com.nokia.services.telephony"; method = "activateDeepRestoreFactorySettings()"; break; - + case MEngineMonitor::EPEMessageActivateRfsNormal: api = "com.nokia.services.telephony"; method = "activateNormalRestoreFactorySettings()"; break; - - case MEngineMonitor::EPEMessageActivateWarrantyMode: - api = "com.nokia.services.telephony"; - method = "activateWarrantyMode()"; - break; - + case MEngineMonitor::EPEMessageShowBTDeviceAddress: api = "com.nokia.services.bluetooth"; method = "showBluetoothDeviceAddress()"; break; - + case MEngineMonitor::EPEMessageShowBTLoopback: api = "com.nokia.services.bluetooth"; method = "showBluetoothLoopback()"; break; - + case MEngineMonitor::EPEMessageBTDebugMode: api = "com.nokia.services.bluetooth"; method = "activateBluetoothDebugMode()"; break; - - case MEngineMonitor::EPEMessageShowIMEI: - api = "com.nokia.services.telephony"; - method = "showIMEICode()"; - break; - + case MEngineMonitor::EPEMessageShowVersion: - api = "com.nokia.services.telephony"; + api = "com.nokia.services.devicemanager"; method = "showVersionNumber()"; break; - - case MEngineMonitor::EPEMessageShowWlanMacAddress: - api = "com.nokia.services.wlan"; - method = "showWLANMacAddress()"; - break; - + case MEngineMonitor::EPEMessageSSRequestFailed: api = "com.nokia.services.telephony"; method = "supplementaryServiceRequestFailed()"; break; - + default: recognized = false; break; } - if(recognized) { + if (recognized && (!m_currentRequest)) { PHONE_DEBUG2("ParserRecognizer::sendMessage api:", api); PHONE_DEBUG2("ParserRecognizer::sendMessage method:", method); - XQServiceRequest snd(api, method); - QVariant err; - snd.send(err); + m_currentRequest = new XQServiceRequest(api, method, false); + // Due to a Qt Highway bug in assignment operator implementation we + // need to set request as asynchronous with a setter function. + m_currentRequest->setSynchronous(false); + connect( + m_currentRequest, SIGNAL(requestCompleted(const QVariant &)), + this, SLOT(requestCompleted(const QVariant &))); + connect( + m_currentRequest, SIGNAL(requestError(int)), + this, SLOT(requestError(int))); + + int exceptionAsError = 0; + bool requestOk = false; + QT_TRYCATCH_ERROR( + exceptionAsError, requestOk = m_currentRequest->send()); + if ((0 != exceptionAsError) || (!requestOk)) { + PHONE_DEBUG2("ParserRecognizer::sendMessage exceptionAsError:", + exceptionAsError); + PHONE_DEBUG2("ParserRecognizer::sendMessage requestOk:", + requestOk); + requestCompleted(QVariant()); + } } } + +void ParserRecognizer::requestCompleted(const QVariant &returnValue) +{ + PHONE_DEBUG("ParserRecognizer::requestCompleted"); + Q_UNUSED(returnValue); + + delete m_currentRequest; + m_currentRequest = NULL; +} + +void ParserRecognizer::requestError(int error) +{ + PHONE_DEBUG2("ParserRecognizer::requestError", error); + + delete m_currentRequest; + m_currentRequest = NULL; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.cpp --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -25,6 +25,7 @@ QString apiString; QString methodString; bool sendCalled; +bool gSendRequestResult = true; class TestParserRecognizer : public QObject { @@ -50,6 +51,8 @@ void testShowVersion(); void testShowWLANMacAddress(); void testSSRequestFailed(); + void testSendRequestFail(); + void testSimultaneousRequests(); private: ParserRecognizer *parserRecognizer; // class under test @@ -62,11 +65,22 @@ methodString = method; } +bool XQServiceRequest::send() +{ + sendCalled = true; + return gSendRequestResult; +} + bool XQServiceRequest::send(QVariant& retValue) { Q_UNUSED(retValue); sendCalled = true; - return true; + return gSendRequestResult; +} + +void XQServiceRequest::setSynchronous(const bool &synchronous) +{ + Q_UNUSED(synchronous); } XQServiceRequest::~XQServiceRequest() @@ -94,6 +108,7 @@ apiString = ""; methodString = ""; sendCalled = false; + gSendRequestResult = true; parserRecognizer = new ParserRecognizer; } @@ -120,10 +135,12 @@ void TestParserRecognizer::testActivateWarrantyMode() { + // Lifetimer is implemented by phone and should not be handled + // by the recognizer. parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateWarrantyMode, 0); - QCOMPARE(apiString, QString("com.nokia.services.telephony")); - QCOMPARE(methodString, QString("activateWarrantyMode()")); - QCOMPARE(sendCalled, true); + QCOMPARE(apiString, QString("")); + QCOMPARE(methodString, QString("")); + QCOMPARE(sendCalled, false); } void TestParserRecognizer::testShowBTDeviceAddress() @@ -152,26 +169,29 @@ void TestParserRecognizer::testShowIMEI() { + // IMEI code showing is implemented by phone and should not be handled + // by the recognizer. parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowIMEI, 0); - QCOMPARE(apiString, QString("com.nokia.services.telephony")); - QCOMPARE(methodString, QString("showIMEICode()")); - QCOMPARE(sendCalled, true); + QCOMPARE(apiString, QString("")); + QCOMPARE(methodString, QString("")); + QCOMPARE(sendCalled, false); } void TestParserRecognizer::testShowVersion() { parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); - QCOMPARE(apiString, QString("com.nokia.services.telephony")); + QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); QCOMPARE(methodString, QString("showVersionNumber()")); QCOMPARE(sendCalled, true); } void TestParserRecognizer::testShowWLANMacAddress() { + // WLAN address showing not supported currently (TB 10.1) parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowWlanMacAddress, 0); - QCOMPARE(apiString, QString("com.nokia.services.wlan")); - QCOMPARE(methodString, QString("showWLANMacAddress()")); - QCOMPARE(sendCalled, true); + QCOMPARE(apiString, QString("")); + QCOMPARE(methodString, QString("")); + QCOMPARE(sendCalled, false); } void TestParserRecognizer::testSSRequestFailed() @@ -182,5 +202,26 @@ QCOMPARE(sendCalled, true); } +void TestParserRecognizer::testSendRequestFail() +{ + gSendRequestResult = false; + parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); + QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); + QCOMPARE(methodString, QString("showVersionNumber()")); + QCOMPARE(sendCalled, true); +} + +void TestParserRecognizer::testSimultaneousRequests() +{ + parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); + QCOMPARE(apiString, QString("com.nokia.services.devicemanager")); + QCOMPARE(methodString, QString("showVersionNumber()")); + QCOMPARE(sendCalled, true); + + sendCalled = false; + parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0); + QCOMPARE(sendCalled, false); +} + QTEST_MAIN(TestParserRecognizer) #include "unit_tests.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer.pro --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer.pro Fri May 14 15:51:57 2010 +0300 @@ -20,6 +20,8 @@ TARGET.UID3 = 0xE31F4ECF DEPENDPATH += . CONFIG += qtestlib +QT -= gui + symbian { INCLUDEPATH +=./ INCLUDEPATH +=../../../../inc diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/xqservicerequest.h --- a/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/xqservicerequest.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/xqservicerequest.h Fri May 14 15:51:57 2010 +0300 @@ -23,10 +23,17 @@ class XQServiceRequest : public QObject { -Q_OBJECT + Q_OBJECT + public: XQServiceRequest(QString const& api, QString const& method, bool const& sync = true); ~XQServiceRequest(); + bool send(); bool send(QVariant& retValue); + void setSynchronous(const bool &synchronous); + +signals: + void requestCompleted(const QVariant& value) ; + void requestError(int err); }; -#endif \ No newline at end of file +#endif diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/api_headers.pri --- a/phoneengine/phonemodel/api_headers.pri Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/api_headers.pri Fri May 14 15:51:57 2010 +0300 @@ -17,6 +17,7 @@ PHONEENGINE_API_HEADERS = ./inc/pevirtualengine.h \ ./inc/mpecallcontrolif.h \ ./inc/mpecallsettersif.h \ + ./inc/mpekeysequencerecognitionif.h \ ./inc/telinternalcrkeys.h \ ./inc/telinternalpskeys.h \ ./inc/telinternalpstypes.h \ diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/inc/cpeexternaldatahandler.h --- a/phoneengine/phonemodel/inc/cpeexternaldatahandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/inc/cpeexternaldatahandler.h Fri May 14 15:51:57 2010 +0300 @@ -26,6 +26,7 @@ #include "cpeprofilesettingmonitor.h" #include "mpeexternaldatahandler.h" #include "cpeaccessorymodemonitor.h" +#include "penetworkhandler.h" #include // FORWARD DECLARATIONS @@ -109,6 +110,7 @@ CPENetworkRegistrationStatusMonitor* iNetworkRegistrationStatus; CPEProfileSettingMonitor* iProfileSettings; CPEAccessoryModeMonitor* iAccessoryModeMonitor; + PeNetworkHandler* iNetworkHandler; // Repository objects CRepository* iAccessorySettingsRepository; diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/inc/cpemessagehandler.h --- a/phoneengine/phonemodel/inc/cpemessagehandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/inc/cpemessagehandler.h Fri May 14 15:51:57 2010 +0300 @@ -28,6 +28,7 @@ #include "mpecallhandling.h" #include "mpecallcontrolif.h" +#include "mpekeysequencerecognitionif.h" // CONSTANTS const TInt KModeNormal = 0; // Normal System mode @@ -105,7 +106,11 @@ * @lib phoneenginebase.dll * @since S60_5.0 */ -NONSHARABLE_CLASS( CPEMessageHandler ) : public CBase, public MPECallControlIF +NONSHARABLE_CLASS( CPEMessageHandler ) + : + public CBase, + public MPECallControlIF, + public MPEKeySequenceRecognitionIF { public: // Destructor @@ -598,7 +603,13 @@ */ TInt HandleDialServiceCall( const TBool aClientCall ); - + + public: // from MPEKeySequenceRecognitionIF + /** + * Executes provided key sequence if recognized. + */ + TBool ExecuteKeySequenceL(const TDesC16 &aSequence); + private: // New functions /** diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/inc/mpeexternaldatahandler.h --- a/phoneengine/phonemodel/inc/mpeexternaldatahandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/inc/mpeexternaldatahandler.h Fri May 14 15:51:57 2010 +0300 @@ -39,7 +39,6 @@ EPECallDurationDisplaySetting, EPEDialPrefixChangeSetting, EPEDialPrefixTextSetting, - EPENetworkRegistrationStatus, EPETelephonyVariationFlags, EPEAccessoryMode, EPEEmergencyCallInfo, diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/inc/mpekeysequencerecognitionif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phonemodel/inc/mpekeysequencerecognitionif.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains the interface for key sequence recognition. +* +*/ + +#ifndef MPEKEYSEQUENCERECOGNITIONIF_H +#define MPEKEYSEQUENCERECOGNITIONIF_H + +#include + +// CLASS DECLARATION + +/** +* Defines interface for key sequence recognition and execution. +* +* @lib phoneengine.lib +* @since S60_10.1 +*/ +NONSHARABLE_CLASS( MPEKeySequenceRecognitionIF ) +{ + public: //New functions + + /** + * Executes provided key sequence if the sequence is recognized. + * @param aSequence The key sequence. + * @return ETrue if the key sequence was executed, EFalse otherwise. + */ + virtual TBool ExecuteKeySequenceL(const TDesC16& aSequence) = 0; + }; + +#endif // MPEKEYSEQUENCERECOGNITIONIF_H + +// End of File diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/inc/penetworkhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phonemodel/inc/penetworkhandler.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,84 @@ +/*! +* 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: Network handling. +* +*/ + +#ifndef PENETWORKHANDLER_H +#define PENETWORKHANDLER_H + +#include +#include +#include +#include "mpephonemodelinternal.h" + +QTM_USE_NAMESPACE + +class PeNetworkHandler : public QObject +{ + Q_OBJECT + +public: + + /*! + Constructor + */ + PeNetworkHandler(MPEPhoneModelInternal& aModel); + + /*! + Destructor + */ + virtual ~PeNetworkHandler (); + + +public slots: + + /*! + \fn void networkStatusChanged() + + Slot is called when network status is changed. + */ + void networkStatusChanged( + QSystemNetworkInfo::NetworkMode mode, + QSystemNetworkInfo::NetworkStatus status); + +private: + + /*! + \fn void sendStatus() + + Sends new status. + */ + void sendStatus(QSystemNetworkInfo::NetworkStatus status); + + /*! + \fn void convertStatus () + + Converts QSystemNetworkInfo::NetworkStatus to + TNWNetworkRegistrationStatus. + */ + TNWNetworkRegistrationStatus convertStatus( + QSystemNetworkInfo::NetworkStatus status); + + +private: + + // Reference to phone model object + MPEPhoneModelInternal& iModel; + + QSystemNetworkInfo* m_networkInfo; + +}; + +#endif // PENETWORKHANDLER_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/phonemodel.pro --- a/phoneengine/phonemodel/phonemodel.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/phonemodel.pro Fri May 14 15:51:57 2010 +0300 @@ -18,6 +18,10 @@ TEMPLATE = lib TARGET = phoneengine +CONFIG += mobility +MOBILITY = systeminfo +QT -= gui +QT += network symbian { TARGET.UID3 = 0x1000A86C @@ -126,6 +130,7 @@ HEADERS += ./inc/telinternalcrkeys.h HEADERS += ./inc/telinternalpskeys.h HEADERS += ./inc/telinternalpstypes.h +HEADERS += ./inc/penetworkhandler.h SOURCES += ./src/cpeaccessorymodemonitor.cpp SOURCES += ./src/cpeactivestarter.cpp @@ -162,6 +167,7 @@ SOURCES += ./src/cperemotepartyinfomediator.cpp SOURCES += ./src/cperemotepartyinfoproxy.cpp SOURCES += ./src/tperemotepartyinfomediatorupdater.cpp +SOURCES += ./src/penetworkhandler.cpp include(api_headers.pri) diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/src/cpeexternaldatahandler.cpp --- a/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -66,6 +66,7 @@ delete iAccessorySettingsRepository; delete iAccessoryModeMonitor; delete iCoreApplicationRepository; + delete iNetworkHandler; } // ----------------------------------------------------------------------------- @@ -83,6 +84,7 @@ iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); iProfileSettings = CPEProfileSettingMonitor::NewL( aModel ); + iNetworkHandler = new PeNetworkHandler(aModel); //TODO /* iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel ); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/src/cpemessagehandler.cpp --- a/phoneengine/phonemodel/src/cpemessagehandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/src/cpemessagehandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -1318,7 +1318,8 @@ "PE CPEMessageHandler::UpdateClientInfo, allowmatch: %d", clientInformation.AllowMatch() ); - if ( clientInformation.AllowMatch() && ( aCallId != KPEEmergencyCallId ) ) + if ( EPECallOriginSAT != iDataStore.CallOrigin(aCallId) && + ( aCallId != KPEEmergencyCallId ) ) { TEFLOGSTRING2( KTAINT, @@ -1342,10 +1343,6 @@ "PE CPEMessageHandler::UpdateClientInfo > MPEContactHandling::FindContactInfoSync( EPEFindWithPhoneNumber ), error code: %d", errorCode ); } - else if ( clientInformation.Name().Length() ) - { - iDataStore.SetRemoteName( clientInformation.Name(), aCallId ); - } // Calls have to log also without a contact (ECCPErrorNotFound). if ( errorCode == ECCPErrorNone || errorCode == ECCPErrorNotFound) @@ -1863,6 +1860,10 @@ { HandleClientCallData(); } + else + { + iDataStore.SetCallOriginCommand(EPECallOriginPhone); + } //Get number of calls numberOfCalls = iCallHandling.GetNumberOfCalls(); @@ -3003,4 +3004,30 @@ return errorCode; } -// End of File + +// ----------------------------------------------------------------------------- +// CPEMessageHandler::ExecuteKeySequenceL +// Only sequences which are not issued with send-key are handled here. SS +// commands etc. are processed in HandleDialCallL(). +// ----------------------------------------------------------------------------- +// +TBool CPEMessageHandler::ExecuteKeySequenceL( const TDesC16 &aSequence ) +{ + TBool keySequenceProcessed( EFalse ); + + iOptions->SetOptionStatus( KPhoneOptionInCall, + ( iCallHandling.GetNumberOfCalls() > 0 ) ); + iOptions->SetOptionStatus( KPhoneOptionSend, EFalse ); + iOptions->SetOptionStatus( KPhoneOptionVoipCall, EFalse ); + + if ( iParser->ParseL( aSequence, *iResult, *iOptions ) ) + { + keySequenceProcessed = ETrue; + iGsmParserErrorCode = ECCPErrorNone; + iParserHandlerContainer->ProcessL( *iResult ); + } + + return keySequenceProcessed; +} + +// End of File diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp --- a/phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -220,8 +220,7 @@ { isPhoneOffline = ETrue; } - //TODO - isPhoneOffline = EFalse; + return isPhoneOffline; } diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/src/cpephonemodel.cpp --- a/phoneengine/phonemodel/src/cpephonemodel.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phonemodel/src/cpephonemodel.cpp Fri May 14 15:51:57 2010 +0300 @@ -1417,7 +1417,8 @@ TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.1" ); __ASSERT_DEBUG( iMessageHandler, Panic( EPEPanicNullPointer ) ); __ASSERT_DEBUG( iEngineInfo, Panic( EPEPanicNullPointer ) ); - iPhoneServices = new PhoneServices (*iMessageHandler, *iEngineInfo); + iPhoneServices = new PhoneServices( + *iMessageHandler, *iEngineInfo, *iMessageHandler); TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.2" ); break; } diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/src/penetworkhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phonemodel/src/penetworkhandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,108 @@ +/*! +* 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: Network handling. +* +*/ + +#include +#include +#include "penetworkhandler.h" +#include "mpedatastore.h" +#include "qtphonelog.h" + +PeNetworkHandler::PeNetworkHandler(MPEPhoneModelInternal& aModel) : + iModel(aModel) +{ + m_networkInfo = new QSystemNetworkInfo(); + + QSystemNetworkInfo::NetworkStatus nwStatus = + m_networkInfo->networkStatus(QSystemNetworkInfo::GsmMode); + + if (nwStatus == QSystemNetworkInfo::NoNetworkAvailable) { + nwStatus = m_networkInfo->networkStatus(QSystemNetworkInfo::WcdmaMode); + } + + if (nwStatus == QSystemNetworkInfo::NoNetworkAvailable) { + nwStatus = m_networkInfo->networkStatus(QSystemNetworkInfo::CdmaMode); + } + + QObject::connect(m_networkInfo, SIGNAL( + networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)), + this, SLOT(networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus))); + + iModel.DataStore()->SetNetworkRegistrationStatus( + static_cast< TNWNetworkRegistrationStatus > ( convertStatus(nwStatus) ) ); +} + +PeNetworkHandler::~PeNetworkHandler() +{ + delete m_networkInfo; +} + +void PeNetworkHandler::networkStatusChanged( + QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status) +{ + if (mode == QSystemNetworkInfo::GsmMode || + mode == QSystemNetworkInfo::WcdmaMode || + mode == QSystemNetworkInfo::CdmaMode) { + sendStatus(status); + } +} + +void PeNetworkHandler::sendStatus( + QSystemNetworkInfo::NetworkStatus status) +{ + iModel.DataStore()->SetNetworkRegistrationStatus( + static_cast< TNWNetworkRegistrationStatus > ( convertStatus(status) ) ); + iModel.SendMessage(MEngineMonitor::EPEMessageNetworkRegistrationStatusChange); +} + +TNWNetworkRegistrationStatus PeNetworkHandler::convertStatus( + QSystemNetworkInfo::NetworkStatus status) +{ + TNWNetworkRegistrationStatus ret; + switch(status) { + case QSystemNetworkInfo::UndefinedStatus: + ret = ENWStatusRegistrationUnknown; + break; + case QSystemNetworkInfo::NoNetworkAvailable: + ret = ENWStatusNotRegisteredNoService; + break; + case QSystemNetworkInfo::EmergencyOnly: + ret = ENWStatusNotRegisteredEmergencyOnly; + break; + case QSystemNetworkInfo::Searching: + ret = ENWStatusNotRegisteredSearching; + break; + case QSystemNetworkInfo::Busy: + ret = ENWStatusRegisteredBusy; + break; + case QSystemNetworkInfo::Connected: + case QSystemNetworkInfo::HomeNetwork: + ret = ENWStatusRegisteredOnHomeNetwork; + break; + case QSystemNetworkInfo::Denied: + ret = ENWStatusRegistrationDenied; + break; + case QSystemNetworkInfo::Roaming: + ret = ENWStatusRegisteredRoaming; + break; + default: + ret = ENWStatusRegistrationUnknown; + break; + } + + return ret; +} + diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/tsrc/ut_penetworkhandler/unit_tests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phonemodel/tsrc/ut_penetworkhandler/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,178 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit tests for PhoneUINetworkHandler. +* +*/ + +#include +#include +#include +#include +#include +#include +#include "cpeengineinfo.h" +#include "penetworkhandler.h" + + +//CONSTANTS + + +#define PHONE_QT_TEST_MAIN(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ + HbApplication app(argc, argv); \ + TestObject tc; \ + QResource::registerResource("../hbcore.rcc"); \ + int ret = QTest::qExec(&tc, argc, argv); \ + /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \ + /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \ + /* app.exec() where the signal is normally emitted is not called here. */ \ + /* So, invoking the signal explicitly. */ \ + QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \ + return ret; \ +} + +class TestNetworkHandler : public QObject, public MPEPhoneModelInternal +{ + Q_OBJECT + +public: + TestNetworkHandler (); + ~TestNetworkHandler (); + +// Functions from MPEPhoneModelInternal base class + + MPEDataStore* DataStore() {return iEngineInfo;}; + + MPEExternalDataHandler* DataStoreExt() {;}; + + CPERemotePartyInfoMediator* MediatorCommunicationHandler() {return 0;}; + + void HandleInternalMessage( const TInt aMessage ) {;}; + + void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) + { + if ( MEngineMonitor::EPEMessageNetworkRegistrationStatusChange == aMessage ) + { + m_networkStatusChanged = true; + } + ;}; + + void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, + const TInt aCallId ) {;}; + +public slots: + void initTestCase (); + void cleanupTestCase (); + void init (); + void cleanup (); + +private slots: + void testNetworkStatusChanged(); + + + +private: + PeNetworkHandler *m_nwHandler; // class under test + CPEEngineInfo *iEngineInfo; + bool m_networkStatusChanged; + +}; + + +TestNetworkHandler::TestNetworkHandler() +{ +} + +TestNetworkHandler::~TestNetworkHandler() +{ +} + +void TestNetworkHandler::initTestCase() +{ +} + +void TestNetworkHandler::cleanupTestCase() +{ +} + +void TestNetworkHandler::init() +{ + TRAP_IGNORE( iEngineInfo = CPEEngineInfo::NewL() ); + m_nwHandler = new PeNetworkHandler(*this); +} + +void TestNetworkHandler::cleanup() +{ + delete m_nwHandler; + delete iEngineInfo; +} + +void TestNetworkHandler::testNetworkStatusChanged() +{ + m_networkStatusChanged = false; + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::UnknownMode, + QSystemNetworkInfo::UndefinedStatus); + QVERIFY( false == m_networkStatusChanged ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::CdmaMode, + QSystemNetworkInfo::UndefinedStatus); + QVERIFY( ENWStatusRegistrationUnknown == + iEngineInfo->NetworkRegistrationStatus() ); + QVERIFY( true == m_networkStatusChanged ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::WcdmaMode, + QSystemNetworkInfo::NoNetworkAvailable); + QVERIFY( ENWStatusNotRegisteredNoService == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::EmergencyOnly); + QVERIFY( ENWStatusNotRegisteredEmergencyOnly == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::Searching); + QVERIFY( ENWStatusNotRegisteredSearching == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::Busy); + QVERIFY( ENWStatusRegisteredBusy == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::HomeNetwork); + QVERIFY( ENWStatusRegisteredOnHomeNetwork == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::Denied); + QVERIFY( ENWStatusRegistrationDenied == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + QSystemNetworkInfo::Roaming); + QVERIFY( ENWStatusRegisteredRoaming == + iEngineInfo->NetworkRegistrationStatus() ); + + m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode, + (QSystemNetworkInfo::NetworkStatus)100); + QVERIFY( ENWStatusRegistrationUnknown == + iEngineInfo->NetworkRegistrationStatus() ); +} + + +PHONE_QT_TEST_MAIN(TestNetworkHandler) +#include "unit_tests.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phonemodel/tsrc/ut_penetworkhandler/ut_penetworkhandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phonemodel/tsrc/ut_penetworkhandler/ut_penetworkhandler.pro Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for building unit test component +# +# + +TEMPLATE = app +TARGET = ut_penetworkhandler +TARGET.CAPABILITY = ALL -TCB +TARGET.UID3 = 0xEA9BEFAA +DEPENDPATH += . ../../src/ +INCLUDEPATH += . +CONFIG += hb qtestlib + +symbian { + + INCLUDEPATH += /epoc32/include/platform/mw \ + /epoc32/include/platform/app \ + /epoc32/include/mw \ + ../../../inc/ \ + ../../../../inc \ + ../../../../engineinfo/inc \ + ./ + + LIBS += -lQtSystemInfo + LIBS += -lengineinfo +} + + +# Input +HEADERS += ../../inc/penetworkhandler.h + +SOURCES += ../../src/penetworkhandler.cpp \ + ./unit_tests.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/bwins/phoneservicesu.def --- a/phoneengine/phoneservices/bwins/phoneservicesu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/bwins/phoneservicesu.def Fri May 14 15:51:57 2010 +0300 @@ -1,8 +1,8 @@ EXPORTS ??_EPhoneServices@@UAE@I@Z @ 1 NONAME ; PhoneServices::~PhoneServices(unsigned int) ?tr@PhoneServices@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString PhoneServices::tr(char const *, char const *, int) - ??0PhoneServices@@QAE@AAVMPECallControlIF@@AAVMPECallSettersIF@@PAVQObject@@@Z @ 3 NONAME ; PhoneServices::PhoneServices(class MPECallControlIF &, class MPECallSettersIF &, class QObject *) - ??1PhoneServices@@UAE@XZ @ 4 NONAME ; PhoneServices::~PhoneServices(void) + ??1PhoneServices@@UAE@XZ @ 3 NONAME ; PhoneServices::~PhoneServices(void) + ??0PhoneServices@@QAE@AAVMPECallControlIF@@AAVMPECallSettersIF@@AAVMPEKeySequenceRecognitionIF@@PAVQObject@@@Z @ 4 NONAME ; PhoneServices::PhoneServices(class MPECallControlIF &, class MPECallSettersIF &, class MPEKeySequenceRecognitionIF &, class QObject *) ?trUtf8@PhoneServices@@SA?AVQString@@PBD0H@Z @ 5 NONAME ; class QString PhoneServices::trUtf8(char const *, char const *, int) ?metaObject@PhoneServices@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * PhoneServices::metaObject(void) const ?trUtf8@PhoneServices@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString PhoneServices::trUtf8(char const *, char const *) diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/eabi/phoneservicesu.def --- a/phoneengine/phoneservices/eabi/phoneservicesu.def Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/eabi/phoneservicesu.def Fri May 14 15:51:57 2010 +0300 @@ -3,8 +3,8 @@ _ZN13PhoneServices11qt_metacastEPKc @ 2 NONAME _ZN13PhoneServices16staticMetaObjectE @ 3 NONAME DATA 16 _ZN13PhoneServices19getStaticMetaObjectEv @ 4 NONAME - _ZN13PhoneServicesC1ER16MPECallControlIFR16MPECallSettersIFP7QObject @ 5 NONAME - _ZN13PhoneServicesC2ER16MPECallControlIFR16MPECallSettersIFP7QObject @ 6 NONAME + _ZN13PhoneServicesC1ER16MPECallControlIFR16MPECallSettersIFR27MPEKeySequenceRecognitionIFP7QObject @ 5 NONAME + _ZN13PhoneServicesC2ER16MPECallControlIFR16MPECallSettersIFR27MPEKeySequenceRecognitionIFP7QObject @ 6 NONAME _ZN13PhoneServicesD0Ev @ 7 NONAME _ZN13PhoneServicesD1Ev @ 8 NONAME _ZN13PhoneServicesD2Ev @ 9 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/dialservice.h --- a/phoneengine/phoneservices/inc/dialservice.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/inc/dialservice.h Fri May 14 15:51:57 2010 +0300 @@ -39,7 +39,7 @@ Phone Application. It is intended to be used via Qt Highway. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dial(QString)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString)"); snd << "0501234567"; */ int dial(const QString& number); @@ -53,7 +53,7 @@ identifier. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString,int)"); snd << "0501234567" << 123456; */ int dial(const QString& number, int contactId); @@ -65,7 +65,7 @@ Phone Application. It is intended to be used via Qt Highway. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dial(QString)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString)"); snd << "0501234567"; */ void dialVideo(const QString& number); @@ -79,7 +79,7 @@ identifier. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString,int)"); snd << "0501234567" << 123456; */ void dialVideo(const QString& number, int contactId); @@ -91,7 +91,7 @@ Phone Application. It is intended to be used via Qt Highway. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoip(QString)"); snd << "address@domain"; */ void dialVoip(const QString& address); @@ -105,7 +105,7 @@ identifier. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString,int)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoip(QString,int)"); snd << "address@domain" << 123456; */ void dialVoip(const QString& address, int contactId); @@ -118,7 +118,7 @@ Call is made by given service (id). Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoipService(QString,int)"); snd << "address@domain" << 123; */ void dialVoipService(const QString& address, int serviceId); @@ -133,7 +133,7 @@ identifier. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int,int)"); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoipService(QString,int,int)"); snd << "address@domain" << 123 << 12345; */ void dialVoipService(const QString& address, int serviceId, int contactId); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/dialservicedepricated.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/inc/dialservicedepricated.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,157 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dial API to be used through Qt Highway. +* THIS IS DEPRICATED API - DO NOT USE! +* (use DialService instead) +* +*/ + +#ifndef DIALSERVICEDEPRICATED_H +#define DIALSERVICEDEPRICATED_H + +#include +#include +#include +#include "mpecallcontrolif.h" +#include "mpecallsettersif.h" + +class DialServiceDepricated : public XQServiceProvider +{ + Q_OBJECT +public: + DialServiceDepricated(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject *parent = 0); + ~DialServiceDepricated(); + +public slots: + /*! + \fn dial(const QString& number) + + This method makes a cellular switched dial command to + Phone Application. It is intended to be used via Qt Highway. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dial(QString)"); + snd << "0501234567"; + */ + int dial(const QString& number); + + /*! + \fn dial(const QString& number) + + This method makes a cellular switched dial command to + Phone Application. It is intended to be used via Qt Highway. + Caller's name is shown according to the given Phonebook contact + identifier. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)"); + snd << "0501234567" << 123456; + */ + int dial(const QString& number, int contactId); + + /*! + \fn dialVideo(const QString& number) + + This method makes a video call dial command to + Phone Application. It is intended to be used via Qt Highway. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dial(QString)"); + snd << "0501234567"; + */ + void dialVideo(const QString& number); + + /*! + \fn dial(const QString& number) + + This method makes a video call dial command to + Phone Application. It is intended to be used via Qt Highway. + Caller's name is shown according to the given Phonebook contact + identifier. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)"); + snd << "0501234567" << 123456; + */ + void dialVideo(const QString& number, int contactId); + + /*! + \fn dialVoip(const QString& address) + + This method makes a voip call dial command to + Phone Application. It is intended to be used via Qt Highway. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString)"); + snd << "address@domain"; + */ + void dialVoip(const QString& address); + + /*! + \fn dialVoip(const QString& address, int contactId) + + This method makes a voip call dial command to + Phone Application. It is intended to be used via Qt Highway. + Caller's name is shown according to the given Phonebook contact + identifier. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString,int)"); + snd << "address@domain" << 123456; + */ + void dialVoip(const QString& address, int contactId); + + /*! + \fn dialVoipService(const QString& address, int contactId) + + This method makes a voip call dial command to + Phone Application. It is intended to be used via Qt Highway. + Call is made by given service (id). + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int)"); + snd << "address@domain" << 123; + */ + void dialVoipService(const QString& address, int serviceId); + + /*! + \fn dialVoipService(const QString& address, int serviceId, int contactId) + + This method makes a voip call dial command to + Phone Application. It is intended to be used via Qt Highway. + Call is made by given service (id). + Caller's name is shown according to the given Phonebook contact + identifier. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int,int)"); + snd << "address@domain" << 123 << 12345; + */ + void dialVoipService(const QString& address, int serviceId, int contactId); + +private: + /*! + \fn QString simplified(QString& number) + + Returns a string that has whitespaces, '(', ')', '-', '[', and ']' chars removed + */ + static QString simplified(const QString &number) Q_REQUIRED_RESULT; + + +private: + MPECallControlIF &m_call; + MPECallSettersIF &m_parameters; +}; + +#endif // DIALERSERVICEDEPRICATED_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/dtmfservice.h --- a/phoneengine/phoneservices/inc/dtmfservice.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/inc/dtmfservice.h Fri May 14 15:51:57 2010 +0300 @@ -1,5 +1,5 @@ /*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -28,27 +28,14 @@ { Q_OBJECT public: - DTMFService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject *parent = 0); + DTMFService( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + QObject *parent = 0); ~DTMFService(); public slots: /*! - \fn recognizeKeySequence(const QString& keySequence) - - Client can use this method to execute key sequence recognition. - Key sequence may contain for example product codes etc. that - may cause lower layers to do any specific things. - - If sequence isn't recognized this method doesn't do anything. - If sequence is recognized then task related to the code is executed. - - Usage example: - XQServiceRequest snd("com.nokia.services.telephony","executeKeySequence(QString)"); - snd << "*#0000#"; - */ - void executeKeySequence(const QString& keySequence); - - /*! \fn playDTMFTone(const QChar& keyToPlay) This method plays DTMF tone matching given character. @@ -56,7 +43,7 @@ it is ignored. Usage example: - XQServiceRequest snd("com.nokia.services.telephony","playDTMFTone(QChar)"); + XQServiceRequest snd("com.nokia.symbian.IDtmfPlay","playDTMFTone(QChar)"); snd << "5"; */ void playDTMFTone(const QChar& keyToPlay); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/dtmfservicedepricated.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/inc/dtmfservicedepricated.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,66 @@ +/*! +* 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: DTMF API to be used through Qt Highway. +* THIS IS DEPRICATED API - DO NOT USE! +* (use DTMFService instead) +* +*/ + +#ifndef DTMFSERVICEDEPRICATED_H +#define DTMFSERVICEDEPRICATED_H + +#include +#include +#include +#include "mpecallcontrolif.h" +#include "mpecallsettersif.h" + +class DTMFServiceDepricated : public XQServiceProvider +{ + Q_OBJECT +public: + DTMFServiceDepricated( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + QObject *parent = 0); + ~DTMFServiceDepricated(); + +public slots: + /*! + \fn playDTMFTone(const QChar& keyToPlay) + + This method plays DTMF tone matching given character. + If character doesn't match any supported DTMF tone + it is ignored. + + Usage example: + XQServiceRequest snd("com.nokia.services.telephony","playDTMFTone(QChar)"); + snd << "5"; + */ + void playDTMFTone(const QChar& keyToPlay); + + /*! + \fn stopDTMFPlay() + + This method stops playing DTMF tone if it is currently played. + */ + void stopDTMFPlay(); + + +private: + MPECallControlIF &m_call; + MPECallSettersIF &m_parameters; +}; + +#endif // DTMFSERVICE_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/keysequencerecognitionservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/inc/keysequencerecognitionservice.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,69 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides key sequence recognition and execution services. +* +*/ + +#ifndef KEYSEQUENCERECOGNITIONSERVICE_H +#define KEYSEQUENCERECOGNITIONSERVICE_H + +#include +#include +#include + +class MPEKeySequenceRecognitionIF; + +class KeySequenceRecognitionService : public XQServiceProvider +{ + Q_OBJECT + +public: + + KeySequenceRecognitionService( + MPEKeySequenceRecognitionIF &keySequenceRecognizer, + QObject *parent = 0); + + ~KeySequenceRecognitionService(); + +public slots: + + /*! + \fn executeKeySequence(const QString& keySequence) + + Client can use this method to execute key sequence recognition. + Key sequence may contain for example product codes etc. that + may cause lower layers to do any specific things. + + If sequence isn't recognized this method doesn't do anything. + If sequence is recognized then task related to the code is executed. + \param keySequence Key sequence to execute. + \return True if key sequence was processed, false otherwise. + + Usage example: + XQServiceRequest request( + "com.nokia.symbian.IDtmfPlay", + "executeKeySequence(QString)", + true); + request << "*#0000#"; + QVariant keySequenceProcessed; + bool requestOk = request.send(keySequenceProcessed); + */ + bool executeKeySequence(const QString &keySequence); + +private: + + MPEKeySequenceRecognitionIF &m_keySequenceRecognizer; +}; + +#endif // KEYSEQUENCERECOGNITIONSERVICE_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/keysequencerecognitionservicedepricated.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/inc/keysequencerecognitionservicedepricated.h Fri May 14 15:51:57 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: Provides key sequence recognition and execution services. +* THIS IS DEPRICATED API - DO NOT USE! +* (use KeySequenceRecognitionService instead) +* +*/ + +#ifndef KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H +#define KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H + +#include +#include +#include + +class MPEKeySequenceRecognitionIF; + +class KeySequenceRecognitionServiceDepricated : public XQServiceProvider +{ + Q_OBJECT + +public: + + KeySequenceRecognitionServiceDepricated( + MPEKeySequenceRecognitionIF &keySequenceRecognizer, + QObject *parent = 0); + + ~KeySequenceRecognitionServiceDepricated(); + +public slots: + + /*! + \fn executeKeySequence(const QString& keySequence) + + Client can use this method to execute key sequence recognition. + Key sequence may contain for example product codes etc. that + may cause lower layers to do any specific things. + + If sequence isn't recognized this method doesn't do anything. + If sequence is recognized then task related to the code is executed. + \param keySequence Key sequence to execute. + \return True if key sequence was processed, false otherwise. + + Usage example: + XQServiceRequest request( + "com.nokia.services.telephony", + "executeKeySequence(QString)", + true); + request << "*#0000#"; + QVariant keySequenceProcessed; + bool requestOk = request.send(keySequenceProcessed); + */ + bool executeKeySequence(const QString &keySequence); + +private: + + MPEKeySequenceRecognitionIF &m_keySequenceRecognizer; +}; + +#endif // KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/inc/phoneservices.h --- a/phoneengine/phoneservices/inc/phoneservices.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/inc/phoneservices.h Fri May 14 15:51:57 2010 +0300 @@ -24,6 +24,13 @@ class DialService; class DTMFService; +class MPEKeySequenceRecognitionIF; +class KeySequenceRecognitionService; + +// Depricated APIs +class DialServiceDepricated; +class DTMFServiceDepricated; +class KeySequenceRecognitionServiceDepricated; #ifdef BUILD_PHONESERVICES #define PHONESERVICES_EXPORT Q_DECL_EXPORT @@ -35,13 +42,22 @@ { Q_OBJECT public: - PhoneServices(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject *parent = 0); + PhoneServices( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + MPEKeySequenceRecognitionIF &keySequenceRecognition, + QObject *parent = 0); ~PhoneServices(); private: - DialService *dialService; - DTMFService *dtmfService; + QScopedPointer dialService; + QScopedPointer dtmfService; + QScopedPointer m_keySequenceRecognitionService; + // Depricated + QScopedPointer dialServiceDepricated; + QScopedPointer dtmfServiceDepricated; + QScopedPointer m_keySequenceRecognitionServiceDepricated; }; #endif // PHONESERVICES_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/phoneservices.pri --- a/phoneengine/phoneservices/phoneservices.pri Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/phoneservices.pri Fri May 14 15:51:57 2010 +0300 @@ -17,12 +17,20 @@ SOURCES=\ ./src/phoneservices.cpp \ ./src/dialservice.cpp \ - ./src/dtmfservice.cpp + ./src/dtmfservice.cpp \ + ./src/keysequencerecognitionservice.cpp \ + ./src/dialservicedepricated.cpp \ + ./src/dtmfservicedepricated.cpp \ + ./src/keysequencerecognitionservicedepricated.cpp HEADERS=\ ./inc/phoneservices.h \ ./inc/dialservice.h \ - ./inc/dtmfservice.h + ./inc/dtmfservice.h \ + ./inc/keysequencerecognitionservice.h \ + ./inc/dialservicedepricated.h \ + ./inc/dtmfservicedepricated.h \ + ./inc/keysequencerecognitionservicedepricated.h PHONESERVICES_API_HEADERS=\ ./inc/phoneservices.h diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/dialservice.cpp --- a/phoneengine/phoneservices/src/dialservice.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/src/dialservice.cpp Fri May 14 15:51:57 2010 +0300 @@ -23,7 +23,7 @@ DialService::DialService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : - XQServiceProvider(QLatin1String("com.nokia.services.telephony"), parent), m_call (call), m_parameters (parameters) + XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters) { publishAll(); } diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/dialservicedepricated.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/src/dialservicedepricated.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,126 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: dial service +* +*/ + +#include +#include +#include +#include "dialservicedepricated.h" +#include "qtphonelog.h" + + +DialServiceDepricated::DialServiceDepricated(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : + XQServiceProvider(QLatin1String("com.nokia.services.telephony"), parent), m_call (call), m_parameters (parameters) +{ + publishAll(); +} + +DialServiceDepricated::~DialServiceDepricated() +{ +} + +int DialServiceDepricated::dial(const QString& number) +{ + PHONE_DEBUG2("DialServiceDepricated::dial number:", number); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr(reinterpret_cast(simplifiedNumber.utf16())); + m_parameters.SetPhoneNumber (numberPtr); + m_parameters.SetCallTypeCommand (EPECallTypeCSVoice); + return m_call.HandleDialServiceCall (); +} + +int DialServiceDepricated::dial(const QString& number, int contactId) +{ + PHONE_DEBUG4("DialServiceDepricated::dial number:", number, "contactId:", contactId); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16())); + m_parameters.SetPhoneNumber (numberPtr); + m_parameters.SetCallTypeCommand (EPECallTypeCSVoice); + m_parameters.SetContactId2 (contactId); + return m_call.HandleDialServiceCall (); +} + +void DialServiceDepricated::dialVideo(const QString& number) +{ + PHONE_DEBUG2("DialServiceDepricated::dialVideo number:", number); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr(reinterpret_cast(simplifiedNumber.utf16())); + m_parameters.SetPhoneNumber (numberPtr); + m_parameters.SetCallTypeCommand (EPECallTypeVideo); + m_call.HandleDialServiceCall (); +} + +void DialServiceDepricated::dialVideo(const QString& number, int contactId) +{ + PHONE_DEBUG4("DialServiceDepricated::dialVideo number:", number, "contactId:", contactId); + QString simplifiedNumber = simplified(number); + TPtrC16 numberPtr (reinterpret_cast(simplifiedNumber.utf16())); + m_parameters.SetPhoneNumber (numberPtr); + m_parameters.SetCallTypeCommand (EPECallTypeVideo); + m_parameters.SetContactId2 (contactId); + m_call.HandleDialServiceCall (); +} + +void DialServiceDepricated::dialVoip(const QString& address) +{ + PHONE_DEBUG2("DialServiceDepricated::dialVoip number:", address); + TPtrC16 numberPtr(reinterpret_cast(address.utf16 ())); + m_parameters.SetPhoneNumber(numberPtr); + m_parameters.SetCallTypeCommand(EPECallTypeVoIP); + m_call.HandleDialServiceCall(); +} + +void DialServiceDepricated::dialVoip(const QString& address, int contactId) +{ + PHONE_DEBUG4("DialServiceDepricated::dialVoip number:", address, "contactId:", contactId); + TPtrC16 numberPtr (reinterpret_cast(address.utf16 ())); + m_parameters.SetPhoneNumber(numberPtr); + m_parameters.SetCallTypeCommand(EPECallTypeVoIP); + m_parameters.SetContactId2(contactId); + m_call.HandleDialServiceCall(); +} + +void DialServiceDepricated::dialVoipService(const QString& address, int serviceId) +{ + PHONE_DEBUG4("DialServiceDepricated::dialVoipService number:", address, "serviceId:", serviceId); + TPtrC16 numberPtr (reinterpret_cast(address.utf16 ())); + m_parameters.SetPhoneNumber(numberPtr); + m_parameters.SetCallTypeCommand(EPECallTypeVoIP); + m_parameters.SetServiceIdCommand(serviceId); + m_call.HandleDialServiceCall(); +} + +void DialServiceDepricated::dialVoipService( + const QString& address, int serviceId, int contactId) +{ + PHONE_DEBUG2("DialServiceDepricated::dialVoipService number:", address); + PHONE_DEBUG2("DialServiceDepricated::dialVoipService serviceId:", serviceId); + PHONE_DEBUG2("DialServiceDepricated::dialVoipService contactId:", contactId); + TPtrC16 numberPtr (reinterpret_cast(address.utf16 ())); + m_parameters.SetPhoneNumber(numberPtr); + m_parameters.SetCallTypeCommand(EPECallTypeVoIP); + m_parameters.SetServiceIdCommand(serviceId); + m_parameters.SetContactId2(contactId); + m_call.HandleDialServiceCall(); +} + +QString DialServiceDepricated::simplified(const QString &number) +{ + QString simplifiedNumber = number; + QRegExp rx(QString("[\\s,.\\[\\]\\(\\)\\-]")); + simplifiedNumber.remove(rx); + return simplifiedNumber; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/dtmfservice.cpp --- a/phoneengine/phoneservices/src/dtmfservice.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/src/dtmfservice.cpp Fri May 14 15:51:57 2010 +0300 @@ -1,5 +1,5 @@ /*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -20,8 +20,15 @@ #include "dtmfservice.h" #include "qtphonelog.h" -DTMFService::DTMFService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : - XQServiceProvider(QLatin1String("com.nokia.services.telephony.dtmf"), parent), m_call (call), m_parameters (parameters) +DTMFService::DTMFService( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + QObject* parent) + : + XQServiceProvider( + QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), + m_call(call), + m_parameters(parameters) { publishAll(); } @@ -30,13 +37,6 @@ { } -void DTMFService::executeKeySequence(const QString& keySequence) -{ - PHONE_DEBUG2("DTMFService::executeKeySequence keySequence:", keySequence); - TPtrC16 keySequencePtr (reinterpret_cast(keySequence.utf16 ())); - m_parameters.SetPhoneNumber (keySequencePtr); -} - void DTMFService::playDTMFTone(const QChar& keyToPlay) { PHONE_DEBUG2("DTMFService::playDTMFTone keyToPlay:", keyToPlay); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/dtmfservicedepricated.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/src/dtmfservicedepricated.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,51 @@ +/*! +* 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: DTMF API to be used through Qt Highway. +* +*/ + +#include +#include +#include "dtmfservicedepricated.h" +#include "qtphonelog.h" + +DTMFServiceDepricated::DTMFServiceDepricated( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + QObject* parent) + : + XQServiceProvider( + QLatin1String("com.nokia.services.telephony.dtmf"), parent), + m_call(call), + m_parameters(parameters) +{ + publishAll(); +} + +DTMFServiceDepricated::~DTMFServiceDepricated() +{ +} + +void DTMFServiceDepricated::playDTMFTone(const QChar& keyToPlay) +{ + PHONE_DEBUG2("DTMFServiceDepricated::playDTMFTone keyToPlay:", keyToPlay); + m_parameters.SetKeyCode(keyToPlay.unicode()); + TRAP_IGNORE( m_call.HandlePlayDTMFL() ); +} + +void DTMFServiceDepricated::stopDTMFPlay() +{ + PHONE_DEBUG("DTMFServiceDepricated::stopDTMFPlay"); + m_call.HandleEndDTMF(); +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/keysequencerecognitionservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/src/keysequencerecognitionservice.cpp Fri May 14 15:51:57 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: Provides key sequence recognition and execution services. +* +*/ + +#include +#include +#include +#include "keysequencerecognitionservice.h" +#include "mpekeysequencerecognitionif.h" + +/*! + KeySequenceRecognitionService::KeySequenceRecognitionService. + */ +KeySequenceRecognitionService::KeySequenceRecognitionService( + MPEKeySequenceRecognitionIF &keySequenceRecognizer, + QObject* parent) + : + XQServiceProvider( + QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), + m_keySequenceRecognizer(keySequenceRecognizer) +{ + publishAll(); +} + + +/*! + KeySequenceRecognitionService::~KeySequenceRecognitionService. + */ +KeySequenceRecognitionService::~KeySequenceRecognitionService() +{ +} + + +/*! + KeySequenceRecognitionService::executeKeySequence. + */ +bool KeySequenceRecognitionService::executeKeySequence( + const QString &keySequence) +{ + TPtrC16 keySequencePtr( + reinterpret_cast(keySequence.utf16())); + bool sequenceProcessed = false; + TRAPD(leaveCode, sequenceProcessed = static_cast( + m_keySequenceRecognizer.ExecuteKeySequenceL(keySequencePtr))); + sequenceProcessed = (KErrNone == leaveCode) ? sequenceProcessed : false; + return sequenceProcessed; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/keysequencerecognitionservicedepricated.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/src/keysequencerecognitionservicedepricated.cpp Fri May 14 15:51:57 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: Provides key sequence recognition and execution services. +* +*/ + +#include +#include +#include +#include "keysequencerecognitionservicedepricated.h" +#include "mpekeysequencerecognitionif.h" + +/*! + KeySequenceRecognitionServiceDepricated::KeySequenceRecognitionServiceDepricated. + */ +KeySequenceRecognitionServiceDepricated::KeySequenceRecognitionServiceDepricated( + MPEKeySequenceRecognitionIF &keySequenceRecognizer, + QObject* parent) + : + XQServiceProvider( + QLatin1String("com.nokia.services.telephony"), parent), + m_keySequenceRecognizer(keySequenceRecognizer) +{ + publishAll(); +} + + +/*! + KeySequenceRecognitionServiceDepricated::~KeySequenceRecognitionServiceDepricated. + */ +KeySequenceRecognitionServiceDepricated::~KeySequenceRecognitionServiceDepricated() +{ +} + + +/*! + KeySequenceRecognitionServiceDepricated::executeKeySequence. + */ +bool KeySequenceRecognitionServiceDepricated::executeKeySequence( + const QString &keySequence) +{ + TPtrC16 keySequencePtr( + reinterpret_cast(keySequence.utf16())); + bool sequenceProcessed = false; + TRAPD(leaveCode, sequenceProcessed = static_cast( + m_keySequenceRecognizer.ExecuteKeySequenceL(keySequencePtr))); + sequenceProcessed = (KErrNone == leaveCode) ? sequenceProcessed : false; + return sequenceProcessed; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/src/phoneservices.cpp --- a/phoneengine/phoneservices/src/phoneservices.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/src/phoneservices.cpp Fri May 14 15:51:57 2010 +0300 @@ -18,14 +18,41 @@ #include "phoneservices.h" #include "dialservice.h" #include "dtmfservice.h" +#include "mpekeysequencerecognitionif.h" +#include "keysequencerecognitionservice.h" #include "qtphonelog.h" -PhoneServices::PhoneServices(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : - QObject(parent) +// Depricated APIs +#include "dialservicedepricated.h" +#include "dtmfservicedepricated.h" +#include "keysequencerecognitionservicedepricated.h" + +PhoneServices::PhoneServices( + MPECallControlIF &call, + MPECallSettersIF ¶meters, + MPEKeySequenceRecognitionIF &keySequenceRecognition, + QObject* parent) + : + QObject(parent), + dialService(0), + dtmfService(0), + m_keySequenceRecognitionService(0) + // Depricated + , dialServiceDepricated(0) + , dtmfServiceDepricated(0) + , m_keySequenceRecognitionServiceDepricated(0) { PHONE_DEBUG("PhoneServices::PhoneServices"); - dialService = new DialService(call, parameters, this); - dtmfService = new DTMFService(call, parameters, this); + dialService.reset(new DialService(call, parameters)); + dtmfService.reset(new DTMFService(call, parameters)); + m_keySequenceRecognitionService.reset( + new KeySequenceRecognitionService(keySequenceRecognition)); + + // Depricated + dialServiceDepricated.reset(new DialServiceDepricated(call, parameters)); + dtmfServiceDepricated.reset(new DTMFServiceDepricated(call, parameters)); + m_keySequenceRecognitionServiceDepricated.reset( + new KeySequenceRecognitionServiceDepricated(keySequenceRecognition)); } PhoneServices::~PhoneServices() diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/runtests.bat --- a/phoneengine/phoneservices/tsrc/runtests.bat Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/tsrc/runtests.bat Fri May 14 15:51:57 2010 +0300 @@ -27,3 +27,7 @@ del \epoc32\winscw\c\private\EEE39B2F\ut_dtmfservice.log \epoc32\release\winscw\udeb\ut_dtmfservice.exe -o ut_dtmfservice.log type \epoc32\winscw\c\private\EEE39B2F\ut_dtmfservice.log + +del \epoc32\winscw\c\private\E31F4ECF\ut_keysequencerecognitionservice.log +\epoc32\release\winscw\udeb\ut_keysequencerecognitionservice.exe -o ut_keysequencerecognitionservice.log +type \epoc32\winscw\c\private\E31F4ECF\ut_keysequencerecognitionservice.log diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/unit.pro --- a/phoneengine/phoneservices/tsrc/unit.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/tsrc/unit.pro Fri May 14 15:51:57 2010 +0300 @@ -19,3 +19,4 @@ SUBDIRS += ut_phoneservices SUBDIRS += ut_dialservice SUBDIRS += ut_dtmfservice +SUBDIRS += ut_keysequencerecognitionservice diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp --- a/phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -44,7 +44,6 @@ void SetServiceIdCommand( TUint32 aServiceId ); private slots: - void testExecuteKeySequence (); void testPlayDTMFTone (); void testStopDTMFPlay (); @@ -142,7 +141,7 @@ void TestDTMFService::SetServiceIdCommand( TUint32 aServiceId ) { - + Q_UNUSED(aServiceId) } TInt TestDTMFService::HandleDialServiceCall( const TBool aClientCall ) @@ -152,14 +151,6 @@ return KErrNone; } -void TestDTMFService::testExecuteKeySequence() -{ - m_dtmfService->executeKeySequence(QString("*#0000#")); - QString keySequence((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length()); - QVERIFY (m_setPhoneNumberCalled == true); - QCOMPARE (keySequence, QString("*#0000#")); -} - void TestDTMFService::testPlayDTMFTone() { QChar six('6'); diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/unit_tests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,113 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit tests for DialService. +* +*/ + +#include + +#include "mpekeysequencerecognitionif.h" +#include "keysequencerecognitionservice.h" + +class UT_KeySequenceRecognitionService + : + public QObject, public MPEKeySequenceRecognitionIF +{ + Q_OBJECT + +public: + UT_KeySequenceRecognitionService(); + virtual ~UT_KeySequenceRecognitionService(); + +public: + TBool ExecuteKeySequenceL(const TDesC16& aSequence); + +private slots: + void init(); + void cleanup(); + void t_executeKeySequence(); + void t_notRecognizedKeySequence(); + void t_leaveDuringExecuteKeySequence(); + +private: + KeySequenceRecognitionService *m_RecognitionService; + TBool m_keySequenceExecutionResult; + TPtrC16 m_keySequencePtr; + int m_leaveSimulationCode; +}; + +UT_KeySequenceRecognitionService::UT_KeySequenceRecognitionService() + : + m_RecognitionService(NULL), + m_keySequenceExecutionResult(ETrue), + m_leaveSimulationCode(KErrNone) +{ +} + +UT_KeySequenceRecognitionService::~UT_KeySequenceRecognitionService() +{ + delete m_RecognitionService; +} + +TBool UT_KeySequenceRecognitionService::ExecuteKeySequenceL( + const TDesC16& aSequence) +{ + Q_UNUSED(aSequence) + User::LeaveIfError(m_leaveSimulationCode); + + m_keySequencePtr.Set(aSequence.Ptr()); + return m_keySequenceExecutionResult; +} + +void UT_KeySequenceRecognitionService::init() +{ + m_RecognitionService = new KeySequenceRecognitionService(*this); + m_keySequenceExecutionResult = ETrue; + m_keySequencePtr.Set(NULL, 0); + m_leaveSimulationCode = KErrNone; +} + +void UT_KeySequenceRecognitionService::cleanup() +{ + delete m_RecognitionService; + m_RecognitionService = NULL; +} + +void UT_KeySequenceRecognitionService::t_executeKeySequence() +{ + QString sequence("*#06#"); + bool result = m_RecognitionService->executeKeySequence(sequence); + QCOMPARE(result, true); + QVERIFY( + m_keySequencePtr == TPtrC16(reinterpret_cast(sequence.utf16()))); +} + +void UT_KeySequenceRecognitionService::t_notRecognizedKeySequence() +{ + m_keySequenceExecutionResult = EFalse; + QString sequence("*#abc#"); + bool result = m_RecognitionService->executeKeySequence(sequence); + QCOMPARE(result, false); +} + +void UT_KeySequenceRecognitionService::t_leaveDuringExecuteKeySequence() +{ + m_leaveSimulationCode = KErrArgument; + QString sequence("abc"); + bool result = m_RecognitionService->executeKeySequence(sequence); + QCOMPARE(result, false); +} + +QTEST_MAIN(UT_KeySequenceRecognitionService) +#include "unit_tests.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/ut_keysequencerecognitionservice.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/ut_keysequencerecognitionservice.pro Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,43 @@ +# +# 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 +TARGET = +TARGET.UID3 = 0xE31F4ECF +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += qtestlib + +QT -= gui + +symbian { + + INCLUDEPATH += \epoc32\include\platform \ + \epoc32\include\platform\mw \ + \epoc32\include\mw \ + ../../../../inc + + LIBS += -lxqservice \ + -lxqserviceutil + + TARGET.CAPABILITY = ALL -TCB +} + +# Input +HEADERS += ../../inc/keysequencerecognitionservice.h +SOURCES += ../../src/keysequencerecognitionservice.cpp +SOURCES += unit_tests.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/ut_phoneservices/unit_tests.cpp --- a/phoneengine/phoneservices/tsrc/ut_phoneservices/unit_tests.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/tsrc/ut_phoneservices/unit_tests.cpp Fri May 14 15:51:57 2010 +0300 @@ -21,21 +21,33 @@ #include "phoneservices.h" #include "dialservice.h" #include "dtmfservice.h" +#include "keysequencerecognitionservice.h" +#include "mpekeysequencerecognitionif.h" bool m_dialServiceConstructed; bool m_dtmfServiceConstructed; +bool g_keySequenceServiceConstructed; MPECallControlIF* m_dialServiceCallPointer; MPECallSettersIF* m_dialServiceParameterPointer; +MPEKeySequenceRecognitionIF* g_keySequenceRecognizerParameterPointer; MPECallControlIF* m_dtmfServiceCallPointer; MPECallSettersIF* m_dtmfServiceParameterPointer; -class TestPhoneServices : public QObject, public MPECallControlIF, public MPECallSettersIF +class TestPhoneServices + : + public QObject, + public MPECallControlIF, + public MPECallSettersIF, + public MPEKeySequenceRecognitionIF { Q_OBJECT public: TestPhoneServices(); virtual ~TestPhoneServices(); +public: + TBool ExecuteKeySequenceL(const TDesC16& aSequence); + public slots: void initTestCase (); void cleanupTestCase (); @@ -72,7 +84,7 @@ }; DialService::DialService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : - XQServiceProvider(QLatin1String("com.nokia.services.telephony"), parent), m_call (call), m_parameters (parameters) + XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters) { m_dialServiceConstructed = true; m_dialServiceCallPointer = &call; @@ -133,7 +145,7 @@ } DTMFService::DTMFService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : - XQServiceProvider(QLatin1String("com.nokia.services.telephony.dtmf"), parent), m_call (call), m_parameters (parameters) + XQServiceProvider(QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), m_call (call), m_parameters (parameters) { m_dtmfServiceConstructed = true; m_dtmfServiceCallPointer = &call; @@ -144,11 +156,6 @@ { } -void DTMFService::executeKeySequence(const QString& keySequence) -{ - Q_UNUSED(keySequence); -} - void DTMFService::playDTMFTone(const QChar& keyToPlay) { Q_UNUSED(keyToPlay); @@ -158,6 +165,29 @@ { } +KeySequenceRecognitionService::KeySequenceRecognitionService( + MPEKeySequenceRecognitionIF &keySequenceRecognizer, + QObject* parent) + : + XQServiceProvider( + QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), + m_keySequenceRecognizer(keySequenceRecognizer) +{ + g_keySequenceServiceConstructed = true; + g_keySequenceRecognizerParameterPointer = &keySequenceRecognizer; +} + +bool KeySequenceRecognitionService::executeKeySequence( + const QString &keySequence) +{ + Q_UNUSED(keySequence); + return true; +} + +KeySequenceRecognitionService::~KeySequenceRecognitionService() +{ +} + TestPhoneServices::TestPhoneServices () { } @@ -188,8 +218,9 @@ keyValue = -1; m_dialServiceConstructed = false; m_dtmfServiceConstructed = false; + g_keySequenceServiceConstructed = false; - m_phoneServices = new PhoneServices (*this, *this, this); + m_phoneServices = new PhoneServices (*this, *this, *this, this); QVERIFY(m_dialServiceConstructed == true); QVERIFY(m_dialServiceCallPointer == this); @@ -198,6 +229,9 @@ QVERIFY(m_dtmfServiceConstructed == true); QVERIFY(m_dtmfServiceCallPointer == this); QVERIFY(m_dtmfServiceParameterPointer == this); + + QVERIFY(g_keySequenceServiceConstructed == true); + QVERIFY(g_keySequenceRecognizerParameterPointer == this); } void TestPhoneServices::cleanup () @@ -205,6 +239,12 @@ delete m_phoneServices; } +TBool TestPhoneServices::ExecuteKeySequenceL(const TDesC16& aSequence) +{ + Q_UNUSED(aSequence) + return ETrue; +} + void TestPhoneServices::SetKeyCode( const TChar& aKeyCode ) { m_setKeyCodeCalled = true; @@ -242,7 +282,7 @@ void TestPhoneServices::SetServiceIdCommand( TUint32 aServiceId ) { - + Q_UNUSED(aServiceId) } TInt TestPhoneServices::HandleDialServiceCall( const TBool aClientCall ) diff -r 2f8f8080a020 -r ebdbd102c78a phoneengine/phoneservices/tsrc/ut_phoneservices/ut_phoneservices.pro --- a/phoneengine/phoneservices/tsrc/ut_phoneservices/ut_phoneservices.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneengine/phoneservices/tsrc/ut_phoneservices/ut_phoneservices.pro Fri May 14 15:51:57 2010 +0300 @@ -20,8 +20,9 @@ TARGET.UID3 = 0xEEE39B3F DEPENDPATH += . INCLUDEPATH += . -CONFIG += hb +#CONFIG += hb CONFIG += qtestlib +QT -= gui symbian { @@ -44,5 +45,12 @@ HEADERS += ../../inc/phoneservices.h HEADERS += ../../inc/dialservice.h HEADERS += ../../inc/dtmfservice.h +HEADERS += ../../inc/keysequencerecognitionservice.h +HEADERS += ../../inc/dialservicedepricated.h +HEADERS += ../../inc/dtmfservicedepricated.h +HEADERS += ../../inc/keysequencerecognitionservicedepricated.h SOURCES += ../../src/phoneservices.cpp +SOURCES += ../../src/dialservicedepricated.cpp +SOURCES += ../../src/dtmfservicedepricated.cpp +SOURCES += ../../src/keysequencerecognitionservicedepricated.cpp SOURCES += unit_tests.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/Makefile --- a/phoneplugins/csplugin/Makefile Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -# ============================================================================== -# Generated by qmake (2.01a) (Qt 4.5.2-tower) on: ti 29. syys 12:32:49 2009 -# This file is generated by qmake and should not be modified by the -# user. -# Name : Makefile -# Description : Wrapper Makefile for calling Symbian build tools -# -# ============================================================================== - - -QMAKE = r:\sf\mw\qt\qmake\qmake.exe -DEL_FILE = del -DEL_DIR = rmdir -XCOPY = xcopy /d /f /h /r /y /i -ABLD = ABLD.BAT -DEBUG_PLATFORMS = winscw gcce armv5 armv6 -RELEASE_PLATFORMS = gcce armv5 armv6 -MAKE = make - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=$(EPOCROOT)epoc32\data\z -endif - -DEFINES = -DSYMBIAN -DUNICODE -DQT_KEYPAD_NAVIGATION -INCPATH = -I"R:/sf/mw/qt/mkspecs/common/symbian/stl-off" -I"R:/sf/mw/qt/mkspecs/common/symbian/stl-off/tmp" -I"R:/sf/mw/qt/mkspecs/common/symbian" -I"R:/sf/mw/qt/mkspecs/common/symbian/tmp" -I"R:/epoc32/include" -I"R:/epoc32/include/stdapis" -I"R:/epoc32/include/stdapis/sys" -I"R:/sf/mw/qt/include" -I"R:/sf/mw/qt/include/tmp" -first: default -default: debug-winscw -all: debug release - -qmake: - $(QMAKE) -spec symbian-abld -o "bld.inf" "R:/sf/app/phone/csplugin/csplugin.pro" - -bld.inf: - $(QMAKE) - -$(ABLD): bld.inf - bldmake bldfiles - -debug: $(ABLD) - $(ABLD) build winscw udeb - $(ABLD) build gcce udeb - $(ABLD) build armv5 udeb - $(ABLD) build armv6 udeb - -release: $(ABLD) - $(ABLD) build gcce urel - $(ABLD) build armv5 urel - $(ABLD) build armv6 urel - -debug-winscw: $(ABLD) - $(ABLD) build winscw udeb -debug-gcce: $(ABLD) - $(ABLD) build gcce udeb -debug-armv5: $(ABLD) - $(ABLD) build armv5 udeb -debug-armv6: $(ABLD) - $(ABLD) build armv6 udeb -release-gcce: $(ABLD) - $(ABLD) build gcce urel -release-armv5: $(ABLD) - $(ABLD) build armv5 urel -release-armv6: $(ABLD) - $(ABLD) build armv6 urel - -export: $(ABLD) - $(ABLD) export - -cleanexport: $(ABLD) - $(ABLD) cleanexport - -compiler_clean: - -create_temps: - -@ if NOT EXIST "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp" mkdir "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp" - -@ if NOT EXIST "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp\tmp" mkdir "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp\tmp" - -@ if NOT EXIST "R:\sf\mw\qt\mkspecs\common\symbian\tmp" mkdir "R:\sf\mw\qt\mkspecs\common\symbian\tmp" - -@ if NOT EXIST "R:\sf\mw\qt\mkspecs\common\symbian\tmp\tmp" mkdir "R:\sf\mw\qt\mkspecs\common\symbian\tmp\tmp" - -@ if NOT EXIST "R:\epoc32\include\tmp" mkdir "R:\epoc32\include\tmp" - -@ if NOT EXIST "R:\epoc32\include\stdapis\tmp" mkdir "R:\epoc32\include\stdapis\tmp" - -@ if NOT EXIST "R:\epoc32\include\stdapis\sys\tmp" mkdir "R:\epoc32\include\stdapis\sys\tmp" - -@ if NOT EXIST "R:\sf\mw\qt\include\tmp" mkdir "R:\sf\mw\qt\include\tmp" - -@ if NOT EXIST "R:\sf\mw\qt\include\tmp\tmp" mkdir "R:\sf\mw\qt\include\tmp\tmp" - -extension_clean: compiler_clean - -@ if EXIST "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp" rmdir /S /Q "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp" - -@ if EXIST "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp\tmp" rmdir /S /Q "R:\sf\mw\qt\mkspecs\common\symbian\stl-off\tmp\tmp" - -@ if EXIST "R:\sf\mw\qt\mkspecs\common\symbian\tmp" rmdir /S /Q "R:\sf\mw\qt\mkspecs\common\symbian\tmp" - -@ if EXIST "R:\sf\mw\qt\mkspecs\common\symbian\tmp\tmp" rmdir /S /Q "R:\sf\mw\qt\mkspecs\common\symbian\tmp\tmp" - -@ if EXIST "R:\epoc32\include\tmp" rmdir /S /Q "R:\epoc32\include\tmp" - -@ if EXIST "R:\epoc32\include\stdapis\tmp" rmdir /S /Q "R:\epoc32\include\stdapis\tmp" - -@ if EXIST "R:\epoc32\include\stdapis\sys\tmp" rmdir /S /Q "R:\epoc32\include\stdapis\sys\tmp" - -@ if EXIST "R:\sf\mw\qt\include\tmp" rmdir /S /Q "R:\sf\mw\qt\include\tmp" - -@ if EXIST "R:\sf\mw\qt\include\tmp\tmp" rmdir /S /Q "R:\sf\mw\qt\include\tmp\tmp" - -pre_targetdeps: \ - generated_sources \ - all_source_deps - -generated_sources: - -all_source_deps: - -finalize: - -winscw_deployment: - -winscw_deployment_clean: - -dodistclean: - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_gcce_udeb.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_gcce_udeb.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_gcce_urel.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_gcce_urel.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_armv5_udeb.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_armv5_udeb.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_armv5_urel.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_armv5_urel.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_armv6_udeb.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_armv6_udeb.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_armv6_urel.pkg" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_armv6_urel.pkg" - -@ if EXIST "r:\sf\app\phone\csplugin\Makefile" $(DEL_FILE) "r:\sf\app\phone\csplugin\Makefile" - -@ if EXIST "r:\sf\app\phone\csplugin\Makefile_0xE35130c6.mk" $(DEL_FILE) "r:\sf\app\phone\csplugin\Makefile_0xE35130c6.mk" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_0xE35130c6.mmp" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_0xE35130c6.mmp" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin_reg.rss" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin_reg.rss" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin.rss" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin.rss" - -@ if EXIST "r:\sf\app\phone\csplugin\csplugin.loc" $(DEL_FILE) "r:\sf\app\phone\csplugin\csplugin.loc" - -@ if EXIST "r:\sf\app\phone\csplugin\bld.inf" $(DEL_FILE) "r:\sf\app\phone\csplugin\bld.inf" - -distclean: clean dodistclean - -clean: $(ABLD) - -$(ABLD) reallyclean - -bldmake clean - -run: - -call /epoc32\release\winscw\udeb\csplugin.exe - diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/Makefile_0xE35130c6.mk --- a/phoneplugins/csplugin/Makefile_0xE35130c6.mk Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -# ============================================================================== -# Generated by qmake (2.01a) (Qt 4.5.2-tower) on: ti 29. syys 12:32:49 2009 -# This file is generated by qmake and should not be modified by the -# user. -# Name : Makefile_0xE35130c6.mk -# Part of : csplugin -# Description : This file is used to call necessary targets on wrapper makefile -# during normal Symbian build process. -# Version : -# -# ============================================================================== - - - -MAKE = make - -do_nothing : - @rem do_nothing - -MAKMAKE: create_temps pre_targetdeps - -LIB: create_temps pre_targetdeps - -BLD: create_temps pre_targetdeps - -ifeq "$(PLATFORM)" "WINSCW" -CLEAN: extension_clean winscw_deployment_clean -else -CLEAN: extension_clean -endif - -CLEANLIB: do_nothing - -RESOURCE: do_nothing - -FREEZE: do_nothing - -SAVESPACE: do_nothing - -RELEASABLES: do_nothing - -ifeq "$(PLATFORM)" "WINSCW" -FINAL: finalize winscw_deployment -else -FINAL: finalize -endif - -pre_targetdeps : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" pre_targetdeps - -create_temps : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" create_temps - -extension_clean : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" extension_clean - -finalize : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" finalize - -winscw_deployment_clean : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" winscw_deployment_clean - -winscw_deployment : r:\sf\app\phone\csplugin\Makefile - -$(MAKE) -f "r:\sf\app\phone\csplugin\Makefile" winscw_deployment - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/bld.inf --- a/phoneplugins/csplugin/bld.inf Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -// ============================================================================ -// * Makefile for building: csplugin -// * Generated by qmake (2.01a) (Qt 4.5.2-tower) on: 2009-09-29T12:32:49 -// * This file is generated by qmake and should not be modified by the -// * user. -// * Project: csplugin.pro -// * Template: app -// ============================================================================ - -#define BLD_INF_CSPLUGIN_06B171AA - - -prj_platforms - -WINSCW GCCE ARMV5 ARMV6 - - -prj_mmpfiles - -gnumakefile makefile_0xe35130c6.mk -csplugin_0xe35130c6.mmp - -prj_extensions - diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin.loc --- a/phoneplugins/csplugin/csplugin.loc Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -// ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.5.2-tower) on: 2009-09-29T12:32:49 -// * This file is generated by qmake and should not be modified by the -// * user. -// ============================================================================ - -#ifdef LANGUAGE_SC -#define STRING_r_short_caption "csplugin" -#define STRING_r_caption "csplugin" -#else -#define STRING_r_short_caption "csplugin" -#define STRING_r_caption "csplugin" -#endif diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin.rss --- a/phoneplugins/csplugin/csplugin.rss Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -// ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.5.2-tower) on: 2009-09-29T12:32:49 -// * This file is generated by qmake and should not be modified by the -// * user. -// ============================================================================ - -#include -#include "csplugin.loc" - -RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info - { - short_caption = STRING_r_short_caption; - caption_and_icon = - CAPTION_AND_ICON_INFO - { - caption = STRING_r_caption; - number_of_icons = 0; - icon_file = ""; - }; - } - diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_0xE35130c6.mmp --- a/phoneplugins/csplugin/csplugin_0xE35130c6.mmp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.5.2-tower) on: 2009-09-29T12:32:49 -// This file is generated by qmake and should not be modified by the -// user. -// Name : csplugin.mmp -// ============================================================================== - -TARGET csplugin.exe -TARGETTYPE EXE - -UID 0x100039CE 0xE35130c6 -SECUREID 0xE35130c6 - - -SOURCEPATH . -LANG SC -START RESOURCE csplugin.rss -HEADER -TARGETPATH /resource/apps -END - -SOURCEPATH . -START RESOURCE csplugin_reg.rss -TARGETPATH /private/10003a3f/import/apps -END - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION - -SYSTEMINCLUDE ../../../mw/qt/mkspecs/common/symbian/stl-off -SYSTEMINCLUDE ../../../mw/qt/mkspecs/common/symbian/stl-off/tmp -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 ../../../mw/qt/include -SYSTEMINCLUDE ../../../mw/qt/include/tmp - - -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib - -CAPABILITY None - -OPTION ARMCC --no_hide_all --fpu softvfp - -VERSION 10.0 - -EXPORTUNFROZEN - -PAGED diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_armv5_udeb.pkg --- a/phoneplugins/csplugin/csplugin_armv5_udeb.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_armv5_udeb.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/armv5/udeb/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_armv5_urel.pkg --- a/phoneplugins/csplugin/csplugin_armv5_urel.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_armv5_urel.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/armv5/urel/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_armv6_udeb.pkg --- a/phoneplugins/csplugin/csplugin_armv6_udeb.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_armv6_udeb.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/armv6/udeb/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_armv6_urel.pkg --- a/phoneplugins/csplugin/csplugin_armv6_urel.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_armv6_urel.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/armv6/urel/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_gcce_udeb.pkg --- a/phoneplugins/csplugin/csplugin_gcce_udeb.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_gcce_udeb.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/gcce/udeb/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_gcce_urel.pkg --- a/phoneplugins/csplugin/csplugin_gcce_urel.pkg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -; csplugin_gcce_urel.pkg generated by qmake at 2009-09-29T12:32:49 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"csplugin"},(0xE35130c6),1,0,0 - -; Localised Vendor name -%{"Nokia, Qt Software"} - -; Unique Vendor name -:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Executable and default resource files -"/epoc32/release/gcce/urel/csplugin.exe" - "!:\sys\bin\csplugin.exe" -"/epoc32/data/z/resource/apps/csplugin.rsc" - "!:\resource\apps\csplugin.rsc" -"/epoc32/data/z/private/10003a3f/import/apps/csplugin_reg.rsc" - "!:\private\10003a3f\import\apps\csplugin_reg.rsc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/csplugin_reg.rss --- a/phoneplugins/csplugin/csplugin_reg.rss Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -// ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.5.2-tower) on: 2009-09-29T12:32:49 -// * This file is generated by qmake and should not be modified by the -// * user. -// ============================================================================ - -#include -#include - -UID2 KUidAppRegistrationResourceFile -UID3 0xE35130c6 - -RESOURCE APP_REGISTRATION_INFO - { - app_file="csplugin"; - localisable_resource_file="\\resource\\apps\\csplugin"; - - } diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/csplugin/src/cspcall.cpp --- a/phoneplugins/csplugin/src/cspcall.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/csplugin/src/cspcall.cpp Fri May 14 15:51:57 2010 +0300 @@ -1339,14 +1339,13 @@ void CSPCall::UpdateCallOrigin( RMobileCall::TMobileCallInfoV7 aCallInfo ) { CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin <"); - - if ( iMobileOriginated ) + + if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin ) { - if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin ) - { - iParams->SetOrigin(CCCECallParameters::ECCECallOriginSAT); - } + iParams->SetOrigin(CCCECallParameters::ECCECallOriginSAT); + iParams->SetAlphaId(aCallInfo.iAlphaId); } + CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin >"); } diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro --- a/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro Fri May 14 15:51:57 2010 +0300 @@ -30,6 +30,10 @@ TARGET.CAPABILITY = ALL \ -TCB INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " \ + "./rom/hsdialerwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(hsdialerwidgetplugin.iby)" } OUTPUT_DIR = $$PWD/bin SOURCE_DIR = $$PWD/inc diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc --- a/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc Fri May 14 15:51:57 2010 +0300 @@ -3,5 +3,6 @@ resource/qtg_fr_shortcut_badge_bg_r.png resource/qtg_fr_shortcut_badge_bg_c.png resource/qtg_fr_shortcut_badge_bg_l.png + resource/qtg_graf_hs_dialer.svg diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/hsdialerwidgetplugin/rom/hsdialerwidgetplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/hsdialerwidgetplugin/rom/hsdialerwidgetplugin.iby Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __HSDIALERWIDETPLUGIN_IBY__ +#define __HSDIALERWIDETPLUGIN_IBY__ + +file=ABI_DIR\BUILD_DIR\hsdialerwidgetplugin.dll SHARED_LIB_DIR\hsdialerwidgetplugin.dll +data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.qtplugin private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.qtplugin +data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.manifest private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.manifest +data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\qtg_graf_hs_dialer.svg private\20022f35\import\widgetregistry\20022F44\qtg_graf_hs_dialer.svg +data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.xml private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.xml + +#endif //__HSDIALERWIDETPLUGIN_IBY__ diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp --- a/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef Q_OS_SYMBIAN #include #include "qtphonelog.h" @@ -34,7 +35,7 @@ namespace { - const char KDialerWidgetIcon[] = "qtg_graf_hs_dialer"; + const char KDialerWidgetIcon[] = ":/icons/resource/qtg_graf_hs_dialer"; const char KMissedCallShortcutBadge[] = ":/icons/resource/qtg_fr_shortcut_badge_bg"; } @@ -80,8 +81,8 @@ m_shortcutBadge = new HbFrameItem(drawer, this); m_shortcutBadge->setZValue(2); - m_shortcutBadge->setVisible(true); - m_missedCalls=2; + m_shortcutBadge->setVisible(false); + m_missedCalls=0; setItemPositions(); resize(preferredSize()); } @@ -120,11 +121,10 @@ badgefont.setPointSize( 8 ); #endif text->setFont(badgefont); - text->setText(QString::number(m_missedCalls)); + text->setText(QLocale::system().toString(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); @@ -226,7 +226,7 @@ void HsDialerWidget::setItemPositions() { HbIcon icon(KDialerWidgetIcon); - setPreferredWidth( icon.width()); + setPreferredWidth(icon.width()); int badgeSize = 20; if ( m_shortcutBadge->isVisible()){ m_backgroud->setGeometry(QRectF(QPointF(0,badgeSize / 2 ), diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h Fri May 14 15:51:57 2010 +0300 @@ -16,7 +16,7 @@ */ #ifndef INFOWIDGETLOGGING_H -#define INFOWIDGETLOGGING +#define INFOWIDGETLOGGING_H #include @@ -33,29 +33,26 @@ #ifdef Q_OS_SYMBIAN #include -static void cpPhoneSettingsPluginsMsgOutput(QtMsgType type, const char *msg) +static void infoWidgetMsgOutput(QtMsgType type, const char *msg) { switch (type) { - + case QtDebugMsg: RDebug::Printf("InfoWidget Debug: %s\n", msg); break; - case QtWarningMsg: RDebug::Printf("InfoWidget Warning: %s\n", msg); break; - case QtCriticalMsg: RDebug::Printf("InfoWidget Critical: %s\n", msg); break; - case QtFatalMsg: RDebug::Printf("InfoWidget Fatal: %s\n", msg); abort(); } } - #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(cpPhoneSettingsPluginsMsgOutput) + #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(infoWidgetMsgOutput) #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0) #endif //Q_OS_SYMBIAN #else @@ -67,7 +64,8 @@ Debug macros */ #define DPRINT qDebug() << __PRETTY_FUNCTION__ - +#define DWARNING qWarning() << __PRETTY_FUNCTION__ +#define DCRITICAL qCritical() << __PRETTY_FUNCTION__ #endif // INFOWIDGETLOGGING diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h Fri May 14 15:51:57 2010 +0300 @@ -85,6 +85,8 @@ InfoWidgetLayoutManager(QObject *parent = 0); ~InfoWidgetLayoutManager(); + void destroyObjects(); + DisplayRole currentDisplayRole(); QList currentWidgetRoles(); diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -129,12 +129,8 @@ { DPRINT << ": IN"; - // Clean layout container, - // layout manager handles layout item cleanup - for (int i=0; i < m_layout->count(); i++) { - DPRINT << ": item(" << i << ") removed from layout"; - m_layout->removeAt(i); - } + // Layout manager item cleanup + m_layoutManager->destroyObjects(); if (m_frameDrawer) { delete m_frameDrawer; @@ -409,10 +405,8 @@ m_layoutManager->showAll(); updateItemsVisibility(); + m_layout->activate(); - m_layout->invalidate(); - m_layout->activate(); - endChanges(); DPRINT << ": OUT"; diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp Fri May 14 15:51:57 2010 +0300 @@ -34,10 +34,8 @@ const char LAYOUT_PREFIX_SETTINGS_DISPLAY[] = "sd:"; const char LAYOUT_NAME_CONTENT[] = "content"; const char LAYOUT_NAME_MCNMARQUEEITEM[] = "mcnMarqueeItem"; -const char LAYOUT_NAME_MCNLABEL[] = "mcnLabel"; const char LAYOUT_NAME_SPNLABEL[] = "spnLabel"; const char LAYOUT_NAME_SATMARQUEEITEM[] = "satMarqueeItem"; -const char LAYOUT_NAME_SATTEXTLABEL[] = "satTextLabel"; const char LAYOUT_NAME_SPNICON[] = "spnIcon"; const char LAYOUT_NAME_MCNICON[] = "mcnIcon"; const char LAYOUT_NAME_SATTEXTICON[] = "satTextIcon"; @@ -140,11 +138,41 @@ if (m_documentLoader) { delete m_documentLoader; } - + DPRINT << ": OUT"; } /*! + InfoWidgetLayoutManager::destroyObjects() + + Call on destruction for freeing + loaded objects. Parent items are deleted + causing deletion of corresponding object tree +*/ +void InfoWidgetLayoutManager::destroyObjects() +{ + DPRINT << ": IN"; + + // Destroy parent items + QGraphicsWidget *contentInfoDisplay = + m_infoDisplayWidgets.value(RoleContent); + if (contentInfoDisplay) { + delete contentInfoDisplay; + m_infoDisplayWidgets.clear(); + } + + QGraphicsWidget *contentSettingsDisplay= + m_settingsDisplayWidgets.value(RoleContent); + if (contentSettingsDisplay) { + delete contentSettingsDisplay; + m_settingsDisplayWidgets.clear(); + } + + DPRINT << ": OUT"; +} + + +/*! InfoWidgetLayoutManager::currentDisplayRole() */ InfoWidgetLayoutManager::DisplayRole InfoWidgetLayoutManager::currentDisplayRole() @@ -347,60 +375,48 @@ QMap &widgetMap) { DPRINT << ": IN"; - bool loadResult(true); + bool loadResult(false); // Cleanup previously loaded content in case of any data widgetMap.clear(); if (!m_documentLoader) { m_documentLoader = new InfoWidgetDocumentLoader; - } - + } Q_ASSERT(m_documentLoader); 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; + DPRINT << ": document " << INFOWIDGET_DOCML_FILE << " loaded successfully"; + + QGraphicsWidget *widget(NULL); + LayoutItemRole currentWidgetRole; + + foreach (currentWidgetRole, displayWidgets) { + DPRINT << ": iterating displayWidgets, current role: " << static_cast(currentWidgetRole); + + widget = loadWidget(*m_documentLoader, displayRole, currentWidgetRole); + if (widget) { + DPRINT << ": widget found, inserting to widget map"; + widgetMap.insert(currentWidgetRole, widget); + widget = NULL; + } else { + DCRITICAL << ": ERROR, widget not found!"; + } } - else { - DPRINT << ": document " << INFOWIDGET_DOCML_FILE << " loaded successfully"; - - QGraphicsWidget *widget(NULL); - LayoutItemRole currentWidgetRole; - bool allWidgetsLoaded(true); - - foreach (currentWidgetRole, displayWidgets) { - DPRINT << ": iterating displayWidgets, current role: " << static_cast(currentWidgetRole); - - widget = loadWidget(*m_documentLoader, displayRole, currentWidgetRole); - if (widget) { - DPRINT << ": widget found, inserting to widget map"; - widgetMap.insert(currentWidgetRole, widget); - widget = NULL; - } else { - allWidgetsLoaded = false; - DPRINT << ": ERROR, widget not found!"; - } - } - - DPRINT << ": allWidgetsLoaded: " << allWidgetsLoaded; - - int widgetCount = widgetMap.count(); - DPRINT << ": loaded widgets count: " << widgetCount; - if (widgetCount == displayWidgets.count()) { - DPRINT << ": all widgets loaded"; - loadResult = true; - } else { - DPRINT << ": error, all widgets were not loaded"; - loadResult = false; - } - } - + + if (widgetMap.count() == displayWidgets.count()) { + DPRINT << ": all widgets loaded"; + loadResult = true; + } else { + DCRITICAL << ": error, all widgets were not loaded"; + } + DPRINT << ": OUT"; return loadResult; } @@ -458,15 +474,9 @@ case RoleSpnLabel: widgetName.append(LAYOUT_NAME_SPNLABEL); break; - case RoleMcnLabel: - widgetName.append(LAYOUT_NAME_MCNLABEL); - break; case RoleSatMarqueeItem: widgetName.append(LAYOUT_NAME_SATMARQUEEITEM); break; - case RoleSatTextLabel: - widgetName.append(LAYOUT_NAME_SATTEXTLABEL); - break; case RoleSpnIcon: widgetName.append(LAYOUT_NAME_SPNICON); break; @@ -501,11 +511,8 @@ } widget = qobject_cast(loader.findWidget(widgetName)); - - if (widget) { - DPRINT << ": widget found: " << widgetName; - } else { - DPRINT << ": ERROR, widget not found!"; + if (!widget) { + DCRITICAL << ": ERROR, widget " << widgetName << " not found!"; } DPRINT << ": OUT"; @@ -524,9 +531,9 @@ QList widgetRoles; + // Fill supported layout item roles for specific display switch (displayRole) { case SettingsDisplay: - // Fill supported layout item roles for settings display widgetRoles.append(RoleContent); widgetRoles.append(RoleSpnCheckBox); widgetRoles.append(RoleMcnCheckBox); @@ -535,7 +542,6 @@ widgetRoles.append(RoleSettingsContainer); break; case InfoDisplay: - // Fill supported layout item roles for info display widgetRoles.append(RoleContent); widgetRoles.append(RoleSpnIcon); widgetRoles.append(RoleSpnLabel); diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyle.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyle.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,200 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this 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 "hbstyle.h" + +//needed for TSmcValueSize()const +class HbStyleParameters {}; +//needed for TSmcValueSize()const +class HbWidget {}; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbStyle::HbStyle +// ----------------------------------------------------------------------------- +// +HbStyle::HbStyle( ):d_ptr(NULL) + // QObject * parent ) + { + // Q_UNUSED(parent); + } + + +// ----------------------------------------------------------------------------- +// HbStyle::~HbStyle +// ----------------------------------------------------------------------------- +// +HbStyle::~HbStyle( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbStyle::createPrimitive +// ----------------------------------------------------------------------------- +// +QGraphicsItem * HbStyle::createPrimitive( + HbStyle::Primitive primitive, + QGraphicsItem * parent ) const + { + SMC_MOCK_METHOD2( QGraphicsItem *, HbStyle::Primitive, primitive, + QGraphicsItem *, parent ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::updatePrimitive +// ----------------------------------------------------------------------------- +// +void HbStyle::updatePrimitive( + QGraphicsItem * item, + HbStyle::Primitive primitive, + const QStyleOption * option ) const + { + SMC_MOCK_METHOD3( void, QGraphicsItem *, item, + HbStyle::Primitive, primitive, + const QStyleOption *, option ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::registerPlugin +// ----------------------------------------------------------------------------- +// +int HbStyle::registerPlugin( + const QString & pluginName ) + { + SMC_MOCK_METHOD1( int, const QString &, pluginName ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::unregisterPlugin +// ----------------------------------------------------------------------------- +// +void HbStyle::unregisterPlugin( + const QString & pluginName ) + { + SMC_MOCK_METHOD1( void, const QString &, pluginName ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::setItemName +// ----------------------------------------------------------------------------- +// +void HbStyle::setItemName( + QGraphicsItem * item, + const QString & name ) + { + SMC_MOCK_METHOD2( void, QGraphicsItem *, item, + const QString &, name ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::itemName +// ----------------------------------------------------------------------------- +// +QString HbStyle::itemName( + const QGraphicsItem * item ) + { + SMC_MOCK_METHOD1( QString, const QGraphicsItem *, item ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::parameter +// ----------------------------------------------------------------------------- +// +bool HbStyle::parameter( + const QString & parameter, + qreal & value, + const HbDeviceProfile & profile ) const + { + SMC_MOCK_METHOD3( bool, const QString &, parameter, + qreal &, value, + const HbDeviceProfile &, profile ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::parameters +// ----------------------------------------------------------------------------- +// +void HbStyle::parameters( + HbStyleParameters & parameters, + const HbDeviceProfile & profile ) const + { + SMC_MOCK_METHOD2( void, HbStyleParameters &, parameters, + const HbDeviceProfile &, profile ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::polish +// ----------------------------------------------------------------------------- +// +void HbStyle::polish( + HbWidget * widget, + HbStyleParameters & params ) + { + SMC_MOCK_METHOD2( void, HbWidget *, widget, + HbStyleParameters &, params ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::updateThemedParams +// ----------------------------------------------------------------------------- +// +void HbStyle::updateThemedParams( + HbWidget * widget ) + { + SMC_MOCK_METHOD1( void, HbWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::hasOrientationSpecificStyleRules +// ----------------------------------------------------------------------------- +// +bool HbStyle::hasOrientationSpecificStyleRules( + HbWidget * widget ) + { + SMC_MOCK_METHOD1( bool, HbWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// HbStyle::HbStyle +// ----------------------------------------------------------------------------- +// +HbStyle::HbStyle( + HbStylePrivate & dd, + QStyle * parent ):d_ptr(NULL) + //: + //QObject( /*dd, parent*/ ) + { + Q_UNUSED(dd); + Q_UNUSED(parent); + } + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -280,17 +280,6 @@ // ----------------------------------------------------------------------------- -// InfoWidget::homeZoneDisplaySettingChanged -// ----------------------------------------------------------------------------- -// -void InfoWidget::homeZoneDisplaySettingChanged( - int state ) - { - SMC_MOCK_METHOD1( void, int, state ) - } - - -// ----------------------------------------------------------------------------- // InfoWidget::mcnDisplaySettingChanged // ----------------------------------------------------------------------------- // @@ -302,17 +291,6 @@ // ----------------------------------------------------------------------------- -// InfoWidget::activeLineDisplaySettingChanged -// ----------------------------------------------------------------------------- -// -void InfoWidget::activeLineDisplaySettingChanged( - int state ) - { - SMC_MOCK_METHOD1( void, int, state ) - } - - -// ----------------------------------------------------------------------------- // InfoWidget::satDisplaySettingChanged // ----------------------------------------------------------------------------- // @@ -343,8 +321,6 @@ } - - // ----------------------------------------------------------------------------- // InfoWidget::paint // ----------------------------------------------------------------------------- diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp Fri May 14 15:51:57 2010 +0300 @@ -44,6 +44,16 @@ // ----------------------------------------------------------------------------- +// InfoWidgetLayoutManager::destroyObjects +// ----------------------------------------------------------------------------- +// +void InfoWidgetLayoutManager::destroyObjects( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- // InfoWidgetLayoutManager::currentDisplayRole // ----------------------------------------------------------------------------- // diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp Fri May 14 15:51:57 2010 +0300 @@ -23,6 +23,8 @@ #include "infowidgetnetworkhandler.h" #include "infowidgetsathandler.h" +const QString KSpnName("Spn name"); // + const QString KHomeZoneTextTag("HomeZoneText0"); // max length 13 const TNWViagIndicatorType KHomeZoneIndicatorType = ENWViagIndicatorTypeHomeZone; @@ -60,13 +62,22 @@ SmcDefaultValue::SetL(""); EXPECT(InfoWidgetNetworkHandler::logCurrentInfo); - EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag) - .returns(KHomeZoneTextTag); - EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType) - .returns(KHomeZoneIndicatorType); + EXPECT(InfoWidgetNetworkHandler::isOnline) + .returns(true); + + EXPECT(InfoWidgetNetworkHandler::serviceProviderName) + .returns(KSpnName); + EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired) + .returns(true); + EXPECT(InfoWidgetNetworkHandler::mcnName).returns(KMcnName); EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType) .returns(KMcnIndicatorType); + + EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType) + .returns(KHomeZoneIndicatorType); + EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag) + .returns(KHomeZoneTextTag); m_infoWidgetEngine = new InfoWidgetEngine(); @@ -90,6 +101,8 @@ void UT_InfoWidgetEngine::t_modelData() { const InfoWidgetEngine::ModelData& data = m_infoWidgetEngine->modelData(); + QVERIFY(data.serviceProviderName() == KSpnName); + QVERIFY(data.serviceProviderNameDisplayRequired() == true); QVERIFY(data.homeZoneTextTag() == KHomeZoneTextTag); QVERIFY(data.homeZoneIndicatorType() == KHomeZoneIndicatorType); QVERIFY(data.mcnName() == KMcnName); @@ -101,24 +114,58 @@ */ void UT_InfoWidgetEngine::t_updateNetworkDataToModel() { + // Test: network status is online EXPECT(InfoWidgetNetworkHandler::logCurrentInfo); - EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag) - .returns(KHomeZoneTextTag); - EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType) - .returns(KHomeZoneIndicatorType); + EXPECT(InfoWidgetNetworkHandler::isOnline) + .returns(true); + + EXPECT(InfoWidgetNetworkHandler::serviceProviderName) + .returns(KSpnName); + EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired) + .returns(true); + EXPECT(InfoWidgetNetworkHandler::mcnName).returns(KMcnName); EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType) .returns(KMcnIndicatorType); + + EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType) + .returns(KHomeZoneIndicatorType); + EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag) + .returns(KHomeZoneTextTag); + QSignalSpy spy(m_infoWidgetEngine, SIGNAL(modelChanged())); - m_infoWidgetEngine->updateNetworkDataToModel(); const int KExpectedNumOfSignalEmissions = 1; QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions); - const QList &arguments = spy.at(0); + const QList &arguments = spy.takeFirst(); QCOMPARE(arguments.count(), 0); QVERIFY(verify()); + + // Test: network status is offline + EXPECT(InfoWidgetNetworkHandler::logCurrentInfo); + EXPECT(InfoWidgetNetworkHandler::isOnline) + .returns(false); + EXPECT(InfoWidgetNetworkHandler::serviceProviderName).times(0); + EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired).times(0); + EXPECT(InfoWidgetNetworkHandler::mcnName).times(0); + EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType).times(0); + EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType).times(0); + EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag).times(0); + + m_infoWidgetEngine->updateNetworkDataToModel(); + QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions); + const QList &arguments2 = spy.takeFirst(); + QCOMPARE(arguments2.count(), 0); + + QVERIFY(verify()); + + const InfoWidgetEngine::ModelData& data = m_infoWidgetEngine->modelData(); + QVERIFY(data.serviceProviderName() == QString("")); + QVERIFY(data.homeZoneTextTag() == QString("")); + QVERIFY(data.mcnName() == QString("")); + } /*! diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h Fri May 14 15:51:57 2010 +0300 @@ -46,7 +46,7 @@ void t_layoutRows(); void t_setLayoutRows(); - //void t_rowHeight(); + void t_rowHeight(); void t_layoutInfoDisplay(); void t_layoutSettingsDisplay(); @@ -66,6 +66,8 @@ void t_removeWidget(); + void t_destroyObjects(); + // InfoWidgetDocumentLoader tests void t_createObject(); diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp Fri May 14 15:51:57 2010 +0300 @@ -15,20 +15,21 @@ * */ #include "ut_infowidgetlayoutmanager.h" - #include -#include +#include +#include #define private public #include "infowidgetlayoutmanager.h" #include "qtestmains60.h" -const int KNumOfSettingsDisplayRoles = 12; -const int KNumOfInfoDisplayRoles = 8; + +const int KNumOfSettingsDisplayRoles = 6; +const int KNumOfInfoDisplayRoles = 7; const QString KInfoWidgetDocmlFile = ":/resource/infowidget.docml"; const QString KMargueeItemClassName = HbMarqueeItem::staticMetaObject.className(); - +//class HbStyle; /*! UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager */ @@ -186,8 +187,6 @@ InfoWidgetLayoutManager::RoleMcnIcon)); QVERIFY(0 <= roles.indexOf( InfoWidgetLayoutManager::RoleSatTextIcon)); - QVERIFY(0 <= roles.indexOf( - InfoWidgetLayoutManager::RoleSettingsContainer)); } activeLayout= m_layoutManager->layoutSettingsDisplay(); @@ -222,11 +221,19 @@ /*! UT_InfoWidgetLayoutManager::t_setLayoutRows - *//* + */ void UT_InfoWidgetLayoutManager::t_rowHeight() { - QVERIFY(m_layoutManager->rowHeight()); -}*/ + bool b = false; + EXPECT(HbStyle::parameter).returns(b); + m_layoutManager->rowHeight(); + + b = true; + EXPECT(HbStyle::parameter).returns(b); + m_layoutManager->rowHeight(); + + QVERIFY(verify()); +} /*! UT_InfoWidgetLayoutManager::t_layoutInfoDisplay @@ -258,13 +265,7 @@ QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleContent)); QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleMcnLabel)); - QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleSatTextLabel)); - QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleMcnIcon)); - QVERIFY(0 <= settingDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleSatTextIcon)); + InfoWidgetLayoutManager::RoleSpnCheckBox)); QVERIFY(0 <= settingDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleMcnCheckBox)); QVERIFY(0 <= settingDisplayRoles.indexOf( @@ -272,13 +273,6 @@ 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)); } @@ -300,8 +294,6 @@ InfoWidgetLayoutManager::RoleMcnIcon)); QVERIFY(0 <= infoDisplayRoles.indexOf( InfoWidgetLayoutManager::RoleSatTextIcon)); - QVERIFY(0 <= infoDisplayRoles.indexOf( - InfoWidgetLayoutManager::RoleSettingsContainer)); } } @@ -449,6 +441,22 @@ } /*! + UT_InfoWidgetLayoutManager::t_destroyObjects + */ +void UT_InfoWidgetLayoutManager::t_destroyObjects() +{ + m_layoutManager->destroyObjects(); + + QGraphicsWidget *widgetInfo = new QGraphicsWidget(); + QGraphicsWidget *widgetSettings = new QGraphicsWidget(); + m_layoutManager->m_infoDisplayWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetInfo); + m_layoutManager->m_settingsDisplayWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetSettings); + m_layoutManager->destroyObjects(); + + QVERIFY(verify()); +} + +/*! UT_InfoWidgetLayoutManager::t_createObject */ void UT_InfoWidgetLayoutManager::t_createObject() diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro Fri May 14 15:51:57 2010 +0300 @@ -42,4 +42,6 @@ # mocks needed for testing SOURCES += ../mocks/mock_hbdocumentloader.cpp SOURCES += ../mocks/mock_hbmarqueeitem.cpp +SOURCES += ../mocks/mock_hbstyle.cpp +#SOURCES += ../mocks/mock_hbwidget.cpp RESOURCES = ../../infowidgetprovider.qrc diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h Fri May 14 15:51:57 2010 +0300 @@ -47,6 +47,8 @@ void t_homeZoneIndicatorType(); void t_mcnName(); void t_mcnIndicatorType(); + void t_isOnline(); + void t_networkRegistrationStatus(); void t_HandleNetworkMessage(); void t_HandleNetworkMessageExceptionWhileEmittingSignal(); void t_HandleNetworkError(); diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp --- a/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include "ut_infowidgetnetworkhandler.h" +#define private public #include "infowidgetnetworkhandler.h" #define EXPECT_EXCEPTION(statements) \ @@ -151,6 +152,38 @@ /*! + UT_InfoWidgetNetworkHandler::t_isOnline + */ +void UT_InfoWidgetNetworkHandler::t_isOnline() +{ + m_networkHandler->m_nwInfo.iRegistrationStatus = + static_cast(ENWRegisteredBusy); + QVERIFY(m_networkHandler->isOnline() == true); + m_networkHandler->m_nwInfo.iRegistrationStatus = + static_cast(ENWRegisteredOnHomeNetwork); + QVERIFY(m_networkHandler->isOnline() == true); + m_networkHandler->m_nwInfo.iRegistrationStatus = + static_cast(ENWRegisteredRoaming); + QVERIFY(m_networkHandler->isOnline() == true); + + m_networkHandler->m_nwInfo.iRegistrationStatus = + static_cast(ENWRegistrationUnknown); + QVERIFY(m_networkHandler->isOnline() == false); +} + + +/*! + UT_InfoWidgetNetworkHandler::t_networkRegistrationStatus + */ +void UT_InfoWidgetNetworkHandler::t_networkRegistrationStatus() +{ + m_networkHandler->m_nwInfo.iRegistrationStatus = + static_cast(ENWRegistrationUnknown); + QVERIFY(m_networkHandler->networkRegistrationStatus() == 0); +} + + +/*! UT_InfoWidgetNetworkHandler::t_HandleNetworkMessage */ void UT_InfoWidgetNetworkHandler::t_HandleNetworkMessage() @@ -211,7 +244,7 @@ m_networkHandler->HandleNetworkMessage( MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteFail); - const int KExpectedNumOfSignalEmissions = 2; + const int KExpectedNumOfSignalEmissions = 3; QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions); const QList &arguments = spy.at(0); @@ -335,7 +368,13 @@ */ void UT_InfoWidgetNetworkHandler::t_serviceProviderNameDisplayRequired() { - QCOMPARE(m_networkHandler->serviceProviderNameDisplayRequired(),true); + m_networkHandler->m_nwInfo.iServiceProviderNameDisplayReq = + RMobilePhone::KDisplaySPNRequired; + QVERIFY(m_networkHandler->serviceProviderNameDisplayRequired() == true); + + m_networkHandler->m_nwInfo.iServiceProviderNameDisplayReq = + RMobilePhone::KDisplaySPNNotRequired; + QVERIFY(m_networkHandler->serviceProviderNameDisplayRequired() == false); } /*! diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/inc/ut_infowidgetsathandlerprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/inc/ut_infowidgetsathandlerprivate.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_INFOWIDGETSATHANDLERPRIVATE_H +#define UT_INFOWIDGETSATHANDLERPRIVATE_H + +#include +#include +#include + + +class InfoWidgetSatHandlerPrivate; +class InfoWidgetSatHandler; + +class UT_InfoWidgetSatHandlerPrivate : public QObject, public MockService +{ + Q_OBJECT + +public: + + UT_InfoWidgetSatHandlerPrivate(); + ~UT_InfoWidgetSatHandlerPrivate(); + +private slots: + + void init(); + void cleanup(); + + void t_connect(); + void t_disconnect(); + void t_startObserving(); + + void t_runL(); + void t_doCancel(); + +private: + + InfoWidgetSatHandlerPrivate *m_satHandler; + InfoWidgetSatHandler* m_iwSatHandler; + RSatService m_satService; + +}; + +#endif // UT_INFOWIDGETSATHANDLERPRIVATE_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/phoneindicatorplugin/inc/phoneindicators.h --- a/phoneplugins/phoneindicatorplugin/inc/phoneindicators.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicators.h Fri May 14 15:51:57 2010 +0300 @@ -29,12 +29,14 @@ { InteractionNone, OpenMissedCallView, + SwitchBackToCall, Deactivate }; enum PhoneIndicatorTypes { - PhoneMissedCallIndicator = 0 + PhoneMissedCallIndicator = 0, + PhoneActiveCallIndicator }; inline QString indicatorName(int indicatorType) { @@ -46,15 +48,15 @@ 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 int PhoneIndicatorCount = 2; static const PhoneIndicatorInfo IndicatorInfos[PhoneIndicatorCount] = { - {"qtg_mono_info.svg", "Missed call", "Name/Number", HbIndicatorInterface::GroupPriorityHigh, OpenMissedCallView } // TODO: change icon + {"qtg_mono_info.svg", "Missed call", "Name/Number", OpenMissedCallView }, + {"qtg_mono_info.svg", "Active call", " ", SwitchBackToCall } }; #endif // PHONEINDICATORS_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp --- a/phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp Fri May 14 15:51:57 2010 +0300 @@ -17,18 +17,22 @@ #include "Phoneindicatorinterface.h" #include "phoneindicators.h" + #include #include #ifdef Q_OS_SYMBIAN #include #include +#include +#include + #endif PhoneIndicatorInterface::PhoneIndicatorInterface( const QString &indicatorType, int typeIndex, Interaction interaction) : - HbIndicatorInterface( indicatorType, IndicatorInfos[typeIndex].priority, + HbIndicatorInterface( indicatorType, HbIndicatorInterface::NotificationCategory, (interaction == InteractionNone) ? NoInteraction : InteractionActivated), m_typeIndex(typeIndex), m_interaction(interaction), @@ -62,6 +66,16 @@ #endif } break; + case SwitchBackToCall: { +#ifdef Q_OS_SYMBIAN + RWsSession& wsSession = CEikonEnv::Static()->WsSession(); + TApaTaskList taskList( wsSession ); + const TUid KUidPhoneApp = { 0x100058B3 }; // Phone application + TApaTask task = taskList.FindApp(KUidPhoneApp); + task.BringToForeground(); +#endif + } + break; case Deactivate: emit deactivate(); break; @@ -81,7 +95,7 @@ return map.value( (QVariant(PrimaryTextRole)).toString()).toString(); } else if (role == SecondaryTextRole ) { return map.value( (QVariant(SecondaryTextRole)).toString()).toString(); - } else if (role == IconNameRole) { + } else if (role == MonoDecorationNameRole) { return m_icon; } else if (role == DecorationNameRole) { return map.value( (QVariant(DecorationNameRole)).toString()).toString(); @@ -93,7 +107,7 @@ { bool handled(false); switch (type) { - // TODO: + case RequestActivate: if (m_parameter != parameter) { m_parameter = parameter; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h --- a/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h Fri May 14 15:51:57 2010 +0300 @@ -25,8 +25,9 @@ class QModelIndex; class CpPhoneNotes; class QValidator; -class QTranslator; +class HbDataFormModel; + /*! \class CpBarringPluginGroup \brief The class CpBarringPluginGroup defines barring items shown on UI. @@ -36,6 +37,15 @@ Q_OBJECT public: + + // Change barring password operation phases + enum ChangeBarringPasswordPhase + { + NonePhase, + CurrentPasswordPhase, + NewPasswordPhase, + VerifyNewPasswordPhase + }; explicit CpBarringPluginGroup(CpItemDataHelper &helper); ~CpBarringPluginGroup(); @@ -46,7 +56,6 @@ private: - void setupLocalization(); void setupConnectionsToWrapper(); void createBarringItems(); @@ -92,10 +101,17 @@ void changeBarringPasswordRequested(bool checked = false); + void completeBarringStateChangeRequestHandling( + QString barringPassword, + bool okPressed); + + void changeBarringPasswordPhasesHandling( + QString barringPassword, + bool okPressed); + private: CpItemDataHelper &m_helper; - QScopedPointer m_translator; QScopedPointer m_pSetWrapper; PSetCallBarringWrapper *m_barringWrapper; CpSettingFormItemData *m_editBarringPasswordItem; @@ -105,6 +121,13 @@ CpPhoneNotes* m_phoneNotes; QValidator *m_barringPasswordValidator; bool m_delayedBarringActivationNote; + CpSettingFormItemData* m_clickedBarringItem; // Not own. + ChangeBarringPasswordPhase m_changeBarringPasswordPhase; + QString m_currentPassword; + QString m_newPassword; + QString m_newPasswordVerified; + QValidator* m_verifyPasswordValidator; // Own. + HbDataFormModel* m_model; }; #endif // CPBARRINGPLUGINGROUP_H diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -18,9 +18,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -44,7 +41,6 @@ HbDataFormModelItem::GroupItem, hbTrId("txt_phone_subhead_call_barring"), 0), m_helper(helper), - m_translator(0), m_pSetWrapper(0), m_barringWrapper(0), m_editBarringPasswordItem(0), @@ -52,7 +48,11 @@ m_activeNoteId(0), m_phoneNotes(0), m_barringPasswordValidator(0), - m_delayedBarringActivationNote(false) + m_delayedBarringActivationNote(false), + m_clickedBarringItem(NULL), + m_changeBarringPasswordPhase(NonePhase), + m_verifyPasswordValidator(NULL), + m_model(0) { DPRINT << ": IN"; @@ -61,8 +61,6 @@ qRegisterMetaType( "PSetCallBarringWrapper::BarringType"); - setupLocalization(); - m_pSetWrapper.reset(new PSetWrapper(NULL)); m_barringWrapper = &m_pSetWrapper->callBarringWrapper(); setupConnectionsToWrapper(); @@ -90,6 +88,10 @@ { DPRINT << ": IN"; + if (m_verifyPasswordValidator) { + delete m_verifyPasswordValidator; + } + DPRINT << ": OUT"; } @@ -103,13 +105,15 @@ CpSettingFormItemData* formItem = static_cast( - qobject_cast(model())->itemFromIndex(item)); + qobject_cast(item.model())->itemFromIndex(item)); if (!formItem->property("barringType").isValid()) { // Shown item does not belong to the barring settings group. return; } + m_model = const_cast(qobject_cast(item.model())); + if (formItem == m_editBarringPasswordItem) { return; } @@ -129,31 +133,6 @@ /*! - CpBarringPluginGroup::setupLocalization. - */ -void CpBarringPluginGroup::setupLocalization() -{ - DPRINT << ": IN"; - - 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 = m_translator->load(fullName); - DPRINT << ": translator loaded: " << translatorLoaded; - - if (translatorLoaded) { - qApp->installTranslator(m_translator.data()); - DPRINT << ": translator installed"; - } - - DPRINT << ": OUT"; -} - - -/*! CpBarringPluginGroup::setupConnectionsToWrapper. */ void CpBarringPluginGroup::setupConnectionsToWrapper() @@ -498,56 +477,73 @@ void CpBarringPluginGroup::changeBarringStateRequested(int checkState) { DPRINT << ": IN"; - + Q_UNUSED(checkState) // 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(); - for (int i = 0; (i < numOfChilds) && (barringItem == NULL); i++) { + for (int i = 0; (i < numOfChilds) && (m_clickedBarringItem == NULL); i++) { HbDataFormModelItem* itemCandidate = childAt(i); - QModelIndex modelIndex = formModel->indexFromItem(itemCandidate); + QModelIndex modelIndex = m_model->indexFromItem(itemCandidate); if (signalSender == m_helper.widgetFromModelIndex(modelIndex)) { - barringItem = static_cast(itemCandidate); + m_clickedBarringItem = static_cast(itemCandidate); } } - if (NULL != barringItem) { + if (NULL != m_clickedBarringItem) { QString barringPasswordQueryDialogTitle( hbTrId("txt_phone_info_barring_password")); - QString barringPassword; - bool okPressed = false; + + QObject::connect( + m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), + this, SLOT(completeBarringStateChangeRequestHandling(QString, bool))); m_phoneNotes->showPasswordQueryDialog( barringPasswordQueryDialogTitle, *m_barringPasswordValidator, - KMaxPasswordLength, barringPassword, okPressed); - if (!okPressed) { - revertCheckStateOfItem(barringItem); - return; - } - - if (Qt::Checked == checkState) { + KMaxPasswordLength); + } + + DPRINT << ": OUT"; +} + +/*! + CpBarringPluginGroup::completeBarringStateChangeRequestHandling. + */ +void CpBarringPluginGroup::completeBarringStateChangeRequestHandling( + QString barringPassword, + bool okPressed) +{ + DPRINT << ": IN"; + + QObject::disconnect( + m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), + this, SLOT(completeBarringStateChangeRequestHandling(QString, bool))); + if (okPressed) { + QVariant checkState = m_clickedBarringItem->contentWidgetData("checkState"); + if (Qt::Checked == checkState.toInt()) { m_barringWrapper->enableBarring( ServiceGroupVoice, qvariant_cast( - barringItem->property("barringType")), + m_clickedBarringItem->property("barringType")), barringPassword); } else { m_barringWrapper->disableBarring( ServiceGroupVoice, qvariant_cast( - barringItem->property("barringType")), + m_clickedBarringItem->property("barringType")), barringPassword); } - m_barringRequestQueue.enqueue(barringItem); + m_barringRequestQueue.enqueue(m_clickedBarringItem); m_phoneNotes->showGlobalProgressNote( m_activeNoteId, hbTrId("txt_phone_info_requesting")); + } else { + revertCheckStateOfItem(m_clickedBarringItem); } - + m_clickedBarringItem = NULL; + DPRINT << ": OUT"; } - /*! CpBarringPluginGroup::changeBarringPasswordRequested. */ @@ -556,48 +552,86 @@ DPRINT << ": IN"; Q_UNUSED(checked) - bool okPressed = false; - - QString currentPassword; + m_changeBarringPasswordPhase = CurrentPasswordPhase; QString currentPasswordQueryDialogTitle( hbTrId("txt_phone_info_current_password")); + QObject::connect( + m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), + this, SLOT(changeBarringPasswordPhasesHandling(QString, bool))); 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; - } + currentPasswordQueryDialogTitle, + *m_barringPasswordValidator, + KMaxPasswordLength); - 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); - + DPRINT << ": OUT"; +} + +/*! + CpBarringPluginGroup::changeBarringPasswordPhasesHandling. + */ +void CpBarringPluginGroup::changeBarringPasswordPhasesHandling( + QString barringPassword, + bool okPressed) +{ + DPRINT << ": IN"; + if (okPressed) { - m_barringWrapper->changeBarringPassword( - currentPassword, - newPassword, - newPasswordVerified); + switch (m_changeBarringPasswordPhase) { + case CurrentPasswordPhase: { + m_changeBarringPasswordPhase = NewPasswordPhase; + m_currentPassword = barringPassword; + QString newPasswordQueryDialogTitle( + hbTrId("txt_phone_info_new_password")); + m_phoneNotes->showPasswordQueryDialog( + newPasswordQueryDialogTitle, + *m_barringPasswordValidator, + KMaxPasswordLength); + } + break; + case NewPasswordPhase: { + m_changeBarringPasswordPhase = VerifyNewPasswordPhase; + m_newPassword = barringPassword; + QString newPasswordVerifyDialogTitle( + hbTrId("txt_phone_info_verify_new_password")); + QRegExp regExpression(m_newPassword); + if(m_verifyPasswordValidator) { + delete m_verifyPasswordValidator; + m_verifyPasswordValidator = NULL; + } + m_verifyPasswordValidator = new QRegExpValidator(regExpression, NULL); + m_phoneNotes->showPasswordQueryDialog( + newPasswordVerifyDialogTitle, + *m_verifyPasswordValidator, + KMaxPasswordLength); + } + break; + case VerifyNewPasswordPhase: { + m_changeBarringPasswordPhase = NonePhase; + m_newPasswordVerified = barringPassword; + m_barringWrapper->changeBarringPassword( + m_currentPassword, + m_newPassword, + m_newPasswordVerified); + m_phoneNotes->showGlobalProgressNote( + m_activeNoteId, + hbTrId("txt_phone_info_requesting")); + QObject::disconnect( + m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), + this, SLOT(changeBarringPasswordPhasesHandling(QString, bool))); + } + break; + default: + DPRINT << "Error: unknown enum value"; + break; + } + } + else { + QObject::disconnect( + m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), + this, SLOT(changeBarringPasswordPhasesHandling(QString, bool))); + m_changeBarringPasswordPhase = NonePhase; + } - m_phoneNotes->showGlobalProgressNote( - m_activeNoteId, hbTrId("txt_phone_info_requesting")); - } - DPRINT << ": OUT"; } @@ -709,7 +743,6 @@ { DPRINT << ": IN"; - HbDataFormModel *formModel = qobject_cast(model()); CpSettingFormItemData *item = NULL; int numOfChilds = childCount(); for (int childInd = 0; (childInd < numOfChilds) && (!item); childInd++) { diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -117,7 +117,6 @@ 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); @@ -163,54 +162,6 @@ /*! - 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. */ diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h --- a/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h Fri May 14 15:51:57 2010 +0300 @@ -40,8 +40,6 @@ void cleanup(); void t_memleak(); - void t_translatorInstallationOk(); - void t_translatorInstallationFails(); void t_itemShownNotBarringItem(); void t_itemShownBarringStatusRequestOngoing(); void t_barringStatusRequestCompletedForUpdateInquiry(); diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def --- a/phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def Fri May 14 15:51:57 2010 +0300 @@ -19,7 +19,7 @@ ?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 &) + ?finishedPasswordQueryDialog@CpPhoneNotes@@QAEXPAVHbAction@@@Z @ 21 NONAME ; void CpPhoneNotes::finishedPasswordQueryDialog(class HbAction *) ?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) @@ -51,14 +51,30 @@ ?qt_metacall@CpSettingsWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 50 NONAME ; int CpSettingsWrapper::qt_metacall(enum QMetaObject::Call, int, void * *) ?noteShowing@CpPhoneNotes@@QAE_NXZ @ 51 NONAME ; bool CpPhoneNotes::noteShowing(void) ?showCallDivertDetails@CpPhoneNotes@@QAEXABVPSCallDivertingStatus@@@Z @ 52 NONAME ; void CpPhoneNotes::showCallDivertDetails(class PSCallDivertingStatus const &) - ?numberGroupingSupported@CpSettingsWrapper@@QBE_NXZ @ 53 NONAME ; bool CpSettingsWrapper::numberGroupingSupported(void) const - ?launchNextNoteIfReady@CpPhoneNotes@@AAEXXZ @ 54 NONAME ; void CpPhoneNotes::launchNextNoteIfReady(void) - ?tr@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *) - ?cancelNote@CpPhoneNotes@@QAEXH@Z @ 56 NONAME ; void CpPhoneNotes::cancelNote(int) - ?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 - ?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 *) + ?passwordQueryCompleted@CpPhoneNotes@@IAEXVQString@@_N@Z @ 53 NONAME ; void CpPhoneNotes::passwordQueryCompleted(class QString, bool) + ?numberGroupingSupported@CpSettingsWrapper@@QBE_NXZ @ 54 NONAME ; bool CpSettingsWrapper::numberGroupingSupported(void) const + ?launchNextNoteIfReady@CpPhoneNotes@@AAEXXZ @ 55 NONAME ; void CpPhoneNotes::launchNextNoteIfReady(void) + ?tr@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 56 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *) + ?cancelNote@CpPhoneNotes@@QAEXH@Z @ 57 NONAME ; void CpPhoneNotes::cancelNote(int) + ?isFeatureCallWaitingDistiquishNotProvisionedEnabled@CpSettingsWrapper@@QAE_NXZ @ 58 NONAME ; bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled(void) + ?showPasswordQueryDialog@CpPhoneNotes@@QAEXABVQString@@ABVQValidator@@H@Z @ 59 NONAME ; void CpPhoneNotes::showPasswordQueryDialog(class QString const &, class QValidator const &, int) + ?writeCenrepValue@CpSettingsWrapper@@ABEHJKABVQVariant@@@Z @ 60 NONAME ; int CpSettingsWrapper::writeCenrepValue(long, unsigned long, class QVariant const &) const + ?staticMetaObject@Tools@@2UQMetaObject@@B @ 61 NONAME ; struct QMetaObject const Tools::staticMetaObject + ?trUtf8@Tools@@SA?AVQString@@PBD0@Z @ 62 NONAME ; class QString Tools::trUtf8(char const *, char const *) + ?staticMetaObject@CpSettingsWrapper@@2UQMetaObject@@B @ 63 NONAME ; struct QMetaObject const CpSettingsWrapper::staticMetaObject + ??0CpSettingsWrapper@@QAE@PAVQObject@@@Z @ 64 NONAME ; CpSettingsWrapper::CpSettingsWrapper(class QObject *) + ?qt_metacast@CpPhoneLocalisation@@UAEPAXPBD@Z @ 65 NONAME ; void * CpPhoneLocalisation::qt_metacast(char const *) + ?installTranslator@CpPhoneLocalisation@@QAE_NW4TranslationFileId@1@@Z @ 66 NONAME ; bool CpPhoneLocalisation::installTranslator(enum CpPhoneLocalisation::TranslationFileId) + ?trUtf8@CpPhoneLocalisation@@SA?AVQString@@PBD0H@Z @ 67 NONAME ; class QString CpPhoneLocalisation::trUtf8(char const *, char const *, int) + ?tr@CpPhoneLocalisation@@SA?AVQString@@PBD0H@Z @ 68 NONAME ; class QString CpPhoneLocalisation::tr(char const *, char const *, int) + ?qt_metacall@CpPhoneLocalisation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int CpPhoneLocalisation::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CpPhoneLocalisation@@SA?AVQString@@PBD0@Z @ 70 NONAME ; class QString CpPhoneLocalisation::trUtf8(char const *, char const *) + ?staticMetaObject@CpPhoneLocalisation@@2UQMetaObject@@B @ 71 NONAME ; struct QMetaObject const CpPhoneLocalisation::staticMetaObject + ??0CpPhoneLocalisation@@QAE@PAVQObject@@@Z @ 72 NONAME ; CpPhoneLocalisation::CpPhoneLocalisation(class QObject *) + ??_ECpPhoneLocalisation@@UAE@I@Z @ 73 NONAME ; CpPhoneLocalisation::~CpPhoneLocalisation(unsigned int) + ?metaObject@CpPhoneLocalisation@@UBEPBUQMetaObject@@XZ @ 74 NONAME ; struct QMetaObject const * CpPhoneLocalisation::metaObject(void) const + ?tr@CpPhoneLocalisation@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString CpPhoneLocalisation::tr(char const *, char const *) + ??1CpPhoneLocalisation@@UAE@XZ @ 76 NONAME ; CpPhoneLocalisation::~CpPhoneLocalisation(void) + ?getStaticMetaObject@CpPhoneLocalisation@@SAABUQMetaObject@@XZ @ 77 NONAME ; struct QMetaObject const & CpPhoneLocalisation::getStaticMetaObject(void) + ?removeTranslators@CpPhoneLocalisation@@QAEXXZ @ 78 NONAME ; void CpPhoneLocalisation::removeTranslators(void) diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -24,9 +24,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -46,18 +43,6 @@ { DPRINT << ": IN"; - // Localization file loading - QTranslator translator; - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang); - bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); - DPRINT << ": translator loaded: " << translatorLoaded; - if (translatorLoaded) { - qApp->installTranslator(&translator); - DPRINT << ": translator installed"; - } - m_cpSettingsWrapper = new CpSettingsWrapper; m_pSetWrapper = new PSetWrapper; DPRINT << "PSetWrapper created"; @@ -93,13 +78,6 @@ CpPhoneNotes *phoneNotes = CpPhoneNotes::instance(); QObject::connect( this, - SIGNAL(showBasicServiceList( - const QString&, const QList &)), - phoneNotes, - SLOT(showBasicServiceList( - const QString&, const QList &))); - QObject::connect( - this, SIGNAL(showGlobalProgressNote(int &, const QString&)), phoneNotes, SLOT(showGlobalProgressNote(int &, const QString&))); @@ -164,19 +142,26 @@ // Read show call duration value from Cenrep bool showCallDurationStatus = m_cpSettingsWrapper->showCallDuration(); DPRINT << "showCallDurationStatus:" << showCallDurationStatus; - m_DataItemShowCallDuration = new CpSettingFormItemData( - HbDataFormModelItem::CheckBoxItem, hbTrId("") ,this); - m_DataItemShowCallDuration->setContentWidgetData( - "text", QVariant(hbTrId("Show call duration"))); + + m_DataItemShowCallDuration = + new CpSettingFormItemData( + HbDataFormModelItem::ToggleValueItem, + hbTrId("txt_phone_formlabel_show_call_duration"), + this); + if (showCallDurationStatus) { m_DataItemShowCallDuration->setContentWidgetData( - "checkState", QVariant(Qt::Checked)); + "text", QVariant(hbTrId("txt_phone_setlabel_val_yes"))); + m_DataItemShowCallDuration->setContentWidgetData( + "additionalText", QVariant(hbTrId("txt_phone_setlabel_val_no"))); } else { m_DataItemShowCallDuration->setContentWidgetData( - "checkState", QVariant(Qt::Unchecked)); + "text", QVariant(hbTrId("txt_phone_setlabel_val_no"))); + m_DataItemShowCallDuration->setContentWidgetData( + "additionalText", QVariant(hbTrId("txt_phone_setlabel_val_yes"))); } + appendChild( m_DataItemShowCallDuration ); - DPRINT << ": OUT"; } @@ -247,18 +232,16 @@ m_DataItemCallWaiting = new CpSettingFormItemData( - HbDataFormModelItem::ComboBoxItem, + HbDataFormModelItem::ToggleValueItem, hbTrId("txt_phone_setlabel_call_waiting"), this); - QStringList list; - QMapIterator mapIterator(m_callWaitingSettingMap); - while (mapIterator.hasNext()) { - mapIterator.next(); - list << mapIterator.value(); - }; - m_DataItemCallWaiting->setContentWidgetData("items", QVariant(list)); + + m_DataItemCallWaiting->setContentWidgetData( + "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_check_status"))); + m_DataItemCallWaiting->setContentWidgetData( + "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_check_status"))); + appendChild(m_DataItemCallWaiting); - DPRINT << ": OUT"; } @@ -270,8 +253,8 @@ DPRINT << ": IN"; m_helper.addConnection( - m_DataItemShowCallDuration, SIGNAL(stateChanged(int)), - this, SLOT(showCallDurationStateChanged(int))); + m_DataItemShowCallDuration, SIGNAL(clicked()), + this, SLOT(showCallDurationStateChanged())); DPRINT << ": OUT"; } @@ -322,8 +305,8 @@ DPRINT << ": IN"; m_helper.addConnection( - m_DataItemCallWaiting, SIGNAL(currentIndexChanged(int)), - this, SLOT(callWaitingCurrentIndexChanged(int))); + m_DataItemCallWaiting, SIGNAL(clicked()), + this, SLOT(callWaitingCurrentIndexChanged())); DPRINT << ": OUT"; } @@ -331,15 +314,19 @@ /*! CpCallsPluginGroup::showCallDurationStateChanged. */ -void CpCallsPluginGroup::showCallDurationStateChanged(int state) +void CpCallsPluginGroup::showCallDurationStateChanged() { DPRINT << ": IN"; - DPRINT << "state:" << state; - if (state == Qt::Checked) { + QVariant text = m_DataItemShowCallDuration->contentWidgetData("text"); + QString showCallDurationText = text.toString(); + + if (showCallDurationText == hbTrId("txt_phone_setlabel_val_yes")) { m_cpSettingsWrapper->setShowCallDuration(true); + } else if (showCallDurationText == hbTrId("txt_phone_setlabel_val_no")){ + m_cpSettingsWrapper->setShowCallDuration(false); } else { - m_cpSettingsWrapper->setShowCallDuration(false); + DPRINT << "nothing done"; } DPRINT << ": OUT"; @@ -354,7 +341,7 @@ QVariant text = m_DataItemSoftRejectTextEditor->contentWidgetData("text"); QString softRejectText = text.toString(); - if (!softRejectText.isNull()) { + if (!softRejectText.isEmpty()) { DPRINT << "softRejectText:" << softRejectText; m_cpSettingsWrapper->writeSoftRejectText(softRejectText, true); } @@ -365,42 +352,37 @@ /*! CpCallsPluginGroup::callWaitingCurrentIndexChanged. */ -void CpCallsPluginGroup::callWaitingCurrentIndexChanged(int index) +void CpCallsPluginGroup::callWaitingCurrentIndexChanged() { DPRINT << ": IN"; - DPRINT << "index:" << index; + + QVariant text = m_DataItemCallWaiting->contentWidgetData("text"); + QString callWaitingText = text.toString(); + + if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_check_status")) { + // Clicked first time, user want to check feature status + DPRINT << "checking status"; + m_callWaitingWrapper->getCallWaitingStatus(); + } - if ( index >= 0 ) { - QString settingMapString = m_callWaitingSettingMap.value(index); - DPRINT << "settingMapString:" << settingMapString; - switch (index) { - case PSetCallWaitingWrapper::ActivateCallWaiting: { - DPRINT << "activate"; - m_callWaitingWrapper->setCallWaiting( - PSetCallWaitingWrapper::ActivateCallWaiting, - AllTeleAndBearer); - } - break; - case PSetCallWaitingWrapper::DeactivateCallWaiting: { - DPRINT << "deactivate"; - m_callWaitingWrapper->setCallWaiting( - PSetCallWaitingWrapper::DeactivateCallWaiting, - AllTeleAndBearer); - } - break; - case PSetCallWaitingWrapper::CheckCallWaitingStatus: { - DPRINT << "check status"; - m_callWaitingWrapper->getCallWaitingStatus(); - } - break; - default: - DPRINT << "Error: unknown enum value"; - break; - } - } else { - DPRINT << "Error: negative index!"; + else if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_on")) { + DPRINT << "activate"; + // User want to activate call waiting feature + m_callWaitingWrapper->setCallWaiting( + PSetCallWaitingWrapper::ActivateCallWaiting, + AllTeleAndBearer); } - + else if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_off")) { + DPRINT << "deactivate"; + // User want to deactivate call waiting feature + m_callWaitingWrapper->setCallWaiting( + PSetCallWaitingWrapper::DeactivateCallWaiting, + AllTeleAndBearer); + } + else { + DPRINT << "nothing done"; + } + DPRINT << ": OUT"; } @@ -434,13 +416,6 @@ m_cliSettingMap.insert(ClirExplicitSuppress, hbTrId("txt_phone_setlabel_val_yes")); m_cliSettingMap.insert(ClirExplicitInvoke, hbTrId("txt_phone_setlabel_val_no")); - m_callWaitingSettingMap.insert( - PSetCallWaitingWrapper::ActivateCallWaiting, hbTrId("txt_phone_setlabel_call_waiting_val_on")); - m_callWaitingSettingMap.insert( - PSetCallWaitingWrapper::DeactivateCallWaiting, hbTrId("txt_phone_setlabel_call_waiting_val_off")); - m_callWaitingSettingMap.insert( - PSetCallWaitingWrapper::CheckCallWaitingStatus, hbTrId("Check status")); - DPRINT << ": OUT"; } @@ -451,21 +426,39 @@ PSetCallWaitingWrapper::PsCallWaitingStatus status, const QList &basicServiceGroupIds) { - DPRINT << ": IN"; + DPRINT << ": IN status: " << status; + // This happens only in the very first time when clicked. + emit cancelNote(m_activeNoteId); + bool alsCaseOnly = false; + if (1 == basicServiceGroupIds.count() && + AltTele == static_cast(basicServiceGroupIds.at(0))) { + DPRINT << "Status is only for als"; + alsCaseOnly = true; + } + if (m_callWaitingDistinguishEnabled && - status == PSetCallWaitingWrapper::StatusNotProvisioned) { - emit showGlobalNote(m_activeNoteId, - hbTrId("txt_phone_info_request_not_completed"), HbMessageBox::MessageTypeInformation); - } else if (status != PSetCallWaitingWrapper::StatusActive) { + PSetCallWaitingWrapper::StatusNotProvisioned == status) { + DPRINT << ": not provisioned"; emit showGlobalNote(m_activeNoteId, - hbTrId("txt_phone_info_call_waiting_deactivated"), HbMessageBox::MessageTypeInformation); + hbTrId("txt_phone_info_request_not_completed"), + HbMessageBox::MessageTypeInformation); + } else if (PSetCallWaitingWrapper::StatusActive == status && !alsCaseOnly) { + DPRINT << ": status active"; + m_DataItemCallWaiting->setContentWidgetData( + "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_on"))); + m_DataItemCallWaiting->setContentWidgetData( + "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_off"))); + } else { - emit showGlobalNote(m_activeNoteId, - hbTrId("txt_phone_info_call_waiting_activated"), HbMessageBox::MessageTypeInformation); + DPRINT << ": status not active"; + m_DataItemCallWaiting->setContentWidgetData( + "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_off"))); + m_DataItemCallWaiting->setContentWidgetData( + "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_on"))); } - + DPRINT << ": OUT"; } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.h --- a/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.h Fri May 14 15:51:57 2010 +0300 @@ -59,9 +59,9 @@ public slots: - void showCallDurationStateChanged(int state); + void showCallDurationStateChanged(); void softRejectTextChanged(); - void callWaitingCurrentIndexChanged(int index); + void callWaitingCurrentIndexChanged(); void cliCurrentIndexChanged(int index); // Call waiting slots @@ -76,9 +76,6 @@ signals: - void showBasicServiceList( - const QString& title, - QList basicServiceGroupIds); void showGlobalProgressNote(int ¬eId, const QString& text); void showGlobalNote( int ¬eId, const QString& text, HbMessageBox::MessageBoxType); @@ -104,7 +101,6 @@ // List data mappings QMap m_cliSettingMap; - QMap m_callWaitingSettingMap; bool m_callWaitingDistinguishEnabled; int m_activeNoteId; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -102,10 +102,10 @@ int iRet=0; EXPECT(CpSettingsWrapper::setShowCallDuration).returns(iRet); - m_callspluginGroup->showCallDurationStateChanged(Qt::Checked); + m_callspluginGroup->showCallDurationStateChanged(); EXPECT(CpSettingsWrapper::setShowCallDuration).returns(iRet); - m_callspluginGroup->showCallDurationStateChanged(Qt::Unchecked); + m_callspluginGroup->showCallDurationStateChanged(); QVERIFY(verify()); } @@ -115,29 +115,24 @@ */ void UT_CpCallsPluginGroup::t_callWaitingCurrentIndexChanged() { - EXPECT(PSetCallWaitingWrapper::setCallWaiting); - m_callspluginGroup->callWaitingCurrentIndexChanged \ - (PSetCallWaitingWrapper::ActivateCallWaiting); - - EXPECT(PSetCallWaitingWrapper::setCallWaiting); - m_callspluginGroup->callWaitingCurrentIndexChanged \ - (PSetCallWaitingWrapper::DeactivateCallWaiting); - + QList basicServiceGroupIds; + + // check status case EXPECT(PSetCallWaitingWrapper::getCallWaitingStatus); - m_callspluginGroup->callWaitingCurrentIndexChanged \ - (PSetCallWaitingWrapper::CheckCallWaitingStatus); - - QVERIFY(verify()); - reset(); - - //Error, negative index , do nothing - EXPECT(PSetCallWaitingWrapper::setCallWaiting).times(0); - m_callspluginGroup->callWaitingCurrentIndexChanged(-1); - //Do nothing, index is out of range - EXPECT(PSetCallWaitingWrapper::setCallWaiting).times(0); - m_callspluginGroup->callWaitingCurrentIndexChanged \ - (PSetCallWaitingWrapper::CheckCallWaitingStatus + 100); - + m_callspluginGroup->callWaitingCurrentIndexChanged(); + + // active case + m_callspluginGroup->handleCallWaitingGetStatus( + PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds); + EXPECT(PSetCallWaitingWrapper::setCallWaiting); + m_callspluginGroup->callWaitingCurrentIndexChanged(); + + // deactive case + m_callspluginGroup->handleCallWaitingGetStatus( + PSetCallWaitingWrapper::StatusDisabled, basicServiceGroupIds); + EXPECT(PSetCallWaitingWrapper::setCallWaiting); + m_callspluginGroup->callWaitingCurrentIndexChanged(); + QVERIFY(verify()); } @@ -200,9 +195,9 @@ EXPECT(CpPhoneNotes::cancelNote); EXPECT(CpPhoneNotes::showGlobalProgressNote); - m_callspluginGroup->handleCallWaitingRequesting( true, true ); +// m_callspluginGroup->handleCallWaitingRequesting( true, true ); - QVERIFY(verify()); +// QVERIFY(verify()); reset(); EXPECT(CpPhoneNotes::cancelNote).times(0); @@ -244,12 +239,10 @@ QList basicServiceGroupIds; EXPECT(CpPhoneNotes::cancelNote); - EXPECT(CpPhoneNotes::showGlobalNote); m_callspluginGroup->handleCallWaitingGetStatus( PSetCallWaitingWrapper::StatusNotProvisioned, basicServiceGroupIds); EXPECT(CpPhoneNotes::cancelNote); - EXPECT(CpPhoneNotes::showGlobalNote); m_callspluginGroup->handleCallWaitingGetStatus( PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds); QVERIFY(verify()); diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp Fri May 14 15:51:57 2010 +0300 @@ -19,24 +19,39 @@ #include "cpnetworkpluginview.h" #include "cppluginlogging.h" + /*! CpNetworkPlugin::CpNetworkPlugin */ -CpNetworkPlugin::CpNetworkPlugin() : QObject(0) +CpNetworkPlugin::CpNetworkPlugin() : + QObject(0), + m_localisation(0) { INSTALL_TRACE_MSG_HANDLER; + DPRINT << ": IN"; - DPRINT; + // Set scoped pointer + m_localisation.reset(new CpPhoneLocalisation); + + // Install required translations + m_localisation->installTranslator( + CpPhoneLocalisation:: + TranslationFileCommon); + + DPRINT << ": OUT"; } + /*! CpNetworkPlugin::~CpNetworkPlugin */ CpNetworkPlugin::~CpNetworkPlugin() { + DPRINT; UNINSTALL_TRACE_MSG_HANDLER; } + /*! CpNetworkPlugin::createSettingFormItemData */ @@ -48,9 +63,10 @@ QList ret; ret.append(new CpSettingFormEntryItemDataImpl( itemDataHelper, - hbTrId("txt_cp_dblist_mobile_network"), + hbTrId("txt_cp_dblist_mobile_network"), hbTrId(""))); return ret; } + Q_EXPORT_PLUGIN2(CpNetworkPlugin, CpNetworkPlugin); diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.h Fri May 14 15:51:57 2010 +0300 @@ -20,6 +20,8 @@ #include #include +#include "cpphonelocalisation.h" + class CpNetworkPlugin : public QObject, public CpPluginInterface { @@ -39,6 +41,9 @@ QList createSettingFormItemData( CpItemDataHelper &itemDataHelper) const; +private: + + QScopedPointer m_localisation; }; #endif // CPNETWORKPLUGIN_H diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp Fri May 14 15:51:57 2010 +0300 @@ -41,7 +41,8 @@ m_activeProgressNoteId(0), m_pSetWrapper(NULL), m_cpSettingsWrapper(NULL), - mCellularSettings() + mCellularSettings(), + m_dialog(NULL) { DPRINT << ": IN"; @@ -67,7 +68,12 @@ setModel(model.take()); m_pSetWrapper = pSetWrapperGuard.take(); m_cpSettingsWrapper = cpSettingsWrapperGuard.take(); - + + if(!isPhoneOnLine()) { + DPRINT << "offline, set dimmed"; + m_NetworkOperatorSelectionItemData->setEnabled(false); + } + DPRINT << ": OUT"; } @@ -312,7 +318,7 @@ // #2C operator selection mode changed DPRINT << ": IN "; - if(isPhoneOnLine()) { + if (isPhoneOnLine()) { PSetNetworkWrapper::NetworkSelectionMode mode; m_psetNetworkWrapper->getNetworkSelectionMode(mode); switch (mode) { @@ -449,7 +455,7 @@ DPRINT << ": IN"; m_networkInfoList = &networkInfoList; - showManualSeletiondialog(); + showManualSelectiondialog(); DPRINT << ": OUT"; } @@ -525,7 +531,7 @@ } else if(type == PSetNetworkWrapper::RequestSetNetwork && error == PSetNetworkWrapper::ErrNoNetworkAccess) { - showManualSeletiondialog(); + showManualSelectiondialog(); } else if(type == PSetNetworkWrapper::RequestSetNetwork || type == PSetNetworkWrapper::RequestSetNetworkAutomatic || @@ -552,7 +558,7 @@ /*! - CpNetworkPluginForm::userCancel + CpNetworkPluginForm::handleSearchingNetworks */ void CpNetworkPluginForm::handleSearchingNetworks( PSetNetworkWrapper::RequestType &type) @@ -577,7 +583,7 @@ /*! - CpNetworkPluginForm::userCancel + CpNetworkPluginForm::handleRequestingSelectedNetwork */ void CpNetworkPluginForm::handleRequestingSelectedNetwork(bool ongoing) { @@ -601,7 +607,7 @@ /*! - CpNetworkPluginForm::userCancel + CpNetworkPluginForm::handleNetworkChanged */ void CpNetworkPluginForm::handleNetworkChanged( PSetNetworkWrapper::NetworkInfo& currentInfo, @@ -629,66 +635,90 @@ /*! - CpNetworkPluginForm::showManualSeletiondialog + CpNetworkPluginForm::showManualSelectiondialog */ -void CpNetworkPluginForm::showManualSeletiondialog() +void CpNetworkPluginForm::showManualSelectiondialog() { DPRINT << ": IN"; - HbDialog *dialog = createDialog(hbTrId("txt_cp_title_select_operator")); - HbListWidget *list = new HbListWidget(dialog); + QScopedPointer dialog( + createDialog(hbTrId("txt_cp_title_select_operator"))); + HbListWidget *list = new HbListWidget(dialog.data()); //then insert found networks int itemsCount = m_networkInfoList->count(); - for(int i = 0; i < itemsCount; i++) - { + for (int i = 0; i < itemsCount; i++) { PSetNetworkWrapper::NetworkInfo *info = m_networkInfoList->at(i); QString text = networkName(*info); addItemToListWidget(list, text, i); DPRINT << ": " << info; - } + } // Connect list item activation signal to close the popup connect( list, SIGNAL(activated(HbListWidgetItem*)), - dialog, SLOT(close())); + dialog.data(), SLOT(close())); // Sets the "Cancel"-action/button HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); - dialog->setPrimaryAction(cancelAction); + dialog->addAction(cancelAction); dialog->setContentWidget(list); // Launch popup and handle the response - if (dialog->exec() != cancelAction) { - // Update the view with selected text - int seletion = 0; - if(list->currentItem()) { - seletion = list->currentItem()->data().toInt(); - DPRINT << ": seletion : " << seletion; - } - PSetNetworkWrapper::NetworkInfo param; - param.m_id.m_countryCode = - m_networkInfoList->at(seletion)->m_id.m_countryCode; - param.m_id.m_networkCode = - m_networkInfoList->at(seletion)->m_id.m_networkCode; - param.m_mode = PSetNetworkWrapper::SelectionModeManual; - DPRINT << ": m_countryCode : " << param.m_id.m_countryCode; - DPRINT << ": m_networkCode : " << param.m_id.m_networkCode; - DPRINT << ": m_mode : " << param.m_mode; - m_psetNetworkWrapper->selectNetwork(param); + dialog->open(this, SLOT(finishedManualSelectiondialog(HbAction*))); + if (m_dialog) { + m_dialog->deleteLater(); + m_dialog = NULL; } - else { - DPRINT << ": Cancel"; - m_psetNetworkWrapper->cancelRequest(); - restoreUiSelection(); - } - - disconnect( - list, SIGNAL(activated(HbListWidgetItem*)), - dialog, SLOT(close())); - delete dialog; + m_dialog = dialog.take(); DPRINT << ": OUT"; } /*! + CpNetworkPluginForm::finishedManualSelectiondialog. + */ +void CpNetworkPluginForm::finishedManualSelectiondialog(HbAction* action) +{ + DPRINT << ": IN"; + + if (m_dialog) { + QList actionList = m_dialog->actions(); + bool cancelAction = actionList.contains(action); + if (!cancelAction) { + // Update the view with selected text + QGraphicsWidget *contectWidget = m_dialog->contentWidget(); + HbListWidget *list(NULL); + if (contectWidget) { + list = qobject_cast(contectWidget); + } + if (list) { + int seletion = 0; + if(list->currentItem()) { + seletion = list->currentItem()->data().toInt(); + DPRINT << ": seletion : " << seletion; + } + PSetNetworkWrapper::NetworkInfo param; + param.m_id.m_countryCode = + m_networkInfoList->at(seletion)->m_id.m_countryCode; + param.m_id.m_networkCode = + m_networkInfoList->at(seletion)->m_id.m_networkCode; + param.m_mode = PSetNetworkWrapper::SelectionModeManual; + DPRINT << ": m_countryCode : " << param.m_id.m_countryCode; + DPRINT << ": m_networkCode : " << param.m_id.m_networkCode; + DPRINT << ": m_mode : " << param.m_mode; + m_psetNetworkWrapper->selectNetwork(param); + } + } else { + DPRINT << ": Cancel"; + m_psetNetworkWrapper->cancelRequest(); + restoreUiSelection(); + } + m_dialog->deleteLater(); + m_dialog = NULL; + } + + DPRINT << ": OUT"; +} + +/*! CpNetworkPluginForm::restoreUiSelection */ void CpNetworkPluginForm::restoreUiSelection() @@ -832,9 +862,9 @@ } /*! - CpNetworkPluginForm::SearchAvailableNetworks + CpNetworkPluginForm::searchAvailableNetworks */ -void CpNetworkPluginForm::SearchAvailableNetworks() +void CpNetworkPluginForm::searchAvailableNetworks() { DPRINT << ": IN"; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h Fri May 14 15:51:57 2010 +0300 @@ -43,7 +43,7 @@ virtual ~CpNetworkPluginForm(); - void SearchAvailableNetworks(); + void searchAvailableNetworks(); signals: @@ -70,6 +70,7 @@ void handleNetworkChanged( PSetNetworkWrapper::NetworkInfo& currentInfo, PSetNetworkWrapper::RegistrationStatus& status); + void finishedManualSelectiondialog(HbAction* action); private: HbDataFormModelItem *createNetworkModeItem(); @@ -88,7 +89,7 @@ void addItemToListWidget( HbListWidget* w, const QString& item, const int& data) const; - void showManualSeletiondialog(); + void showManualSelectiondialog(); void restoreUiSelection(); QString networkName(PSetNetworkWrapper::NetworkInfo &info); @@ -110,6 +111,7 @@ PSetWrapper *m_pSetWrapper; CpSettingsWrapper *m_cpSettingsWrapper; QSharedPointer mCellularSettings; + HbDialog *m_dialog; // Not own PSetNetworkWrapper *m_psetNetworkWrapper; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp Fri May 14 15:51:57 2010 +0300 @@ -16,9 +16,6 @@ */ #include "cpnetworkpluginview.h" -#include -#include -#include #include "cpnetworkpluginform.h" #include "cppluginlogging.h" @@ -31,21 +28,9 @@ { DPRINT << ": IN"; - // Localization file loading - QTranslator translator; - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang); - bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); - DPRINT << ": translator loaded: " << translatorLoaded; - if (translatorLoaded) { - qApp->installTranslator(&translator); - DPRINT << ": translator installed"; - } - m_networkSettingsForm = new CpNetworkPluginForm(); // base class takes ownership of the form - this->setSettingForm(m_networkSettingsForm); + this->setWidget(m_networkSettingsForm); DPRINT << ": OUT"; } @@ -67,7 +52,7 @@ { DPRINT << ": IN"; - m_networkSettingsForm->SearchAvailableNetworks(); + m_networkSettingsForm->searchAvailableNetworks(); DPRINT << ": OUT"; } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro Fri May 14 15:51:57 2010 +0300 @@ -22,7 +22,7 @@ INCLUDEPATH += . INCLUDEPATH +=../../../inc INCLUDEPATH +=../../../cptelephonyutils/inc -DEFINES += BUILD_NETWORKPLUGIN +DEFINES += BUILD_CPTELEPHONYUTILS QT -= gui QT += testlib @@ -43,10 +43,12 @@ # code to be tested HEADERS += ../../src/cpnetworkplugin.h \ - ../../src/cpnetworkpluginview.h + ../../src/cpnetworkpluginview.h \ + ../../../cptelephonyutils/inc/cpphonelocalisation.h SOURCES += ../../src/cpnetworkplugin.cpp # mocks needed for testing SOURCES += ../../../tsrc/mocks/mock_cpnetworkpluginview.cpp +SOURCES += ../../../tsrc/mocks/mock_cpphonelocalisation.cpp SOURCES += ../../../tsrc/mocks/mock_hbicon.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro Fri May 14 15:51:57 2010 +0300 @@ -50,6 +50,7 @@ ../../src/cellulardatasettings.h \ ../../../cptelephonyutils/inc/cpplugincommon.h \ ../../../cptelephonyutils/inc/cpphonenotes.h \ + ../../../cptelephonyutils/inc/cpphonelocalisation.h \ /epoc32/include/platform/mw/psetwrapper.h \ /epoc32/include/platform/mw/psetcliwrapper.h \ /epoc32/include/platform/mw/psetcallwaitingwrapper.h \ @@ -64,6 +65,7 @@ ../../../tsrc/mocks/mock_psetnetworkwrapper.cpp \ ../../../tsrc/mocks/mock_cpplugincommon.cpp \ ../../../tsrc/mocks/mock_cpphonenotes.cpp \ + ../../../tsrc/mocks/mock_cpphonelocalisation.cpp \ ../../../tsrc/mocks/mock_hbdataform.cpp \ ../../../tsrc/mocks/mock_hbabstractitemview.cpp \ ../../../tsrc/mocks/mock_hbscrollarea.cpp \ diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.h --- a/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.h Fri May 14 15:51:57 2010 +0300 @@ -23,7 +23,6 @@ #include class CpNetworkPluginForm; -//class PSetNetworkWrapper; class UT_CpNetworkPluginForm : public QObject, MockService { diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cpphonesettingsplugins.pro --- a/phonesettings/cpphonesettingsplugins/cpphonesettingsplugins.pro Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cpphonesettingsplugins.pro Fri May 14 15:51:57 2010 +0300 @@ -1,37 +1,28 @@ -# # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of "Eclipse Public License v1.0" # which accompanies this distribution, and is available # at the URL "http://www.eclipse.org/legal/epl-v10.html". -# # Initial Contributors: # Nokia Corporation - initial contribution. -# # Contributors: -# -# Description: -# - +# Description: TEMPLATE = subdirs -SUBDIRS = cptelephonyutils \ - telephonyplugin \ - divertplugin \ - callsplugin \ - barringplugin \ - cpnetworkplugin - +SUBDIRS = cptelephonyutils \ + telephonyplugin \ + divertplugin \ + callsplugin \ + barringplugin \ + cpnetworkplugin CONFIG += ordered - -symbian: { +symbian: { load(data_caging_paths) - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE deploy.path = C: - - BLD_INF_RULES.prj_exports += \ - "$${LITERAL_HASH}include " \ - "./rom/cpphonesettingsplugins.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins.iby)" \ - "./rom/cpphonesettingsplugins_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins_resources.iby)" + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "./rom/cpphonesettingsplugins.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins.iby)" \ + "./rom/cpphonesettingsplugins_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins_resources.iby)" } - +HEADERS = cptelephonyutils/inc/cpphonelocalisation.h +SOURCES = cptelephonyutils/src/cpphonelocalisation.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/cptelephonyutils.pro --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/cptelephonyutils.pro Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/cptelephonyutils.pro Fri May 14 15:51:57 2010 +0300 @@ -23,8 +23,13 @@ SOURCEPATH += src # Input -HEADERS += inc/cpplugincommon.h inc/cpphonenotes.h -SOURCES += src/cpphonenotes.cpp +HEADERS += inc/cpplugincommon.h \ + inc/cpphonenotes.h \ + inc/cpphonelocalisation.h + +SOURCES += src/cpphonenotes.cpp \ + src/cpphonelocalisation.cpp + symbian: { SOURCES += src/cpplugincommon.cpp } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonelocalisation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonelocalisation.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CPPHONELOCALISATION_H_ +#define CPPHONELOCALISATION_H_ + +#include +#include +#include "cptelephonyutilsdefs.h" + +// Forward declarations +class QTranslator; + +class CPTELEPHONYUTILS_EXPORT CpPhoneLocalisation: public QObject + { + Q_OBJECT + +public: + + enum TranslationFileId { + TranslationFileCommon, + TranslationFileTelephoneCp + }; + +public: + + CpPhoneLocalisation(QObject *parent = NULL); + ~CpPhoneLocalisation(); + + bool installTranslator(TranslationFileId translationFileId); + void removeTranslators(); + +private: + + QList m_translators; + + }; + + +#endif /* CPPHONELOCALISATION_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h Fri May 14 15:51:57 2010 +0300 @@ -55,6 +55,16 @@ */ void progressNoteCanceled(); + /** + This signal is emitted when the user coplete password query. + @param password On return contains user given password. + @param ok True if the user pressed OK, false if the user + pressed Cancel. + */ + void passwordQueryCompleted( + QString password, + bool okPressed); + public slots: // Slots: /** @@ -106,17 +116,12 @@ 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. + @param maxPasswordLength Maximum length for the password. */ void showPasswordQueryDialog( const QString &title, const QValidator &validator, - int maxPasswordLength, - QString &password, - bool &ok); + int maxPasswordLength); /** Cancels specified note. @@ -129,6 +134,11 @@ */ bool noteShowing(); + /** + Slot for HbDialog finished singal. + */ + void finishedPasswordQueryDialog(HbAction* action); + private: /** @@ -187,7 +197,7 @@ bool m_isNoteShowingOngoing; /** - Password query dialog. Not own. + Password query dialog. Own. */ HbInputDialog *m_passwordDialog; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cppluginlogging.h --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cppluginlogging.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cppluginlogging.h Fri May 14 15:51:57 2010 +0300 @@ -40,19 +40,19 @@ case QtDebugMsg: RDebug::Printf("CpPhoneSettingsPlugins Debug: %s\n", msg); - break; - + break; case QtWarningMsg: RDebug::Printf("CpPhoneSettingsPlugins Warning: %s\n", msg); break; - case QtCriticalMsg: RDebug::Printf("CpPhoneSettingsPlugins Critical: %s\n", msg); - break; - + break; case QtFatalMsg: RDebug::Printf("CpPhoneSettingsPlugins Fatal: %s\n", msg); abort(); + break; + default: + break; } } @@ -71,7 +71,7 @@ Debug macros */ #define DPRINT qDebug() << __PRETTY_FUNCTION__ - +#define DWARNING qWarning() << __PRETTY_FUNCTION__ #endif // CPPHONESETTINGSPLUGINSLOGGING_H diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonelocalisation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonelocalisation.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include "cpphonelocalisation.h" +#include "cppluginlogging.h" +#include +#include +#include + + +// Constant definitions +const char *TS_FILE_TELEPHONE_CP = "telephone_cp"; +const char *TS_FILE_COMMON = "common"; + +/*! + \class CpPhoneLocalisation + \brief Localisation utility class for + Telephony control panel plugins. + + Use installTranslator function for installing + needed translation files. + + Takes ownership of the created QTranslator objects + and destroys them when CpPhoneLocalisation + object is destructed. +*/ + + +/*! + CpPhoneLocalisation::CpPhoneLocalisation() +*/ +CpPhoneLocalisation::CpPhoneLocalisation(QObject *parent) + :QObject(parent) +{ + DPRINT; +} + + +/*! + CpPhoneLocalisation::~CpPhoneLocalisation() +*/ +CpPhoneLocalisation::~CpPhoneLocalisation() +{ + DPRINT << ":IN"; + removeTranslators(); + DPRINT << ":OUT"; +} + + +/*! + CpPhoneLocalisation::installTranslator() +*/ +bool CpPhoneLocalisation::installTranslator( + TranslationFileId translationFileId) +{ + DPRINT << ": IN"; + + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + bool translatorLoaded(false); + + QString fileName; + switch (translationFileId) { + case TranslationFileTelephoneCp: + fileName = TS_FILE_TELEPHONE_CP; + break; + case TranslationFileCommon: + fileName = TS_FILE_COMMON; + break; + default: + break; + } + + if (!fileName.isEmpty()) { + QTranslator* translator = new QTranslator; + translatorLoaded = translator->load( + path + fileName + "_" + lang); + if (translatorLoaded) { + m_translators.append(translator); + qApp->installTranslator(translator); + DPRINT << ": translator installed: " << fileName; + } else { + delete translator; + translator = NULL; + DWARNING << ": WARNING! Translator not loaded!"; + } + } + + DPRINT << ": OUT"; + return translatorLoaded; +} + + +/*! + CpPhoneLocalisation::removeTranslators() +*/ +void CpPhoneLocalisation::removeTranslators() +{ + DPRINT << ": IN"; + + foreach (QTranslator *translator, m_translators) { + qApp->removeTranslator(translator); + } + qDeleteAll(m_translators); + m_translators.clear(); + + DPRINT << ": OUT"; +} + + +// End of File. diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp Fri May 14 15:51:57 2010 +0300 @@ -57,7 +57,7 @@ m_passwordValidator(NULL) { DPRINT << ": IN"; - + m_notesQueue = new QQueue(); m_cpSettingsWrapper = new CpSettingsWrapper; @@ -77,6 +77,10 @@ delete note; } delete m_notesQueue; + if(m_passwordDialog) { + delete m_passwordDialog; + } + DPRINT << ": OUT"; } @@ -92,6 +96,9 @@ HbDeviceProgressDialog *note = new HbDeviceProgressDialog(HbProgressDialog::WaitDialog, this); note->setText(text); + QAction *action = new QAction(hbTrId("txt_common_button_hide"), this); + //Ownership of action is not transferred. Deleted when note closes. + note->setAction(action, HbDeviceProgressDialog::CancelButtonRole ); noteId = reinterpret_cast(note); DPRINT << ", NOTEID: " << noteId; QObject::connect( @@ -175,7 +182,12 @@ HbAction *backAction = new HbAction(hbTrId("txt_common_button_back"), serviceListPopup.data()); serviceListPopup->setPrimaryAction(backAction); - serviceListPopup->exec(); + + HbDialog *serviceListPopupDialog = serviceListPopup.take(); + QObject::connect( + serviceListPopupDialog, SIGNAL(finished(HbAction*)), + serviceListPopupDialog, SLOT(deleteLater())); + serviceListPopupDialog->show(); DPRINT << ": OUT"; } @@ -195,10 +207,7 @@ QObject *note = m_notesQueue->at(index); DPRINT << ": NOTEID: " << noteId; if (qobject_cast(note)) { - // QObject::disconnect( - // note, SIGNAL(cancelled()), - // this, SLOT(ProgresNoteCanceled())); - static_cast(note)->cancel(); + static_cast(note)->close(); } else if (qobject_cast(note)) { static_cast(note)->close(); } else { @@ -326,9 +335,9 @@ { DPRINT << ": IN"; - HbMessageBox *divertInfo = - new HbMessageBox(HbMessageBox::MessageTypeInformation); - divertInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + QScopedPointer divertInfoScopedPointer( + new HbMessageBox(HbMessageBox::MessageTypeInformation)); + divertInfoScopedPointer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // TODO: Orbit layout support is insufficient currently and all text // is not shown. @@ -340,11 +349,17 @@ content.append(QString::number(divertStatus.iTimeout)); content.append(hbTrId(" seconds")); } - divertInfo->setText(content); - HbAction *backAction = new HbAction(hbTrId("txt_common_button_back"), divertInfo); - divertInfo->setPrimaryAction(backAction); - divertInfo->exec(); - delete divertInfo; + divertInfoScopedPointer->setText(content); + HbAction *backAction = new HbAction( + hbTrId("txt_common_button_back"), + divertInfoScopedPointer.data()); + divertInfoScopedPointer->setPrimaryAction(backAction); + + HbMessageBox *divertInfo = divertInfoScopedPointer.take(); + QObject::connect( + divertInfo, SIGNAL(finished(HbAction*)), + divertInfo, SLOT(deleteLater())); + divertInfo->show(); DPRINT << ": OUT"; } @@ -355,9 +370,7 @@ void CpPhoneNotes::showPasswordQueryDialog( const QString &title, const QValidator &validator, - int maxPasswordLength, - QString &password, - bool &ok) + int maxPasswordLength) { DPRINT << ": IN"; @@ -370,32 +383,53 @@ HbLineEdit *hbLineEdit = passwordDialog->lineEdit(); hbLineEdit->setMaxLength(maxPasswordLength); HbEditorInterface editorInterface(hbLineEdit); - editorInterface.setInputMode(HbInputModeNumeric); - editorInterface.setConstraints(HbEditorConstraintFixedInputMode); + + editorInterface.setMode(HbInputModeNumeric); + editorInterface.setInputConstraints(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(); + passwordDialog->open(this, SLOT(finishedPasswordQueryDialog(HbAction*))); + if(m_passwordDialog) { + m_passwordDialog->deleteLater(); + m_passwordDialog = NULL; + } + m_passwordDialog = passwordDialog.take(); + + DPRINT << ": OUT"; +} + +/*! + CpPhoneNotes::finishedPasswordQueryDialog. + */ +void CpPhoneNotes::finishedPasswordQueryDialog(HbAction* action) +{ + bool ok; + QString password; + if(m_passwordDialog) { + if (action == m_passwordDialog->secondaryAction()) { + ok = false; + } else { + ok = true; + password = m_passwordDialog->value().toString(); + } + + disconnect( + m_passwordDialog->lineEdit(), SIGNAL(contentsChanged()), + this, SLOT(passwordTextChanged())); + + m_passwordDialog->deleteLater(); + m_passwordDialog = NULL; + m_passwordValidator = NULL; + + emit passwordQueryCompleted(password, ok); } - - m_passwordDialog = NULL; - m_passwordValidator = NULL; - disconnect( - hbLineEdit, SIGNAL(contentsChanged()), - this, SLOT(passwordTextChanged())); - - DPRINT << ": OUT"; } /*! @@ -442,7 +476,7 @@ static_cast(note)->show(); } else if (qobject_cast(note)) { DPRINT << ", show HbDeviceMessageBox"; - static_cast(note)->exec(); + static_cast(note)->show(); } else { DPRINT << ", UNKNOWN NOTE"; Q_ASSERT(false); @@ -471,6 +505,11 @@ launchNextNoteIfReady(); note->disconnect(this); DPRINT << ", delete note: " << reinterpret_cast(note); + HbDeviceProgressDialog *pNote = + qobject_cast(note); + if(pNote){ + delete pNote->action(); + } note->deleteLater(); } } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/qtestmains60.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/qtestmains60.h Fri May 14 15:51:57 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 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "ut_cpphonelocalisation.h" +#include "qtestmains60.h" +#include +#define private public +#include "cpphonelocalisation.h" + +void QCoreApplication::installTranslator(QTranslator * messageFile) +{ + SMC_MOCK_METHOD1( void, QTranslator *, messageFile) +} + +/*! + UT_cpphonelocalisation::UT_cpphonelocalisation + */ +UT_cpphonelocalisation::UT_cpphonelocalisation() +{ + +} + +/*! + UT_cpphonelocalisation::~UT_cpphonelocalisation + */ +UT_cpphonelocalisation::~UT_cpphonelocalisation() +{ + +} + +/*! + UT_cpphonelocalisation::init + */ +void UT_cpphonelocalisation::init() +{ + initialize(); + + m_phoneLocalisation.reset(new CpPhoneLocalisation); +} + +/*! + UT_cpphonelocalisation::cleanup + */ +void UT_cpphonelocalisation::cleanup() +{ + reset(); + delete m_phoneLocalisation.take(); +} + +/*! + UT_cpphonelocalisation::t_memleak + */ +void UT_cpphonelocalisation::t_memleak() +{ + +} + +/*! + UT_cpphonelocalisation::t_installTranslator + */ +void UT_cpphonelocalisation::t_installTranslator() +{ + + // Test: successfull load + expect("QTranslator::load"). + returns(true); + expect("QCoreApplication::installTranslator").times(1); + + m_phoneLocalisation->installTranslator( + CpPhoneLocalisation::TranslationFileCommon); + QVERIFY(m_phoneLocalisation->m_translators.count() == 1); + QVERIFY(verify()); + + // Test: failing load + expect("QTranslator::load"). + returns(false); + expect("QCoreApplication::installTranslator").times(0); + m_phoneLocalisation->installTranslator( + CpPhoneLocalisation::TranslationFileCommon); + QVERIFY(m_phoneLocalisation->m_translators.count() == 1); + QVERIFY(verify()); + + // Test: telephone_cp translator load + expect("QTranslator::load"). + returns(false); + expect("QCoreApplication::installTranslator").times(0); + m_phoneLocalisation->installTranslator( + CpPhoneLocalisation::TranslationFileTelephoneCp); + QVERIFY(verify()); + +} + +/*! + UT_cpphonelocalisation::t_removeTranslators + */ +void UT_cpphonelocalisation::t_removeTranslators() +{ + expect("QTranslator::load"). + returns(true); + + m_phoneLocalisation->installTranslator( + CpPhoneLocalisation::TranslationFileCommon); + m_phoneLocalisation->installTranslator( + CpPhoneLocalisation::TranslationFileTelephoneCp); + + m_phoneLocalisation->removeTranslators(); + QVERIFY(m_phoneLocalisation->m_translators.count() == 0); + QVERIFY(verify()); +} + + + + +QTEST_MAIN_S60(UT_cpphonelocalisation) diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_CPPHONELOCALISATION_H +#define UT_CPPHONELOCALISATION_H + +#include +#include + +class CpPhoneLocalisation; + +class UT_cpphonelocalisation : public QObject, MockService +{ + Q_OBJECT + +public: + UT_cpphonelocalisation(); + ~UT_cpphonelocalisation(); + +private slots: + void init(); + void cleanup(); + void t_memleak(); + void t_installTranslator(); + void t_removeTranslators(); + +private: + QScopedPointer m_phoneLocalisation; + +}; + +#endif diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.pro Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +CONFIG += qtestlib +CONFIG += hb +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../src/ +INCLUDEPATH += . ../../inc/ +DEFINES += BUILD_CPTELEPHONYUTILS + +QT -= gui +QT += testlib + +symbian: { + CONFIG += no_icon + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib -lsymbianmock +} + +# test code +HEADERS += ut_cpphonelocalisation.h +SOURCES += ut_cpphonelocalisation.cpp + +# code to be tested +HEADERS += ../../inc/cpphonelocalisation.h + +SOURCES += ../../src/cpphonelocalisation.cpp + +# mocks needed for testing +SOURCES += ../../../tsrc/mocks/mock_qtranslator.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp Fri May 14 15:51:57 2010 +0300 @@ -219,7 +219,7 @@ QRegExp regExpression("\\d{4}"); QRegExpValidator validator(regExpression, this); CpPhoneNotes::instance()->showPasswordQueryDialog( - queryTitle, validator, 5, password, okPressed); + queryTitle, validator, 5); } @@ -229,7 +229,11 @@ */ void UT_CpPhoneNotes::t_cancelNote() { + CpPhoneNotes::instance()->cancelNote(m_noteid1); CpPhoneNotes::instance()->showGlobalProgressNote(m_noteid1, "test"); + CpPhoneNotes::instance()->noteShowing(); + CpPhoneNotes::instance()->cancelNote(m_noteid1); + QTest::qWait(5000); } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.cpp Fri May 14 15:51:57 2010 +0300 @@ -26,7 +26,6 @@ { // Install plugin specific msg handler INSTALL_TRACE_MSG_HANDLER; - DPRINT; } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.h Fri May 14 15:51:57 2010 +0300 @@ -30,8 +30,7 @@ public: - CpDivertPlugin(); - + CpDivertPlugin(); ~CpDivertPlugin(); /** diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -15,6 +15,7 @@ * */ +#include #include #include #include @@ -27,9 +28,6 @@ #include #include #include -#include -#include -#include #include #include "cpdivertselectionitem.h" #include "cpdivertplugingroup.h" @@ -42,6 +40,11 @@ Q_DECLARE_METATYPE(PsCallDivertingCondition) Q_DECLARE_METATYPE(PsServiceGroup) +// CONSTANTS +const QString KVoiceMail("voiceMail"); +const QString KVideoMail("voiceMail"); +const QString KOtherNumber("otherNumber"); + /*! CpDivertPluginGroup::CpDivertPluginGroup. */ @@ -61,7 +64,8 @@ m_activeNoteId(0), m_activeProgressNoteId(0), m_divertToVoiceMailBox(false), - m_helper(helper) + m_helper(helper), + m_divertTimeout(0) { DPRINT << ": IN"; @@ -73,18 +77,6 @@ qRegisterMetaType( "PsServiceGroup"); - // Localization file loading - QTranslator translator; - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang); - bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); - DPRINT << ": translator loaded: " << translatorLoaded; - if (translatorLoaded) { - qApp->installTranslator(&translator); - DPRINT << ": translator installed"; - } - m_pSetWrapper = new PSetWrapper; DPRINT << ": PSetWrapper created"; @@ -124,6 +116,9 @@ // Create grouped setting items createVoiceCallItems(this); createVideoCallItems(this); + + m_eventLoop = new QEventLoop(this); + DPRINT << ": OUT"; } @@ -289,8 +284,9 @@ { DPRINT << ": IN"; DPRINT << "item:" << item; + HbDataFormModelItem* modelItem = - qobject_cast(model())->itemFromIndex(item); + qobject_cast(item.model())->itemFromIndex(item); if (!modelItem->contentWidgetData("number").isValid() && (static_cast @@ -712,107 +708,168 @@ 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); - 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]); + if (!m_eventLoop->isRunning()){ + m_divertNumber = ""; + m_divertToVoiceMailBox = false; + QStringList defNumbers; + HbDialog *dialog = createDialog(heading); + m_voiceNumberList = new HbListWidget(dialog); + if (serviceGroup == ServiceGroupVoice) { + addItemToListWidget( + m_voiceNumberList, 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(m_voiceNumberList, defNumbers[i], defNumbers[i]); + } + addItemToListWidget(m_voiceNumberList, hbTrId("txt_phone_list_enter_number_manually"), KOtherNumber ); + dialog->setContentWidget(m_voiceNumberList); + + // Connect list item activation signal to close the popup + QObject::connect(m_voiceNumberList, + SIGNAL(activated(HbListWidgetItem*)), + dialog, + SLOT(close()), + Qt::UniqueConnection); + + // Sets the "Cancel"-action/button + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); + dialog->addAction(cancelAction); + QObject::connect(cancelAction, + SIGNAL(triggered(bool)), + dialog, + SLOT(close())); + + dialog->open(this, SLOT(voiceNumberListQueryClosed(HbAction *))); + + QPointer guard = this; + m_eventLoop->exec(); + if (guard.isNull()) { + requestOK = false; + } else if (!m_divertNumber.isEmpty()) { + result = m_divertNumber; + requestOK = true; + } } - 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(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 == KVoiceMail) { - m_callDivertingWrapper->getVoiceMailBoxNumber(result); - if (result.size()) { - // voicemailboxnumber found - m_divertToVoiceMailBox = true; - requestOK = true; - } - } else if (data == KOtherNumber) { - requestOK = popUpNumberEditor(hbTrId("txt_phone_info_number"), result); - } else { - //TODO if matched contact name not work - result = data; - requestOK = true; - } - } - else { - DPRINT << ": Cancel"; - } - disconnect( - list, SIGNAL(activated(HbListWidgetItem*)), - dialog, SLOT(close())); - delete dialog; + DPRINT << ": OUT : result:" << result; DPRINT << ": OUT : requestOK :" << requestOK; return requestOK; } /*! + CpDivertPluginGroup::voiceNumberListQueryClosed() +*/ +void CpDivertPluginGroup::voiceNumberListQueryClosed(HbAction* action) +{ + DPRINT << ": IN"; + + bool exitLoop(true); + + // Enter if cancel wasn't selected + if (!action) { + // Update the view with selected text + QString data = m_voiceNumberList->currentItem()->data().toString(); + DPRINT << ": data: " << data; + + if (data == KVoiceMail) { + m_callDivertingWrapper->getVoiceMailBoxNumber(m_divertNumber); + if (!m_divertNumber.isEmpty()) { + DPRINT << ": voicemailboxnumber found"; + } + + m_eventLoop->quit(); + + } else if (data == KOtherNumber) { + // Event loop is terminated by popUpNumberEditorClosed + exitLoop = false; + + DPRINT << ": open popUpNumberEditor"; + popUpNumberEditor(hbTrId("txt_phone_info_number"), m_divertNumber); + } else { + //TODO if matched contact name not work + DPRINT << ": else"; + m_divertNumber = data; + } + + } + + if (exitLoop) { + DPRINT << ": quit eventloop"; + m_eventLoop->quit(); + } + + DPRINT << ": OUT"; +} + +/*! CpDivertPluginGroup::popUpNumberEditor. */ -bool CpDivertPluginGroup::popUpNumberEditor( +void CpDivertPluginGroup::popUpNumberEditor( const QString& heading, QString& result) { DPRINT << ": IN"; - bool requestOK(false); + Q_UNUSED(result); + HbDialog *dialog = createDialog(heading); - HbLineEdit *editor = new HbLineEdit(dialog); - HbEditorInterface editorInterface(editor); - editorInterface.setUpAsPhoneNumberEditor(); - dialog->setContentWidget(editor); + + m_voiceNumberEditor = new HbLineEdit(dialog); + m_voiceNumberEditor->setInputMethodHints(Qt::ImhDialableCharactersOnly); + dialog->setContentWidget(m_voiceNumberEditor); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); dialog->addAction(okAction); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); - dialog->setSecondaryAction(cancelAction); + dialog->addAction(cancelAction); + + dialog->open(this, SLOT(popUpNumberEditorClosed(HbAction*))); - HbAction *resultAction = dialog->exec(); - if (resultAction == cancelAction) { - DPRINT << ": canceled"; + DPRINT << ": OUT"; +} + +/*! + CpDivertPluginGroup::popUpNumberEditorClosed. + */ +void CpDivertPluginGroup::popUpNumberEditorClosed(HbAction* action) +{ + DPRINT << ": IN"; + + bool cancelled(true); + if (action) { + if (action->text() == hbTrId("txt_common_button_ok")) + { + cancelled = false; + DPRINT << ": ok selected"; + } } - else { - result = editor->text(); - DPRINT << ": number " - << result; - if (result.count()) { - requestOK = true; - } - else { - CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, - hbTrId("txt_phone_info_invalid_phone_number"), HbMessageBox::MessageTypeWarning); - } + + if (!cancelled) { + m_divertNumber = m_voiceNumberEditor->text(); + DPRINT << ": m_divertNumber " + << m_divertNumber; + if (m_divertNumber.isEmpty()) { + CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, + hbTrId("txt_phone_info_invalid_phone_number"), HbMessageBox::MessageTypeWarning); + } } - delete dialog; - DPRINT << ": OUT : requestOK :" << requestOK; - return requestOK; + if (m_voiceNumberEditor) { + delete m_voiceNumberEditor; + m_voiceNumberEditor = NULL; + } + + m_eventLoop->quit(); + DPRINT << ": OUT"; } /*! @@ -845,50 +902,80 @@ /*! CpDivertPluginGroup::popUpTimerQuery. */ -bool CpDivertPluginGroup::popUpTimerQuery(int &timeout) const +bool CpDivertPluginGroup::popUpTimerQuery(int &timeout) { DPRINT << ": IN"; + Q_UNUSED(timeout); bool requestOK(false); - HbDialog *dialog = createDialog(hbTrId("Time out")); - HbListWidget *list = new HbListWidget(dialog); - addItemToListWidget(list, hbTrId("5 second"), 5 ); - addItemToListWidget(list, hbTrId("10 second"), 10); - addItemToListWidget(list, hbTrId("15 second"), 15); - addItemToListWidget(list, hbTrId("20 second"), 20); - addItemToListWidget(list, hbTrId("25 second"), 25); - addItemToListWidget(list, hbTrId("30 second"), 30); - // 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(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 - if (list->currentItem()) { - timeout = list->currentItem()->data().toInt(); + m_divertTimeout = 0; + + if (!m_eventLoop->isRunning()) { + HbDialog *dialog = createDialog(hbTrId("txt_phone_title_delay")); + + if (m_popupTimerList) { + m_popupTimerList = new HbListWidget(dialog); + + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_5_seconds"), 5 ); + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_10_seconds"), 10); + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_15_seconds"), 15); + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_20_seconds"), 20); + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_25_seconds"), 25); + addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_30_seconds"), 30); + + // Connect list item activation signal to close the popup + QObject::connect( + m_popupTimerList, SIGNAL(activated(HbListWidgetItem*)), + dialog, SLOT(close()), + Qt::UniqueConnection); } - requestOK = true; - } - else { - DPRINT << ": Cancel"; + + // Sets the "Cancel"-action/button + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); + dialog->addAction(cancelAction); + dialog->setContentWidget(m_popupTimerList); + + dialog->open(this, SLOT(popUpTimerQueryClosed(HbAction *))); + + QPointer guard = this; + m_eventLoop->exec(); + if (guard.isNull()) { + requestOK = false; + } else if (m_divertTimeout > 0) { + requestOK = true; + } } - - disconnect( - list, SIGNAL(activated(HbListWidgetItem*)), - dialog, SLOT(close())); - delete dialog; DPRINT << ": OUT : requestOK :" << requestOK; return requestOK; } /*! - CpDivertPluginGroup::setbscParam. + CpDivertPluginGroup::popUpTimerQueryClosed. + */ +void CpDivertPluginGroup::popUpTimerQueryClosed(HbAction* action) +{ + // If not cancel action selected + if (!action) { + // Update the view with selected text + if (m_popupTimerList->currentItem()) { + m_divertTimeout = + m_popupTimerList->currentItem()->data().toInt(); + } + } + else { + DPRINT << ": Cancel"; + } + + DPRINT << ": quit eventloop"; + m_eventLoop->quit(); + + DPRINT << ": OUT: timeout: " << m_divertTimeout; +} + + +/*! + CpDivertPluginGroup::bscParam. */ int CpDivertPluginGroup::bscParam(PsServiceGroup serviceGroup) { diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h Fri May 14 15:51:57 2010 +0300 @@ -34,6 +34,8 @@ class PSCallDivertingCommand; class HbListWidget; class CpDivertItemData; +class QEventLoop; +class HbLineEdit; using namespace CpTelephonyUtils; @@ -101,6 +103,11 @@ Slot which handles item updating when it is needed. */ void itemShown(const QModelIndex& item); + + void voiceNumberListQueryClosed(HbAction* action); + void popUpNumberEditorClosed(HbAction* action); + void popUpTimerQueryClosed(HbAction* action); + private: /** @@ -133,7 +140,7 @@ /** Show to user number query. */ - bool popUpNumberEditor( + void popUpNumberEditor( const QString& heading, QString& result); @@ -145,7 +152,7 @@ /** Show to user divert time out query list. */ - bool popUpTimerQuery(int &timeout) const; + bool popUpTimerQuery(int &timeout); /** Desides which bsc parameters to use. @@ -245,7 +252,7 @@ CpDivertItemData *m_DataItemVideoIfNotAnswered; CpDivertItemData *m_DataItemVideoIfOutOfReach; CpDivertItemData *m_DataItemVideoIfNotAvailable; - + int m_activeNoteId; int m_activeProgressNoteId; @@ -258,8 +265,17 @@ QQueue m_divertRequestQueue; CpItemDataHelper &m_helper; + + int m_divertTimeout; + + HbListWidget *m_voiceNumberList; + HbListWidget *m_popupTimerList; + QString m_divertNumber; + HbLineEdit *m_voiceNumberEditor; + QEventLoop *m_eventLoop; + }; #endif // CPDIVERTPLUGINGROUP_H -// end of file + diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.cpp --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.cpp Fri May 14 15:51:57 2010 +0300 @@ -22,13 +22,15 @@ #include +/*! + CpDivertSelectionCustomitem::CpDivertSelectionCustomitem. + */ CpDivertSelectionCustomitem::CpDivertSelectionCustomitem( QGraphicsItem *parent /**=0*/, Qt::WindowFlags wFlags /**=0*/): HbWidget(parent, wFlags), layout(NULL), checkbox(NULL), - //numberValueLabel(NULL), timeoutLabel(NULL), timeoutValueLabel(NULL), m_state(Disabled) @@ -42,18 +44,11 @@ layout->setRowMaximumHeight(1,0); checkbox = new HbCheckBox(this); - checkbox->setBackgroundItem(HbStyle::P_DataItem_background); - HbStyle::setItemName(checkbox, "dataItem_ContentWidget"); layout->addItem(checkbox, 0, 0, 1, 2); - connect(checkbox,SIGNAL(clicked()), this, SIGNAL(clicked())); - //numberValueLabel = new HbLabel(this); - //layout->addItem(numberValueLabel, 0, 1); - //connect(numberValueLabel,SIGNAL(clicked()), this, SIGNAL(clicked())); - timeoutLabel = new HbLabel(this); HbStyle::setItemName(timeoutLabel, "dataItem_ContentWidget"); timeoutLabel->setAlignment(Qt::AlignRight); @@ -61,7 +56,6 @@ timeoutLabel->hide(); timeoutValueLabel = new HbLabel(this); - timeoutValueLabel->setBackgroundItem(HbStyle::P_DataItem_background); HbStyle::setItemName(timeoutValueLabel, "dataItem_ContentWidget"); timeoutValueLabel->hide(); layout->addItem(timeoutValueLabel, 1, 1); @@ -69,42 +63,69 @@ setLayout(layout); } + +/*! + CpDivertSelectionCustomitem::~CpDivertSelectionCustomitem. + */ CpDivertSelectionCustomitem::~CpDivertSelectionCustomitem() { DPRINT; } + +/*! + CpDivertSelectionCustomitem::number. + */ const QString CpDivertSelectionCustomitem::number() const { DPRINT; return checkbox->text(); } -void CpDivertSelectionCustomitem::setNumber( const QString& number ) + +/*! + CpDivertSelectionCustomitem::setNumber. + */ +void CpDivertSelectionCustomitem::setNumber(const QString& number) { - DPRINT << number; - + DPRINT << number; checkbox->setText(number); } + +/*! + CpDivertSelectionCustomitem::timeout. + */ int CpDivertSelectionCustomitem::timeout() const { DPRINT; return timeoutValueLabel->plainText().toInt(); } -void CpDivertSelectionCustomitem::setTimeout( int timeout) + +/*! + CpDivertSelectionCustomitem::setTimeout. + */ +void CpDivertSelectionCustomitem::setTimeout(int timeout) { DPRINT << timeout; timeoutValueLabel->setPlainText(QString::number(timeout)); } + +/*! + CpDivertSelectionCustomitem::timeoutText. + */ const QString CpDivertSelectionCustomitem::timeoutText() const { DPRINT; return timeoutLabel->plainText(); } + +/*! + CpDivertSelectionCustomitem::setTimeoutText. + */ void CpDivertSelectionCustomitem::setTimeoutText( const QString& text ) { DPRINT << text; @@ -120,22 +141,31 @@ } } + +/*! + CpDivertSelectionCustomitem::state. + */ int CpDivertSelectionCustomitem::state() const { DPRINT << m_state; - return m_state; } + +/*! + CpDivertSelectionCustomitem::setState. + */ void CpDivertSelectionCustomitem::setState(int state) { DPRINT << state; - m_state = state; - updateCheckState(); } + +/*! + CpDivertSelectionCustomitem::updateCheckState. + */ void CpDivertSelectionCustomitem::updateCheckState() { DPRINT << m_state; @@ -155,3 +185,5 @@ break; } } + +// End of File. diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h --- a/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h Fri May 14 15:51:57 2010 +0300 @@ -75,7 +75,6 @@ private: QGraphicsGridLayout *layout; HbCheckBox *checkbox; - //HbLabel *numberValueLabel; HbLabel *timeoutLabel; HbLabel *timeoutValueLabel; int m_state; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def --- a/phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def Fri May 14 15:51:57 2010 +0300 @@ -13,50 +13,66 @@ _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 - _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 + _ZN12CpPhoneNotes22passwordQueryCompletedE7QStringb @ 15 NONAME + _ZN12CpPhoneNotes22showGlobalProgressNoteERiRK7QString @ 16 NONAME + _ZN12CpPhoneNotes23showPasswordQueryDialogERK7QStringRK10QValidatori @ 17 NONAME + _ZN12CpPhoneNotes26handleProgressNoteCanceledEv @ 18 NONAME + _ZN12CpPhoneNotes27finishedPasswordQueryDialogEP8HbAction @ 19 NONAME + _ZN12CpPhoneNotes8instanceEv @ 20 NONAME + _ZN12CpPhoneNotesC1Ev @ 21 NONAME + _ZN12CpPhoneNotesC2Ev @ 22 NONAME + _ZN12CpPhoneNotesD0Ev @ 23 NONAME + _ZN12CpPhoneNotesD1Ev @ 24 NONAME + _ZN12CpPhoneNotesD2Ev @ 25 NONAME + _ZN17CpSettingsWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME + _ZN17CpSettingsWrapper11qt_metacastEPKc @ 27 NONAME + _ZN17CpSettingsWrapper16showCallDurationEv @ 28 NONAME + _ZN17CpSettingsWrapper16staticMetaObjectE @ 29 NONAME DATA 16 + _ZN17CpSettingsWrapper18readSoftRejectTextER7QStringRb @ 30 NONAME + _ZN17CpSettingsWrapper19getStaticMetaObjectEv @ 31 NONAME + _ZN17CpSettingsWrapper19setShowCallDurationEb @ 32 NONAME + _ZN17CpSettingsWrapper19writeSoftRejectTextERK7QStringb @ 33 NONAME + _ZN17CpSettingsWrapper51isFeatureCallWaitingDistiquishNotProvisionedEnabledEv @ 34 NONAME + _ZN17CpSettingsWrapperC1EP7QObject @ 35 NONAME + _ZN17CpSettingsWrapperC2EP7QObject @ 36 NONAME + _ZN17CpSettingsWrapperD0Ev @ 37 NONAME + _ZN17CpSettingsWrapperD1Ev @ 38 NONAME + _ZN17CpSettingsWrapperD2Ev @ 39 NONAME + _ZN5Tools11qt_metacallEN11QMetaObject4CallEiPPv @ 40 NONAME + _ZN5Tools11qt_metacastEPKc @ 41 NONAME + _ZN5Tools13voipSupportedEv @ 42 NONAME + _ZN5Tools14videoSupportedEv @ 43 NONAME + _ZN5Tools16staticMetaObjectE @ 44 NONAME DATA 16 + _ZN5Tools19getStaticMetaObjectEv @ 45 NONAME + _ZN5Tools20errorCodeTextMappingEiR7QString @ 46 NONAME + _ZNK12CpPhoneNotes10metaObjectEv @ 47 NONAME + _ZNK12CpPhoneNotes17formatPhoneNumberE7QString @ 48 NONAME + _ZNK12CpPhoneNotes21basicServiceGroupNameEN16CpTelephonyUtils18BasicServiceGroupsE @ 49 NONAME + _ZNK17CpSettingsWrapper10metaObjectEv @ 50 NONAME + _ZNK17CpSettingsWrapper14isPhoneOfflineEv @ 51 NONAME + _ZNK17CpSettingsWrapper15readCenrepValueElm @ 52 NONAME + _ZNK17CpSettingsWrapper16readCenrepStringElm @ 53 NONAME + _ZNK17CpSettingsWrapper16writeCenrepValueElmRK8QVariant @ 54 NONAME + _ZNK17CpSettingsWrapper23numberGroupingSupportedEv @ 55 NONAME + _ZNK5Tools10metaObjectEv @ 56 NONAME + _ZTI12CpPhoneNotes @ 57 NONAME + _ZTI17CpSettingsWrapper @ 58 NONAME + _ZTI5Tools @ 59 NONAME + _ZTV12CpPhoneNotes @ 60 NONAME + _ZTV17CpSettingsWrapper @ 61 NONAME + _ZTV5Tools @ 62 NONAME + _ZN19CpPhoneLocalisation11qt_metacallEN11QMetaObject4CallEiPPv @ 63 NONAME + _ZN19CpPhoneLocalisation11qt_metacastEPKc @ 64 NONAME + _ZN19CpPhoneLocalisation16staticMetaObjectE @ 65 NONAME DATA 16 + _ZN19CpPhoneLocalisation17installTranslatorENS_17TranslationFileIdE @ 66 NONAME + _ZN19CpPhoneLocalisation17removeTranslatorsEv @ 67 NONAME + _ZN19CpPhoneLocalisation19getStaticMetaObjectEv @ 68 NONAME + _ZN19CpPhoneLocalisationC1EP7QObject @ 69 NONAME + _ZN19CpPhoneLocalisationC2EP7QObject @ 70 NONAME + _ZN19CpPhoneLocalisationD0Ev @ 71 NONAME + _ZN19CpPhoneLocalisationD1Ev @ 72 NONAME + _ZN19CpPhoneLocalisationD2Ev @ 73 NONAME + _ZNK19CpPhoneLocalisation10metaObjectEv @ 74 NONAME + _ZTI19CpPhoneLocalisation @ 75 NONAME + _ZTV19CpPhoneLocalisation @ 76 NONAME diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp Fri May 14 15:51:57 2010 +0300 @@ -14,29 +14,52 @@ * Description: * */ - #include #include #include "cptelephonyplugin.h" #include "cptelephonypluginview.h" #include "cppluginlogging.h" -CpTelephonyPlugin::CpTelephonyPlugin() : QObject(0) + +/*! + CpTelephonyPlugin::CpTelephonyPlugin() +*/ +CpTelephonyPlugin::CpTelephonyPlugin() : + QObject(0), + m_localisation(0) { // Install plugin specific msg handler INSTALL_TRACE_MSG_HANDLER; + DPRINT << ": IN"; + + // Set scoped pointer + m_localisation.reset(new CpPhoneLocalisation(this)); + + // Install required translations + m_localisation->installTranslator( + CpPhoneLocalisation:: + TranslationFileCommon); + m_localisation->installTranslator( + CpPhoneLocalisation:: + TranslationFileTelephoneCp); - DPRINT; + DPRINT << ": OUT"; } +/*! + CpTelephonyPlugin::~CpTelephonyPlugin() +*/ CpTelephonyPlugin::~CpTelephonyPlugin() { DPRINT; - + // Uninstall plugin specific msg handler UNINSTALL_TRACE_MSG_HANDLER; } +/*! + CpTelephonyPlugin::createSettingFormItemData() const +*/ QList CpTelephonyPlugin::createSettingFormItemData( CpItemDataHelper &itemDataHelper) const { diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.h --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.h Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.h Fri May 14 15:51:57 2010 +0300 @@ -18,8 +18,10 @@ #ifndef CPTELEPHONYPLUGIN_H #define CPTELEPHONYPLUGIN_H -#include +#include +#include #include +#include "cpphonelocalisation.h" /*! \class CpTelephonyPlugin @@ -43,6 +45,10 @@ */ QList createSettingFormItemData( CpItemDataHelper &itemDataHelper) const; + +private: + + QScopedPointer m_localisation; }; #endif /* CPTELEPHONYPLUGIN_H */ diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp --- a/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp Fri May 14 15:51:57 2010 +0300 @@ -18,9 +18,6 @@ #include "cptelephonypluginview.h" #include "cppluginlogging.h" #include -#include -#include -#include #include #include #include @@ -28,24 +25,16 @@ #include #include + +/*! + CpTelephonyPluginView::CpTelephonyPluginView() +*/ CpTelephonyPluginView::CpTelephonyPluginView() : CpBaseSettingView(0,0), m_helper(NULL) { DPRINT << ": IN"; - // Localization file loading - QTranslator translator; - QString lang = QLocale::system().name(); - QString path = "z:/resource/qt/translations/"; - DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang); - bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); - DPRINT << ": translator loaded: " << translatorLoaded; - if (translatorLoaded) { - qApp->installTranslator(&translator); - DPRINT << ": translator installed"; - } - HbDataForm *form = qobject_cast(widget()); if (form) { HbDataFormModel *model = new HbDataFormModel; @@ -81,6 +70,9 @@ DPRINT << ": OUT"; } +/*! + CpTelephonyPluginView::~CpTelephonyPluginView() +*/ CpTelephonyPluginView::~CpTelephonyPluginView() { DPRINT << ": IN"; @@ -90,6 +82,9 @@ DPRINT << ": OUT"; } +/*! + CpTelephonyPluginView::groupItemFromPlugin() +*/ QList CpTelephonyPluginView::groupItemFromPlugin( const QString& plugin ) { DPRINT << ": IN"; @@ -110,6 +105,9 @@ return items; } +/*! + CpTelephonyPluginView::initializeItemDataHelper() +*/ CpItemDataHelper* CpTelephonyPluginView::initializeItemDataHelper() { DPRINT; diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp Fri May 14 15:51:57 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 @@ -38,6 +38,7 @@ :CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId("Barring"),0), m_helper(helper) { + } @@ -55,10 +56,11 @@ // CpBarringPluginGroup::itemShown // ----------------------------------------------------------------------------- // -void CpBarringPluginGroup::itemShown(const QModelIndex& item) -{ - SMC_MOCK_METHOD1( void, QModelIndex &, item ) -} +void CpBarringPluginGroup::itemShown( + const QModelIndex & item ) + { + SMC_MOCK_METHOD1( void, const QModelIndex &, item ) + } // ----------------------------------------------------------------------------- @@ -150,3 +152,29 @@ { SMC_MOCK_METHOD0( void ) } + + +// ----------------------------------------------------------------------------- +// CpBarringPluginGroup::completeBarringStateChangeRequestHandling +// ----------------------------------------------------------------------------- +// +void CpBarringPluginGroup::completeBarringStateChangeRequestHandling( + QString barringPassword, + bool okPressed) +{ + SMC_MOCK_METHOD2( void, QString, barringPassword, bool, okPressed) +} + + +// ----------------------------------------------------------------------------- +// CpBarringPluginGroup::changeBarringPasswordPhasesHandling +// ----------------------------------------------------------------------------- +// +void CpBarringPluginGroup::changeBarringPasswordPhasesHandling( + QString barringPassword, + bool okPressed) +{ + SMC_MOCK_METHOD2( void, QString, barringPassword, bool, okPressed) +} + + diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugingroup.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugingroup.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugingroup.cpp Fri May 14 15:51:57 2010 +0300 @@ -46,9 +46,9 @@ // CpCallsPluginGroup::showCallDurationStateChanged // ----------------------------------------------------------------------------- // -void CpCallsPluginGroup::showCallDurationStateChanged( int state ) +void CpCallsPluginGroup::showCallDurationStateChanged( ) { - Q_UNUSED( state ) + } @@ -66,9 +66,9 @@ // CpCallsPluginGroup::callWaitingCurrentIndexChanged // ----------------------------------------------------------------------------- // -void CpCallsPluginGroup::callWaitingCurrentIndexChanged( int index ) +void CpCallsPluginGroup::callWaitingCurrentIndexChanged( ) { - Q_UNUSED( index ) + } diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp Fri May 14 15:51:57 2010 +0300 @@ -49,6 +49,16 @@ } + +// ----------------------------------------------------------------------------- +// CpNetworkPluginForm::searchAvailableNetworks +// ----------------------------------------------------------------------------- +// +void CpNetworkPluginForm::searchAvailableNetworks( ) + { + SMC_MOCK_METHOD0( void ) + } + // ----------------------------------------------------------------------------- // CpNetworkPluginForm::cellularDataUseHomeStateChanged // ----------------------------------------------------------------------------- diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp Fri May 14 15:51:57 2010 +0300 @@ -44,3 +44,13 @@ } +// ----------------------------------------------------------------------------- +// CpNetworkPluginView::SearchAvailableNetworks +// ----------------------------------------------------------------------------- +// +void CpNetworkPluginView::SearchAvailableNetworks( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonelocalisation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonelocalisation.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "cpphonelocalisation.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CpPhoneLocalisation::CpPhoneLocalisation +// ----------------------------------------------------------------------------- +// +CpPhoneLocalisation::CpPhoneLocalisation( + QObject * parent ) + //: + //QObject( /*parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// CpPhoneLocalisation::~CpPhoneLocalisation +// ----------------------------------------------------------------------------- +// +CpPhoneLocalisation::~CpPhoneLocalisation( ) + { + + } + + +// ----------------------------------------------------------------------------- +// CpPhoneLocalisation::installTranslator +// ----------------------------------------------------------------------------- +// +bool CpPhoneLocalisation::installTranslator( + TranslationFileId translationFileId ) + { + SMC_MOCK_METHOD1( bool, TranslationFileId, translationFileId ) + } + + +// ----------------------------------------------------------------------------- +// CpPhoneLocalisation::removeTranslators +// ----------------------------------------------------------------------------- +// +void CpPhoneLocalisation::removeTranslators( ) + { + SMC_MOCK_METHOD0( void ) + } + + diff -r 2f8f8080a020 -r ebdbd102c78a phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp --- a/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp Fri May 14 15:51:57 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 @@ -48,15 +48,16 @@ } - - // ----------------------------------------------------------------------------- // CpPhoneNotes::showGlobalProgressNote // ----------------------------------------------------------------------------- // -void CpPhoneNotes::showGlobalProgressNote( int & noteId, const QString & text ) +void CpPhoneNotes::showGlobalProgressNote( + int & noteId, + const QString & text ) { - SMC_MOCK_METHOD2( void, int &, noteId, const QString &, text ) + SMC_MOCK_METHOD2( void, int &, noteId, + const QString &, text ) } @@ -79,22 +80,27 @@ // CpPhoneNotes::showGlobalErrorNote // ----------------------------------------------------------------------------- // -void CpPhoneNotes::showGlobalErrorNote( int & noteId, int errorCode ) +void CpPhoneNotes::showGlobalErrorNote( + int & noteId, + int errorCode ) { - SMC_MOCK_METHOD2( void, int &, noteId, int, errorCode ) + SMC_MOCK_METHOD2( void, int &, noteId, + int, errorCode ) } + // ----------------------------------------------------------------------------- // CpPhoneNotes::showBasicServiceList // ----------------------------------------------------------------------------- // -void CpPhoneNotes::showBasicServiceList( - const QString &title, - const QList &basicServiceGroupIds) -{ +void CpPhoneNotes::showBasicServiceList( + const QString & title, + const QList & basicServiceGroupIds ) + { SMC_MOCK_METHOD2( void, const QString &, title, const QList &, basicServiceGroupIds ) -} + } + // ----------------------------------------------------------------------------- // CpPhoneNotes::showCallDivertDetails @@ -111,27 +117,23 @@ // 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) -} +void CpPhoneNotes::showPasswordQueryDialog( + const QString & title, + const QValidator & validator, + int maxPasswordLength ) + { + SMC_MOCK_METHOD3( void, const QString &, title, + const QValidator &, validator, + int, maxPasswordLength ) + } // ----------------------------------------------------------------------------- // CpPhoneNotes::cancelNote // ----------------------------------------------------------------------------- // -void CpPhoneNotes::cancelNote( int noteId ) +void CpPhoneNotes::cancelNote( + int noteId ) { SMC_MOCK_METHOD1( void, int, noteId ) } @@ -141,10 +143,21 @@ // CpPhoneNotes::noteShowing // ----------------------------------------------------------------------------- // -bool CpPhoneNotes::noteShowing() -{ +bool CpPhoneNotes::noteShowing( ) + { SMC_MOCK_METHOD0( bool ) -} + } + + +// ----------------------------------------------------------------------------- +// CpPhoneNotes::finishedPasswordQueryDialog +// ----------------------------------------------------------------------------- +// +void CpPhoneNotes::finishedPasswordQueryDialog( + HbAction * action ) + { + //SMC_MOCK_METHOD1( void, HbAction *, action ) + } // ----------------------------------------------------------------------------- @@ -172,7 +185,10 @@ // ----------------------------------------------------------------------------- // + void CpPhoneNotes::passwordTextChanged() { SMC_MOCK_METHOD0( void ) } + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/bubblecore.qrc --- a/phoneuis/bubblemanager2/bubblecore/bubblecore.qrc Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/bubblecore.qrc Fri May 14 15:51:57 2010 +0300 @@ -42,7 +42,6 @@ themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg - resources/qgn_indi_call_muted.svg 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 @@ -53,5 +52,13 @@ themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg effects/bubble_muted_disappear.fxml effects/bubble_muted_appear.fxml + xml/bubbleheadingwidget.widgetml + xml/bubbleimagewidget.css + xml/bubbleimagewidget.widgetml + xml/bubbleparticipantlistitem.css + xml/bubbleparticipantlistitem.widgetml + xml/bubbleheadingwidget.css + themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg + resources/bubble_icon_anim.axml diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/resources/bubble_icon_anim.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/resources/bubble_icon_anim.axml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,19 @@ + + + + +qtg_large_active_call +qtg_large_waiting_call + + + +qtg_large_video_call_active +qtg_large_video_call_waiting + + + +qtg_large_voip_call_active +qtg_large_voip_call_waiting + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/resources/qgn_indi_call_muted.svg --- a/phoneuis/bubblemanager2/bubblecore/resources/qgn_indi_call_muted.svg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblebutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblebutton.cpp Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,91 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Custom button +* +*/ + +#include +#include + +#include "bubblebutton.h" + +BubbleButton::BubbleButton(QGraphicsItem *parent) + : HbPushButton(parent), mButtonType(DefaultButton) +{ +} + +BubbleButton::~BubbleButton() +{ +} + +BubbleButton::BubbleButtonType BubbleButton::buttonType() const +{ + return mButtonType; +} + +void BubbleButton::setButtonType(BubbleButtonType type) +{ + mButtonType = type; +} + +bool BubbleButton::sceneEvent(QEvent *event) +{ + bool result = HbPushButton::sceneEvent(event); + + if (event->type() == QEvent::UngrabMouse) { + if (isDown()) { + // this is needed in situation, where + // longpress launches a dialog (vmbx) + // and button release event goes to + // dialog (HbPopup grabs mouse). + setDown(false); + emit clicked(); + emit released(); + } + } + + return result; +} + +void BubbleButton::updatePrimitives() +{ + HbPushButton::updatePrimitives(); + + HbFrameItem* frame = + qgraphicsitem_cast(HbWidget::primitive("background")); + + if (!frame) { + return; + } + + QString graphicsName; + + if (isDown()) { + if (buttonType()==GreenButton) { + graphicsName = "qtg_fr_btn_green_pressed"; + } else if (buttonType()==RedButton) { + graphicsName = "qtg_fr_btn_red_pressed"; + } + } else { + if (buttonType()==GreenButton) { + graphicsName = "qtg_fr_btn_green_normal"; + } else if (buttonType()==RedButton) { + graphicsName = "qtg_fr_btn_red_normal"; + } + } + + if (graphicsName.length()) { + frame->frameDrawer().setFrameGraphicsName(graphicsName); + } +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblebutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblebutton.h Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,53 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Custom button +* +*/ + +#ifndef BUBBLEBUTTON_H +#define BUBBLEBUTTON_H + +#include "hbpushbutton.h" + +class BubbleButton : public HbPushButton +{ + Q_OBJECT + + Q_PROPERTY(BubbleButtonType buttonType READ buttonType WRITE setButtonType) + Q_ENUMS(BubbleButtonType) + +public: + enum BubbleButtonType { + DefaultButton = 0x1, + GreenButton = 0x2, + RedButton = 0x3 + }; + +public: + explicit BubbleButton(QGraphicsItem *parent = 0 ); + virtual ~BubbleButton( ); + + BubbleButtonType buttonType() const; + void setButtonType(BubbleButtonType type); + + void updatePrimitives(); + +protected: + bool sceneEvent(QEvent *event); + +private: + BubbleButtonType mButtonType; +}; + +#endif // BUBBLEBUTTON_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblebuttonstyle.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblebuttonstyle.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +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: Custom style for push buttons. -* -*/ - -#include -#include -#include -#include -#include -#include - -#include "bubblebuttonstyle.h" - -BubbleButtonStyle::BubbleButtonStyle() : mButtonColor(Default) -{ -} - -BubbleButtonStyle::~BubbleButtonStyle() -{ -} - -void BubbleButtonStyle::setButtonColor(ButtonColor color) -{ - mButtonColor = color; -} - -void BubbleButtonStyle::updatePrimitive( - QGraphicsItem *item, - HbStyle::Primitive primitive, - const QStyleOption *option ) const -{ - switch(primitive){ - case P_PushButton_background:{ - const HbStyleOptionPushButton *opt = - qstyleoption_cast(option); - HbFrameItem *frameItem = qgraphicsitem_cast( item ); - if(!frameItem) - return; - - frameItem->setZValue(-1.0); - if(opt->backgroundFrameDrawer &&!(opt->backgroundFrameDrawer->isNull())) { - frameItem->setFrameDrawer( (opt->backgroundFrameDrawer)); - } else { - QString frameGraphicsName; - QIcon::Mode mode = QIcon::Disabled; - QIcon::State state = QIcon::Off; - if (opt->state & QStyle::State_Enabled) - mode = QIcon::Normal; - if (opt->state & QStyle::State_Active) - mode = QIcon::Active; - if (opt->state & QStyle::State_Selected) - mode = QIcon::Selected; - if (opt->state & QStyle::State_On) - state = QIcon::On; - - if (mode == QIcon::Disabled && state == QIcon::Off) { - frameGraphicsName = "qtg_fr_btn_disabled"; - } else if (mode == QIcon::Normal && state == QIcon::On) { - if (mButtonColor==Green) { - frameGraphicsName = "qtg_fr_btn_green_pressed"; - } else if (mButtonColor==Red) { - frameGraphicsName = "qtg_fr_btn_red_pressed"; - } else { - frameGraphicsName = "qtg_fr_btn_pressed"; - } - } else if (mode == QIcon::Selected && state == QIcon::Off) { - frameGraphicsName = "qtg_fr_btn_highlight"; - } else { - if (mButtonColor==Green) { - frameGraphicsName = "qtg_fr_btn_green_normal"; - } else if (mButtonColor==Red) { - frameGraphicsName = "qtg_fr_btn_red_normal"; - } else { - frameGraphicsName = "qtg_fr_btn_normal"; - } - } - - frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); - if (!opt->background.isNull()) { - QString customName = opt->background.iconName(mode, state); - frameItem->frameDrawer().setFrameGraphicsName(customName); - frameItem->setGeometry(opt->rect); - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - break; - } - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - } - - frameItem->setGeometry(opt->rect); - } - break; - - case P_PushButton_icon: - { - HbStyle::updatePrimitive(item,primitive,option); - - HbIconItem *iconItem = static_cast(item); - - if (iconItem) { - if (mButtonColor==Green || mButtonColor==Red) { - iconItem->setColor(Qt::white); - } else { - QColor color; - color = HbColorScheme::color("qtc_button_normal"); - if (color.isValid()) { - iconItem->setColor(color); - } - } - } - } - break; - - default: - HbStyle::updatePrimitive(item,primitive,option); - break; - } // switch -} - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblebuttonstyle.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubblebuttonstyle.h Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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: Custom style for push buttons. -* -*/ - -#ifndef BUBBLEBUTTONSTYLE_H_ -#define BUBBLEBUTTONSTYLE_H_ - -#include - -class BubbleButtonStyle : public HbStyle -{ -public: - enum ButtonColor - { - Default, - Green, - Red, - }; - -public: - explicit BubbleButtonStyle(); - virtual ~BubbleButtonStyle(); - - void setButtonColor(ButtonColor color); - - void updatePrimitive( - QGraphicsItem *item, - HbStyle::Primitive primitive, - const QStyleOption *option ) const; - -protected: - ButtonColor mButtonColor; -}; - -#endif /* BUBBLEBUTTONSTYLE_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -27,9 +26,9 @@ #include "bubbleconferencehandler.h" #include "bubbleconferenceheader.h" #include "bubbleutils.h" -#include "bubblebuttonstyle.h" #include "bubbleparticipantlistitem.h" #include "bubbleparticipantlistmodel.h" +#include "bubblebutton.h" static const int BUBBLE_SELECTION_TIMEOUT = 3000; @@ -50,13 +49,13 @@ mTimerLabel->setAlignment(Qt::AlignLeft); mButtonCenter = - qobject_cast(widget(BubbleWidgetManager::CenterButton)); + qobject_cast(widget(BubbleWidgetManager::CenterButton)); Q_ASSERT(mButtonCenter); mButtonLeft = - qobject_cast(widget(BubbleWidgetManager::LeftButton)); + qobject_cast(widget(BubbleWidgetManager::LeftButton)); Q_ASSERT(mButtonLeft); mButtonRight = - qobject_cast(widget(BubbleWidgetManager::RightButton)); + qobject_cast(widget(BubbleWidgetManager::RightButton)); Q_ASSERT(mButtonRight); mList = @@ -70,8 +69,10 @@ widgetManager.createParticipantListItem()); Q_ASSERT(mPrototype); mList->setItemPrototype(mPrototype); - connect(mPrototype,SIGNAL(selectionChanged(int)), - SLOT(handleItemSelected(int))); + connect(mList->selectionModel(), + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, + SLOT(handleItemSelected(QModelIndex,QModelIndex))); mSelectionTimer = new QTimer(this); connect(mSelectionTimer,SIGNAL(timeout()),SLOT(clearSelection())); @@ -107,6 +108,13 @@ Q_ASSERT(header.isConference()); mHeader = static_cast(&header); + // set actions to item prototype + QList prototypes = mList->itemPrototypes(); + QList actions = mHeader->participantListActions(); + foreach (HbAction* action, actions ) { + mPrototype->addAction(action); + } + // populate participant list model QList participants = mHeader->headers(); foreach(BubbleHeader* participant, participants) { @@ -117,13 +125,6 @@ !(mHeader->callFlags()&BubbleManagerIF::NoCiphering)); } - // set actions to item prototype - QList prototypes = mList->itemPrototypes(); - QList actions = mHeader->participantListActions(); - foreach (HbAction* action, actions ) { - mPrototype->addAction(action); - } - if (header.timerCost().length()) { QColor color; color = HbColorScheme::color("list_item_title_normal"); @@ -188,15 +189,21 @@ mTimerLabel->update(); } -void BubbleConferenceHandler::handleItemSelected(int row) +void BubbleConferenceHandler::handleItemSelected( + const QModelIndex & current, + const QModelIndex & previous ) { - Q_ASSERT( mHeader != 0 ); - // need to cast constness away - BubbleConferenceHeader& mutableHeader = - const_cast(*mHeader); - mutableHeader.setSelectedHeader(mModel->bubbleId(row)); - mSelectionTimer->stop(); - mSelectionTimer->start(BUBBLE_SELECTION_TIMEOUT); + Q_UNUSED(previous); + + if (current.isValid()) { + Q_ASSERT( mHeader != 0 ); + // need to cast constness away + BubbleConferenceHeader& mutableHeader = + const_cast(*mHeader); + mutableHeader.setSelectedHeader(mModel->bubbleId(current.row())); + mSelectionTimer->stop(); + mSelectionTimer->start(BUBBLE_SELECTION_TIMEOUT); + } } void BubbleConferenceHandler::clearSelection() diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.h Fri May 14 15:51:57 2010 +0300 @@ -23,7 +23,7 @@ class BubbleHeader; class HbAction; -class HbPushButton; +class BubbleButton; class HbLabel; class BubbleConferenceHeader; class HbListWidgetItem; @@ -31,6 +31,7 @@ class HbListView; class BubbleParticipantListModel; class QTimer; +class QModelIndex; class BubbleConferenceHandler : public BubbleHandler { @@ -60,15 +61,16 @@ void conferenceRemoved(); protected slots: - void handleItemSelected(int row); + void handleItemSelected( const QModelIndex& current, + const QModelIndex& previous); void clearSelection(); protected: //data const BubbleConferenceHeader* mHeader; HbLabel* mTimerLabel; - HbPushButton* mButtonCenter; - HbPushButton* mButtonLeft; - HbPushButton* mButtonRight; + BubbleButton* mButtonCenter; + BubbleButton* mButtonLeft; + BubbleButton* mButtonRight; HbListView* mList; BubbleParticipantListModel* mModel; BubbleParticipantListItem* mPrototype; // not owned diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -20,46 +20,32 @@ #include #include #include "bubblecontainerwidget.h" -#include "bubbleprimitives.h" -#include "bubblestyleoption.h" -BubbleContainerWidget::BubbleContainerWidget( - const QString& stylePluginName, QGraphicsItem* item) - : HbWidget(item), mStylePluginName(stylePluginName), - mBackground(0) +BubbleContainerWidget::BubbleContainerWidget(QGraphicsItem* item) + : HbWidget(item), mBackground(0) { - setPluginBaseId(style()->registerPlugin(mStylePluginName)); - Q_ASSERT(pluginBaseId()!=-1); - createPrimitives(); updatePrimitives(); + Q_ASSERT(mBackground); } BubbleContainerWidget::~BubbleContainerWidget() { - style()->unregisterPlugin(mStylePluginName); } void BubbleContainerWidget::createPrimitives() { - QGraphicsItem *background = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame), this); + delete mBackground; + mBackground = new HbFrameItem(this); style()->setItemName(mBackground, "background"); - - delete mBackground; - mBackground = - qgraphicsitem_cast(background); + mBackground->setZValue(-1.0); + mBackground->setVisible(false); // background in drawn in paint() } void BubbleContainerWidget::updatePrimitives() { - if (mBackground) { - BubbleStyleOption option; - style()->updatePrimitive( - mBackground, (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame), - &option); - mBackground->setVisible(false); // background in drawn in paint() - } + mBackground->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mBackground->frameDrawer().setFrameGraphicsName("qtg_fr_list_normal"); } void BubbleContainerWidget::mousePressEvent( @@ -89,7 +75,7 @@ } void BubbleContainerWidget::mouseReleaseEvent( - QGraphicsSceneMouseEvent * event) + QGraphicsSceneMouseEvent *event) { if (event->button() != Qt::LeftButton) { event->ignore(); @@ -111,8 +97,12 @@ Q_UNUSED(widget) Q_UNUSED(option) - if (mBackground) { - mBackground->frameDrawer().paint(painter,boundingRect()); - } + mBackground->frameDrawer().paint(painter,boundingRect()); } +void BubbleContainerWidget::showEvent(QShowEvent *event) +{ + Q_UNUSED(event) + mPressed = false; +} + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.h Fri May 14 15:51:57 2010 +0300 @@ -27,8 +27,7 @@ Q_OBJECT public: - BubbleContainerWidget(const QString& stylePluginName, - QGraphicsItem* item=0); + BubbleContainerWidget(QGraphicsItem* item=0); virtual ~BubbleContainerWidget(); signals: @@ -47,8 +46,9 @@ const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + void showEvent(QShowEvent *event); + private: - QString mStylePluginName; HbFrameItem* mBackground; bool mPressed; }; diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri --- a/phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri Fri May 14 15:51:57 2010 +0300 @@ -18,7 +18,6 @@ src/bubbleimagewidget.h \ src/bubbleheader.h \ src/bubbleutils.h \ - src/bubblebuttonstyle.h \ src/bubbleconferenceheader.h \ src/bubbleparticipantlistitem.h \ src/bubbleparticipantlistmodel.h \ @@ -31,14 +30,14 @@ src/bubbleconferencehandler.h \ src/bubbleimagemanager.h \ src/bubbleimagemanager_p.h \ - src/bubbleeffecthandler.h + src/bubbleeffecthandler.h \ + src/bubblebutton.h + SOURCES += src/bubblemanager2.cpp \ src/bubbleheader.cpp \ src/bubbleimagewidget.cpp \ src/bubbleutils.cpp \ - src/bubblestyleoption.cpp \ - src/bubblebuttonstyle.cpp \ src/bubbleconferenceheader.cpp \ src/bubbleparticipantlistitem.cpp \ src/bubbleparticipantlistmodel.cpp \ @@ -50,7 +49,8 @@ src/bubblecollapsedhandler.cpp \ src/bubbleconferencehandler.cpp \ src/bubbleimagemanager.cpp \ - src/bubbleeffecthandler.cpp + src/bubbleeffecthandler.cpp \ + src/bubblebutton.cpp symbian { SOURCES += src/bubbleimagemanager_p.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -17,7 +17,6 @@ #include #include -#include #include #include "bubblemanager2.h" @@ -26,6 +25,7 @@ #include "bubbleutils.h" #include "bubbleimagewidget.h" #include "bubbleheadingwidget.h" +#include "bubblebutton.h" BubbleExpandedHandler::BubbleExpandedHandler( BubbleWidgetManager& widgetManager, @@ -42,13 +42,13 @@ widget(BubbleWidgetManager::Image)); Q_ASSERT(mImage); - mButtonCenter = qobject_cast( + mButtonCenter = qobject_cast( widget(BubbleWidgetManager::CenterButton)); Q_ASSERT(mButtonCenter); - mButtonLeft = qobject_cast( + mButtonLeft = qobject_cast( widget(BubbleWidgetManager::LeftButton)); Q_ASSERT(mButtonLeft); - mButtonRight = qobject_cast( + mButtonRight = qobject_cast( widget(BubbleWidgetManager::RightButton)); Q_ASSERT(mButtonRight); diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.h Fri May 14 15:51:57 2010 +0300 @@ -22,7 +22,7 @@ class BubbleHeader; class HbAction; -class HbPushButton; +class BubbleButton; class BubbleImageWidget; class BubbleHeadingWidget; @@ -56,9 +56,9 @@ BubbleImageWidget* mImage; - HbPushButton* mButtonCenter; - HbPushButton* mButtonLeft; - HbPushButton* mButtonRight; + BubbleButton* mButtonCenter; + BubbleButton* mButtonLeft; + BubbleButton* mButtonRight; }; #endif /* BUBBLEEXPANDEDHANDLER_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -18,32 +18,56 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include + #include "bubbleheadingwidget.h" -#include "bubbleprimitives.h" -#include "bubblestyleoption.h" #include "bubblemanager2.h" #include "bubbleutils.h" #include "bubbleheader.h" -BubbleHeadingWidget::BubbleHeadingWidget( - const QString& stylePluginName, QGraphicsItem* item) - : HbWidget(item), mStylePluginName(stylePluginName), mStatusIcon(0), - mNumberTypeIcon(0), mCipheringIcon(0), mText1(0), mText2(0), mText3(0) +BubbleHeadingWidget::BubbleHeadingWidget(QGraphicsItem* item) + : HbWidget(item), mStatusIcon(0), mNumberTypeIcon(0), + mCipheringIcon(0), mText1(0), mText2(0), mText3(0) { - setPluginBaseId(style()->registerPlugin(mStylePluginName)); - Q_ASSERT(pluginBaseId()!=-1); + createPrimitives(); + + HbStyleLoader::registerFilePath(":/bubbleheadingwidget.css"); + HbStyleLoader::registerFilePath(":/bubbleheadingwidget.widgetml"); - createPrimitives(); + // font is update in code, because cli position is changing + mCliFont = new HbFontSpec(HbFontSpec::Primary); + mTextFont = new HbFontSpec(HbFontSpec::Secondary); + + HbDeviceProfile profile; + mCliFont->setTextHeight(4*HbDeviceProfile::current().unitValue()); + mTextFont->setTextHeight(4*HbDeviceProfile::current().unitValue()); + + HbIconAnimationManager *mgr = HbIconAnimationManager::global(); + mgr->addDefinitionFile(":/bubble_icon_anim.axml"); } BubbleHeadingWidget::~BubbleHeadingWidget() { - style()->unregisterPlugin(mStylePluginName); + delete mCliFont; + delete mTextFont; } void BubbleHeadingWidget::reset() { mHeader = 0; + mText1->setText(QString()); + mText2->setText(QString()); + mText3->setText(QString()); + mStatusIcon->hide(); + mStatusIcon->animator().stopAnimation(); + mNumberTypeIcon->hide(); + mCipheringIcon->hide(); } void BubbleHeadingWidget::readBubbleHeader(const BubbleHeader& header) @@ -54,127 +78,88 @@ void BubbleHeadingWidget::createPrimitives() { - delete mText1; - mText1 = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text), this); + mText1 = new HbTextItem(this); style()->setItemName( mText1, "text_line_1" ); - delete mText2; - mText2 = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Text2_text), this); + mText2 = new HbTextItem(this); style()->setItemName( mText2, "text_line_2" ); - delete mText3; - mText3 = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Text3_text), this); + mText3 = new HbTextItem(this); style()->setItemName( mText3, "text_line_3" ); - delete mNumberTypeIcon; - mNumberTypeIcon = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_NumberType_icon), this); + //mStatusIcon = new BubbleAnimIconItem(BUBBLE_ICON_ANIM_INTERVAL, this); + mStatusIcon = new HbIconItem(this); + style()->setItemName( mStatusIcon, "status_icon" ); + + mNumberTypeIcon = new HbIconItem(this); style()->setItemName( mNumberTypeIcon, "number_type_icon" ); - delete mCipheringIcon; - mCipheringIcon = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon), this); + mCipheringIcon = new HbIconItem(this); style()->setItemName( mCipheringIcon, "ciphering_icon" ); - - delete mStatusIcon; - mStatusIcon = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), this); - style()->setItemName( mStatusIcon, "status_icon" ); } void BubbleHeadingWidget::updatePrimitives() { - BubbleStyleOption option; - initStyleOption(option); + if (mHeader!=0) { + BubbleUtils::setCallStatusIcon( + mHeader->callState(), mHeader->callFlags(), *mStatusIcon); - if (mText1) { - style()->updatePrimitive( - mText1, - (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text), - &option); - } + BubbleUtils::setNumberTypeIcon( + mHeader->callState(), mHeader->callFlags(), *mNumberTypeIcon); - if (mText2) { - style()->updatePrimitive( - mText2, - (HbStyle::Primitive)(pluginBaseId()+BP_Text2_text), - &option); - } + BubbleUtils::setCipheringIcon( + mHeader->callState(), mHeader->callFlags(), *mCipheringIcon); + + // update text lines + int cliLine = 0; - if (mText3) { - style()->updatePrimitive( - mText3, - (HbStyle::Primitive)(pluginBaseId()+BP_Text3_text), - &option); - } + if (lines==3) { + BubbleUtils::setCallHeaderTexts3Lines( + *mHeader, *mText1, *mText2, *mText3, cliLine, + mCallTimerTextLine ); + } else if (lines==2) { + BubbleUtils::setCallHeaderTexts2Lines( + *mHeader, *mText1, *mText2, cliLine, + mCallTimerTextLine ); + } else { + // todo: 1-line + BubbleUtils::setCallHeaderTexts2Lines( + *mHeader, *mText1, *mText2, cliLine, + mCallTimerTextLine ); + } - if (mStatusIcon) { - style()->updatePrimitive( - mStatusIcon, - (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), - &option); - } - - if (mNumberTypeIcon) { - style()->updatePrimitive( - mNumberTypeIcon, - (HbStyle::Primitive)(pluginBaseId()+BP_NumberType_icon), - &option); - } - - if (mCipheringIcon) { - style()->updatePrimitive( - mCipheringIcon, - (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon), - &option); + // update font + if (cliLine==2) { + mText1->setFontSpec(*mTextFont); + mText2->setFontSpec(*mCliFont); + mText3->setFontSpec(*mTextFont); + } else { + mText1->setFontSpec(*mCliFont); + mText2->setFontSpec(*mTextFont); + mText3->setFontSpec(*mTextFont); + } } repolish(); } -void BubbleHeadingWidget::initStyleOption(BubbleStyleOption& option) -{ - HbWidget::initStyleOption(&option); - - if (mHeader!=0) { - option.mCallState = mHeader->callState(); - option.mCallFlags = mHeader->callFlags(); - - if (lines==3) { - BubbleUtils::setCallHeaderTexts3Lines( *mHeader, option ); - } else if (lines==2) { - BubbleUtils::setCallHeaderTexts2Lines( *mHeader, option ); - } else { - // todo: 1-line - BubbleUtils::setCallHeaderTexts2Lines( *mHeader, option ); - } - - mCallTimerTextLine = option.mTimerLineNumber; - } -} - void BubbleHeadingWidget::polishEvent() { - if (mText1 && mText2 && mText3) { - if (lines == 3) { - setLayout("three_lines"); - mText1->setVisible(true); - mText2->setVisible(true); - mText3->setVisible(true); - } else if (lines == 2) { - setLayout("two_lines"); - mText1->setVisible(true); - mText2->setVisible(true); - mText3->setVisible(false); - } else if (lines == 1) { - setLayout("one_line"); - mText1->setVisible(true); - mText2->setVisible(true); - mText3->setVisible(false); - } + if (lines == 3) { + setLayout("three_lines"); + mText1->setVisible(true); + mText2->setVisible(true); + mText3->setVisible(true); + } else if (lines == 2) { + setLayout("two_lines"); + mText1->setVisible(true); + mText2->setVisible(true); + mText3->setVisible(false); + } else if (lines == 1) { + setLayout("one_line"); + mText1->setVisible(true); + mText2->setVisible(true); + mText3->setVisible(false); } HbWidget::polishEvent(); @@ -206,24 +191,12 @@ void BubbleHeadingWidget::updateTimerDisplayNow() { if ( mHeader && ( mHeader->callState() == BubbleManager::Active ) ) { - BubbleStyleOption option; - if ( mCallTimerTextLine == 2 ) { - option.mText2 = mHeader->timerCost(); - option.mText2Clip = Qt::ElideRight; - option.mTimerLineNumber = mCallTimerTextLine; - style()->updatePrimitive( - mText2, - (HbStyle::Primitive)(pluginBaseId()+BP_Text2_text), - &option); + mText2->setText(mHeader->timerCost()); + mText2->setElideMode(Qt::ElideRight); } else if ( mCallTimerTextLine == 3 ) { - option.mText3 = mHeader->timerCost(); - option.mText3Clip = Qt::ElideRight; - option.mTimerLineNumber = mCallTimerTextLine; - style()->updatePrimitive( - mText3, - (HbStyle::Primitive)(pluginBaseId()+BP_Text3_text), - &option); + mText3->setText(mHeader->timerCost()); + mText3->setElideMode(Qt::ElideRight); } } } @@ -237,3 +210,8 @@ HbWidget::changeEvent(event); } +void BubbleHeadingWidget::showEvent(QShowEvent *event) +{ + Q_UNUSED(event) + mStatusIcon->animator().startAnimation(); +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.h Fri May 14 15:51:57 2010 +0300 @@ -20,7 +20,9 @@ #include -class BubbleStyleOption; +class HbIconItem; +class HbTextItem; +class HbFontSpec; class BubbleHeader; class BubbleHeadingWidget : public HbWidget @@ -30,7 +32,7 @@ Q_PROPERTY(QString layoutOption READ layout WRITE setLayout) public: - BubbleHeadingWidget(const QString& stylePluginName, QGraphicsItem* item=0); + BubbleHeadingWidget(QGraphicsItem* item=0); virtual ~BubbleHeadingWidget(); int lineCount() const; @@ -46,29 +48,29 @@ private: void createPrimitives(); void updatePrimitives(); - void initStyleOption(BubbleStyleOption& option); - - void polishEvent(); protected: + void polishEvent(); void changeEvent(QEvent *event); + void showEvent(QShowEvent *event); private: - QString mStylePluginName; - int lines; QString layoutOption; const BubbleHeader* mHeader; // primitives - QGraphicsItem* mStatusIcon; - QGraphicsItem* mNumberTypeIcon; - QGraphicsItem* mCipheringIcon; - QGraphicsItem* mText1; - QGraphicsItem* mText2; - QGraphicsItem* mText3; + //BubbleAnimIconItem* mStatusIcon; + HbIconItem* mStatusIcon; + HbIconItem* mNumberTypeIcon; + HbIconItem* mCipheringIcon; + HbTextItem* mText1; + HbTextItem* mText2; + HbTextItem* mText3; int mCallTimerTextLine; + HbFontSpec* mCliFont; + HbFontSpec* mTextFont; }; #endif // BUBBLEHEADINGWIDGET_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -18,32 +18,33 @@ #include #include +#include +#include #include "bubbleimagemanager.h" #include "bubbleimagewidget.h" -#include "bubbleprimitives.h" -#include "bubblestyleoption.h" -BubbleImageWidget::BubbleImageWidget(const QString& stylePluginName, - BubbleImageManager& imageManager, QGraphicsItem* parent) - : HbWidget(parent), mStylePluginName(stylePluginName), - mImageManager(imageManager), mDefaultAvatar(0) +BubbleImageWidget::BubbleImageWidget( + BubbleImageManager& imageManager, + QGraphicsItem* parent) + : HbWidget(parent), + mImageManager(imageManager), + mDefaultAvatar(0) { - setPluginBaseId(style()->registerPlugin(mStylePluginName)); - Q_ASSERT(pluginBaseId()!=-1); + // create avatar + mDefaultAvatar = new HbIconItem(this); + style()->setItemName( mDefaultAvatar, "default_avatar" ); + mDefaultAvatar->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); + mDefaultAvatar->setAlignment(Qt::AlignCenter); - // 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))); - connect(&mImageManager,SIGNAL(pixmapReady(QString)), - this,SLOT(imageLoaded(QString))); + HbStyleLoader::registerFilePath(":/bubbleimagewidget.css"); + HbStyleLoader::registerFilePath(":/bubbleimagewidget.widgetml"); } BubbleImageWidget::~BubbleImageWidget() { - style()->unregisterPlugin(mStylePluginName); } void BubbleImageWidget::setImage(const QString& name) @@ -52,13 +53,10 @@ if (!mImageName.isEmpty()) { mDefaultAvatar->setVisible(false); + mDefaultAvatar->setIcon(HbIcon()); mImageManager.loadImage(mImageName); } else { - BubbleStyleOption option; - style()->updatePrimitive( - mDefaultAvatar, - (HbStyle::Primitive)(pluginBaseId()+BP_DefaultAvatar_icon), - &option); + mDefaultAvatar->setIconName("qtg_large_avatar"); mDefaultAvatar->setVisible(true); } } diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h Fri May 14 15:51:57 2010 +0300 @@ -21,6 +21,7 @@ #include class BubbleImageManager; +class HbIconItem; class BubbleImageWidget : public HbWidget { @@ -28,7 +29,6 @@ public: explicit BubbleImageWidget( - const QString& stylePluginName, BubbleImageManager& imageManager, QGraphicsItem* parent = 0 ); virtual ~BubbleImageWidget(); @@ -45,10 +45,9 @@ QWidget* widget); private: - QString mStylePluginName; BubbleImageManager& mImageManager; QString mImageName; - QGraphicsItem* mDefaultAvatar; + HbIconItem* mDefaultAvatar; }; #endif /* BUBBLEIMAGEWIDGET_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp Fri May 14 15:51:57 2010 +0300 @@ -60,9 +60,7 @@ mEffectHandler = new BubbleEffectHandler(this); mWidgetManager = new BubbleWidgetManager( - *mBubbleImageManager, mDefaultStyleBaseId, this); - mWidgetManager->setStylePluginName( - BubbleUtils::stylePluginNameWithPath("bubblestyleplugin.dll")); + *mBubbleImageManager, this); mMainLayout = new HbStackedLayout(this); mMainLayout->setContentsMargins(0.0,0.0,0.0,0.0); @@ -715,6 +713,7 @@ Q_ASSERT( mIsReadyToDraw > 0 ); if ( mConferenceHeader->isUsed() ) { mConferenceHeader->setExpanded(expanded); + mSortHeaders = true; } } @@ -874,20 +873,27 @@ int expanded = mActiveHeaders[0]->bubbleId(); if ( bubbleId != expanded ) { startChanges(); - // find header + BubbleHeader* header = 0; - for ( int i=0; i < mActiveHeaders.size(); i++ ) { - if ( mActiveHeaders[i]->bubbleId() == bubbleId ) { - header = mActiveHeaders[i]; - mActiveHeaders.remove(i); - break; + + if (bubbleId == BUBBLE_CONF_CALL_ID) { + header = mConferenceHeader; + } else { + // find header + for ( int i=0; i < mActiveHeaders.size(); i++ ) { + if ( mActiveHeaders[i]->bubbleId() == bubbleId ) { + header = mActiveHeaders[i]; + mActiveHeaders.remove(i); + break; + } } + + Q_ASSERT(header); + + // set it first + mActiveHeaders.insert(0,header); } - Q_ASSERT(header); - - // set it first - mActiveHeaders.insert(0,header); endChanges(); // trigger the expand action diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp Fri May 14 15:51:57 2010 +0300 @@ -15,28 +15,22 @@ * */ -#include +#include #include -#include #include -#include #include #include -#include +#include +#include +#include #include "bubbleparticipantlistitem.h" -#include "bubbleprimitives.h" -#include "bubblestyleoption.h" -#include "bubblebuttonstyle.h" +#include "bubblemanagerif.h" +#include "bubbleutils.h" BubbleParticipantListItem::BubbleParticipantListItem( - const QString& stylePluginName, - BubbleButtonStyle& buttonStyle, QGraphicsItem *parent) : - HbListViewItem(parent), - mStylePluginName(stylePluginName), - mButtonStyle(buttonStyle), - mBackground(0), + HbAbstractViewItem(parent), mText(0), mStatusIcon(0), mCipheringIcon(0), @@ -45,15 +39,12 @@ mButton2(0), mExpanded(false) { - mStylePluginBaseId = style()->registerPlugin(mStylePluginName); - Q_ASSERT(pluginBaseId()!=-1); + HbStyleLoader::registerFilePath(":/bubbleparticipantlistitem.css"); + HbStyleLoader::registerFilePath(":/bubbleparticipantlistitem.widgetml"); } BubbleParticipantListItem::~BubbleParticipantListItem() { - if (prototype()==(HbAbstractViewItem*)this) { - style()->unregisterPlugin(mStylePluginName); - } } HbAbstractViewItem* BubbleParticipantListItem::createItem() @@ -63,46 +54,36 @@ void BubbleParticipantListItem::updateChildItems() { - setPluginBaseId(mStylePluginBaseId); + HbAbstractViewItem::updateChildItems(); + setFocusPolicy(Qt::ClickFocus); // to enable expanding // create primitives - if (!mBackground) { - mBackground = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame), this); - if ( mBackground ) { - style()->setItemName( mBackground, "background" ); - } - } - if (!mText) { - mText = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text), this); - if ( mText ) { - style()->setItemName( mText, "text" ); - } + mText = new HbTextItem(this); + style()->setItemName( mText, "text" ); } if (!mCipheringIcon) { - mCipheringIcon = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon), this); - if ( mCipheringIcon ) { - style()->setItemName( mCipheringIcon, "ciphering" ); - } + mCipheringIcon = new HbIconItem(this); + style()->setItemName( mCipheringIcon, "ciphering" ); } if (!mStatusIcon) { - mStatusIcon = style()->createPrimitive( - (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), this); - if ( mStatusIcon ) { - style()->setItemName( mStatusIcon, "icon" ); - } + mStatusIcon = new HbIconItem(this); + style()->setItemName( mStatusIcon, "icon" ); } if (!mExpandIcon) { mExpandIcon = new HbIconItem(this); - if ( mExpandIcon ) { - style()->setItemName( mExpandIcon, "expand-indi" ); + style()->setItemName( mExpandIcon, "expand-indi" ); + + // for expand/collapse controls + if (itemView()) { + connect( itemView()->selectionModel(), + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, + SLOT(currentIndexChanged(QModelIndex,QModelIndex)) ); } } @@ -113,14 +94,8 @@ Q_ASSERT(p->mActions.count()==2); HbAction* action = p->mActions.at(0); mButton1 = new HbPushButton(this); - mButton1->setStyle(&mButtonStyle); mButton1->setIcon(action->icon()); style()->setItemName( mButton1, "button-1" ); - HbTextItem* label = static_cast( - mButton1->primitive(HbStyle::P_PushButton_text)); - if (label) { - label->setTextColor( Qt::white ); - } // connect first action connect(mButton1, @@ -137,14 +112,8 @@ Q_ASSERT(p->mActions.count()==2); HbAction* action = p->mActions.at(1); mButton2 = new HbPushButton(this); - mButton2->setStyle(&mButtonStyle); mButton2->setIcon(action->icon()); style()->setItemName( mButton2, "button-2" ); - HbTextItem* label = static_cast( - mButton2->primitive(HbStyle::P_PushButton_text)); - if (label) { - label->setTextColor( Qt::white ); - } // connect second action connect(mButton2, @@ -158,53 +127,29 @@ mButton2 = 0; } - // update primitives - BubbleStyleOption option; - HbWidget::initStyleOption(&option); - - // check canConvert() - option.mCallState = (BubbleManagerIF::PhoneCallState) - modelIndex().data(Qt::DecorationRole).toInt(); - option.mText1 = modelIndex().data(Qt::DisplayRole).toString(); - option.mCliLineNumber = 1; - bool ciphering = modelIndex().data(Qt::StatusTipRole).toBool(); - if (!ciphering) { - option.mCallFlags = BubbleManagerIF::NoCiphering; + if (mText) { + mText->setText(modelIndex().data(Qt::DisplayRole).toString()); } - if (mBackground) { - style()->updatePrimitive( - mBackground, - (HbStyle::Primitive)(pluginBaseId()+BP_Bubble_frame), - &option); - } - - if (mText) { - style()->updatePrimitive( - mText, - (HbStyle::Primitive)(pluginBaseId()+BP_Text1_text), - &option); - } + int state = (BubbleManagerIF::PhoneCallState) + modelIndex().data(Qt::DecorationRole).toInt(); if (mStatusIcon) { - style()->updatePrimitive( - mStatusIcon, - (HbStyle::Primitive)(pluginBaseId()+BP_CallStatus_icon), - &option ); + BubbleUtils::setCallStatusIcon(state,0,*mStatusIcon); } if (mCipheringIcon) { - style()->updatePrimitive( - mCipheringIcon, - (HbStyle::Primitive)(pluginBaseId()+BP_Ciphering_icon), - &option ); + int flags = !modelIndex().data(Qt::StatusTipRole).toBool() ? + BubbleManagerIF::NoCiphering : 0; + + BubbleUtils::setCipheringIcon(state,flags,*mCipheringIcon); } if (mExpandIcon) { if (mExpanded) { - mExpandIcon->setIcon(HbIcon("qtg_small_expand")); + mExpandIcon->setIcon(HbIcon("qtg_small_collapse")); } else { - mExpandIcon->setIcon(HbIcon("qtg_small_collapse")); + mExpandIcon->setIcon(HbIcon("qtg_small_expand")); } } @@ -219,26 +164,7 @@ setProperty("layoutOption","collapsed"); } - HbListViewItem::polish(params); -} - -void BubbleParticipantListItem::receivedFocus() -{ - HbListViewItem::receivedFocus(); - BubbleParticipantListItem* p = - static_cast(prototype()); - if ( p->mActions.count() == 2 ) { - // supports two buttons layout only - - setExpanded(true); - emit p->selectionChanged(modelIndex().row()); - } -} - -void BubbleParticipantListItem::lostFocus() -{ - HbListViewItem::lostFocus(); - setExpanded(false); + HbAbstractViewItem::polish(params); } void BubbleParticipantListItem::setExpanded(bool expanded) @@ -258,5 +184,23 @@ mExpanded = false; } +void BubbleParticipantListItem::currentIndexChanged( + const QModelIndex ¤t, + const QModelIndex &previous) +{ + Q_UNUSED(previous); + if (modelIndex() == current) { + if ( !mExpanded ) { + setExpanded(true); + } + } else if (mExpanded) { + setExpanded(false); + } +} +int BubbleParticipantListItem::type() const +{ + return HbListViewItem::Type; +} + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.h Fri May 14 15:51:57 2010 +0300 @@ -18,52 +18,47 @@ #ifndef BUBBLEPARTICIPANTLISTITEM_H #define BUBBLEPARTICIPANTLISTITEM_H -#include +#include class QGraphicsItem; class HbPushButton; -class BubbleButtonStyle; class HbAction; class HbIconItem; +class HbFrameItem; +class HbTextItem; -class BubbleParticipantListItem : public HbListViewItem +class BubbleParticipantListItem : public HbAbstractViewItem { Q_OBJECT public: - BubbleParticipantListItem( - const QString& stylePluginName, - BubbleButtonStyle& buttonStyle, - QGraphicsItem *parent = 0); + BubbleParticipantListItem(QGraphicsItem *parent = 0); ~BubbleParticipantListItem(); HbAbstractViewItem* createItem(); void updateChildItems(); - void receivedFocus(); - void lostFocus(); void setExpanded(bool expanded); void addAction(HbAction* action); void clearActions(); -signals: - void selectionChanged(int row); - private: void polish(HbStyleParameters& params); + int type() const; + +private slots: + void currentIndexChanged(const QModelIndex ¤t, + const QModelIndex &previous); + private: - QString mStylePluginName; - int mStylePluginBaseId; - BubbleButtonStyle& mButtonStyle; - QGraphicsItem* mBackground; - QGraphicsItem* mText; - QGraphicsItem* mStatusIcon; - QGraphicsItem* mCipheringIcon; - HbIconItem* mExpandIcon; - HbPushButton* mButton1; - HbPushButton* mButton2; + HbTextItem* mText; + HbIconItem* mStatusIcon; + HbIconItem* mCipheringIcon; + HbIconItem* mExpandIcon; + HbPushButton* mButton1; + HbPushButton* mButton2; QList mActions; bool mExpanded; diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblestyleoption.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblestyleoption.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bubble style option. -* -*/ - -#include "bubblestyleoption.h" - -BubbleStyleOption::BubbleStyleOption(): HbStyleOption() -{ - type = (int)Type; - version = (int)Version; - mText1 = ""; - mText2 = ""; - mText3 = ""; - mText1Clip = Qt::ElideNone; - mText2Clip = Qt::ElideNone; - mText3Clip = Qt::ElideNone; - mCliLineNumber = 0; - mTimerLineNumber = 0; - mCallState = BubbleManagerIF::None; - mCallFlags = 0; - mNumberType = BubbleManagerIF::NotSet; -} - -BubbleStyleOption::BubbleStyleOption(const BubbleStyleOption &other) : - HbStyleOption(other) -{ - type = (int)Type; - version = (int)Version; - - mText1 = other.mText1; - mText2 = other.mText2; - mText3 = other.mText3; - mText1Clip = other.mText1Clip; - mText2Clip = other.mText2Clip; - mText3Clip = other.mText3Clip; - mCliLineNumber = other.mCliLineNumber; - mTimerLineNumber = other.mTimerLineNumber; - mCallState = other.mCallState; - mCallFlags = other.mCallFlags; - mNumberType = other.mNumberType; -} - -BubbleStyleOption::~BubbleStyleOption() -{ -} - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleutils.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.cpp Fri May 14 15:51:57 2010 +0300 @@ -16,17 +16,24 @@ */ #include +#include +#include +#include +#include +#include + #include "bubblemanager2.h" #include "bubbleutils.h" #include "bubbleheader.h" -#include "bubblestyleoption.h" -#include "bubblebuttonstyle.h" -#include "hbpushbutton.h" -#include "hbaction.h" +#include "bubblebutton.h" void BubbleUtils::setCallHeaderTexts3Lines( const BubbleHeader& header, - BubbleStyleOption& option ) + HbTextItem& textLine1, + HbTextItem& textLine2, + HbTextItem& textLine3, + int& cliLineNumber, + int& timerLineNumber) { switch( header.callState() ) { case BubbleManager::Incoming: @@ -34,39 +41,31 @@ case BubbleManager::AlertToDisconnected: { if ( header.secondaryCli().length() ) { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.secondaryCli() ); - option.mText2Clip = header.secondaryCliClipDirection(); - option.mText3.append( header.text() ); - option.mText3Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.secondaryCli(), + header.secondaryCliClipDirection()); + setText(textLine3, header.text(), header.textClipDirection()); + cliLineNumber = 1; } else { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.text() ); - option.mText2Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1,header.cli(), header.cliClipDirection()); + setText(textLine2,header.text(), header.textClipDirection()); + cliLineNumber = 1; } break; } - + case BubbleManager::Outgoing: { if ( header.secondaryCli().length() ) { - option.mText1.append( header.text() ); - option.mText1Clip = header.textClipDirection(); - option.mText2.append( header.cli() ); - option.mText2Clip = header.cliClipDirection(); - option.mText3.append( header.secondaryCli() ); - option.mText3Clip = header.secondaryCliClipDirection(); - option.mCliLineNumber = 2; + setText(textLine1, header.text(), header.textClipDirection()); + setText(textLine2, header.cli(), header.cliClipDirection()); + setText(textLine3, header.secondaryCli(), + header.secondaryCliClipDirection()); + cliLineNumber = 2; } else { - option.mText1.append( header.text() ); - option.mText1Clip = header.textClipDirection(); - option.mText2.append( header.cli() ); - option.mText2Clip = header.cliClipDirection(); - option.mCliLineNumber = 2; + setText(textLine1, header.text(), header.textClipDirection()); + setText(textLine2, header.cli(), header.cliClipDirection()); + cliLineNumber = 2; } break; } @@ -75,42 +74,34 @@ case BubbleManager::Alerting: { if ( header.secondaryCli().length() ) { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.secondaryCli() ); - option.mText2Clip = header.secondaryCliClipDirection(); - option.mText3.append( header.timerCost() ); - option.mText3Clip = Qt::ElideRight; - option.mCliLineNumber = 1; - option.mTimerLineNumber = 3; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.secondaryCli(), + header.secondaryCliClipDirection()); + setText(textLine3, header.timerCost(), Qt::ElideRight); + cliLineNumber = 1; + timerLineNumber = 3; } else { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.timerCost() ); - option.mText2Clip = Qt::ElideRight; - option.mCliLineNumber = 1; - option.mTimerLineNumber = 2; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.timerCost(), Qt::ElideRight); + cliLineNumber = 1; + timerLineNumber = 2; } break; } - + case BubbleManager::OnHold: case BubbleManager::Disconnected: { if ( header.secondaryCli().length() ) { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.secondaryCli() ); - option.mText2Clip = header.secondaryCliClipDirection(); - option.mText3.append( header.text() ); - option.mText3Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.secondaryCli(), + header.secondaryCliClipDirection()); + setText(textLine3, header.text(), header.textClipDirection()); + cliLineNumber = 1; } else { - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.text() ); - option.mText2Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.text(), header.textClipDirection()); + cliLineNumber = 1; } break; } @@ -123,43 +114,38 @@ void BubbleUtils::setCallHeaderTexts2Lines( const BubbleHeader& header, - BubbleStyleOption& option ) + HbTextItem& textLine1, + HbTextItem& textLine2, + int& cliLineNumber, + int& timerLineNumber) { switch( header.callState() ) { case BubbleManager::Active: - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.timerCost() ); - option.mText2Clip = Qt::ElideRight; - option.mCliLineNumber = 1; - option.mTimerLineNumber = 2; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.timerCost(), Qt::ElideRight); + cliLineNumber = 1; + timerLineNumber = 2; break; case BubbleManager::OnHold: case BubbleManager::Disconnected: - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.text() ); - option.mText2Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.text(), header.textClipDirection()); + cliLineNumber = 1; break; case BubbleManager::Waiting: case BubbleManager::AlertToDisconnected: - option.mText1.append( header.cli() ); - option.mText1Clip = header.cliClipDirection(); - option.mText2.append( header.text() ); - option.mText2Clip = header.textClipDirection(); - option.mCliLineNumber = 1; + setText(textLine1, header.cli(), header.cliClipDirection()); + setText(textLine2, header.text(), header.textClipDirection()); + cliLineNumber = 1; break; case BubbleManager::Outgoing: - option.mText1.append(header.text()); - option.mText1Clip = header.textClipDirection(); - option.mText2.append(header.cli()); - option.mText2Clip = header.cliClipDirection(); - option.mCliLineNumber = 2; + setText(textLine1, header.text(), header.textClipDirection()); + setText(textLine2, header.cli(), header.cliClipDirection()); + cliLineNumber = 2; break; default: @@ -168,49 +154,148 @@ } // switch } +void BubbleUtils::setText( + HbTextItem& item, + const QString& text, + Qt::TextElideMode clip) +{ + if (clip == Qt::ElideLeft) { + // convert phonenumber to phone ui language + QString converted = HbStringUtil::convertDigits(text); + item.setText(converted); + } else { + item.setText( text ); + } + item.setElideMode( clip ); +} + bool BubbleUtils::compareHeaders( const BubbleHeader* header1, const BubbleHeader* header2 ) { - if ( header1->callState() < header2->callState() ) { + // sort according to call states, but keep conference header + // last, it shown at foreground only when expanded. + if ( (header1->callState() < header2->callState()) || + header1->isConference() ) { return false; } else { return true; } } -QString BubbleUtils::stylePluginNameWithPath(const QString& pluginName) +void BubbleUtils::setButtonStyleForAction( + BubbleButton& button, + const HbAction& action) { - QString nameWithPath; + if (action.softKeyRole()==QAction::PositiveSoftKey) { + button.setButtonType(BubbleButton::GreenButton); + } else if (action.softKeyRole()==QAction::NegativeSoftKey) { + button.setButtonType(BubbleButton::RedButton); + } else { + button.setButtonType(BubbleButton::DefaultButton); + } -#if defined(Q_OS_SYMBIAN) - nameWithPath.append("z:/resource/qt/plugins/phone/"); - nameWithPath.append(pluginName); -#elif defined(Q_OS_WIN) - nameWithPath.append("c:/hb/bin/"); - nameWithPath.append(pluginName); -#else // Q_OS_UNIX - nameWithPath.append("/home/lib/"); - nameWithPath.append(pluginName); -#endif - - return nameWithPath; + button.updatePrimitives(); } -void BubbleUtils::setButtonStyleForAction( - HbPushButton& button, - const HbAction& action) +void BubbleUtils::setCallStatusIcon( + int callState, + int callFlags, + HbIconItem& icon) { - BubbleButtonStyle* style = - static_cast(button.style()); + bool showIcon = true; - if (action.softKeyRole()==QAction::PositiveSoftKey) { - style->setButtonColor(BubbleButtonStyle::Green); - } else if (action.softKeyRole()==QAction::NegativeSoftKey) { - style->setButtonColor(BubbleButtonStyle::Red); - } else { - style->setButtonColor(BubbleButtonStyle::Default); + switch(callState) { + case BubbleManagerIF::Incoming: + case BubbleManagerIF::Alerting: + case BubbleManagerIF::Waiting: + // from bubble_icon_anim.axml + if ( callFlags & BubbleManagerIF::VoIPCall ) { + icon.setIconName("voip_call_waiting_anim"); + } else if ( callFlags & BubbleManagerIF::Video ) { + icon.setIconName("video_call_waiting_anim"); + } else { + icon.setIconName("voice_call_waiting_anim"); + } + break; + case BubbleManagerIF::Outgoing: + case BubbleManagerIF::Active: + if ( callFlags & BubbleManagerIF::VoIPCall ) { + icon.setIconName("qtg_large_voip_call_active"); + } else if ( callFlags & BubbleManagerIF::Video ) { + icon.setIconName("qtg_large_video_call_active"); + } else { + icon.setIconName("qtg_large_active_call"); + } + break; + case BubbleManagerIF::OnHold: + if ( callFlags & BubbleManagerIF::VoIPCall ) { + icon.setIconName("qtg_large_voip_call_waiting"); + } else if ( callFlags & BubbleManagerIF::Video ) { + icon.setIconName("qtg_large_video_call_waiting"); + } else { + icon.setIconName("qtg_large_waiting_call"); + } + break; + case BubbleManagerIF::Disconnected: + case BubbleManagerIF::AlertToDisconnected: + if ( callFlags & BubbleManagerIF::VoIPCall ) { + icon.setIconName("qtg_large_end_call"); + } else if ( callFlags & BubbleManagerIF::Video ) { + icon.setIconName("qtg_large_end_call"); + } else { + icon.setIconName("qtg_large_end_call"); + } + break; + default: + icon.setIcon(HbIcon()); + showIcon = false; + break; } + if (showIcon) { + icon.show(); + } } +void BubbleUtils::setNumberTypeIcon( + int callState, + int callFlags, + HbIconItem& icon) +{ + if ( (( callState == BubbleManagerIF::Incoming ) || + ( callState == BubbleManagerIF::Waiting )) && + (callFlags & BubbleManagerIF::Diverted) ) { + icon.setIcon( HbIcon(":/qtg_mono_call_diverted.svg") ); + + // temporary, diverted icon is not yet in theme and + // because of that css coloring doesn't work + QColor color; + color = HbColorScheme::color("qtc_list_item_title_normal"); + if (color.isValid()) { + icon.setColor(Qt::white); + } + + icon.show(); + } else { + icon.setIcon( HbIcon() ); + icon.hide(); + } +} + +void BubbleUtils::setCipheringIcon( + int callState, + int callFlags, + HbIconItem& icon) +{ + Q_UNUSED(callState) + + if (callFlags & BubbleManagerIF::NoCiphering) { + icon.setIcon( HbIcon("qtg_mono_ciphering_off") ); + icon.show(); + } else { + icon.setIcon( HbIcon() ); + icon.hide(); + } +} + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleutils.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.h Fri May 14 15:51:57 2010 +0300 @@ -23,29 +23,57 @@ class BubbleHeader; class BubbleCallIndicator; class HbIconItem; -class BubbleStyleOption; -class HbPushButton; +class BubbleButton; class HbAction; +class HbTextItem; class BubbleUtils { public: static void setCallHeaderTexts3Lines( const BubbleHeader& header, - BubbleStyleOption& option ); + HbTextItem& textLine1, + HbTextItem& textLine2, + HbTextItem& textLine3, + int& cliLineNumber, + int& timerLineNumber); static void setCallHeaderTexts2Lines( const BubbleHeader& header, - BubbleStyleOption& option ); + HbTextItem& textLine1, + HbTextItem& textLine2, + int& cliLineNumber, + int& timerLineNumber); static bool compareHeaders( const BubbleHeader* header1, - const BubbleHeader* header2 ); + const BubbleHeader* header2); + + static void setButtonStyleForAction( + BubbleButton& button, + const HbAction& action); + + static void setCallStatusIcon( + int callState, + int callFlags, + HbIconItem& icon); - static QString stylePluginNameWithPath(const QString& pluginName); + static void setNumberTypeIcon( + int callState, + int callFlags, + HbIconItem& icon); - static void setButtonStyleForAction(HbPushButton& button, - const HbAction& action); + static void setCipheringIcon( + int callState, + int callFlags, + HbIconItem& icon); + +private: + static void setText( + HbTextItem& item, + const QString& text, + Qt::TextElideMode clip); + }; #endif /* BUBBLEUTILS_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp Fri May 14 15:51:57 2010 +0300 @@ -27,8 +27,7 @@ #include "bubblecollapsedhandler.h" #include "bubbleconferencehandler.h" #include "bubbleparticipantlistitem.h" -#include "bubblebuttonstyle.h" -#include "hbpushbutton.h" +#include "bubblebutton.h" #include "hbtextitem.h" const char *BUBBLE_DOCUMENT_CONTENT = "content"; @@ -37,19 +36,17 @@ class BubbleDocumentLoader : public HbDocumentLoader { public: - BubbleDocumentLoader(BubbleImageManager& imageManager, - const QString& stylePluginName); + BubbleDocumentLoader(BubbleImageManager& imageManager); virtual QObject *createObject(const QString& type, const QString &name); private: BubbleImageManager& mImageManager; - QString mStylePluginName; }; BubbleWidgetManager::BubbleWidgetManager( - BubbleImageManager& imageManager, int style, QObject* parent) - : QObject(parent), mImageManager(imageManager), mStyleBaseId(style), + BubbleImageManager& imageManager, QObject* parent) + : QObject(parent), mImageManager(imageManager), mOrientation(Qt::Vertical) { // .docml mappings @@ -76,11 +73,6 @@ mWidgetName.insert(ConferenceTimer,"callTimer"); mWidgetName.insert(ParticipantList,"participantList"); mWidgetName.insert(MutedIcon, "mutedIcon"); - - mButtonStyle.insert(LeftButton, new BubbleButtonStyle()); - mButtonStyle.insert(CenterButton, new BubbleButtonStyle()); - mButtonStyle.insert(RightButton, new BubbleButtonStyle()); - mButtonStyle.insert(ParticipantListButton, new BubbleButtonStyle()); // not needed?? } BubbleWidgetManager::~BubbleWidgetManager() @@ -94,8 +86,6 @@ } qDeleteAll(mDocumentHandlers); mDocumentHandlers.clear(); - - qDeleteAll(mButtonStyle); } QGraphicsWidget* BubbleWidgetManager::view(View view) @@ -119,7 +109,7 @@ Qt::Orientation orientation) { BubbleDocumentLoader* loader = - new BubbleDocumentLoader(mImageManager,mStylePluginName); + new BubbleDocumentLoader(mImageManager); bool ok; loader->load(mFileNames[view],&ok); @@ -136,34 +126,20 @@ widget->setVisible(false); mDocumentContent.insert(view,widget); - applyCustomStyles(view); - if (view!=MutedOverlay) { createDocumentHandlers(view); } + applyCustomStyles(view); + return widget; } void BubbleWidgetManager::applyCustomStyles(View view) { - 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) -{ - HbPushButton* b; - b = qobject_cast(button); - if (b) { - Q_ASSERT(mButtonStyle.contains(widget)); - b->setStyle(mButtonStyle.value(widget)); - } -} - void BubbleWidgetManager::setBackground(QGraphicsWidget* widget) { HbWidget* w; @@ -265,19 +241,12 @@ QGraphicsWidget* BubbleWidgetManager::createParticipantListItem() { - return new BubbleParticipantListItem(mStylePluginName, - *mButtonStyle.value(ParticipantListButton)); -} - -void BubbleWidgetManager::setStylePluginName(const QString& name) -{ - mStylePluginName = name; + return new BubbleParticipantListItem(); } // custom widget loading -BubbleDocumentLoader::BubbleDocumentLoader( - BubbleImageManager& imageManager, const QString& stylePluginName) - : mImageManager(imageManager), mStylePluginName(stylePluginName) +BubbleDocumentLoader::BubbleDocumentLoader(BubbleImageManager& imageManager) + : mImageManager(imageManager) { } @@ -286,20 +255,25 @@ const QString &name) { if ( type == BubbleContainerWidget::staticMetaObject.className() ) { - QObject *object = new BubbleContainerWidget(mStylePluginName); + QObject *object = new BubbleContainerWidget(); object->setObjectName(name); return object; } if ( type == BubbleImageWidget::staticMetaObject.className() ) { - QObject *object = new BubbleImageWidget( - mStylePluginName, mImageManager); + QObject *object = new BubbleImageWidget(mImageManager); object->setObjectName(name); return object; } if ( type == BubbleHeadingWidget::staticMetaObject.className() ) { - QObject *object = new BubbleHeadingWidget(mStylePluginName); + QObject *object = new BubbleHeadingWidget(); + object->setObjectName(name); + return object; + } + + if ( type == BubbleButton::staticMetaObject.className() ) { + QObject *object = new BubbleButton; object->setObjectName(name); return object; } diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h --- a/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h Fri May 14 15:51:57 2010 +0300 @@ -24,7 +24,6 @@ class QGraphicsWidget; class BubbleDocumentLoader; class BubbleHandler; -class BubbleButtonStyle; class BubbleImageManager; class BubbleWidgetManager : public QObject @@ -66,7 +65,6 @@ public: BubbleWidgetManager( BubbleImageManager& imageManager, - int style, QObject* parent=0); virtual ~BubbleWidgetManager(); @@ -85,8 +83,6 @@ QGraphicsWidget* createParticipantListItem(); - void setStylePluginName(const QString& name); - public slots: void handleOrientationChange(Qt::Orientation orientation); @@ -99,8 +95,6 @@ private: BubbleImageManager& mImageManager; - int mStyleBaseId; - QString mStylePluginName; Qt::Orientation mOrientation; QMap mDocumentLoaders; QMap*> mDocumentHandlers; @@ -111,7 +105,6 @@ QMap mWidgetPrefix; QMap mWidgetName; QMap mOrientationName; - QMap mButtonStyle; }; #endif // BUBBLEWIDGETMANAGER_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_1.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_1.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_2.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_2.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,124 @@ + + + +
+ + + + + + +
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_3.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_3.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,184 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_4.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_4.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_5.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_5.docml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,35 @@ + + + + +
+ + + + + +
+
+ + + + + +
+
+ +
+ + + + +
+ +
+ + + + +
+ +
diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.css Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,70 @@ + + +BubbleHeadingWidget[layoutOption="three_lines"] +{ + layout: three_lines_layout; +} + +BubbleHeadingWidget[layoutOption="two_lines"] +{ + layout: two_lines_layout; +} + +BubbleHeadingWidget[layoutOption="one_line"] +{ + layout: one_line_layout; +} + +BubbleHeadingWidget:text_line_1 +{ + preferred-height: var(hb-param-text-height-primary); + left: -var(hb-param-margin-gene-middle-horizontal); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_2[layoutOption!="one_line"] +{ + preferred-height: var(hb-param-text-height-primary); + preferred-width: -1; + left: -var(hb-param-margin-gene-middle-horizontal); + top: -var(hb-param-margin-gene-middle-vertical); + text-align: left; + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_2[layoutOption="one_line"] +{ + preferred-height: var(hb-param-text-height-primary); + preferred-width: 30un; + left: -var(hb-param-margin-gene-middle-horizontal); + text-align: right; + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_3 +{ + preferred-height: var(hb-param-text-height-primary); + left: -var(hb-param-margin-gene-middle-horizontal); + top: -var(hb-param-margin-gene-middle-vertical); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:status_icon +{ + fixed-width: var(hb-param-graphic-size-primary-large); + fixed-height: var(hb-param-graphic-size-primary-large); +} + +BubbleHeadingWidget:number_type_icon +{ + fixed-height: var(hb-param-graphic-size-secondary); + fixed-width: var(hb-param-graphic-size-secondary); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:ciphering_icon +{ + fixed-height: 2.5un; + fixed-width: 2.5un; + color: var(qtc_list_item_title_normal); +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.widgetml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.css Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,7 @@ + + +BubbleImageWidget +{ + layout: avatar_layout; +} + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.widgetml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.css Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,44 @@ + +BubbleParticipantListItem[layoutOption="collapsed"] { + layout:collapsed; +} + +BubbleParticipantListItem[layoutOption="expanded"] { + layout:expanded; +} + +BubbleParticipantListItem::icon { + fixed-width: var(hb-param-graphic-size-primary-medium); + fixed-height: var(hb-param-graphic-size-primary-medium); +} + +BubbleParticipantListItem::ciphering { + fixed-width: 2.0un; + fixed-height: 2.0un; + left: (hb-param-margin-gene-middle-horizontal); + top: (hb-param-margin-gene-middle-vertical); + color: var(qtc_list_item_title_normal); +} + +BubbleParticipantListItem::expand-indi { + fixed-width: var(hb-param-graphic-size-primary-small); + fixed-height: var(hb-param-graphic-size-primary-small); + right: var(hb-param-margin-gene-middle-horizontal); +} + +BubbleParticipantListItem::text +{ + text-height: var(hb-param-text-height-primary); + font-variant: primary; + color: var(qtc_list_item_title_normal); + left: var(hb-param-margin-gene-middle-horizontal); + right: var(hb-param-margin-gene-middle-horizontal); +} + +BubbleParticipantListItem::button-1 { + fixed-height: 9.0un; +} + +BubbleParticipantListItem::button-2 { + fixed-height: 9.0un; +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.widgetml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblemanager2.pro --- a/phoneuis/bubblemanager2/bubblemanager2.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblemanager2.pro Fri May 14 15:51:57 2010 +0300 @@ -30,15 +30,6 @@ BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ "./rom/bubblemanager.iby CORE_APP_LAYER_IBY_EXPORT_PATH(bubblemanager.iby)" - - # qt plugin stub - pluginstub.sources += bubblestyleplugin.dll - pluginstub.path = $$QT_PLUGINS_BASE_DIR/phone - DEPLOYMENT += pluginstub - # for target - BLD_INF_RULES.prj_exports += \ - "./qmakepluginstubs/bubblestyleplugin.qtplugin /$$HW_ZDIR$$RESOURCE_FILES_DIR/qt/plugins/phone/bubblestyleplugin.qtplugin" } SUBDIRS += ./bubblecore -SUBDIRS += ./bubblestyle \ No newline at end of file diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/bubblestyle.pro --- a/phoneuis/bubblemanager2/bubblestyle/bubblestyle.pro Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# -TEMPLATE = lib -TARGET = bubblestyleplugin -CONFIG += plugin hb -INCLUDEPATH += . ../inc - -win32 { - INCLUDEPATH += c:/hb/include/hbcore c:/hb/include/hbwidgets - DESTDIR = c:/hb/lib - DLLDESTDIR = c:/hb/bin -} - -symbian:TARGET.EPOCALLOWDLLDATA = 1 -symbian:TARGET.CAPABILITY = CAP_GENERAL_DLL -symbian:TARGET.UID3 = 0x20029F89 - -# Input -include(src/bubblestyle.pri) -RESOURCES += bubblestyle.qrc diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/bubblestyle.qrc --- a/phoneuis/bubblemanager2/bubblestyle/bubblestyle.qrc Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - resources/qgn_indi_call_diverted.svg - layout/bubbleparticipantlistitem.widgetml - layout/bubbleparticipantlistitem.css - layout/bubbleheadingwidget.widgetml - layout/bubbleheadingwidget.css - layout/bubbleimagewidget.widgetml - layout/bubbleimagewidget.css - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleheadingwidget.css --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleheadingwidget.css Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - - -BubbleHeadingWidget[layoutOption="three_lines"] -{ - layout: three_lines_layout; -} - -BubbleHeadingWidget[layoutOption="two_lines"] -{ - layout: two_lines_layout; -} - -BubbleHeadingWidget[layoutOption="one_line"] -{ - layout: one_line_layout; -} - -BubbleHeadingWidget:text_line_1 -{ - preferred-height: var(hb-param-text-height-primary); - left: -var(hb-param-margin-gene-middle-horizontal); -} - -BubbleHeadingWidget:text_line_2[layoutOption!="one_line"] -{ - preferred-height: var(hb-param-text-height-primary); - preferred-width: -1; - left: -var(hb-param-margin-gene-middle-horizontal); - top: -var(hb-param-margin-gene-middle-vertical); - text-align: left; -} - -BubbleHeadingWidget:text_line_2[layoutOption="one_line"] -{ - preferred-height: var(hb-param-text-height-primary); - preferred-width: 30un; - left: -var(hb-param-margin-gene-middle-horizontal); - text-align: right; -} - -BubbleHeadingWidget:text_line_3 -{ - preferred-height: var(hb-param-text-height-primary); - left: -var(hb-param-margin-gene-middle-horizontal); - top: -var(hb-param-margin-gene-middle-vertical); -} - -BubbleHeadingWidget:status_icon -{ - fixed-width: var(hb-param-graphic-size-primary-large); - fixed-height: var(hb-param-graphic-size-primary-large); -} - -BubbleHeadingWidget:number_type_icon -{ - fixed-height: var(hb-param-graphic-size-secondary); - fixed-width: var(hb-param-graphic-size-secondary); -} - -BubbleHeadingWidget:ciphering_icon -{ - fixed-height: 2.5un; - fixed-width: 2.5un; -} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleheadingwidget.widgetml --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleheadingwidget.widgetml Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.css --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.css Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - -BubbleImageWidget -{ - layout: avatar_layout; -} - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.widgetml --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleimagewidget.widgetml Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - - - - - - - - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleparticipantlistitem.css --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleparticipantlistitem.css Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ - -BubbleParticipantListItem[layoutOption="collapsed"] { - layout:collapsed; -} - -BubbleParticipantListItem[layoutOption="expanded"] { - layout:expanded; -} - -BubbleParticipantListItem::icon { - fixed-width: var(hb-param-graphic-size-primary-medium); - fixed-height: var(hb-param-graphic-size-primary-medium); -} - -BubbleParticipantListItem::ciphering { - fixed-width: 2.0un; - fixed-height: 2.0un; - left: (hb-param-margin-gene-middle-horizontal); - top: (hb-param-margin-gene-middle-vertical) -} - -BubbleParticipantListItem::expand-indi { - fixed-width: var(hb-param-graphic-size-primary-small); - fixed-height: var(hb-param-graphic-size-primary-small); - right: var(hb-param-margin-gene-middle-horizontal); -} - -BubbleHeadingWidget:text -{ - preferred-height: var(hb-param-text-height-primary); - left: var(hb-param-margin-gene-middle-horizontal); - right: var(hb-param-margin-gene-middle-horizontal); -} - -BubbleParticipantListItem::button-1 { - fixed-height: 9.0un; -} - -BubbleParticipantListItem::button-2 { - fixed-height: 9.0un; -} - -BubbleParticipantListItem::background{ - left:0.0; - right:0.0; - top:0.0; - bottom:0.0; -} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/layout/bubbleparticipantlistitem.widgetml --- a/phoneuis/bubblemanager2/bubblestyle/layout/bubbleparticipantlistitem.widgetml Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/resources/qgn_indi_call_diverted.svg --- a/phoneuis/bubblemanager2/bubblestyle/resources/qgn_indi_call_diverted.svg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/src/bubbleanimiconitem.cpp --- a/phoneuis/bubblemanager2/bubblestyle/src/bubbleanimiconitem.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +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: Animated icon. -* -*/ - -#include -#include -#include "bubbleanimiconitem.h" - -BubbleAnimIconItem::BubbleAnimIconItem( int interval, QGraphicsItem* parent ) - : HbIconItem( parent ), mInterval(interval), mAnimationTimerId(0) -{ - reset(); -} - -BubbleAnimIconItem::~BubbleAnimIconItem() -{ - reset(); -} - -void BubbleAnimIconItem::appendIcon( const QString& iconName ) -{ - HbIcon* icon = new HbIcon(iconName); - icon->setSize(rect().size()); - mFrames.append(icon); - if (mFrames.count()==1) { - setIcon(*icon); // initial frame - } -} - -void BubbleAnimIconItem::startAnimation(int interval) -{ - mAnimationTimerId = startTimer(interval); -} - -void BubbleAnimIconItem::stopAnimation() -{ - if ( mAnimationTimerId ) { - killTimer(mAnimationTimerId); - mAnimationTimerId = 0; - } -} - -void BubbleAnimIconItem::reset() -{ - stopAnimation(); - foreach (HbIcon* icon, mFrames) { - delete icon; - } - mFrames.clear(); - mCurrentFrame = 0; -} - -void BubbleAnimIconItem::timerEvent(QTimerEvent *event) -{ - Q_UNUSED(event) - - mCurrentFrame = (mCurrentFrame + 1) % mFrames.count(); - setIcon(*mFrames.at(mCurrentFrame)); - update(); -} - -void BubbleAnimIconItem::paint( - QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget *widget ) -{ - HbIconItem::paint( painter, option, widget ); - - if ( mFrames.count() && mAnimationTimerId == 0 ) { - startAnimation(mInterval); // begin animation - } -} - -QVariant BubbleAnimIconItem::itemChange( - GraphicsItemChange change, - const QVariant& value ) -{ - if (change==QGraphicsItem::ItemVisibleHasChanged) { - if (mAnimationTimerId && value.toBool()==false) { - stopAnimation(); // stop animation when going invisible - } - } - - return HbIconItem::itemChange( change, value ); -} - -void BubbleAnimIconItem::resizeEvent(QGraphicsSceneResizeEvent *event) -{ - HbIconItem::resizeEvent(event); - foreach (HbIcon* icon, mFrames) { - icon->setSize(event->newSize()); - } -} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/src/bubbleanimiconitem.h --- a/phoneuis/bubblemanager2/bubblestyle/src/bubbleanimiconitem.h Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +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: Animated icon. -* -*/ - -#ifndef BUBBLEANIMICONITEM_H_ -#define BUBBLEANIMICONITEM_H_ - -#include -#include - -class BubbleAnimIconItem : public HbIconItem - { - Q_OBJECT // for timer - -public: - explicit BubbleAnimIconItem( int interval, QGraphicsItem* parent = 0 ); - virtual ~BubbleAnimIconItem(); - - void appendIcon( const QString& iconName ); - void reset(); - -protected: - void startAnimation(int interval); - void stopAnimation(); - void timerEvent(QTimerEvent *event); - void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); - void resizeEvent( QGraphicsSceneResizeEvent * event ); - -protected: - int mInterval; - int mAnimationTimerId; - int mCurrentFrame; - QList mFrames; - }; - -#endif /* BUBBLEANIMICONITEM_H_ */ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/src/bubblestyle.pri --- a/phoneuis/bubblemanager2/bubblestyle/src/bubblestyle.pri Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# -HEADERS += src/bubblestyleplugin.h \ - src/bubbleanimiconitem.h - -SOURCES += src/bubblestyleplugin.cpp \ - src/bubbleanimiconitem.cpp - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.cpp --- a/phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,314 +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: Bubble style plugin. -* -*/ - -#include "bubblestyleplugin.h" -#include "bubblestyleoption.h" -#include "bubbleprimitives.h" -#include "bubbleanimiconitem.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static const int BUBBLE_ICON_ANIM_INTERVAL = 500; // ms - -BubbleStylePlugin::BubbleStylePlugin() -{ - mCliFont = new HbFontSpec(HbFontSpec::Primary); - mTextFont = new HbFontSpec(HbFontSpec::Secondary); - mTimerFont = new HbFontSpec(HbFontSpec::Secondary); - - HbDeviceProfile profile; - mCliFont->setTextHeight(4*HbDeviceProfile::current().unitValue()); - mTextFont->setTextHeight(4*HbDeviceProfile::current().unitValue()); - mTimerFont->setTextHeight(4*HbDeviceProfile::current().unitValue()); -} - -BubbleStylePlugin::~BubbleStylePlugin() -{ - delete mCliFont; - delete mTextFont; - delete mTimerFont; -} - -int BubbleStylePlugin::primitiveCount() const -{ - return BP_Bubble_primitive_count; -} - -QGraphicsItem* BubbleStylePlugin::createPrimitive( - HbStyle::Primitive primitive, - QGraphicsItem *parent) const -{ - QGraphicsItem* item = 0; - - switch(primitive) { - case BP_Bubble_frame: { - HbFrameItem* frame = new HbFrameItem(parent); - frame->setZValue(-1.0); - HbFrameDrawer *drawer = new HbFrameDrawer(); - frame->setFrameDrawer( drawer ); // takes ownership - item = frame; - } - break; - case BP_Text1_text: - case BP_Text2_text: - case BP_Text3_text: { - HbTextItem* text = new HbTextItem(parent); - item = text; - } - break; - case BP_CallStatus_icon: { - BubbleAnimIconItem* anim = - new BubbleAnimIconItem(BUBBLE_ICON_ANIM_INTERVAL,parent); - item = anim; - } - break; - case BP_NumberType_icon: { - HbIconItem* icon = new HbIconItem(parent); - item = icon; - } - break; - case BP_Ciphering_icon: { - HbIconItem* icon = new HbIconItem(parent); - item = icon; - } - break; - case BP_DefaultAvatar_icon: { - HbIconItem* icon = new HbIconItem(parent); - item = icon; - } - default: - break; - } // switch - - return item; -} - -void BubbleStylePlugin::updatePrimitive( - QGraphicsItem *item, - HbStyle::Primitive primitive, - const QStyleOption *option ) const -{ -#ifndef Q_OS_SYMBIAN - // qtcast didn't work with mingw - const BubbleStyleOption *opt = static_cast(option); -#else - const BubbleStyleOption *opt = qstyleoption_cast(option); -#endif - if ( !opt ) { - return; - } - - switch(primitive) { - case BP_Bubble_frame: { - HbFrameItem *frame = static_cast(item); - frame->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - frame->frameDrawer().setFrameGraphicsName("qtg_fr_list_normal"); - } - break; - - case BP_Text1_text: { - HbTextItem* textItem = static_cast(item); - setText(textItem, opt->mText1, opt->mText1Clip); - setFont(textItem, primitive, opt); - } - break; - - case BP_Text2_text: { - HbTextItem* textItem = static_cast(item); - setText(textItem, opt->mText2, opt->mText2Clip); - setFont(textItem, primitive, opt); - } - break; - - case BP_Text3_text: { - HbTextItem* textItem = static_cast(item); - setText(textItem, opt->mText3, opt->mText3Clip); - setFont(textItem, primitive, opt); - } - break; - - case BP_CallStatus_icon: { - setCallStatusIcons(static_cast(item), opt); - } - break; - - case BP_NumberType_icon: { - HbIconItem* icon = static_cast(item); - if ( (( opt->mCallState == BubbleManagerIF::Incoming ) || - ( opt->mCallState == BubbleManagerIF::Waiting )) && - ( opt->mCallFlags & BubbleManagerIF::Diverted ) ) { - icon->setIconName(":/qgn_indi_call_diverted.svg"); - setIconColor(icon); - icon->show(); - } else { - icon->setIconName(QString()); - icon->hide(); - } - } - break; - - case BP_Ciphering_icon: { - HbIconItem* icon = static_cast(item); - if ( opt->mCallFlags & BubbleManagerIF::NoCiphering ) { - icon->setIconName("qtg_mono_ciphering_off"); - setIconColor(icon); - icon->show(); - } else { - icon->setIconName(QString()); - icon->hide(); - } - } - 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 -} - -void BubbleStylePlugin::setText( - HbTextItem* item, - const QString& text, - Qt::TextElideMode clip) const -{ - if (clip == Qt::ElideLeft) { - // convert phonenumber to phone ui language - QString converted = HbStringUtil::convertDigits(text); - item->setText(converted); - } else { - item->setText( text ); - } - item->setElideMode( clip ); -} - -void BubbleStylePlugin::setFont( - HbTextItem* item, - int primitive, - const BubbleStyleOption *option) const -{ - int primitiveLineNumber = 0; - if (primitive==BP_Text1_text) { - primitiveLineNumber = 1; - } else if (primitive==BP_Text2_text) { - primitiveLineNumber = 2; - } else if (primitive==BP_Text3_text) { - primitiveLineNumber = 3; - } - - QFont font = mTextFont->font(); - if (primitiveLineNumber==option->mCliLineNumber) { - font = mCliFont->font(); - } else if (primitiveLineNumber==option->mTimerLineNumber) { - font = mTimerFont->font(); - } - - item->setFont(font); - - // set color (to be done via css when possible) - QColor color; - color = HbColorScheme::color("list_item_title_normal"); - if (color.isValid()) { - item->setTextColor(color); - } else { - item->setTextColor(Qt::black); - } -} - -void BubbleStylePlugin::setIconColor(HbIconItem* icon) const -{ - // to be done via css when possible - QColor color; - color = HbColorScheme::color("list_item_title_normal"); - if (color.isValid()) { - icon->setColor(color); - } -} - -QString BubbleStylePlugin::layoutPath() const -{ - QString path(":/"); - return path; -} - -void BubbleStylePlugin::setCallStatusIcons(BubbleAnimIconItem* anim, const BubbleStyleOption *opt) const -{ - anim->reset(); - switch(opt->mCallState) { - case BubbleManagerIF::Incoming: - case BubbleManagerIF::Alerting: - case BubbleManagerIF::Waiting: - if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - 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_call_active"); - anim->appendIcon("qtg_large_video_call_waiting"); - } else { - anim->appendIcon("qtg_large_active_call"); - anim->appendIcon("qtg_large_waiting_call"); - } - break; - case BubbleManagerIF::Outgoing: - case BubbleManagerIF::Active: - if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_voip_call_active"); - } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - 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_call_waiting"); - } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_video_call_waiting"); - } else { - anim->appendIcon("qtg_large_waiting_call"); - } - break; - case BubbleManagerIF::Disconnected: - case BubbleManagerIF::AlertToDisconnected: - if ( opt->mCallFlags & BubbleManagerIF::VoIPCall ) { - anim->appendIcon("qtg_large_end_call"); - } else if ( opt->mCallFlags & BubbleManagerIF::Video ) { - anim->appendIcon("qtg_large_end_call"); - } else { - anim->appendIcon("qtg_large_end_call"); - } - break; - default: - break; - } - -} - -Q_EXPORT_PLUGIN2(bubblestyleplugin, BubbleStylePlugin) diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.h --- a/phoneuis/bubblemanager2/bubblestyle/src/bubblestyleplugin.h Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bubble style plugin. -* -*/ - -#ifndef BUBBLESTYLEPLUGIN_H -#define BUBBLESTYLEPLUGIN_H - -#include - -#include -#include - -class HbFontSpec; -class HbTextItem; -class HbIconItem; -class BubbleStyleOption; -class BubbleAnimIconItem; - -class BubbleStylePlugin: public QObject, public HbStyleInterface -{ - Q_OBJECT - Q_INTERFACES(HbStyleInterface) - -public: - BubbleStylePlugin(); - virtual ~BubbleStylePlugin(); - -protected: - int primitiveCount() const; - QGraphicsItem *createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent = 0 ) const; - void updatePrimitive( QGraphicsItem *item, HbStyle::Primitive primitive, const QStyleOption *option ) const; - QString layoutPath() const; - -private: - void setCallStatusIcons(BubbleAnimIconItem* anim, const BubbleStyleOption *opt) const; - void setText(HbTextItem* item, const QString& text, Qt::TextElideMode clip) const; - void setFont(HbTextItem* item, int primitive, const BubbleStyleOption *option) const; - void setIconColor(HbIconItem* icon) const; - -private: - HbFontSpec* mCliFont; - HbFontSpec* mTextFont; - HbFontSpec* mTimerFont; -}; - -#endif // BUBBLESTYLEPLUGIN_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/inc/bubblemanager2.h --- a/phoneuis/bubblemanager2/inc/bubblemanager2.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/inc/bubblemanager2.h Fri May 14 15:51:57 2010 +0300 @@ -355,7 +355,6 @@ QVector mActiveHandlers; int mIsReadyToDraw; - int mDefaultStyleBaseId; bool mMuted; QGraphicsWidget* mMutedIcon; bool mSortHeaders; diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/inc/bubbleprimitives.h --- a/phoneuis/bubblemanager2/inc/bubbleprimitives.h Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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: Primitive items in call bubble. -* -*/ - -#ifndef BUBBLEPRIMITIVES_H -#define BUBBLEPRIMITIVES_H - -enum BubblePrimitive -{ - BP_Bubble_frame = 0, - BP_Text1_text, - BP_Text2_text, - BP_Text3_text, - BP_CallStatus_icon, - BP_NumberType_icon, - BP_Ciphering_icon, - BP_DefaultAvatar_icon, - BP_Bubble_primitive_count -}; - -#endif // BUBBLEPRIMITIVES_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/inc/bubblestyleoption.h --- a/phoneuis/bubblemanager2/inc/bubblestyleoption.h Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bubble style option. -* -*/ - -#ifndef BUBBLESTYLEOPTION_H -#define BUBBLESTYLEOPTION_H - -#include -#include "bubblemanagerif.h" - -class BubbleStyleOption : public HbStyleOption -{ -public: - BubbleStyleOption(); - BubbleStyleOption(const BubbleStyleOption &other); - ~BubbleStyleOption(); - - enum StyleOptionType { Type = HbSO_CustomBase + 1 }; - enum StyleOptionVersion { Version = 1 }; - - QString mText1; - Qt::TextElideMode mText1Clip; - QString mText2; - Qt::TextElideMode mText2Clip; - QString mText3; - Qt::TextElideMode mText3Clip; - int mCliLineNumber; - int mTimerLineNumber; - BubbleManagerIF::PhoneCallState mCallState; - BubbleManagerIF::PhoneNumberType mNumberType; - int mCallFlags; -}; - -#endif // BUBBLESTYLEOPTION_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/rom/bubblemanager.iby --- a/phoneuis/bubblemanager2/rom/bubblemanager.iby Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/rom/bubblemanager.iby Fri May 14 15:51:57 2010 +0300 @@ -23,8 +23,4 @@ file=ABI_DIR/BUILD_DIR/bubblemanager2.dll SHARED_LIB_DIR/bubblemanager2.dll -//indicator popup plugin -file=ABI_DIR/BUILD_DIR/bubblestyleplugin.dll SHARED_LIB_DIR/bubblestyleplugin.dll -data=DATAZ_/resource/qt/plugins/phone/bubblestyleplugin.qtplugin resource/qt/plugins/phone/bubblestyleplugin.qtplugin - #endif // __BUBBLEMANAGER_IBY__ diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/runall.cmd --- a/phoneuis/bubblemanager2/tsrc/unit/runall.cmd Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/runall.cmd Fri May 14 15:51:57 2010 +0300 @@ -21,15 +21,11 @@ call runtest.cmd ut_bubbleheader call runtest.cmd ut_bubbleconferenceheader call runtest.cmd ut_bubblepartlistmodel -call runtest.cmd ut_bubblestyleoption call runtest.cmd ut_bubblecontainerwidget call runtest.cmd ut_bubbleheadingwidget call runtest.cmd ut_bubbleimagewidget call runtest.cmd ut_bubbleparticipantlistitem -call runtest.cmd ut_bubblebuttonstyle -call runtest.cmd ut_bubbleanimiconitem -call runtest.cmd ut_bubblestyleplugin -call runtest.cmd mt_bubblemanager2 +rem call runtest.cmd mt_bubblemanager2 ) @echo off @@ -38,15 +34,11 @@ call runtest_w32.cmd ut_bubbleheader call runtest_w32.cmd ut_bubbleconferenceheader call runtest_w32.cmd ut_bubblepartlistmodel -call runtest_w32.cmd ut_bubblestyleoption call runtest_w32.cmd ut_bubblecontainerwidget call runtest_w32.cmd ut_bubbleheadingwidget call runtest_w32.cmd ut_bubbleimagewidget call runtest_w32.cmd ut_bubbleparticipantlistitem -call runtest_w32.cmd ut_bubblebuttonstyle -call runtest_w32.cmd ut_bubbleanimiconitem -call runtest_w32.cmd ut_bubblestyleplugin -call runtest_w32.cmd mt_bubblemanager2 +rem call runtest_w32.cmd mt_bubblemanager2 ) @echo off @@ -56,14 +48,11 @@ ut_bubbleheader\mon.sym ut_bubbleheader\mon.dat^ ut_bubbleconferenceheader\mon.sym ut_bubbleconferenceheader\mon.dat^ ut_bubblepartlistmodel\mon.sym ut_bubblepartlistmodel\mon.dat^ - ut_bubblestyleoption\mon.sym ut_bubblestyleoption\mon.dat^ ut_bubblecontainerwidget\mon.sym ut_bubblecontainerwidget\mon.dat^ ut_bubbleheadingwidget\mon.sym ut_bubbleheadingwidget\mon.dat^ ut_bubbleimagewidget\mon.sym ut_bubbleimagewidget\mon.dat^ ut_bubbleparticipantlistitem\mon.sym ut_bubbleparticipantlistitem\mon.dat^ - ut_bubblebuttonstyle\mon.sym ut_bubblebuttonstyle\mon.dat^ ut_bubbleanimiconitem\mon.sym ut_bubbleanimiconitem\mon.dat^ - ut_bubblestyleplugin\mon.sym ut_bubblestyleplugin\mon.dat^ -p profile.txt call ctc2html -i profile.txt ) diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/shared/bubbletest.h --- a/phoneuis/bubblemanager2/tsrc/unit/shared/bubbletest.h Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/shared/bubbletest.h Fri May 14 15:51:57 2010 +0300 @@ -35,16 +35,4 @@ return ret; \ } -// style plugin name -#if defined(Q_OS_SYMBIAN) - const char* BUBBLE_STYLE_PLUGIN = \ - "z:/resource/qt/plugins/phone/bubblestyleplugin.dll"; -#elif defined(Q_OS_WIN) - const char* BUBBLE_STYLE_PLUGIN = \ - "c:/hb/bin/bubblestyleplugin.dll"; -#else // Q_OS_UNIX - const char* BUBBLE_STYLE_PLUGIN = \ - "/home/lib/libbubblestyleplugin.so"; -#endif - #endif // BUBBLETEST_H diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/unit.pro --- a/phoneuis/bubblemanager2/tsrc/unit/unit.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/unit.pro Fri May 14 15:51:57 2010 +0300 @@ -20,14 +20,10 @@ SUBDIRS += ut_bubbleconferenceheader SUBDIRS += ut_bubblepartlistmodel SUBDIRS += ut_bubbleutils -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 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/data/qtg_indi_call_connect.svg --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/data/qtg_indi_call_connect.svg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/data/qtg_indi_call_wait.svg --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/data/qtg_indi_call_wait.svg Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include - -#include -#include -#include - -#include "bubbletest.h" -#include "bubbleanimiconitem.h" - -class Container : public HbWidget -{ -public: - Container() - { - mItem = new BubbleAnimIconItem(50,this); - mItem->appendIcon(":/data/qtg_indi_call_connect.svg"); - mItem->appendIcon(":/data/qtg_indi_call_wait.svg"); - QGraphicsLinearLayout* layout = new - QGraphicsLinearLayout; - layout->addItem(mItem); - setLayout(layout); - } - - void reset() - { - mItem->reset(); - } - -private: - BubbleAnimIconItem* mItem; -}; - -class ut_BubbleAnimIconItem : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void testItem(); - -private: - HbMainWindow* mMainWindow; - Container* mContainer; - int mStyleBaseId; -}; - -void ut_BubbleAnimIconItem::initTestCase() -{ - mMainWindow = new HbMainWindow(); - mContainer = new Container; - mMainWindow->addView(mContainer); - mContainer->hide(); - mMainWindow->show(); -} - -void ut_BubbleAnimIconItem::cleanupTestCase() -{ - delete mMainWindow; -} - -void ut_BubbleAnimIconItem::testItem() -{ - mContainer->show(); - QTest::qWait(200); - mContainer->hide(); -} - -BUBBLE_TEST_MAIN(ut_BubbleAnimIconItem) -#include "ut_bubbleanimiconitem.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.pro Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# - -TEMPLATE = app -TARGET = -DEPENDPATH += . ../../../bubblecore/src -INCLUDEPATH += . ../../../bubblestyle/src ../../../inc ../shared -CONFIG += hb qtestlib - -symbian { - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} else:win32 { - DESTDIR = ./ -} - -# -HEADERS += ../../../bubblestyle/src/bubbleanimiconitem.h -SOURCES += ut_bubbleanimiconitem.cpp \ - ../../../bubblestyle/src/bubbleanimiconitem.cpp -RESOURCES += ut_bubbleanimiconitem.qrc diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.qrc --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleanimiconitem/ut_bubbleanimiconitem.qrc Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - data/qtg_indi_call_wait.svg - data/qtg_indi_call_connect.svg - - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblebuttonstyle/ut_bubblebuttonstyle.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblebuttonstyle/ut_bubblebuttonstyle.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +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 -#include -#include -#include -#include -#include -#include - -#include "bubbletest.h" -#include "bubblebuttonstyle.h" - -class ut_BubbleButtonStyle : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void testPushButtonFrame(); - void testPushButtonIcon(); - -private: - BubbleButtonStyle *mStyle; -}; - -void ut_BubbleButtonStyle::initTestCase() -{ - mStyle = new BubbleButtonStyle(); -} - -void ut_BubbleButtonStyle::cleanupTestCase() -{ - delete mStyle; -} - -void ut_BubbleButtonStyle::testPushButtonFrame() -{ - HbFrameItem* item = new HbFrameItem(); - HbStyleOptionPushButton option; - option.backgroundFrameDrawer = 0; - - // Enabled ON - option.state |= QStyle::State_On; - option.state |= QStyle::State_Enabled; - - mStyle->setButtonColor(BubbleButtonStyle::Default); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_pressed"); - - mStyle->setButtonColor(BubbleButtonStyle::Green); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_green_pressed"); - - mStyle->setButtonColor(BubbleButtonStyle::Red); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_red_pressed"); - - // Enabled OFF - option.state &= ~QStyle::State_On; - option.state |= QStyle::State_Off; - - mStyle->setButtonColor(BubbleButtonStyle::Default); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_normal"); - - mStyle->setButtonColor(BubbleButtonStyle::Green); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_green_normal"); - - mStyle->setButtonColor(BubbleButtonStyle::Red); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_red_normal"); - - // Disabled - option.state &= ~QStyle::State_Enabled; - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_disabled"); - - // Selected - option.state |= QStyle::State_Selected; - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_highlight"); - - // Active - option.state &= ~QStyle::State_Selected; - option.state |= QStyle::State_Active; - mStyle->setButtonColor(BubbleButtonStyle::Default);; - mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_normal"); - - delete item; - - // exception type - HbIconItem* item2 = new HbIconItem(); - mStyle->updatePrimitive(item2,HbStyle::P_PushButton_background,&option); - delete item2; -} - -void ut_BubbleButtonStyle::testPushButtonIcon() -{ - HbIconItem* item = new HbIconItem(); - HbStyleOptionPushButton option; - - mStyle->setButtonColor(BubbleButtonStyle::Red); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==Qt::white); - - mStyle->setButtonColor(BubbleButtonStyle::Green); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==Qt::white); - - QColor color; - color = HbColorScheme::color("qtc_button_normal"); - mStyle->setButtonColor(BubbleButtonStyle::Default); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==color); -} - -BUBBLE_TEST_MAIN(ut_BubbleButtonStyle) -#include "ut_bubblebuttonstyle.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblebuttonstyle/ut_bubblebuttonstyle.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblebuttonstyle/ut_bubblebuttonstyle.pro Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# - -TEMPLATE = app -TARGET = -DEPENDPATH += . ../../../bubblecore/src -INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared -CONFIG += hb qtestlib - -symbian { - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} else:win32 { - DESTDIR = ./ -} - -# -HEADERS += ../../../bubblecore/src/bubblebuttonstyle.h -SOURCES += ut_bubblebuttonstyle.cpp \ - ../../../bubblecore/src/bubblebuttonstyle.cpp - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -40,8 +40,6 @@ void testRightMouseClick(); void testMouseMove(); - //void testInvalidStylePlugin(); - private: BubbleContainerWidget* mContainer; HbMainWindow* mMainWindow; @@ -51,7 +49,7 @@ void ut_BubbleContainerWidget::initTestCase() { mMainWindow = new HbMainWindow(); - mContainer = new BubbleContainerWidget(BUBBLE_STYLE_PLUGIN); + mContainer = new BubbleContainerWidget(); mMainWindow->addView(mContainer); mMainWindow->show(); } @@ -99,14 +97,5 @@ QCOMPARE( spy.count(), 0 ); } -/*void ut_BubbleContainerWidget::testInvalidStylePlugin() -{ - // this just shouldn't crash - BubbleContainerWidget *cnt = - new BubbleContainerWidget("c:\foobar.dll"); - HbView* view = mMainWindow->addView(cnt); - mMainWindow->setCurrentView(view); -}*/ - BUBBLE_TEST_MAIN(ut_BubbleContainerWidget) #include "ut_bubblecontainerwidget.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.pro Fri May 14 15:51:57 2010 +0300 @@ -30,6 +30,6 @@ # HEADERS += ../../../bubblecore/src/bubblecontainerwidget.h SOURCES += ut_bubblecontainerwidget.cpp \ - ../../../bubblecore/src/bubblecontainerwidget.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp + ../../../bubblecore/src/bubblecontainerwidget.cpp + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.css Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,70 @@ + + +BubbleHeadingWidget[layoutOption="three_lines"] +{ + layout: three_lines_layout; +} + +BubbleHeadingWidget[layoutOption="two_lines"] +{ + layout: two_lines_layout; +} + +BubbleHeadingWidget[layoutOption="one_line"] +{ + layout: one_line_layout; +} + +BubbleHeadingWidget:text_line_1 +{ + preferred-height: var(hb-param-text-height-primary); + left: -var(hb-param-margin-gene-middle-horizontal); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_2[layoutOption!="one_line"] +{ + preferred-height: var(hb-param-text-height-primary); + preferred-width: -1; + left: -var(hb-param-margin-gene-middle-horizontal); + top: -var(hb-param-margin-gene-middle-vertical); + text-align: left; + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_2[layoutOption="one_line"] +{ + preferred-height: var(hb-param-text-height-primary); + preferred-width: 30un; + left: -var(hb-param-margin-gene-middle-horizontal); + text-align: right; + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:text_line_3 +{ + preferred-height: var(hb-param-text-height-primary); + left: -var(hb-param-margin-gene-middle-horizontal); + top: -var(hb-param-margin-gene-middle-vertical); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:status_icon +{ + fixed-width: var(hb-param-graphic-size-primary-large); + fixed-height: var(hb-param-graphic-size-primary-large); +} + +BubbleHeadingWidget:number_type_icon +{ + fixed-height: var(hb-param-graphic-size-secondary); + fixed-width: var(hb-param-graphic-size-secondary); + color: var(qtc_list_item_title_normal); +} + +BubbleHeadingWidget:ciphering_icon +{ + fixed-height: 2.5un; + fixed-width: 2.5un; + color: var(qtc_list_item_title_normal); +} diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.widgetml Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -52,7 +52,7 @@ void ut_BubbleHeadingWidget::initTestCase() { mMainWindow = new HbMainWindow(); - mHeading = new BubbleHeadingWidget(BUBBLE_STYLE_PLUGIN); + mHeading = new BubbleHeadingWidget(); mMainWindow->addView(mHeading); mMainWindow->show(); } @@ -92,7 +92,7 @@ header.setSecondaryCli("12345",Qt::ElideLeft); header.setText("",Qt::ElideRight); header.setTimerCost("0:00"); - header.setCallState(BubbleManagerIF::Active); + header.setCallState(BubbleManagerIF::Outgoing); header.setCallFlag(BubbleManagerIF::NoCiphering); mHeading->setLineCount(2); diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.pro Fri May 14 15:51:57 2010 +0300 @@ -28,11 +28,13 @@ } # -HEADERS += ../../../bubblecore/src/bubbleheadingwidget.h +HEADERS += ../../../bubblecore/src/bubbleheadingwidget.h \ + ../../../bubblecore/src/bubblebutton.h + SOURCES += ut_bubbleheadingwidget.cpp \ ../../../bubblecore/src/bubbleheadingwidget.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp \ ../../../bubblecore/src/bubbleheader.cpp \ ../../../bubblecore/src/bubbleutils.cpp \ - ../../../bubblecore/src/bubblebuttonstyle.cpp + ../../../bubblecore/src/bubblebutton.cpp +RESOURCES += ut_bubbleheadingwidget.qrc diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.qrc Fri May 14 15:51:57 2010 +0300 @@ -0,0 +1,6 @@ + + + resources/bubbleheadingwidget.widgetml + resources/bubbleheadingwidget.css + + diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp Fri May 14 15:51:57 2010 +0300 @@ -47,7 +47,6 @@ private: BubbleImageWidget* mImage; HbMainWindow* mMainWindow; - int mStyleBaseId; BubbleImageManager* mImageManager; }; @@ -64,8 +63,7 @@ { mMainWindow = new HbMainWindow(); mImageManager = new BubbleImageManager(); - mImage = new BubbleImageWidget( - BUBBLE_STYLE_PLUGIN,*mImageManager); + mImage = new BubbleImageWidget(*mImageManager); mMainWindow->addView(mImage); mMainWindow->show(); } diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro Fri May 14 15:51:57 2010 +0300 @@ -42,7 +42,6 @@ ../../../bubblecore/src/bubbleimagemanager_p.h SOURCES += ut_bubbleimagewidget.cpp \ ../../../bubblecore/src/bubbleimagewidget.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp \ ../../../bubblecore/src/bubbleimagemanager.cpp symbian { diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp Fri May 14 15:51:57 2010 +0300 @@ -27,7 +27,6 @@ #include "bubbletest.h" #include "bubbleparticipantlistitem.h" -#include "bubblebuttonstyle.h" class ut_BubbleParticipantListItem : public QObject { @@ -43,17 +42,16 @@ private: BubbleParticipantListItem* mItem; HbMainWindow* mMainWindow; - BubbleButtonStyle* mButtonStyle; int mStyleBaseId; }; void ut_BubbleParticipantListItem::initTestCase() { mMainWindow = new HbMainWindow(); - mButtonStyle = new BubbleButtonStyle(); - mItem = new BubbleParticipantListItem(BUBBLE_STYLE_PLUGIN,*mButtonStyle); + mItem = new BubbleParticipantListItem(); mMainWindow->addView(mItem); - HbListViewItem* item = static_cast(mItem); + BubbleParticipantListItem* item = + static_cast(mItem); item->updateChildItems(); mMainWindow->show(); } @@ -62,7 +60,6 @@ { mItem->clearActions(); delete mMainWindow; - delete mButtonStyle; } void ut_BubbleParticipantListItem::testCreateItem() diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.pro Fri May 14 15:51:57 2010 +0300 @@ -28,9 +28,13 @@ } # -HEADERS += ../../../bubblecore/src/bubbleparticipantlistitem.h +HEADERS += ../../../bubblecore/src/bubbleparticipantlistitem.h \ + ../../../bubblecore/src/bubblebutton.h + SOURCES += ut_bubbleparticipantlistitem.cpp \ ../../../bubblecore/src/bubbleparticipantlistitem.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp \ - ../../../bubblecore/src/bubblebuttonstyle.cpp + ../../../bubblecore/src/bubbleutils.cpp \ + ../../../bubblecore/src/bubbleheader.cpp \ + ../../../bubblecore/src/bubbleconferenceheader.cpp \ + ../../../bubblecore/src/bubblebutton.cpp diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleoption/ut_bubblestyleoption.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleoption/ut_bubblestyleoption.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/*! -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include - -#include -#include -#include - -#include "bubbletest.h" -#include "bubblestyleoption.h" - -class ut_BubbleStyleOption : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void testStyleOption(); - -private: -}; - -void ut_BubbleStyleOption::initTestCase() -{ -} - -void ut_BubbleStyleOption::cleanupTestCase() -{ -} - -void ut_BubbleStyleOption::testStyleOption() -{ - BubbleStyleOption option; - Q_ASSERT(option.mText1==""); - option.mText1="John"; - BubbleStyleOption option2(option); - Q_ASSERT(option2.mText1 == "John"); -} - -BUBBLE_TEST_MAIN(ut_BubbleStyleOption) -#include "ut_bubblestyleoption.moc" diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleoption/ut_bubblestyleoption.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleoption/ut_bubblestyleoption.pro Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# - -TEMPLATE = app -TARGET = -DEPENDPATH += . ../../../bubblecore/src -INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared -CONFIG += hb qtestlib - -symbian { - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} else:win32 { - DESTDIR = ./ -# CONFIG(debug,debug|release) -# { -# QMAKE_CXX = ctc -i d g++ -# LIBS += $$(CTCHOME)\lib\ctcmsnt.lib -# } -} - -# -SOURCES += ut_bubblestyleoption.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.cpp Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +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 -#include -#include -#include -#include -#include -#include -#include - -#include "bubbletest.h" -#include "bubblestyleplugin.h" -#include "bubbleprimitives.h" -#include "bubblestyleoption.h" -#include "bubbleanimiconitem.h" - -class ut_BubbleStylePlugin : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void testPrimitiveCount(); - void testLayoutPath(); - - void testBubbleFrame(); - void testText1(); - void testText2(); - void testText3(); - void testCallStatusIcon(); - void testVideoCallStatusIcon(); - void testVoipCallStatusIcon(); - void testNumberTypeIcon(); - void testCipheringIcon(); - void testAvatar(); - -private: - BubbleStylePlugin* mPluginInstance; - HbStyleInterface* mPlugin; - HbWidget* mParent; -}; - -void ut_BubbleStylePlugin::initTestCase() -{ - mPluginInstance = new BubbleStylePlugin(); - mPlugin = static_cast(mPluginInstance); - mParent = new HbWidget(); -} - -void ut_BubbleStylePlugin::cleanupTestCase() -{ - delete mPluginInstance; - delete mParent; -} - -void ut_BubbleStylePlugin::testPrimitiveCount() -{ - QVERIFY(mPlugin->primitiveCount()==BP_Bubble_primitive_count); -} - -void ut_BubbleStylePlugin::testLayoutPath() -{ - QVERIFY(mPlugin->layoutPath()==":/"); -} - -void ut_BubbleStylePlugin::testBubbleFrame() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_Bubble_frame),mParent); - QVERIFY(item); - QVERIFY(item->zValue()==-1.0); - QVERIFY(item->parentItem()==mParent); - - HbFrameItem* frame = qgraphicsitem_cast(item); - QVERIFY(frame); - - BubbleStyleOption option; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Bubble_frame), - &option); - QVERIFY(frame->frameDrawer().frameGraphicsName()== - "qtg_fr_list_normal"); -} - -void ut_BubbleStylePlugin::testText1() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_Text1_text),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - HbTextItem* text = qgraphicsitem_cast(item); - QVERIFY(text); - - BubbleStyleOption option; - option.mText1 = "foo"; - option.mText1Clip = Qt::ElideRight; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Text1_text), - &option); - QVERIFY(text->text()=="foo"); - QVERIFY(text->elideMode()==Qt::ElideRight); - -} - -void ut_BubbleStylePlugin::testText2() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_Text2_text),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - HbTextItem* text = qgraphicsitem_cast(item); - QVERIFY(text); - - BubbleStyleOption option; - option.mText2 = "foo"; - option.mText2Clip = Qt::ElideRight; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Text2_text), - &option); - QVERIFY(text->text()=="foo"); - QVERIFY(text->elideMode()==Qt::ElideRight); - -} - -void ut_BubbleStylePlugin::testText3() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_Text3_text),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - HbTextItem* text = qgraphicsitem_cast(item); - QVERIFY(text); - - BubbleStyleOption option; - option.mText3 = "foo"; - option.mText3Clip = Qt::ElideLeft; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Text3_text), - &option); - QVERIFY(text->text()=="foo"); - QVERIFY(text->elideMode()==Qt::ElideLeft); - -} - -void ut_BubbleStylePlugin::testCallStatusIcon() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_CallStatus_icon),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - BubbleAnimIconItem* icon = static_cast(item); - QVERIFY(icon); - - BubbleStyleOption option; - option.mCallState = BubbleManagerIF::Active; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::OnHold; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Disconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::AlertToDisconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Incoming; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Alerting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Waiting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Outgoing; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); -} - -void ut_BubbleStylePlugin::testVideoCallStatusIcon() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_CallStatus_icon),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - BubbleAnimIconItem* icon = static_cast(item); - QVERIFY(icon); - - BubbleStyleOption option; - option.mCallFlags |= BubbleManagerIF::Video; - option.mCallState = BubbleManagerIF::Active; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::OnHold; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Disconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::AlertToDisconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Incoming; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Alerting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Waiting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Outgoing; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); -} - -void ut_BubbleStylePlugin::testVoipCallStatusIcon() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_CallStatus_icon),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - BubbleAnimIconItem* icon = static_cast(item); - QVERIFY(icon); - - BubbleStyleOption option; - option.mCallFlags |= BubbleManagerIF::VoIPCall; - option.mCallState = BubbleManagerIF::Active; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::OnHold; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Disconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::AlertToDisconnected; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Incoming; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Alerting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Waiting; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); - option.mCallState = BubbleManagerIF::Outgoing; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_CallStatus_icon), - &option); -} - -void ut_BubbleStylePlugin::testNumberTypeIcon() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_NumberType_icon),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - HbIconItem* icon = qgraphicsitem_cast(item); - QVERIFY(icon); - BubbleStyleOption option; - // incoming call - option.mCallState = BubbleManagerIF::Incoming; - option.mCallFlags |= BubbleManagerIF::Diverted; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_NumberType_icon), - &option); - QVERIFY(icon->icon().iconName()==":/qgn_indi_call_diverted.svg"); - option.mCallState = BubbleManagerIF::Incoming; - option.mCallFlags &= ~BubbleManagerIF::Diverted; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_NumberType_icon), - &option); - QVERIFY(icon->icon().iconName()==""); - - // waiting call - option.mCallState = BubbleManagerIF::Waiting; - option.mCallFlags |= BubbleManagerIF::Diverted; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_NumberType_icon), - &option); - QVERIFY(icon->icon().iconName()==":/qgn_indi_call_diverted.svg"); - option.mCallState = BubbleManagerIF::Waiting; - option.mCallFlags &= ~BubbleManagerIF::Diverted; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_NumberType_icon), - &option); - QVERIFY(icon->icon().iconName()==""); -} - -void ut_BubbleStylePlugin::testCipheringIcon() -{ - QGraphicsItem *item = mPlugin->createPrimitive( - (HbStyle::Primitive)(BP_Ciphering_icon),mParent); - QVERIFY(item); - QVERIFY(item->parentItem()==mParent); - - HbIconItem* icon = qgraphicsitem_cast(item); - QVERIFY(icon); - BubbleStyleOption option; - option.mCallState = BubbleManagerIF::Active; - option.mCallFlags |= BubbleManagerIF::NoCiphering; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Ciphering_icon), - &option); - QVERIFY(icon->icon().iconName()=="qtg_mono_ciphering_off"); - option.mCallState = BubbleManagerIF::Incoming; - option.mCallFlags &= ~BubbleManagerIF::NoCiphering; - mPlugin->updatePrimitive( - item, (HbStyle::Primitive)(BP_Ciphering_icon), - &option); - 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 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubblestyleplugin/ut_bubblestyleplugin.pro Mon May 03 12:31:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# - -TEMPLATE = app -TARGET = -DEPENDPATH += . ../../../bubblestyle/src -INCLUDEPATH += . ../../../bubblestyle/src ../../../inc ../shared -CONFIG += hb qtestlib - -symbian { - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} else:win32 { - DESTDIR = ./ -} - -# -HEADERS += ../../../bubblestyle/src/bubblestyleplugin.h \ - ../../../bubblestyle/src/bubbleanimiconitem.h -SOURCES += ut_bubblestyleplugin.cpp \ - ../../../bubblestyle/src/bubblestyleplugin.cpp \ - ../../../bubblestyle/src/bubbleanimiconitem.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp - diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.cpp --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.cpp Fri May 14 15:51:57 2010 +0300 @@ -20,21 +20,13 @@ #include #include #include -#include +#include #include #include "bubbletest.h" #include "bubbleutils.h" #include "bubbleheader.h" -#include "bubblestyleoption.h" -#include "bubblebuttonstyle.h" - -class BubbleButtonStyleMock : public BubbleButtonStyle -{ -public: - BubbleButtonStyleMock() {}; - BubbleButtonStyle::ButtonColor color() {return mButtonColor; }; -}; +#include "bubbleconferenceheader.h" class ut_BubbleUtils : public QObject { @@ -62,9 +54,15 @@ void test_compareHeaders(); - void test_stylePluginNameWithPath(); + void test_setButtonStyleForAction(); - void test_setButtonStyleForAction(); + void test_voiceCallStatusIcon(); + void test_videoCallStatusIcon(); + void test_voipCallStatusIcon(); + + void test_numberTypeIcon(); + + void test_cipheringIcon(); private: }; @@ -81,414 +79,445 @@ { // incoming call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Incoming ); header.setCli( "john", Qt::ElideRight ); header.setText( "calling", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "calling" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "calling" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "calling" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "calling" ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_waiting() { // incoming call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Waiting ); header.setCli( "john", Qt::ElideRight ); header.setText( "waiting", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "waiting" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "waiting" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "waiting" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "waiting" ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_active() { // active call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Active ); header.setCli( "john", Qt::ElideRight ); header.setText( "", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "" ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "" ); + QVERIFY( text3.text() == "" ); // add timer - opt = BubbleStyleOption(); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "00:00" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); + QVERIFY( text1.text()== "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "00:00" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); header.setTimerCost( "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "" ); // add timer - opt = BubbleStyleOption(); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "00:00" ); - QVERIFY( opt.mText3Clip == Qt::ElideRight ); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); + QVERIFY( text1.text()== "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "00:00" ); + QVERIFY( text3.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_disconnected() { // disconnected call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Disconnected ); header.setCli( "john", Qt::ElideRight ); header.setText( "discon", Qt::ElideRight ); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "discon" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "discon" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "discon" ); - QVERIFY( opt.mText3Clip == Qt::ElideRight ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "discon" ); + QVERIFY( text3.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_outgoing() { // outgoing call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Outgoing ); header.setCli( "john", Qt::ElideRight ); header.setText( "calling", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "calling" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "john" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "calling" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "john" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "calling" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "john" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "12345" ); - QVERIFY( opt.mText3Clip == Qt::ElideLeft ); + QVERIFY( text1.text() == "calling" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "john" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "12345" ); + QVERIFY( text3.elideMode() == Qt::ElideLeft ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_alerting() { // alerting call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Alerting ); header.setCli( "john", Qt::ElideRight ); header.setText( "calling", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "" ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "" ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "" ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_held() { // held BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::OnHold ); header.setCli( "john", Qt::ElideRight ); header.setText( "on hold", Qt::ElideRight ); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "on hold" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "on hold" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "on hold" ); - QVERIFY( opt.mText3Clip == Qt::ElideRight ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "on hold" ); + QVERIFY( text3.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts3Lines_alerttodisconnected() { // incoming call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + HbTextItem text3; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Incoming ); header.setCallState( BubbleManager::AlertToDisconnected ); header.setCli( "john", Qt::ElideRight ); header.setText( "disconnected", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "disconnected" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "disconnected" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); + QVERIFY( text3.text() == "" ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli( "12345", Qt::ElideLeft ); - BubbleUtils::setCallHeaderTexts3Lines(header, opt); + BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "12345" ); - QVERIFY( opt.mText2Clip == Qt::ElideLeft ); - QVERIFY( opt.mText3 == "disconnected" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "12345" ); + QVERIFY( text2.elideMode() == Qt::ElideLeft ); + QVERIFY( text3.text() == "disconnected" ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_waiting() { // waiting call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Waiting ); header.setCli( "john", Qt::ElideRight ); header.setText( "waiting", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "waiting" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "waiting" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli("12345",Qt::ElideLeft); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "waiting" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "waiting" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_alerttodisconnected() { // waiting call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; - header.setCallState( BubbleManager::Waiting ); + header.setCallState( BubbleManager::AlertToDisconnected ); header.setCli( "john", Qt::ElideRight ); header.setText( "disconnected", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "disconnected" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "disconnected" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); // add secondary cli - opt = BubbleStyleOption(); header.setSecondaryCli("12345",Qt::ElideLeft); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "disconnected" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "disconnected" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_active() { // active call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Active ); header.setCli( "john", Qt::ElideRight ); header.setText( "", Qt::ElideRight ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "" ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "" ); // add timer - opt = BubbleStyleOption(); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "00:00" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "00:00" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_held() { // held BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; header.setCallState( BubbleManager::OnHold ); header.setCli( "john", Qt::ElideRight ); header.setText( "on hold", Qt::ElideRight ); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "on hold" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "on hold" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_disconnected() { // disconnected call BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; header.setCallState( BubbleManager::Disconnected ); header.setCli( "john", Qt::ElideRight ); header.setText( "discon", Qt::ElideRight ); header.setTimerCost( "00:00" ); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); - QVERIFY( opt.mText1 == "john" ); - QVERIFY( opt.mText1Clip == Qt::ElideRight ); - QVERIFY( opt.mText2 == "discon" ); - QVERIFY( opt.mText2Clip == Qt::ElideRight ); - QVERIFY( opt.mText3 == "" ); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); + QVERIFY( text1.text() == "john" ); + QVERIFY( text1.elideMode() == Qt::ElideRight ); + QVERIFY( text2.text() == "discon" ); + QVERIFY( text2.elideMode() == Qt::ElideRight ); } void ut_BubbleUtils::test_setCallHeaderTexts2Lines_outgoing() { // outgoing BubbleHeader header; - BubbleStyleOption opt; + HbTextItem text1; + HbTextItem text2; + int cliLine; + int timerLine; header.setCallState(BubbleManager::Outgoing); header.setCli("john", Qt::ElideRight); header.setText("calling", Qt::ElideRight); header.setTimerCost("00:00"); - BubbleUtils::setCallHeaderTexts2Lines(header, opt); - QCOMPARE(opt.mText1, QString("calling")); - QCOMPARE(opt.mText1Clip, Qt::ElideRight); - QCOMPARE(opt.mText2, QString("john")); - QCOMPARE(opt.mText2Clip, Qt::ElideRight); + BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine); + QCOMPARE(text1.text(), QString("calling")); + QCOMPARE(text1.elideMode(), Qt::ElideRight); + QCOMPARE(text2.text(), QString("john")); + QCOMPARE(text2.elideMode(), Qt::ElideRight); } void ut_BubbleUtils::test_compareHeaders() { BubbleHeader header1; BubbleHeader header2; + BubbleConferenceHeader headerC; header1.setCallState(BubbleManagerIF::Active); header2.setCallState(BubbleManagerIF::Waiting); @@ -497,40 +526,207 @@ header1.setCallState(BubbleManagerIF::Active); header2.setCallState(BubbleManagerIF::OnHold); QVERIFY( BubbleUtils::compareHeaders(&header1,&header2) == true ); -} -void ut_BubbleUtils::test_stylePluginNameWithPath() -{ -#if defined(Q_OS_SYMBIAN) - QString name(BubbleUtils::stylePluginNameWithPath("bubblestyleplugin.dll")); - QVERIFY(name=="z:/resource/qt/plugins/phone/bubblestyleplugin.dll"); -#elif defined(Q_OS_WIN) - QString name(BubbleUtils::stylePluginNameWithPath("bubblestyleplugin.dll")); - QVERIFY(name=="c:/hb/bin/bubblestyleplugin.dll"); -#else // Q_OS_UNIX - QString name(BubbleUtils::stylePluginNameWithPath("bubblestyleplugin.dll")); - QVERIFY(name=="/home/lib/bubblestyleplugin.dll"); -#endif + headerC.setCallState(BubbleManagerIF::Active); + header1.setCallState(BubbleManagerIF::OnHold); + + QVERIFY( BubbleUtils::compareHeaders(&headerC,&header1) == false ); } void ut_BubbleUtils::test_setButtonStyleForAction() { - HbPushButton button; - BubbleButtonStyleMock style; - button.setStyle(&style); + BubbleButton button; HbAction action; action.setSoftKeyRole(QAction::NoSoftKey); BubbleUtils::setButtonStyleForAction(button,action); - QVERIFY(style.color()==BubbleButtonStyle::Default); + QVERIFY(button.buttonType()==BubbleButton::DefaultButton); action.setSoftKeyRole(QAction::PositiveSoftKey); BubbleUtils::setButtonStyleForAction(button,action); - QVERIFY(style.color()==BubbleButtonStyle::Green); + QVERIFY(button.buttonType()==BubbleButton::GreenButton); action.setSoftKeyRole(QAction::NegativeSoftKey); BubbleUtils::setButtonStyleForAction(button,action); - QVERIFY(style.color()==BubbleButtonStyle::Red); + QVERIFY(button.buttonType()==BubbleButton::RedButton); +} + +void ut_BubbleUtils::test_voiceCallStatusIcon() +{ + HbIconItem icon; + icon.hide(); + + // test different voice call states + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="voice_call_waiting_anim"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Waiting, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="voice_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Alerting, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="voice_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Active, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="qtg_large_active_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Outgoing, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="qtg_large_active_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::OnHold, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="qtg_large_waiting_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Disconnected, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + icon.hide(); + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::None, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()==""); + QVERIFY(icon.isVisible()==false); +} + +void ut_BubbleUtils::test_videoCallStatusIcon() +{ + HbIconItem icon; + icon.hide(); + + // test different voice call states + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="video_call_waiting_anim"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Waiting, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="video_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Alerting, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="video_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Active, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="qtg_large_video_call_active"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Outgoing, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="qtg_large_video_call_active"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::OnHold, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="qtg_large_video_call_waiting"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Disconnected, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + icon.hide(); + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::None, BubbleManagerIF::Video, icon); + QVERIFY(icon.iconName()==""); + QVERIFY(icon.isVisible()==false); +} + +void ut_BubbleUtils::test_voipCallStatusIcon() +{ + HbIconItem icon; + icon.hide(); + + // test different voice call states + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="voip_call_waiting_anim"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Waiting, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="voip_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Alerting, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="voip_call_waiting_anim"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Active, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="qtg_large_voip_call_active"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Outgoing, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="qtg_large_voip_call_active"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::OnHold, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="qtg_large_voip_call_waiting"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::Disconnected, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()=="qtg_large_end_call"); + + icon.hide(); + BubbleUtils::setCallStatusIcon( + BubbleManagerIF::None, BubbleManagerIF::VoIPCall, icon); + QVERIFY(icon.iconName()==""); + QVERIFY(icon.isVisible()==false); +} + +void ut_BubbleUtils::test_numberTypeIcon() +{ + HbIconItem icon; + icon.hide(); + + BubbleUtils::setNumberTypeIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::Diverted, icon); + QVERIFY(icon.iconName()==":/qtg_mono_call_diverted.svg"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setNumberTypeIcon( + BubbleManagerIF::Waiting, BubbleManagerIF::Diverted, icon); + QVERIFY(icon.iconName()==":/qtg_mono_call_diverted.svg"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setNumberTypeIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()==""); + QVERIFY(icon.isVisible()==false); +} + +void ut_BubbleUtils::test_cipheringIcon() +{ + HbIconItem icon; + icon.hide(); + + BubbleUtils::setCipheringIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::NoCiphering, icon); + QVERIFY(icon.iconName()=="qtg_mono_ciphering_off"); + QVERIFY(icon.isVisible()==true); + + BubbleUtils::setCipheringIcon( + BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon); + QVERIFY(icon.iconName()==""); + QVERIFY(icon.isVisible()==false); } BUBBLE_TEST_MAIN(ut_BubbleUtils) diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.pro --- a/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.pro Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.pro Fri May 14 15:51:57 2010 +0300 @@ -27,11 +27,12 @@ DESTDIR = ./ } -# +HEADERS += ../../../bubblecore/src/bubblebutton.h + SOURCES += ut_bubbleutils.cpp \ ../../../bubblecore/src/bubbleheader.cpp \ + ../../../bubblecore/src/bubbleconferenceheader.cpp \ ../../../bubblecore/src/bubbleutils.cpp \ - ../../../bubblecore/src/bubblestyleoption.cpp \ - ../../../bubblecore/src/bubblebuttonstyle.cpp + ../../../bubblecore/src/bubblebutton.cpp