diff -r 594d59766373 -r 7d48bed6ce0c cellular/psuinotes/src/psuidivertnotehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/src/psuidivertnotehandler.cpp Tue Aug 31 15:45:17 2010 +0300 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this 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 "psuinotes.h" +#include "psuidivertnotehandler.h" +#include "psuilogging.h" + +/*! + PsUiDivertNoteHandler::PsUiDivertNoteHandler + */ +PsUiDivertNoteHandler::PsUiDivertNoteHandler(PSetCallDivertingWrapper& callDivertingWrapper) : + m_callDivertingWrapper(callDivertingWrapper) +{ + DPRINT << ": IN"; + + QObject::connect( + &m_callDivertingWrapper, + SIGNAL(handleDivertingChanged(const PSCallDivertingCommand&,bool)), + this, + SLOT(handleDivertingChanged(const PSCallDivertingCommand&,bool))); + QObject::connect( + &m_callDivertingWrapper, + SIGNAL(handleDivertingStatus(QList&, bool)), + this, + SLOT(handleDivertingStatus(QList&, bool))); + QObject::connect( + &m_callDivertingWrapper, + SIGNAL(handleDivertingError(int)), + this, + SLOT(handleDivertingError(int))); + QObject::connect( + &m_callDivertingWrapper, + SIGNAL(handleCFRequesting(bool,bool)), + this, + SLOT(handleCFRequesting(bool,bool))); + DPRINT << ": OUT"; +} + +/*! + PsUiDivertNoteHandler::~PsUiDivertNoteHandler + */ +PsUiDivertNoteHandler::~PsUiDivertNoteHandler() +{ +} + +/*! + PsUiDivertNoteHandler::handleDivertingChanged + */ +void PsUiDivertNoteHandler::handleDivertingChanged( + const PSCallDivertingCommand& aSetting, + bool aPlural) +{ + DPRINT << ": IN"; + switch ( aSetting.iStatus ) { + case DivertingStatusActive: + if (aPlural) { + PsUiNotes::instance()->showGlobalNotificationDialog( + hbTrId("txt_phone_info_diverts_activated")); + } else { + PsUiNotes::instance()->showGlobalNotificationDialog( + hbTrId("txt_phone_info_divert_activated")); + } + break; + case DivertingStatusNotRegistered: + case DivertingStatusInactive: + if (aPlural) { + PsUiNotes::instance()->showGlobalNotificationDialog( + hbTrId("txt_phone_info_diverts_deactivated")); + } else { + PsUiNotes::instance()->showGlobalNotificationDialog( + hbTrId("txt_phone_info_divert_deactivated")); + } + break; + case DivertingStatusNotProvisioned: + case DivertingStatusUnknown: + default: + PsUiNotes::instance()->showGlobalNotificationDialog( + hbTrId("txt_phone_info_request_not_completed")); + } + DPRINT << ": OUT"; +} + +/*! + PsUiDivertNoteHandler::handleDivertingStatus + */ +void PsUiDivertNoteHandler::handleDivertingStatus( + QList& divertList, + bool plural) +{ + DPRINT << ": IN"; + Q_UNUSED(plural); + + PsUiNotes::instance()->showCallDivertDetails(divertList); + DPRINT << ": OUT"; +} + +/*! + PsUiDivertNoteHandler::handleDivertingError + */ +void PsUiDivertNoteHandler::handleDivertingError(int aReason) +{ + DPRINT << ": IN"; + // Cancel previous note + PsUiNotes::instance()->cancelNote(m_activeNoteId); + // Show error note + PsUiNotes::instance()->showGlobalErrorNote(m_activeNoteId, aReason); + DPRINT << ": OUT"; +} + +/*! + PsUiDivertNoteHandler::handleCFRequesting + */ +void PsUiDivertNoteHandler::handleCFRequesting(bool ongoing, bool interrupted) +{ + DPRINT << ": IN"; + if (interrupted) { + PsUiNotes::instance()->cancelNote(m_activeProgressNoteId); + PsUiNotes::instance()->cancelNote(m_activeNoteId); + } else { + if (ongoing) { + PsUiNotes::instance()->showGlobalProgressNote( + m_activeProgressNoteId, hbTrId("txt_phone_info_requesting")); + } else { + PsUiNotes::instance()->cancelNote(m_activeProgressNoteId); + } + } + DPRINT << ": OUT"; +}