# HG changeset patch # User hgs # Date 1279878228 -10800 # Node ID e6aff7b69165269224530899352805ef25672b8f # Parent 81c360d47083e004374e472a5bfd598ec7d88ce1 201029 diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_services_api/contacts_services_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_services_api/contacts_services_api.metaxml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts services API + Qt Highway services offered by Contacts package. + c++ + phonebookui + + + + no + no + + diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_services_api/inc/cntservicescontact.h --- a/contacts_plat/contacts_services_api/inc/cntservicescontact.h Wed Jul 21 11:37:51 2010 +0300 +++ b/contacts_plat/contacts_services_api/inc/cntservicescontact.h Fri Jul 23 12:43:48 2010 +0300 @@ -38,7 +38,7 @@ const int KCntServicesReturnValueContactSaved = 1; const int KCntServicesReturnValueContactDeleted = -1; const int KCntServicesReturnValueContactNotModified = 0; - +const int KCntServicesTerminated = -2; /** * A data container class to be used with "phonebookservices" Qt Highway services. diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_ui_api/contacts_ui_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_api/contacts_ui_api.metaxml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts UI API + Contacts UI related APIs. + c++ + phonebookui + + + + no + no + + diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h --- a/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h Wed Jul 21 11:37:51 2010 +0300 +++ b/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h Fri Jul 23 12:43:48 2010 +0300 @@ -34,7 +34,7 @@ /* New API */ virtual void changeView( const CntViewParameters aArgs ) = 0; - virtual void back( const CntViewParameters aArgs ) = 0; + virtual void back( const CntViewParameters aArgs, bool toRoot = false ) = 0; virtual QContactManager* contactManager( const QString& aType ) = 0; }; diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_ui_api/inc/cntviewparams.h --- a/contacts_plat/contacts_ui_api/inc/cntviewparams.h Wed Jul 21 11:37:51 2010 +0300 +++ b/contacts_plat/contacts_ui_api/inc/cntviewparams.h Fri Jul 23 12:43:48 2010 +0300 @@ -38,7 +38,7 @@ ESelectedDetail, ESelectionMode, EMyCard, - EFinder, + EExtraAction, ECustomParam = 100 }; @@ -46,7 +46,7 @@ { noView=0, //exit namesView, - commLauncherView, + contactCardView, serviceContactCardView, serviceAssignContactCardView, myCardView, @@ -54,7 +54,7 @@ serviceContactSelectionView, collectionView, collectionFavoritesView, - FavoritesMemberView, + favoritesMemberView, editView, serviceEditView, serviceSubEditView, diff -r 81c360d47083 -r e6aff7b69165 contacts_plat/contacts_ui_extensions_api/contacts_ui_extensions_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_extensions_api/contacts_ui_extensions_api.metaxml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts UI extensions API + Plugin APIs for extending phonebook application. + c++ + phonebookui + + + + no + no + + diff -r 81c360d47083 -r e6aff7b69165 contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp --- a/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -113,7 +113,11 @@ CommLauncherWidget::~CommLauncherWidget() { // Deleting request cancels all pending requests - delete mRequest; + if (mRequest) { + delete mRequest; + mRequest = NULL; + } + } /*! @@ -518,12 +522,14 @@ */ void CommLauncherWidget::keyPressEvent(QKeyEvent *event) { + qDebug() << "keyPressEvent event=" << event->key(); if (event->key() == Qt::Key_Yes) { // Call key initializes a call makeCall(); event->accept(); } else { - HbPopup::keyPressEvent(event); + close(); + //HbPopup::keyPressEvent(event); } } @@ -544,3 +550,4 @@ return width; } + diff -r 81c360d47083 -r e6aff7b69165 contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp --- a/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -135,15 +135,37 @@ */ ContactWidgetHs::~ContactWidgetHs() { - delete mLauncher; - delete mContactManager; - delete mAppManager; - delete mAvatar; - // Deleting request cancels all pending requests - delete mContactSelectRequest; - //,,first cancel? - delete mThumbnailManager; - delete mTranslator; + if (mLauncher) + { + delete mLauncher; + } + if (mContactManager) + { + delete mContactManager; + } + if (mAppManager) + { + delete mAppManager; + } + if (mAvatar) + { + delete mAvatar; + } + + // Deleting request cancels all pending requests + if (mContactSelectRequest) + { + delete mContactSelectRequest; + } + + if (mThumbnailManager) + { + delete mThumbnailManager; + } + if (mTranslator) + { + delete mTranslator; + } } /*! @@ -240,17 +262,38 @@ painter.end(); qDebug() << "setContactImage av 2"; //,, + int maxSize = (inputPixmap.width() > inputPixmap.height() ? inputPixmap.width():inputPixmap.height()); + int minSize = (inputPixmap.width() < inputPixmap.height() ? inputPixmap.width():inputPixmap.height()); + int sizeFrom = maxSize - minSize; // We may draw the icon when thumnail processing is still in progress, // so can't show the thumbnail yet. if (inputPixmap.width()>0) { + if (inputPixmap.width() < inputPixmap.height()) + { + QPixmap pm3 = inputPixmap.copy(0,sizeFrom/2,minSize,minSize); + QPixmap pm2 = pm3.scaled( QSize(contactIconSize, contactIconSize), Qt::KeepAspectRatio ); + qDebug() << "pm2 " << pm2.width() << " " << pm2.height(); + avatarPixmap = pm2; + } + else if (inputPixmap.width() > inputPixmap.height()) + { + QPixmap pm3 = inputPixmap.copy(sizeFrom/2,0,minSize,minSize); + QPixmap pm2 = pm3.scaled( QSize(contactIconSize, contactIconSize), Qt::KeepAspectRatio ); + qDebug() << "pm2 " << pm2.width() << " " << pm2.height(); + avatarPixmap = pm2; + }else + { QPixmap pm2 = inputPixmap.scaled( QSize(contactIconSize, contactIconSize), Qt::IgnoreAspectRatio ); qDebug() << "pm2 " << pm2.width() << " " << pm2.height(); avatarPixmap = pm2; // + } } HbIcon *avatarIcon = new HbIcon(QIcon(avatarPixmap)); mAvatarIconItem->setIcon(*avatarIcon); + mAvatarIconItem->setSize(QSize(contactIconSize, contactIconSize)); + mAvatarIconItem->setAspectRatioMode(Qt::KeepAspectRatio); // Then display the new image update(); @@ -414,7 +457,21 @@ */ void ContactWidgetHs::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event && event->type() == QEvent::GraphicsSceneMousePress) { + Q_UNUSED(event); +} + +/*! + \fn void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) + + Widget start is triggered from release \a event. + \sa +*/ +void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) +{ + qDebug() << "mouseReleaseEvent event->type() = " << (int)event->type(); + + //Q_UNUSED(event); + if (event && event->type() == QEvent::GraphicsSceneMouseRelease) { // If the widget doesn't have contact yet and // there are contacts, select one. if (mContactLocalId == unUsedContactId) { @@ -447,17 +504,6 @@ } } -/*! - \fn void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) - - Widget start is triggered from release \a event. - \sa -*/ -void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) -{ - Q_UNUSED(event); -} - // Store contact data to member variables and to UI void ContactWidgetHs::getContactData() @@ -751,7 +797,17 @@ for(i=0; ideleteLater(); + mContactNameLabel->deleteLater(); + mAppManager->deleteLater(); + mLauncher->deleteLater(); + mContactLocalId = unUsedContactId; + delete mAvatar; + mContactHasAvatarDetail = false; + mContactManager->deleteLater(); + mThumbnailManager->deleteLater(); + emit finished(); break; } diff -r 81c360d47083 -r e6aff7b69165 inc/cntdebug.h --- a/inc/cntdebug.h Wed Jul 21 11:37:51 2010 +0300 +++ b/inc/cntdebug.h Fri Jul 23 12:43:48 2010 +0300 @@ -23,7 +23,8 @@ #include // qDebug() // #define TRACK_MEMORY_LEAKS -// #define CNT_TRACE2FILE +// #define TRACES +// #define TRACE2FILE /*! \def CNT_UNUSED(name) @@ -350,7 +351,13 @@ by the streaming operator <<. */ -#if defined (_DEBUG) || defined (CNT_TRACE2FILE) +// traces for debug builds by default, or if +// TRACES macro is defined +#if defined (_DEBUG) && !defined (TRACES) +#define TRACES +#endif + +#if defined (TRACES) || defined (TRACE2FILE) #define CNT_UNUSED(name) #define CNT_STATIC_ENTRY qDebug() << __PRETTY_FUNCTION__ << "entry"; #define CNT_STATIC_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "entry," << args; @@ -376,7 +383,7 @@ #define CNT_WARNING(args) #define CNT_CRITICAL(args) #define CNT_FATAL(args) -#endif // _DEBUG || CNT_TRACE2FILE +#endif // TRACES || TRACE2FILE // for tracing memory leaks #ifdef TRACK_MEMORY_LEAKS @@ -413,7 +420,7 @@ #endif // filter phonebook app traces -#ifdef CNT_TRACE2FILE +#ifdef TRACE2FILE #include #include static void cntCustomLog2File(QtMsgType type, const char *msg) @@ -474,6 +481,6 @@ #else #define MSG_HANDLER 0 #endif // Q_OS_SYMBIAN -#endif // CNT_TRACE2FILE +#endif // TRACE2FILE #endif // CNTDEBUG_H diff -r 81c360d47083 -r e6aff7b69165 inc/cntglobal.h --- a/inc/cntglobal.h Wed Jul 21 11:37:51 2010 +0300 +++ b/inc/cntglobal.h Fri Jul 23 12:43:48 2010 +0300 @@ -47,5 +47,7 @@ #define CNT_ADD_ACTION "add" #define CNT_FOCUS_ACTION "focus" #define CNT_SAVE_ACTION "save" +#define CNT_FIND_ACTION "find" +#define CNT_ROOT_ACTION "root" #endif // CNTGLOBAL_H diff -r 81c360d47083 -r e6aff7b69165 phonebookengines/cntactions/src/cntaction.cpp --- a/phonebookengines/cntactions/src/cntaction.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookengines/cntactions/src/cntaction.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -165,20 +165,9 @@ // TODO: Using XQApplicationManager is not working with calls // The factory method cannot create a request. Find out why - bool isCallAction = (m_actionName == "call" || m_actionName == "videocall"); + //bool isCallAction = (m_actionName == "call" || m_actionName == "videocall"); XQServiceRequest snd(interface, operation, false); - delete m_request; - m_request = NULL; - m_request = m_AppManager.create(interface, operation, false); // not embedded - - if (!isCallAction) { - if (!m_request) { - emitResult(GeneralError, retValue); - return; - } - } - //QContactType == TypeGroup if (QContactType::TypeGroup == m_contact.type()) { QContactPhoneNumber conferenceCall = m_contact.detail(); @@ -196,17 +185,9 @@ args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); - // TODO remove once call action works - if (isCallAction) { - snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); - snd.send(retValue); - emitResult(snd.latestError(), retValue); - } - else { - m_request->setArguments(args); - m_request->send(retValue); - emitResult(m_request->lastError(), retValue); - } + snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); + snd.send(retValue); + emitResult(snd.latestError(), retValue); } //QContactType == TypeContact //if no detail, pick preferred @@ -227,17 +208,9 @@ args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); - // TODO remove once call action works - if (isCallAction) { - snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); - snd.send(retValue); - emitResult(snd.latestError(), retValue); - } - else { - m_request->setArguments(args); - m_request->send(retValue); - emitResult(m_request->lastError(), retValue); - } + snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); + snd.send(retValue); + emitResult(snd.latestError(), retValue); } //else return an error else { diff -r 81c360d47083 -r e6aff7b69165 phonebookengines/cntactions/src/cntemailaction.cpp --- a/phonebookengines/cntactions/src/cntemailaction.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookengines/cntactions/src/cntemailaction.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -108,29 +108,6 @@ m_request->send(retValue); emitResult(m_request->lastError(), retValue); } - - // If no detail, pick preferred. - // Todo : Temporary fix. Remove setting preferred when selection popup feature available. - else if (m_detail.isEmpty()) { - QContactDetail detail = m_contact.preferredDetail(m_actionName); - QContactEmailAddress email; - - // If preferred is empty pick first email. - if (detail.isEmpty()) { - email = m_contact.detail(); - } - else { - email = static_cast(detail); - } - - recipients.append(email.emailAddress()); - map.insert(EMAIL_SEND_TO_KEY, recipients); - data.append(map); - - m_request->setArguments(data); - m_request->send(retValue); - emitResult(m_request->lastError(), retValue); - } else { emitResult(GeneralError, retValue); } diff -r 81c360d47083 -r e6aff7b69165 phonebookengines/cntactions/src/cntmessageaction.cpp --- a/phonebookengines/cntactions/src/cntmessageaction.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookengines/cntactions/src/cntmessageaction.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -66,10 +66,60 @@ void CntMessageAction::performAction() { - QString service("com.nokia.symbian.IMessageSend"); - QString type("send(QString,qint32,QString)"); + QList data; + QVariant retValue; - performNumberAction(service, type); + delete m_request; + m_request = NULL; + + //QContactType == TypeGroup + if (QContactType::TypeGroup == m_contact.type()) { + QString interface("com.nokia.symbian.IMessageSend"); + QString operation("send(QVariantMap,QString)"); + m_request = m_AppManager.create(interface, operation, false); // not embedded + if (m_request==NULL) { + emitResult(GeneralError, retValue); + return; + } + + QVariantMap recipientMap; + QVariant value = m_data.value("message"); + if (value.canConvert()) { + recipientMap = value.toMap(); + } + if (!recipientMap.isEmpty()) { + data.append(recipientMap); //recipients + data.append(QString()); //body text + + m_request->setArguments(data); + m_request->send(retValue); + emitResult(m_request->lastError(), retValue); + } + else { + emitResult(GeneralError, retValue); + } + } + //QContactType == TypeContact + //detail exist use it + else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) { + QString interface("com.nokia.symbian.IMessageSend"); + QString operation("send(QString,qint32,QString)"); + m_request = m_AppManager.create(interface, operation, false); // not embedded + if (m_request==NULL) { + emitResult(GeneralError, retValue); + return; + } + + const QContactPhoneNumber &phoneNumber = static_cast(m_detail); + data << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); + + m_request->setArguments(data); + m_request->send(retValue); + emitResult(m_request->lastError(), retValue); + } + else { + emitResult(GeneralError, retValue); + } } diff -r 81c360d47083 -r e6aff7b69165 phonebookengines_old/contactsmodel/groupsql/cntmodel.iby --- a/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby Fri Jul 23 12:43:48 2010 +0300 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include REM Log Engine contact matching plug-in implementation #include @@ -33,9 +33,9 @@ #define CONTACT_SERVER_MAX_HEAPSIZE 0x100000 #endif -file=ABI_DIR\BUILD_DIR\cntsrv.exe System\Programs\cntsrv.exe heapmax=CONTACT_SERVER_MAX_HEAPSIZE -file=ABI_DIR\BUILD_DIR\cntmodel.dll System\Libs\cntmodel.dll -file=ABI_DIR\BUILD_DIR\cntview.dll System\Libs\cntview.dll +file=ABI_DIR/BUILD_DIR/cntsrv.exe System/Programs/cntsrv.exe heapmax=CONTACT_SERVER_MAX_HEAPSIZE +file=ABI_DIR/BUILD_DIR/cntmodel.dll System/Libs/cntmodel.dll +file=ABI_DIR/BUILD_DIR/cntview.dll System/Libs/cntview.dll ECOM_PLUGIN(cntvcard.dll,102035f8.rsc) ECOM_PLUGIN(cntphone.dll,102035fb.rsc) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/bwins/pbkcommonuiu.def --- a/phonebookui/bwins/pbkcommonuiu.def Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/bwins/pbkcommonuiu.def Fri Jul 23 12:43:48 2010 +0300 @@ -27,114 +27,117 @@ ??1CntEditView@@UAE@XZ @ 26 NONAME ; CntEditView::~CntEditView(void) ?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 27 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *) ?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const - ?backPressed@CntContactCardView@@IAEXXZ @ 29 NONAME ; void CntContactCardView::backPressed(void) - ?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 30 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *) - ?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 31 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap) - ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int) - ?viewId@CntEditView@@UBEHXZ @ 33 NONAME ; int CntEditView::viewId(void) const - ?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 34 NONAME ; void * CntContactCardView::qt_metacast(char const *) - ?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 35 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap) - ?viewClosed@CntBaseSelectionView@@IAEXXZ @ 36 NONAME ; void CntBaseSelectionView::viewClosed(void) - ?showActionPopup@CntActionPopup@@QAE_NVQString@@@Z @ 37 NONAME ; bool CntActionPopup::showActionPopup(class QString) - ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0@Z @ 38 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *) - ?keyPressed@CntMainWindow@@IAEXPAVQKeyEvent@@@Z @ 39 NONAME ; void CntMainWindow::keyPressed(class QKeyEvent *) - ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int) - ?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 41 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const - ??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 42 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *) - ?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 43 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const - ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int) - ?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 45 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void) - ??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 46 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *) - ?getStaticMetaObject@CntActionPopup@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & CntActionPopup::getStaticMetaObject(void) - ?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 48 NONAME ; void CntViewNavigator::next(int const &, class QFlags &) - ?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 49 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int) - ?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 50 NONAME ; void * CntEditView::qt_metacast(char const *) - ?contactRemoved@CntEditView@@IAEX_N@Z @ 51 NONAME ; void CntEditView::contactRemoved(bool) - ?d_func@CntActionPopup@@ABEPBVCntActionPopupPrivate@@XZ @ 52 NONAME ; class CntActionPopupPrivate const * CntActionPopup::d_func(void) const - ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 53 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *) - ?metaObject@CntActionPopup@@UBEPBUQMetaObject@@XZ @ 54 NONAME ; struct QMetaObject const * CntActionPopup::metaObject(void) const - ?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 55 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject - ?removeException@CntViewNavigator@@QAEXABH@Z @ 56 NONAME ; void CntViewNavigator::removeException(int const &) - ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *) - ?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 58 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const - ??_ECntMainWindow@@UAE@I@Z @ 59 NONAME ; CntMainWindow::~CntMainWindow(unsigned int) - ?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 60 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const - ?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 61 NONAME ; int const & CntViewNavigator::back(class QFlags &) - ?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 62 NONAME ; void CntDefaultViewManager::changeView(class QMap) - ??_ECntContactCardView@@UAE@I@Z @ 63 NONAME ; CntContactCardView::~CntContactCardView(unsigned int) - ?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 64 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject - ?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 65 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 66 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *) - ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 67 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *) - ?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 68 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject - ??1CntContactCardView@@UAE@XZ @ 69 NONAME ; CntContactCardView::~CntContactCardView(void) - ?isDefault@CntContactCardView@@UBE_NXZ @ 70 NONAME ; bool CntContactCardView::isDefault(void) const - ?qt_metacall@CntActionPopup@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 71 NONAME ; int CntActionPopup::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0CntBaseSelectionView@@QAE@XZ @ 72 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void) - ??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 73 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int) - ??1CntActionPopup@@UAE@XZ @ 74 NONAME ; CntActionPopup::~CntActionPopup(void) - ?viewId@CntContactCardView@@UBEHXZ @ 75 NONAME ; int CntContactCardView::viewId(void) const - ?removeEffect@CntViewNavigator@@QAEXABH@Z @ 76 NONAME ; void CntViewNavigator::removeEffect(int const &) - ?getStaticMetaObject@CntContactCardView@@SAABUQMetaObject@@XZ @ 77 NONAME ; struct QMetaObject const & CntContactCardView::getStaticMetaObject(void) - ?back@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 78 NONAME ; void CntDefaultViewManager::back(class QMap) - ?activate@CntContactCardView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 79 NONAME ; void CntContactCardView::activate(class CntAbstractViewManager *, class QMap) - ?staticMetaObject@CntActionPopup@@2UQMetaObject@@B @ 80 NONAME ; struct QMetaObject const CntActionPopup::staticMetaObject - ?staticMetaObject@CntEditView@@2UQMetaObject@@B @ 81 NONAME ; struct QMetaObject const CntEditView::staticMetaObject - ?viewOpened@CntBaseSelectionView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 82 NONAME ; void CntBaseSelectionView::viewOpened(class CntAbstractViewManager *, class QMap) - ?isDefault@CntEditView@@UBE_NXZ @ 83 NONAME ; bool CntEditView::isDefault(void) const - ??_ECntViewNavigator@@UAE@I@Z @ 84 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int) - ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 85 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *, int) - ?addException@CntViewNavigator@@QAEXABH0@Z @ 86 NONAME ; void CntViewNavigator::addException(int const &, int const &) - ?closeApp@CntDefaultViewManager@@MAEXXZ @ 87 NONAME ; void CntDefaultViewManager::closeApp(void) - ?deactivate@CntBaseSelectionView@@UAEXXZ @ 88 NONAME ; void CntBaseSelectionView::deactivate(void) - ?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 89 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const - ?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 90 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *) - ?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void) - ?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 92 NONAME ; class QString CntViewNavigator::tr(char const *, char const *) - ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *, int) - ?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int) - ?tr@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CntActionPopup::tr(char const *, char const *, int) - ?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 96 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *) - ?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 97 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0CntEditView@@QAE@XZ @ 98 NONAME ; CntEditView::CntEditView(void) - ?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 99 NONAME ; void * CntViewNavigator::qt_metacast(char const *) - ?view@CntContactCardView@@UBEPAVHbView@@XZ @ 100 NONAME ; class HbView * CntContactCardView::view(void) const - ?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int) - ?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString CntContactCardView::tr(char const *, char const *) - ?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString CntEditView::tr(char const *, char const *) - ?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 104 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void) - ?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 105 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const - ?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 106 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject - ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *) - ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *) - ?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 109 NONAME ; void CntDefaultViewManager::switchView(class QMap, class QFlags) - ?deactivate@CntEditView@@UAEXXZ @ 110 NONAME ; void CntEditView::deactivate(void) - ?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 111 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &) - ?addEffect@CntViewNavigator@@QAEXABH0@Z @ 112 NONAME ; void CntViewNavigator::addEffect(int const &, int const &) - ??_ECntActionPopup@@UAE@I@Z @ 113 NONAME ; CntActionPopup::~CntActionPopup(unsigned int) - ?d_func@CntActionPopup@@AAEPAVCntActionPopupPrivate@@XZ @ 114 NONAME ; class CntActionPopupPrivate * CntActionPopup::d_func(void) - ?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 115 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const - ?contactUpdated@CntEditView@@IAEXH@Z @ 116 NONAME ; void CntEditView::contactUpdated(int) - ??1CntDefaultViewManager@@UAE@XZ @ 117 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void) - ??0CntContactCardView@@QAE@XZ @ 118 NONAME ; CntContactCardView::CntContactCardView(void) - ?deactivate@CntContactCardView@@UAEXXZ @ 119 NONAME ; void CntContactCardView::deactivate(void) - ?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 120 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void) - ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 121 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int) - ?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 122 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 123 NONAME ; class QString CntEditView::tr(char const *, char const *, int) - ?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void) - ??1CntViewNavigator@@UAE@XZ @ 125 NONAME ; CntViewNavigator::~CntViewNavigator(void) - ?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 126 NONAME ; void * CntMainWindow::qt_metacast(char const *) - ?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 127 NONAME ; class QString CntEditView::trUtf8(char const *, char const *) - ?isDefault@CntBaseSelectionView@@UBE_NXZ @ 128 NONAME ; bool CntBaseSelectionView::isDefault(void) const - ??1CntBaseSelectionView@@UAE@XZ @ 129 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void) - ?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 130 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int) - ?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 131 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int) - ??_ECntEditView@@UAE@I@Z @ 132 NONAME ; CntEditView::~CntEditView(unsigned int) - ??0CntActionPopup@@QAE@PAVQContact@QtMobility@@@Z @ 133 NONAME ; CntActionPopup::CntActionPopup(class QtMobility::QContact *) - ?executeContactAction@CntActionPopup@@IAEXAAVQContact@QtMobility@@VQContactDetail@3@VQString@@@Z @ 134 NONAME ; void CntActionPopup::executeContactAction(class QtMobility::QContact &, class QtMobility::QContactDetail, class QString) - ?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void) - ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *) - ?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 137 NONAME ; void CntDefaultViewManager::removeCurrentView(void) - ?actionPopupCancelPressed@CntActionPopup@@IAEXXZ @ 138 NONAME ; void CntActionPopup::actionPopupCancelPressed(void) + ?back@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@_N@Z @ 29 NONAME ; void CntDefaultViewManager::back(class QMap, bool) + ?backPressed@CntContactCardView@@IAEXXZ @ 30 NONAME ; void CntContactCardView::backPressed(void) + ?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 31 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *) + ?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 32 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap) + ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 33 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int) + ?viewId@CntEditView@@UBEHXZ @ 34 NONAME ; int CntEditView::viewId(void) const + ?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 35 NONAME ; void * CntContactCardView::qt_metacast(char const *) + ?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 36 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap) + ?viewClosed@CntBaseSelectionView@@IAEXXZ @ 37 NONAME ; void CntBaseSelectionView::viewClosed(void) + ?showActionPopup@CntActionPopup@@QAE_NVQString@@@Z @ 38 NONAME ; bool CntActionPopup::showActionPopup(class QString) + ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0@Z @ 39 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *) + ?keyPressed@CntMainWindow@@IAEXPAVQKeyEvent@@@Z @ 40 NONAME ; void CntMainWindow::keyPressed(class QKeyEvent *) + ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int) + ?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const + ??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 43 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *) + ?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 44 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const + ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int) + ?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void) + ??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 47 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *) + ?actionPopupCancelPressed@CntActionPopup@@IAEXXZ @ 48 NONAME ; void CntActionPopup::actionPopupCancelPressed(void) + ?getStaticMetaObject@CntActionPopup@@SAABUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const & CntActionPopup::getStaticMetaObject(void) + ?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 50 NONAME ; void CntViewNavigator::next(int const &, class QFlags &) + ?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 51 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int) + ?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 52 NONAME ; void * CntEditView::qt_metacast(char const *) + ??0CntContactCardView@@QAE@_N@Z @ 53 NONAME ; CntContactCardView::CntContactCardView(bool) + ?contactRemoved@CntEditView@@IAEX_N@Z @ 54 NONAME ; void CntEditView::contactRemoved(bool) + ?d_func@CntActionPopup@@ABEPBVCntActionPopupPrivate@@XZ @ 55 NONAME ; class CntActionPopupPrivate const * CntActionPopup::d_func(void) const + ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 56 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *) + ?metaObject@CntActionPopup@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * CntActionPopup::metaObject(void) const + ?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 58 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject + ?removeException@CntViewNavigator@@QAEXABH@Z @ 59 NONAME ; void CntViewNavigator::removeException(int const &) + ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 60 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *) + ?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const + ??_ECntMainWindow@@UAE@I@Z @ 62 NONAME ; CntMainWindow::~CntMainWindow(unsigned int) + ?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const + ?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 64 NONAME ; void CntDefaultViewManager::changeView(class QMap) + ??_ECntContactCardView@@UAE@I@Z @ 65 NONAME ; CntContactCardView::~CntContactCardView(unsigned int) + ?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 66 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject + ?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 67 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 68 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 69 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *) + ?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 70 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject + ?isDefault@CntContactCardView@@UBE_NXZ @ 71 NONAME ; bool CntContactCardView::isDefault(void) const + ??1CntContactCardView@@UAE@XZ @ 72 NONAME ; CntContactCardView::~CntContactCardView(void) + ?qt_metacall@CntActionPopup@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 73 NONAME ; int CntActionPopup::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0CntBaseSelectionView@@QAE@XZ @ 74 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void) + ??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 75 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int) + ??1CntActionPopup@@UAE@XZ @ 76 NONAME ; CntActionPopup::~CntActionPopup(void) + ?viewId@CntContactCardView@@UBEHXZ @ 77 NONAME ; int CntContactCardView::viewId(void) const + ?removeEffect@CntViewNavigator@@QAEXABH@Z @ 78 NONAME ; void CntViewNavigator::removeEffect(int const &) + ?getStaticMetaObject@CntContactCardView@@SAABUQMetaObject@@XZ @ 79 NONAME ; struct QMetaObject const & CntContactCardView::getStaticMetaObject(void) + ?activate@CntContactCardView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 80 NONAME ; void CntContactCardView::activate(class CntAbstractViewManager *, class QMap) + ?staticMetaObject@CntActionPopup@@2UQMetaObject@@B @ 81 NONAME ; struct QMetaObject const CntActionPopup::staticMetaObject + ?staticMetaObject@CntEditView@@2UQMetaObject@@B @ 82 NONAME ; struct QMetaObject const CntEditView::staticMetaObject + ?viewOpened@CntBaseSelectionView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 83 NONAME ; void CntBaseSelectionView::viewOpened(class CntAbstractViewManager *, class QMap) + ?isDefault@CntEditView@@UBE_NXZ @ 84 NONAME ; bool CntEditView::isDefault(void) const + ??_ECntViewNavigator@@UAE@I@Z @ 85 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int) + ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 86 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *, int) + ?addException@CntViewNavigator@@QAEXABH0@Z @ 87 NONAME ; void CntViewNavigator::addException(int const &, int const &) + ?closeApp@CntDefaultViewManager@@MAEXXZ @ 88 NONAME ; void CntDefaultViewManager::closeApp(void) + ?deactivate@CntBaseSelectionView@@UAEXXZ @ 89 NONAME ; void CntBaseSelectionView::deactivate(void) + ?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 90 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const + ?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 91 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *) + ?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void) + ?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 93 NONAME ; class QString CntViewNavigator::tr(char const *, char const *) + ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *, int) + ?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int) + ?tr@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 96 NONAME ; class QString CntActionPopup::tr(char const *, char const *, int) + ?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 97 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *) + ?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 98 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0CntEditView@@QAE@XZ @ 99 NONAME ; CntEditView::CntEditView(void) + ?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 100 NONAME ; void * CntViewNavigator::qt_metacast(char const *) + ?view@CntContactCardView@@UBEPAVHbView@@XZ @ 101 NONAME ; class HbView * CntContactCardView::view(void) const + ?addToContacts@CntContactCardView@@IAEXXZ @ 102 NONAME ; void CntContactCardView::addToContacts(void) + ?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 103 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int) + ?addRoot@CntViewNavigator@@QAEXABH@Z @ 104 NONAME ; void CntViewNavigator::addRoot(int const &) + ?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString CntContactCardView::tr(char const *, char const *) + ?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 106 NONAME ; class QString CntEditView::tr(char const *, char const *) + ?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 107 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void) + ?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 108 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const + ?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 109 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject + ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 110 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *) + ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 111 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *) + ?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 112 NONAME ; void CntDefaultViewManager::switchView(class QMap, class QFlags) + ?deactivate@CntEditView@@UAEXXZ @ 113 NONAME ; void CntEditView::deactivate(void) + ?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 114 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &) + ?addEffect@CntViewNavigator@@QAEXABH0@Z @ 115 NONAME ; void CntViewNavigator::addEffect(int const &, int const &) + ??_ECntActionPopup@@UAE@I@Z @ 116 NONAME ; CntActionPopup::~CntActionPopup(unsigned int) + ?d_func@CntActionPopup@@AAEPAVCntActionPopupPrivate@@XZ @ 117 NONAME ; class CntActionPopupPrivate * CntActionPopup::d_func(void) + ?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 118 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const + ?contactUpdated@CntEditView@@IAEXH@Z @ 119 NONAME ; void CntEditView::contactUpdated(int) + ??1CntDefaultViewManager@@UAE@XZ @ 120 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void) + ?deactivate@CntContactCardView@@UAEXXZ @ 121 NONAME ; void CntContactCardView::deactivate(void) + ?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 122 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void) + ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 123 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int) + ?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 124 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 125 NONAME ; class QString CntEditView::tr(char const *, char const *, int) + ?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 126 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void) + ??1CntViewNavigator@@UAE@XZ @ 127 NONAME ; CntViewNavigator::~CntViewNavigator(void) + ?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 128 NONAME ; void * CntMainWindow::qt_metacast(char const *) + ?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 129 NONAME ; class QString CntEditView::trUtf8(char const *, char const *) + ?isDefault@CntBaseSelectionView@@UBE_NXZ @ 130 NONAME ; bool CntBaseSelectionView::isDefault(void) const + ?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@_N@Z @ 131 NONAME ; int const & CntViewNavigator::back(class QFlags &, bool) + ??1CntBaseSelectionView@@UAE@XZ @ 132 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void) + ?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 133 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int) + ?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 134 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int) + ??_ECntEditView@@UAE@I@Z @ 135 NONAME ; CntEditView::~CntEditView(unsigned int) + ??0CntActionPopup@@QAE@PAVQContact@QtMobility@@@Z @ 136 NONAME ; CntActionPopup::CntActionPopup(class QtMobility::QContact *) + ?executeContactAction@CntActionPopup@@IAEXAAVQContact@QtMobility@@VQContactDetail@3@VQString@@@Z @ 137 NONAME ; void CntActionPopup::executeContactAction(class QtMobility::QContact &, class QtMobility::QContactDetail, class QString) + ?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 138 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void) + ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 139 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *) + ?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 140 NONAME ; void CntDefaultViewManager::removeCurrentView(void) + ?currentViewId@CntDefaultViewManager@@QAEHXZ @ 141 NONAME ; int CntDefaultViewManager::currentViewId(void) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h --- a/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h Fri Jul 23 12:43:48 2010 +0300 @@ -20,10 +20,8 @@ enum Attributes { CntIncoming = 1, - CntOutgoing = 2, - CntUnseen = 4, - CntSeen = 8, - CntAttachment = 16 + CntUnseen = 2, + CntAttachment = 4 }; enum ItemType diff -r 81c360d47083 -r e6aff7b69165 phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp --- a/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -22,6 +22,7 @@ #include #include "cnthistorymodel_p.h" +#include "cntdebug.h" // Unnamed namespace for helper functions @@ -36,6 +37,33 @@ { return ((*t1).timeStamp < (*t2).timeStamp); } + +#ifdef TRACES +#define LOG_ITEM(i) logItem(i) +#else +#define LOG_ITEM(i) +#endif + + void logItem(const HistoryItem& item) + { + QStringList l; + + l << item.message << item.number << item.timeStamp.toString() << item.title; + l << (item.flags & CntIncoming ? "incoming" : "outgoing"); + l << (item.flags & CntUnseen ? "unseen" : "seen"); + l << (item.flags & CntAttachment ? "attachment" : ""); + l << (item.flags & CntCallLog ? "call" : "message"); + if (item.flags & CntReceivedCall) + l << "recieved"; + else if (item.flags & CntMissedCall) + l << "missed"; + else if (item.flags & CntDialledCall) + l << "dialled"; + + l.removeAll(""); + + qDebug() << l; + } } Q_DECLARE_METATYPE(LogsEvent *) @@ -382,16 +410,20 @@ } } - if ( event->direction() == LogsEvent::DirOut ) - item.flags |= CntOutgoing; - else + if ( event->direction() == LogsEvent::DirMissed + || event->direction() == LogsEvent::DirIn ) { item.flags |= CntIncoming; + } else { + item.flags &= ~CntIncoming; + } item.message = bodyText; item.title = title; item.timeStamp = event->time().toLocalTime(); item.flags |= CntCallLog; item.number = QString(event->number()); + + LOG_ITEM(item); } /*! @@ -604,7 +636,7 @@ else item.flags &= ~CntUnseen; } else if ( event.direction() == MsgItem::MsgDirectionOutgoing ) - item.flags |= CntOutgoing; + item.flags &= ~CntIncoming; // Attachment if (event.isAttributeSet(MsgItem::MsgAttributeAttachment)) @@ -623,6 +655,8 @@ } item.timeStamp = event.timeStamp().toLocalTime(); + + LOG_ITEM(item); } /*! diff -r 81c360d47083 -r e6aff7b69165 phonebookui/eabi/pbkcommonuiu.def --- a/phonebookui/eabi/pbkcommonuiu.def Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/eabi/pbkcommonuiu.def Fri Jul 23 12:43:48 2010 +0300 @@ -30,135 +30,138 @@ _ZN14CntActionPopup16staticMetaObjectE @ 29 NONAME DATA 16 _ZN14CntActionPopup19getStaticMetaObjectEv @ 30 NONAME _ZN14CntActionPopup20executeContactActionERN10QtMobility8QContactENS0_14QContactDetailE7QString @ 31 NONAME - _ZN14CntActionPopupC1EPN10QtMobility8QContactE @ 32 NONAME - _ZN14CntActionPopupC2EPN10QtMobility8QContactE @ 33 NONAME - _ZN14CntActionPopupD0Ev @ 34 NONAME - _ZN14CntActionPopupD1Ev @ 35 NONAME - _ZN14CntActionPopupD2Ev @ 36 NONAME - _ZN16CntViewNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 37 NONAME - _ZN16CntViewNavigator11qt_metacastEPKc @ 38 NONAME - _ZN16CntViewNavigator12addExceptionERKiS1_ @ 39 NONAME - _ZN16CntViewNavigator12removeEffectERKi @ 40 NONAME - _ZN16CntViewNavigator15removeExceptionERKi @ 41 NONAME - _ZN16CntViewNavigator16staticMetaObjectE @ 42 NONAME DATA 16 - _ZN16CntViewNavigator19getStaticMetaObjectEv @ 43 NONAME - _ZN16CntViewNavigator4backER6QFlagsIN2Hb14ViewSwitchFlagEE @ 44 NONAME - _ZN16CntViewNavigator4nextERKiR6QFlagsIN2Hb14ViewSwitchFlagEE @ 45 NONAME - _ZN16CntViewNavigator9addEffectERKiS1_ @ 46 NONAME - _ZN16CntViewNavigatorC1EP7QObject @ 47 NONAME - _ZN16CntViewNavigatorC2EP7QObject @ 48 NONAME - _ZN16CntViewNavigatorD0Ev @ 49 NONAME - _ZN16CntViewNavigatorD1Ev @ 50 NONAME - _ZN16CntViewNavigatorD2Ev @ 51 NONAME - _ZN18CntContactCardView10deactivateEv @ 52 NONAME - _ZN18CntContactCardView11backPressedEv @ 53 NONAME - _ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 54 NONAME - _ZN18CntContactCardView11qt_metacastEPKc @ 55 NONAME - _ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 56 NONAME - _ZN18CntContactCardView16staticMetaObjectE @ 57 NONAME DATA 16 - _ZN18CntContactCardView19getStaticMetaObjectEv @ 58 NONAME - _ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 59 NONAME - _ZN18CntContactCardViewC1Ev @ 60 NONAME - _ZN18CntContactCardViewC2Ev @ 61 NONAME - _ZN18CntContactCardViewD0Ev @ 62 NONAME - _ZN18CntContactCardViewD1Ev @ 63 NONAME - _ZN18CntContactCardViewD2Ev @ 64 NONAME - _ZN20CntBaseSelectionView10deactivateEv @ 65 NONAME - _ZN20CntBaseSelectionView10viewClosedEv @ 66 NONAME - _ZN20CntBaseSelectionView10viewOpenedEP22CntAbstractViewManager4QMapIi8QVariantE @ 67 NONAME - _ZN20CntBaseSelectionView11qt_metacallEN11QMetaObject4CallEiPPv @ 68 NONAME - _ZN20CntBaseSelectionView11qt_metacastEPKc @ 69 NONAME - _ZN20CntBaseSelectionView16staticMetaObjectE @ 70 NONAME DATA 16 - _ZN20CntBaseSelectionView19getStaticMetaObjectEv @ 71 NONAME - _ZN20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 72 NONAME - _ZN20CntBaseSelectionView9closeViewEv @ 73 NONAME - _ZN20CntBaseSelectionViewC2Ev @ 74 NONAME - _ZN20CntBaseSelectionViewD0Ev @ 75 NONAME - _ZN20CntBaseSelectionViewD1Ev @ 76 NONAME - _ZN20CntBaseSelectionViewD2Ev @ 77 NONAME - _ZN21CntDefaultViewFactory10createViewEi @ 78 NONAME - _ZN21CntDefaultViewFactory16createPluginViewEi @ 79 NONAME - _ZN21CntDefaultViewFactoryC1Ev @ 80 NONAME - _ZN21CntDefaultViewFactoryC2Ev @ 81 NONAME - _ZN21CntDefaultViewFactoryD0Ev @ 82 NONAME - _ZN21CntDefaultViewFactoryD1Ev @ 83 NONAME - _ZN21CntDefaultViewFactoryD2Ev @ 84 NONAME - _ZN21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 85 NONAME - _ZN21CntDefaultViewManager10switchViewE4QMapIi8QVariantE6QFlagsIN2Hb14ViewSwitchFlagEE @ 86 NONAME - _ZN21CntDefaultViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 87 NONAME - _ZN21CntDefaultViewManager11qt_metacastEPKc @ 88 NONAME - _ZN21CntDefaultViewManager13deleteOldViewEv @ 89 NONAME - _ZN21CntDefaultViewManager14contactManagerERK7QString @ 90 NONAME - _ZN21CntDefaultViewManager14setViewFactoryEP22CntAbstractViewFactory @ 91 NONAME - _ZN21CntDefaultViewManager16setViewNavigatorEP16CntViewNavigator @ 92 NONAME - _ZN21CntDefaultViewManager16staticMetaObjectE @ 93 NONAME DATA 16 - _ZN21CntDefaultViewManager17removeCurrentViewEv @ 94 NONAME - _ZN21CntDefaultViewManager19getStaticMetaObjectEv @ 95 NONAME - _ZN21CntDefaultViewManager4backE4QMapIi8QVariantE @ 96 NONAME - _ZN21CntDefaultViewManager7cleanupEv @ 97 NONAME - _ZN21CntDefaultViewManager8closeAppEv @ 98 NONAME - _ZN21CntDefaultViewManagerC1EP12HbMainWindow @ 99 NONAME - _ZN21CntDefaultViewManagerC2EP12HbMainWindow @ 100 NONAME - _ZN21CntDefaultViewManagerD0Ev @ 101 NONAME - _ZN21CntDefaultViewManagerD1Ev @ 102 NONAME - _ZN21CntDefaultViewManagerD2Ev @ 103 NONAME - _ZNK11CntEditView10metaObjectEv @ 104 NONAME - _ZNK11CntEditView4viewEv @ 105 NONAME - _ZNK11CntEditView6viewIdEv @ 106 NONAME - _ZNK11CntEditView9isDefaultEv @ 107 NONAME - _ZNK13CntMainWindow10metaObjectEv @ 108 NONAME - _ZNK14CntActionPopup10metaObjectEv @ 109 NONAME - _ZNK16CntViewNavigator10metaObjectEv @ 110 NONAME - _ZNK18CntContactCardView10metaObjectEv @ 111 NONAME - _ZNK18CntContactCardView4viewEv @ 112 NONAME - _ZNK18CntContactCardView6viewIdEv @ 113 NONAME - _ZNK18CntContactCardView9isDefaultEv @ 114 NONAME - _ZNK20CntBaseSelectionView10metaObjectEv @ 115 NONAME - _ZNK20CntBaseSelectionView4viewEv @ 116 NONAME - _ZNK20CntBaseSelectionView9isDefaultEv @ 117 NONAME - _ZNK21CntDefaultViewManager10metaObjectEv @ 118 NONAME - _ZTI11CntEditView @ 119 NONAME - _ZTI13CntMainWindow @ 120 NONAME - _ZTI14CntActionPopup @ 121 NONAME - _ZTI16CntViewNavigator @ 122 NONAME - _ZTI18CntContactCardView @ 123 NONAME - _ZTI20CntBaseSelectionView @ 124 NONAME - _ZTI21CntDefaultViewFactory @ 125 NONAME - _ZTI21CntDefaultViewManager @ 126 NONAME - _ZTV11CntEditView @ 127 NONAME - _ZTV13CntMainWindow @ 128 NONAME - _ZTV14CntActionPopup @ 129 NONAME - _ZTV16CntViewNavigator @ 130 NONAME - _ZTV18CntContactCardView @ 131 NONAME - _ZTV20CntBaseSelectionView @ 132 NONAME - _ZTV21CntDefaultViewFactory @ 133 NONAME - _ZTV21CntDefaultViewManager @ 134 NONAME - _ZThn8_N11CntEditView10deactivateEv @ 135 NONAME - _ZThn8_N11CntEditView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 136 NONAME - _ZThn8_N11CntEditViewD0Ev @ 137 NONAME - _ZThn8_N11CntEditViewD1Ev @ 138 NONAME - _ZThn8_N13CntMainWindowD0Ev @ 139 NONAME - _ZThn8_N13CntMainWindowD1Ev @ 140 NONAME - _ZThn8_N18CntContactCardView10deactivateEv @ 141 NONAME - _ZThn8_N18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 142 NONAME - _ZThn8_N18CntContactCardViewD0Ev @ 143 NONAME - _ZThn8_N18CntContactCardViewD1Ev @ 144 NONAME - _ZThn8_N20CntBaseSelectionView10deactivateEv @ 145 NONAME - _ZThn8_N20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 146 NONAME - _ZThn8_N20CntBaseSelectionViewD0Ev @ 147 NONAME - _ZThn8_N20CntBaseSelectionViewD1Ev @ 148 NONAME - _ZThn8_N21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 149 NONAME - _ZThn8_N21CntDefaultViewManager14contactManagerERK7QString @ 150 NONAME - _ZThn8_N21CntDefaultViewManager4backE4QMapIi8QVariantE @ 151 NONAME - _ZThn8_N21CntDefaultViewManagerD0Ev @ 152 NONAME - _ZThn8_N21CntDefaultViewManagerD1Ev @ 153 NONAME - _ZThn8_NK11CntEditView4viewEv @ 154 NONAME - _ZThn8_NK11CntEditView6viewIdEv @ 155 NONAME - _ZThn8_NK11CntEditView9isDefaultEv @ 156 NONAME - _ZThn8_NK18CntContactCardView4viewEv @ 157 NONAME - _ZThn8_NK18CntContactCardView6viewIdEv @ 158 NONAME - _ZThn8_NK18CntContactCardView9isDefaultEv @ 159 NONAME - _ZThn8_NK20CntBaseSelectionView4viewEv @ 160 NONAME - _ZThn8_NK20CntBaseSelectionView9isDefaultEv @ 161 NONAME - _ZN14CntActionPopup24actionPopupCancelPressedEv @ 162 NONAME + _ZN14CntActionPopup24actionPopupCancelPressedEv @ 32 NONAME + _ZN14CntActionPopupC1EPN10QtMobility8QContactE @ 33 NONAME + _ZN14CntActionPopupC2EPN10QtMobility8QContactE @ 34 NONAME + _ZN14CntActionPopupD0Ev @ 35 NONAME + _ZN14CntActionPopupD1Ev @ 36 NONAME + _ZN14CntActionPopupD2Ev @ 37 NONAME + _ZN16CntViewNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME + _ZN16CntViewNavigator11qt_metacastEPKc @ 39 NONAME + _ZN16CntViewNavigator12addExceptionERKiS1_ @ 40 NONAME + _ZN16CntViewNavigator12removeEffectERKi @ 41 NONAME + _ZN16CntViewNavigator15removeExceptionERKi @ 42 NONAME + _ZN16CntViewNavigator16staticMetaObjectE @ 43 NONAME DATA 16 + _ZN16CntViewNavigator19getStaticMetaObjectEv @ 44 NONAME + _ZN16CntViewNavigator4backER6QFlagsIN2Hb14ViewSwitchFlagEEb @ 45 NONAME + _ZN16CntViewNavigator4nextERKiR6QFlagsIN2Hb14ViewSwitchFlagEE @ 46 NONAME + _ZN16CntViewNavigator7addRootERKi @ 47 NONAME + _ZN16CntViewNavigator9addEffectERKiS1_ @ 48 NONAME + _ZN16CntViewNavigatorC1EP7QObject @ 49 NONAME + _ZN16CntViewNavigatorC2EP7QObject @ 50 NONAME + _ZN16CntViewNavigatorD0Ev @ 51 NONAME + _ZN16CntViewNavigatorD1Ev @ 52 NONAME + _ZN16CntViewNavigatorD2Ev @ 53 NONAME + _ZN18CntContactCardView10deactivateEv @ 54 NONAME + _ZN18CntContactCardView11backPressedEv @ 55 NONAME + _ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 56 NONAME + _ZN18CntContactCardView11qt_metacastEPKc @ 57 NONAME + _ZN18CntContactCardView13addToContactsEv @ 58 NONAME + _ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 59 NONAME + _ZN18CntContactCardView16staticMetaObjectE @ 60 NONAME DATA 16 + _ZN18CntContactCardView19getStaticMetaObjectEv @ 61 NONAME + _ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 62 NONAME + _ZN18CntContactCardViewC1Eb @ 63 NONAME + _ZN18CntContactCardViewC2Eb @ 64 NONAME + _ZN18CntContactCardViewD0Ev @ 65 NONAME + _ZN18CntContactCardViewD1Ev @ 66 NONAME + _ZN18CntContactCardViewD2Ev @ 67 NONAME + _ZN20CntBaseSelectionView10deactivateEv @ 68 NONAME + _ZN20CntBaseSelectionView10viewClosedEv @ 69 NONAME + _ZN20CntBaseSelectionView10viewOpenedEP22CntAbstractViewManager4QMapIi8QVariantE @ 70 NONAME + _ZN20CntBaseSelectionView11qt_metacallEN11QMetaObject4CallEiPPv @ 71 NONAME + _ZN20CntBaseSelectionView11qt_metacastEPKc @ 72 NONAME + _ZN20CntBaseSelectionView16staticMetaObjectE @ 73 NONAME DATA 16 + _ZN20CntBaseSelectionView19getStaticMetaObjectEv @ 74 NONAME + _ZN20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 75 NONAME + _ZN20CntBaseSelectionView9closeViewEv @ 76 NONAME + _ZN20CntBaseSelectionViewC2Ev @ 77 NONAME + _ZN20CntBaseSelectionViewD0Ev @ 78 NONAME + _ZN20CntBaseSelectionViewD1Ev @ 79 NONAME + _ZN20CntBaseSelectionViewD2Ev @ 80 NONAME + _ZN21CntDefaultViewFactory10createViewEi @ 81 NONAME + _ZN21CntDefaultViewFactory16createPluginViewEi @ 82 NONAME + _ZN21CntDefaultViewFactoryC1Ev @ 83 NONAME + _ZN21CntDefaultViewFactoryC2Ev @ 84 NONAME + _ZN21CntDefaultViewFactoryD0Ev @ 85 NONAME + _ZN21CntDefaultViewFactoryD1Ev @ 86 NONAME + _ZN21CntDefaultViewFactoryD2Ev @ 87 NONAME + _ZN21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 88 NONAME + _ZN21CntDefaultViewManager10switchViewE4QMapIi8QVariantE6QFlagsIN2Hb14ViewSwitchFlagEE @ 89 NONAME + _ZN21CntDefaultViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 90 NONAME + _ZN21CntDefaultViewManager11qt_metacastEPKc @ 91 NONAME + _ZN21CntDefaultViewManager13currentViewIdEv @ 92 NONAME + _ZN21CntDefaultViewManager13deleteOldViewEv @ 93 NONAME + _ZN21CntDefaultViewManager14contactManagerERK7QString @ 94 NONAME + _ZN21CntDefaultViewManager14setViewFactoryEP22CntAbstractViewFactory @ 95 NONAME + _ZN21CntDefaultViewManager16setViewNavigatorEP16CntViewNavigator @ 96 NONAME + _ZN21CntDefaultViewManager16staticMetaObjectE @ 97 NONAME DATA 16 + _ZN21CntDefaultViewManager17removeCurrentViewEv @ 98 NONAME + _ZN21CntDefaultViewManager19getStaticMetaObjectEv @ 99 NONAME + _ZN21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 100 NONAME + _ZN21CntDefaultViewManager7cleanupEv @ 101 NONAME + _ZN21CntDefaultViewManager8closeAppEv @ 102 NONAME + _ZN21CntDefaultViewManagerC1EP12HbMainWindow @ 103 NONAME + _ZN21CntDefaultViewManagerC2EP12HbMainWindow @ 104 NONAME + _ZN21CntDefaultViewManagerD0Ev @ 105 NONAME + _ZN21CntDefaultViewManagerD1Ev @ 106 NONAME + _ZN21CntDefaultViewManagerD2Ev @ 107 NONAME + _ZNK11CntEditView10metaObjectEv @ 108 NONAME + _ZNK11CntEditView4viewEv @ 109 NONAME + _ZNK11CntEditView6viewIdEv @ 110 NONAME + _ZNK11CntEditView9isDefaultEv @ 111 NONAME + _ZNK13CntMainWindow10metaObjectEv @ 112 NONAME + _ZNK14CntActionPopup10metaObjectEv @ 113 NONAME + _ZNK16CntViewNavigator10metaObjectEv @ 114 NONAME + _ZNK18CntContactCardView10metaObjectEv @ 115 NONAME + _ZNK18CntContactCardView4viewEv @ 116 NONAME + _ZNK18CntContactCardView6viewIdEv @ 117 NONAME + _ZNK18CntContactCardView9isDefaultEv @ 118 NONAME + _ZNK20CntBaseSelectionView10metaObjectEv @ 119 NONAME + _ZNK20CntBaseSelectionView4viewEv @ 120 NONAME + _ZNK20CntBaseSelectionView9isDefaultEv @ 121 NONAME + _ZNK21CntDefaultViewManager10metaObjectEv @ 122 NONAME + _ZTI11CntEditView @ 123 NONAME + _ZTI13CntMainWindow @ 124 NONAME + _ZTI14CntActionPopup @ 125 NONAME + _ZTI16CntViewNavigator @ 126 NONAME + _ZTI18CntContactCardView @ 127 NONAME + _ZTI20CntBaseSelectionView @ 128 NONAME + _ZTI21CntDefaultViewFactory @ 129 NONAME + _ZTI21CntDefaultViewManager @ 130 NONAME + _ZTV11CntEditView @ 131 NONAME + _ZTV13CntMainWindow @ 132 NONAME + _ZTV14CntActionPopup @ 133 NONAME + _ZTV16CntViewNavigator @ 134 NONAME + _ZTV18CntContactCardView @ 135 NONAME + _ZTV20CntBaseSelectionView @ 136 NONAME + _ZTV21CntDefaultViewFactory @ 137 NONAME + _ZTV21CntDefaultViewManager @ 138 NONAME + _ZThn8_N11CntEditView10deactivateEv @ 139 NONAME + _ZThn8_N11CntEditView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 140 NONAME + _ZThn8_N11CntEditViewD0Ev @ 141 NONAME + _ZThn8_N11CntEditViewD1Ev @ 142 NONAME + _ZThn8_N13CntMainWindowD0Ev @ 143 NONAME + _ZThn8_N13CntMainWindowD1Ev @ 144 NONAME + _ZThn8_N18CntContactCardView10deactivateEv @ 145 NONAME + _ZThn8_N18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 146 NONAME + _ZThn8_N18CntContactCardViewD0Ev @ 147 NONAME + _ZThn8_N18CntContactCardViewD1Ev @ 148 NONAME + _ZThn8_N20CntBaseSelectionView10deactivateEv @ 149 NONAME + _ZThn8_N20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 150 NONAME + _ZThn8_N20CntBaseSelectionViewD0Ev @ 151 NONAME + _ZThn8_N20CntBaseSelectionViewD1Ev @ 152 NONAME + _ZThn8_N21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 153 NONAME + _ZThn8_N21CntDefaultViewManager14contactManagerERK7QString @ 154 NONAME + _ZThn8_N21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 155 NONAME + _ZThn8_N21CntDefaultViewManagerD0Ev @ 156 NONAME + _ZThn8_N21CntDefaultViewManagerD1Ev @ 157 NONAME + _ZThn8_NK11CntEditView4viewEv @ 158 NONAME + _ZThn8_NK11CntEditView6viewIdEv @ 159 NONAME + _ZThn8_NK11CntEditView9isDefaultEv @ 160 NONAME + _ZThn8_NK18CntContactCardView4viewEv @ 161 NONAME + _ZThn8_NK18CntContactCardView6viewIdEv @ 162 NONAME + _ZThn8_NK18CntContactCardView9isDefaultEv @ 163 NONAME + _ZThn8_NK20CntBaseSelectionView4viewEv @ 164 NONAME + _ZThn8_NK20CntBaseSelectionView9isDefaultEv @ 165 NONAME diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntcollectionview.h --- a/phonebookui/pbkcommonui/inc/cntcollectionview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionview.h Fri Jul 23 12:43:48 2010 +0300 @@ -29,7 +29,6 @@ class HbView; class HbListView; class CntCollectionListModel; -class CntFetchContacts; class QModelIndex; class QActionGroup; class HbAbstractViewItem; @@ -66,7 +65,9 @@ void newGroup(); void handleNewGroup(HbAction* action); - void handleNewGroupMembers(); + void handleNewGroupMembers( QSet aMembers ); + void handleCancelGroupMembers(); + void notifyNewGroup(); void refreshDataModel(); @@ -96,7 +97,6 @@ HbAction* mDeleteGroupsAction; // owned by view QContact* mHandledContact; // own, needed for asynchronous popups - CntFetchContacts* mFetchView; QSet mSelectedContactsSet; QActionGroup* mActionGroup; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntcontactcardview.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview.h Fri Jul 23 12:43:48 2010 +0300 @@ -38,12 +38,13 @@ Q_OBJECT public: - CntContactCardView(); + CntContactCardView(bool isTemporary = false); ~CntContactCardView(); signals: void backPressed(); void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); + void addToContacts(); public: // From CntAbstractView void activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntcontactcardview_p.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Fri Jul 23 12:43:48 2010 +0300 @@ -25,6 +25,7 @@ #include #include "cntglobal.h" #include +#include class HbView; class HbScrollArea; @@ -47,6 +48,7 @@ class HbSelectionDialog; class CntPresenceListener; class HbLabel; +class XQAiwRequest; QTM_BEGIN_NAMESPACE class QContact; @@ -79,7 +81,7 @@ Q_DECLARE_PUBLIC(CntContactCardView) public: - CntContactCardViewPrivate(); + CntContactCardViewPrivate(bool isTemporary); virtual ~CntContactCardViewPrivate(); public slots: @@ -91,6 +93,7 @@ void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); void drawMenu(const QPointF &aCoords); void sendToHs(); + void onAddedToContacts(); void mapTileStatusReceived(int contactid, int addressType, int status); void keyPressed(QKeyEvent *event); @@ -106,11 +109,13 @@ void showPreviousView(); void doChangeImage(); void doRemoveImage(); + void showRootView(); void handleMenuAction(HbAction* aAction); void handleSendBusinessCard( HbAction* aAction ); void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction); void sendKeyCancelSlot(); + void contactDeletedFromOtherSource(const QList& contactIds); #ifdef PBK_UNIT_TEST public slots: @@ -138,7 +143,7 @@ void preferredUpdated(); void backPressed(); void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); - + void addToContacts(); #ifdef PBK_UNIT_TEST public: @@ -175,7 +180,9 @@ QContactAction *mContactAction; HbAction *mBackKey; CntImageLabel *mImageLabel; + XQApplicationManager mAppManager; XQServiceRequest *mHighwayService; + XQAiwRequest *mRequest; // own HbIcon *mVCardIcon; CntViewParameters mArgs; ShareUi *mShareUi; @@ -187,6 +194,8 @@ QTimer *mProgressTimer; QList mAddressList; QMap mMaptileLabelList; + bool mIsTemporary; + bool mIsExecutingAction; }; #endif // CNTCOMMLAUNCHERVIEW_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h --- a/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Fri Jul 23 12:43:48 2010 +0300 @@ -47,8 +47,11 @@ public: // From CntAbstractViewManager void changeView( const CntViewParameters aArgs ); - void back( const CntViewParameters aArgs ); + void back( const CntViewParameters aArgs, bool toRoot = false ); QContactManager* contactManager( const QString& aType ); + +public: + int currentViewId(); private slots: void removeCurrentView(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntdetaileditor.h --- a/phonebookui/pbkcommonui/inc/cntdetaileditor.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdetaileditor.h Fri Jul 23 12:43:48 2010 +0300 @@ -49,6 +49,8 @@ void handleItemShown(const QModelIndex& aIndex ); void saveContact(); + void contactDeletedFromOtherSource(const QList& contactIds); + void showRootView(); public: void setViewId( int aId ); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntdetailpopup.h --- a/phonebookui/pbkcommonui/inc/cntdetailpopup.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdetailpopup.h Fri Jul 23 12:43:48 2010 +0300 @@ -19,46 +19,29 @@ #define CNTDETAILPOPUP_H #include -#include +#include #include class QStandardItemModel; -class HbListView; typedef QList CntViewIdList; -class CntDetailPopup : public HbDialog +class CntDetailPopup : public HbSelectionDialog { + friend class TestCntDetailPopup; Q_OBJECT + public: static void selectDetail( CntViewIdList aList, QObject *receiver = 0, const char *member = 0 ); - int selectedDetail(); -#ifdef PBK_UNIT_TEST -public slots: -#else -private slots: -#endif - void listItemSelected(QModelIndex index); - -#ifdef PBK_UNIT_TEST -public: -#else private: -#endif CntDetailPopup(QGraphicsItem *parent, CntViewIdList aList ); ~CntDetailPopup(); void addListItem(QString aIcon, QString label, int aId); -#ifdef PBK_UNIT_TEST -public: -#else private: -#endif QStandardItemModel *mListModel; - HbListView *mListView; - int mSelectedDetail; CntViewIdList mViewIdList; }; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cnteditview_p.h --- a/phonebookui/pbkcommonui/inc/cnteditview_p.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditview_p.h Fri Jul 23 12:43:48 2010 +0300 @@ -80,6 +80,7 @@ void handleDeleteContact(int action); void discardChanges(); void saveChanges(); + void showRootView(); void openNameEditor(); void openImageEditor(); @@ -89,6 +90,7 @@ void setScrollPosition(); void ringToneFetchHandleError(int errorCode, const QString& errorMessage); void ringToneFetchHandleOk(const QVariant &result); + void contactDeletedFromOtherSource(const QList& contactIds); private: void loadAvatar(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h --- a/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Fri Jul 23 12:43:48 2010 +0300 @@ -44,7 +44,7 @@ void deactivate(); bool isDefault() const { return false; } HbView* view() const { return mView; } - int viewId() const { return FavoritesMemberView; } + int viewId() const { return favoritesMemberView; } void createModel(); public: @@ -58,7 +58,7 @@ #endif void manageFavorites(); - void handleManageFavorites(); + void handleManageFavorites(QSet aIds); void onLongPressed (HbAbstractViewItem *item, const QPointF &coords); void handleMenu(HbAction* action); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntfavoritesview.h --- a/phonebookui/pbkcommonui/inc/cntfavoritesview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfavoritesview.h Fri Jul 23 12:43:48 2010 +0300 @@ -21,10 +21,10 @@ #include #include #include +#include class HbAction; class HbView; -class CntFetchContacts; QTM_BEGIN_NAMESPACE class QContact; @@ -52,7 +52,7 @@ private slots: void showPreviousView(); void openSelectionPopup(); - void handleMemberSelection(); + void handleMemberSelection( QSet aIds ); void setOrientation(Qt::Orientation orientation); private: @@ -68,7 +68,6 @@ HbAction* mSoftkey; CntAbstractViewManager* mViewManager; HbDocumentLoader mDocumentLoader; - CntFetchContacts* mFetchView; }; #endif // CNTFAVORITESVIEW_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,104 @@ +/* +* 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 CNTFETCHCONTACTPOPUP_H_ +#define CNTFETCHCONTACTPOPUP_H_ + +#include +#include +#include + +class HbDialog; +class HbListView; +class HbTextItem; +class HbLabel; +class HbAction; +class HbSearchPanel; +class HbStaticVkbHost; + +class QGraphicsLinearLayout; +class QItemSelectionModel; + +class CntListModel; +class CntFetchMarkAll; +class CntDocumentLoader; + +QTM_BEGIN_NAMESPACE +class QContactManager; +QTM_END_NAMESPACE +QTM_USE_NAMESPACE + +/*! + CntFetchContactPopup is simple to use popup for fetching (selecting) number + of contacts. + + \code + \endcode + + Note that by default, CntFetchContactPopup deletes itself when closing the popup. +*/ +class CntFetchContactPopup : public QObject +{ + Q_OBJECT + +public: + ~CntFetchContactPopup(); + + static CntFetchContactPopup* createMultiSelectionPopup( QString aTitle, QString aAction, QContactManager& aContactMgr ); + static CntFetchContactPopup* createSingleSelectionPopup( QString aTitle, QContactManager& aContactMgr ); + + void setSelectedContacts( QSet aIds ); + void showPopup(); + +signals: + void fetchReady( QSet aIds ); + void fetchCancelled(); + +private slots: + void setFilter( const QString& aFilter ); + void contactSelected( const QModelIndex& aIndex ); + void contactsSelected( const QItemSelection & selected, const QItemSelection & deselected ); + void selectAll( int aState ); + void dialogDismissed( HbAction* aAction ); + void loadLayout( Qt::Orientation aOrientation ); + void handleKeypadOpen(); + void handleKeypadClosed(); + void closePopup(); + +private: + CntFetchContactPopup( QContactManager& aManager ); + void constructPopupDialog( QString aTitle, QString aAction, HbAbstractItemView::SelectionMode aMode ); + +private: + QContactManager& mManager; + QList mIdList; + + HbDialog* mPopup; // own + HbListView* mListView; // own + HbTextItem* mEmptyView; // own + HbLabel* mHeading; // own + HbAction* mPrimaryAction; // own + HbSearchPanel* mSearch; //own + CntListModel* mModel; // own + HbStaticVkbHost* mVirtualKeyboard; // own + CntFetchMarkAll* mMarkAll; // own + QItemSelectionModel* mSelectionModel; // own + CntDocumentLoader* mDoc; // own + QString mTitle; +}; + +#endif /* CNTFETCHCONTACTPOPUP_H_ */ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntfetchcontactsview.h --- a/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h Wed Jul 21 11:37:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CntFetchContacts_H_ -#define CntFetchContacts_H_ - -#include -#include -#include -#include -#include - -class HbDialog; -class HbSearchPanel; -class HbAction; -class HbListView; -class HbLabel; -class HbStaticVkbHost; -class HbIndexFeedback; - -class CntListModel; -class QGraphicsLinearLayout; - -QTM_BEGIN_NAMESPACE -class QContact; -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - -class CntFetchContacts : public QObject - { - Q_OBJECT - -public: - CntFetchContacts(QContactManager &aManager); - ~CntFetchContacts(); - -private slots: - void memberSelectionChanged(const QModelIndex &index); - - void setFilter(const QString &filterString); - - void handleKeypadOpen(); - void handleKeypadClose(); - - void handleUserResponse(HbAction* action); - -public: - void displayContacts(HbAbstractItemView::SelectionMode aMode, - QSet aContacts); - - QSet getSelectedContacts() const; - bool wasCanceled() const; - void setDetails(QString aTitle, QString aButtonText); - -private: - void doInitialize(HbAbstractItemView::SelectionMode aMode, - QSet aContacts); - void showPopup(); - void markMembersInView(); - -signals: - void clicked(); - -private: - HbDialog* mPopup; - HbSearchPanel* mSearchPanel; - CntListModel* mCntModel; - HbListView* mListView; - QGraphicsLinearLayout* mLayout; - HbTextItem* mEmptyListLabel; - HbWidget* mContainerWidget; - HbAbstractItemView::SelectionMode mSelectionMode; - QSet mCurrentlySelected; - QContactManager* mManager; - bool mWasCanceled; - HbLabel* mLabel; - HbStaticVkbHost* mVirtualKeyboard; - QString mButtonText; - HbAction* mPrimaryAction; - HbAction* mSecondaryAction; - HbIndexFeedback* mIndexFeedback; - - friend class TestCntFetchUtility; - friend class TestCntMyCardView; - }; - -#endif /* CntFetchContacts_H_ */ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntfetchmarkall.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntfetchmarkall.h Fri Jul 23 12:43:48 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 CNTFETCHSELECTIONITEM_H +#define CNTFETCHSELECTIONITEM_H + +#include +#include + +class HbCheckBox; +class HbTextItem; +class HbFrameItem; + +class CntFetchMarkAll : public HbWidget +{ + Q_OBJECT + +public: + CntFetchMarkAll(QGraphicsItem *aParent = 0); + ~CntFetchMarkAll(); + + void setMaxContactCount( int aContactCount ); + void setSelectedContactCount( int aSelectedCount ); + +signals: + void markAll(int aState); + +private: + friend class TestCntFetchSelectionItems; + + HbCheckBox* mCheckBox; // not own + HbTextItem* mCounterLabel; // not own + HbFrameItem* mFrame; + + int mContactCount; + int mSelectionCount; +}; + +#endif // CNTFETCHSELECTIONITEM_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntgroupactionsview.h --- a/phonebookui/pbkcommonui/inc/cntgroupactionsview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupactionsview.h Fri Jul 23 12:43:48 2010 +0300 @@ -90,7 +90,8 @@ HbAction* mSoftkey; // owned by view HbListView* mListView; // owned by layout int mPopupCount; - QStringList mActionParams; + QStringList mEmailActionParams; + QVariantMap mMessageActionParams; }; #endif // CNTGROUPACTIONSVIEW_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntgroupmemberview.h --- a/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Fri Jul 23 12:43:48 2010 +0300 @@ -21,13 +21,12 @@ #include #include #include - +#include #include class CntListModel; class CntAbstractViewManager; class CntContactCardHeadingItem; -class CntFetchContacts; class HbView; class HbAction; class HbListView; @@ -67,7 +66,7 @@ void showPreviousView(); void openGroupActions(); void manageMembers(); - void handleManageMembers(); + void handleManageMembers(QSet aIds); void editGroup(); void deleteGroup(); void handleDeleteGroup(int action); @@ -85,6 +84,7 @@ void createModel(); void removeImage(); + void sendToHs(const QModelIndex &index); private: QContactManager* getContactManager(); @@ -107,7 +107,6 @@ CntImageLabel* mImageLabel; HbListView* mListView; // owned by layout HbDocumentLoader* mDocument; - CntFetchContacts* mFetchView; QList mOriginalGroupMembers; QContactAvatar* mAvatar; CntViewParameters mArgs; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cnthistoryview.h --- a/phonebookui/pbkcommonui/inc/cnthistoryview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnthistoryview.h Fri Jul 23 12:43:48 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include class HbListView; class CntHistoryModel; @@ -55,6 +56,8 @@ void itemActivated(const QModelIndex &index); void showPreviousView(); void showClearHistoryMenu(); + void showRootView(); + void contactDeletedFromOtherSource(const QList& contactIds); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntimageeditorview.h --- a/phonebookui/pbkcommonui/inc/cntimageeditorview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimageeditorview.h Fri Jul 23 12:43:48 2010 +0300 @@ -19,12 +19,12 @@ #define CNTIMAGEEDITORVIEW_H #include -#include +#include #include #include -class HbLabel; +class CntImageLabel; class HbListView; class XQAiwRequest; class ThumbnailManager; @@ -86,7 +86,7 @@ #endif QContact *mContact; // own QContactAvatar *mAvatar; // own - HbLabel *mImageLabel; // owned by layout + CntImageLabel *mImageLabel; // owned by layout XQAiwRequest *mRequest; // own XQApplicationManager mAppManager; ThumbnailManager *mThumbnailManager; // own @@ -94,7 +94,7 @@ HbAction *mSoftkey; // owned by view HbAction *mRemoveImage; // own CntAbstractViewManager *mViewManager; - HbDocumentLoader mDocumentLoader; + CntDocumentLoader mDocumentLoader; HbListView *mListView; // owned by layout QStandardItemModel *mModel; // own CntSaveManager *mSaveManager; // own diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntimagelabel.h --- a/phonebookui/pbkcommonui/inc/cntimagelabel.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimagelabel.h Fri Jul 23 12:43:48 2010 +0300 @@ -19,24 +19,41 @@ #define CNTIMAGELABEL_H #include -#include +#include class QGesture; +class QPixmap; +class HbIconItem; +class HbIcon; -class CntImageLabel : public HbLabel +class CntImageLabel : public HbWidget { Q_OBJECT + Q_PROPERTY(HbIcon icon READ avatarIcon WRITE setAvatarIcon) public: CntImageLabel(QGraphicsItem *parent = 0); ~CntImageLabel(); + void setAvatarIcon(const HbIcon &icon); + HbIcon avatarIcon() const; + + void setIcon(const QPixmap &pixmap); + void clear(); + protected: void gestureEvent(QGestureEvent* event); + void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); signals: void iconClicked(); void iconLongPressed(const QPointF&); + +private: + HbIconItem* mDefaultAvatar; + HbIcon mIcon; + QPixmap mPixmap; + }; #endif // CNTEDITVIEWHEADINGITEM_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntmainwindow.h --- a/phonebookui/pbkcommonui/inc/cntmainwindow.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntmainwindow.h Fri Jul 23 12:43:48 2010 +0300 @@ -50,6 +50,7 @@ protected: #endif CntDefaultViewManager *mViewManager; + int mDefaultView; }; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntmycardview.h --- a/phonebookui/pbkcommonui/inc/cntmycardview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntmycardview.h Fri Jul 23 12:43:48 2010 +0300 @@ -19,12 +19,11 @@ #define CNTMYCARDVIEW_H_ #include +#include #include - #include class CntAbstractViewManager; -class CntFetchContacts; class HbView; class HbAction; @@ -55,7 +54,7 @@ void showPreviousView(); void openNameEditor(); void openMyCardSelectionView(); - void handleMultiCardSelection(); + void handleMultiCardSelection(QSet aIds); void setOrientation(Qt::Orientation orientation); private: @@ -68,7 +67,6 @@ HbDocumentLoader mDocumentLoader; HbView* mView; // own HbAction* mSoftkey; - CntFetchContacts* mFetchView; friend class TestCntMyCardView; }; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntnamesview_p.h --- a/phonebookui/pbkcommonui/inc/cntnamesview_p.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntnamesview_p.h Fri Jul 23 12:43:48 2010 +0300 @@ -60,7 +60,7 @@ void deleteContact( QContact& aContact ); void deleteMultipleContacts(); - void handleDeleteMultipleContacts(); + void handleDeleteMultipleContacts( QSet aIds ); void showPreviousView(); void showCollectionView(); @@ -79,6 +79,9 @@ void handleContactRemoval(const QList & aRemovedList); void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId); +private slots: + void switchOrientation(); + public: bool isFinderVisible(); void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); @@ -114,7 +117,6 @@ HbAction* mNewContact; QContactLocalId mHandledContactId; HbAction* mMultipleDeleter; - CntFetchContacts* mFetchView; bool mIsDefault; int mId; QActionGroup* mActionGroup; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/inc/cntviewnavigator.h --- a/phonebookui/pbkcommonui/inc/cntviewnavigator.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntviewnavigator.h Fri Jul 23 12:43:48 2010 +0300 @@ -50,7 +50,7 @@ /*! * Back view returns the previous view */ - const int& back( QFlags &flags ); + const int& back( QFlags &flags, bool toRoot ); /*! * Add exceptions to next/back mechanism. Function will use the aBack argument @@ -65,10 +65,16 @@ void addEffect( const int& aCurrent, const int& aBack ); void removeEffect( const int& aCurrent ); + /*! + * Set a view as a root view. + */ + void addRoot( const int& aCurrent ); + private: QStack iViewStack; QMap< int, int > iExceptions; QMap< int, int > iEffects; + QList iRoots; int iTop; }; #endif /* CNTVIEWNAVIGATOR_H_ */ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/pbkcommonui.pro --- a/phonebookui/pbkcommonui/pbkcommonui.pro Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/pbkcommonui.pro Fri Jul 23 12:43:48 2010 +0300 @@ -29,6 +29,7 @@ INCLUDEPATH += ../../inc INCLUDEPATH += ../../phonebookengines/cntimageutility/inc INCLUDEPATH += ../../phonebookengines/cntsimutility/inc +INCLUDEPATH += ../phonebookapp/inc INCLUDEPATH += ../cnthistorymodel/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE @@ -128,7 +129,8 @@ inc/cntgroupdeletepopup.h \ inc/cntextensionmanager.h \ inc/cntimagelabel.h \ - inc/cntfetchcontactsview.h \ + inc/cntfetchcontactpopup.h \ + inc/cntfetchmarkall.h \ inc/cntimportsview.h \ inc/cntsettingsview.h \ inc/cntpresencelistener.h \ @@ -204,7 +206,8 @@ src/cntextensionmanager.cpp \ src/cntimagelabel.cpp \ src/cntimportsview.cpp \ - src/cntfetchcontactsview.cpp \ + src/cntfetchcontactpopup.cpp \ + src/cntfetchmarkall.cpp \ src/cntsettingsview.cpp \ src/cntpresencelistener.cpp \ src/cntdetailorderinghelper.cpp \ @@ -214,7 +217,7 @@ src/cntactionpopup.cpp \ src/cntsavemanager.cpp -RESOURCES += resources\pbkcommonui.qrc +RESOURCES += resources/pbkcommonui.qrc LIBS+= -lhbcore \ -lxqservice \ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/contacts_contactcard.docml --- a/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Fri Jul 23 12:43:48 2010 +0300 @@ -12,6 +12,9 @@ + + + @@ -33,10 +36,7 @@ - - - @@ -94,9 +94,9 @@ - - - + + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/contacts_ev.docml --- a/phonebookui/pbkcommonui/resources/contacts_ev.docml Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_ev.docml Fri Jul 23 12:43:48 2010 +0300 @@ -34,9 +34,6 @@ - - - @@ -72,9 +69,9 @@ - - - + + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + + +
diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/contacts_if.docml --- a/phonebookui/pbkcommonui/resources/contacts_if.docml Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_if.docml Fri Jul 23 12:43:48 2010 +0300 @@ -1,41 +1,38 @@ - + - + - - - - + + - - + - - + + - +
- - - - - + + + + +
@@ -45,9 +42,9 @@ - - - + + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/pbkcommonui.qrc --- a/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Fri Jul 23 12:43:48 2010 +0300 @@ -17,6 +17,7 @@ contacts_collections.docml contacts_groupmembers.docml contacts_detail_editor.docml + contacts_fetchdialog.docml contacts_settings.docml @@ -34,9 +35,12 @@ style/cntcontactcardheadingitem_color.css style/cnthistoryviewitem.widgetml style/cnthistoryviewitem.css - style/cntlocationbutton.hbpushbutton.widgetml - style/cntlocationbutton.css style/cntcommondetailviewitem.widgetml style/cntcommondetailviewitem.css + style/cntimagelabel.widgetml + style/cntimagelabel.css + style/cntfetchmarkall.widgetml + style/cntfetchmarkall.css + style/cntfetchmarkall_color.css diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,13 @@ +CntFetchMarkAll{ + layout:default; +} + +CntFetchMarkAll::counter +{ + text-align: right; + text-height: var(hb-param-text-height-tiny); + text-line-count-max: 1; + text-line-count-min: 1; + font-variant:secondary; + right:var(hb-param-margin-gene-popup); +} diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/style/cntfetchmarkall_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall_color.css Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,6 @@ +CntFetchMarkAll::counter +{ + color: var(qtc_viewtitle_normal); +} + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/style/cntimagelabel.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.css Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,4 @@ +CntImageLabel +{ + layout: avatar_layout; +} diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntactionlauncher.cpp --- a/phonebookui/pbkcommonui/src/cntactionlauncher.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntactionlauncher.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -49,6 +49,10 @@ this, SLOT(progress(QContactAction::State))); executed = mContactAction->invokeAction( aContact, aDetail ); } + else + { + progress(QContactAction::FinishedWithErrorState); + } return executed; } @@ -71,6 +75,10 @@ this, SLOT(progress(QContactAction::State))); executed = mContactAction->invokeAction( aContact, aDetail, aParameters ); } + else + { + progress(QContactAction::FinishedWithErrorState); + } return executed; } @@ -89,6 +97,10 @@ this, SLOT(progress(QContactAction::State))); executed = mContactAction->invokeAction( aContact, aDetail ); } + else + { + progress(QContactAction::FinishedWithErrorState); + } return executed; } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntaddressviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -70,25 +70,21 @@ HbDataFormModelItem::DataItemType itemType = static_cast( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - HbWidget* widget = new HbWidget(); + HbWidget* widget = NULL; + if( itemType == HbDataFormModelItem::CustomItemBase ) { - QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Horizontal); - widget->setLayout(layout); - - HbStyleLoader::registerFilePath(":/style/cntlocationbutton.css"); - HbStyleLoader::registerFilePath(":/style/cntlocationbutton.hbpushbutton.widgetml"); - HbDataForm* form = static_cast (itemView()); - HbDataFormModel* model = static_cast (form->model()); + HbPushButton* locationButton = new HbPushButton(this); + + // Naming UI components for automation testability + locationButton->setObjectName("Select location button"); + locationButton->setText( hbTrId("txt_phob_button_select_location") ); + locationButton->setTextAlignment( Qt::AlignCenter ); + locationButton->setContentsMargins(0,0,0,0); - HbPushButton* mLocationButton = new HbPushButton(this); - mLocationButton->setObjectName("cntlocationbutton"); - mLocationButton->setText( hbTrId("txt_phob_button_select_location") ); - mLocationButton->setTextAlignment( Qt::AlignCenter ); + connect(locationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); - connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker())); - - layout->addItem(mLocationButton); + widget = locationButton; } return widget; @@ -151,6 +147,6 @@ } - Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem) +Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem) // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntcollectionview.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntcollectionview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntgroupdeletepopup.h" #include "cntcollectionlistmodel.h" #include "cntextensionmanager.h" @@ -61,7 +61,6 @@ mNewGroupAction(NULL), mDeleteGroupsAction(NULL), mHandledContact(NULL), - mFetchView(NULL), mActionGroup(NULL) { bool ok = false; @@ -111,9 +110,6 @@ delete mHandledContact; mHandledContact = NULL; - - delete mFetchView; - mFetchView = NULL; } /*! @@ -190,7 +186,7 @@ void CntCollectionView::showNamesViewWithFinder() { CntViewParameters viewParameters; - viewParameters.insert(EFinder, "show"); + viewParameters.insert(EExtraAction, CNT_FIND_ACTION); mViewManager->back(viewParameters); } @@ -234,7 +230,7 @@ else { CntViewParameters viewParameters; - viewParameters.insert(EViewId, FavoritesMemberView); + viewParameters.insert(EViewId, favoritesMemberView); QVariant var; var.setValue(favoriteGroup); viewParameters.insert(ESelectedGroupContact, var); @@ -354,29 +350,29 @@ groupNameCreated = hbTrId("txt_phob_list_unnamed"); } - if (!mFetchView) - { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleNewGroupMembers())); - } - mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupNameCreated), - hbTrId("txt_common_button_save")); - mFetchView->displayContacts(HbAbstractItemView::MultiSelection, contactsSet); + CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup( + HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupNameCreated), + hbTrId("txt_common_button_save"), + *mViewManager->contactManager(SYMBIAN_BACKEND)); + connect( popup, SIGNAL(fetchReady(QSet)), this, SLOT(handleNewGroupMembers(QSet)) ); + connect( popup, SIGNAL(fetchCancelled()), this, SLOT(handleCancelGroupMembers()) ); + + popup->setSelectedContacts( contactsSet ); + popup->showPopup(); } } -void CntCollectionView::handleNewGroupMembers() +void CntCollectionView::handleNewGroupMembers( QSet aIds ) { - mSelectedContactsSet = mFetchView->getSelectedContacts(); - - if ( !mFetchView->wasCanceled() && mSelectedContactsSet.size() ) { + mSelectedContactsSet = aIds; + + if ( aIds.size() > 0 ) + { saveNewGroup(mHandledContact); - delete mFetchView; - mFetchView = NULL; - CntViewParameters viewParameters; viewParameters.insert(EViewId, groupMemberView); + QVariant var; var.setValue(*mHandledContact); viewParameters.insert(ESelectedGroupContact, var); @@ -384,14 +380,23 @@ } else { - // Add the new group mModel->addGroup(mHandledContact->localId()); mDeleteGroupsAction->setEnabled(true); - - delete mFetchView; - mFetchView = NULL; } + notifyNewGroup(); +} + +void CntCollectionView::handleCancelGroupMembers() +{ + mSelectedContactsSet.clear(); + mModel->addGroup(mHandledContact->localId()); + mDeleteGroupsAction->setEnabled(true); + notifyNewGroup(); +} + +void CntCollectionView::notifyNewGroup() +{ QString groupNameCreated = mHandledContact->displayLabel(); if (groupNameCreated.isEmpty()) { @@ -406,8 +411,10 @@ void CntCollectionView::refreshDataModel() { mListView->setModel(0); + delete mModel; - mModel = 0; + mModel = NULL; + mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this); mListView->setModel(mModel); } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntcontactcardview.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -20,12 +20,13 @@ #include -CntContactCardView::CntContactCardView() : d_ptr(new CntContactCardViewPrivate()) +CntContactCardView::CntContactCardView(bool isTemporary) : d_ptr(new CntContactCardViewPrivate(isTemporary)) { Q_D(CntContactCardView); connect(d_ptr, SIGNAL(backPressed()), this, SIGNAL(backPressed())); connect(d_ptr, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)), this, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters))); + connect(d_ptr, SIGNAL(addToContacts()), this, SIGNAL(addToContacts())); } /*! @@ -62,7 +63,7 @@ int CntContactCardView::viewId() const { - return commLauncherView; + return contactCardView; } // end of file diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -46,7 +46,10 @@ #include #include #include +#include +#include #include //Progress indication icon +#include #include #include "cntcontactcarddatacontainer.h" @@ -74,7 +77,7 @@ Constructor, initialize member variables. \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0) */ -CntContactCardViewPrivate::CntContactCardViewPrivate() : +CntContactCardViewPrivate::CntContactCardViewPrivate(bool isTemporary) : QObject(), mScrollArea(NULL), mContainerWidget(NULL), @@ -90,13 +93,16 @@ mContactAction(NULL), mBackKey(NULL), mImageLabel(NULL), + mRequest(NULL), mVCardIcon(NULL), mShareUi(NULL), mAcceptSendKey(true), mSendKeyListModel(NULL), mPresenceListener(NULL), mMaptile(NULL), - mProgressTimer(NULL) + mProgressTimer(NULL), + mIsTemporary(isTemporary), + mIsExecutingAction(false) { bool ok; document()->load(CNT_CONTACTCARDVIEW_XML, &ok); @@ -119,7 +125,7 @@ mBackKey = new HbAction(Hb::BackNaviAction, mView); mView->setNavigationAction(mBackKey); connect(mBackKey, SIGNAL(triggered()), this, SLOT(showPreviousView())); - + mProgressTimer = new QTimer(this); mProgressTimer->setSingleShot(true); connect(mProgressTimer, SIGNAL(timeout()),this, SLOT(updateSpinningIndicator())); @@ -169,7 +175,11 @@ delete mPresenceListener; mPresenceListener = NULL; - delete mMaptile; + + delete mRequest; + mRequest = NULL; + + delete mMaptile; mMaptile = NULL; delete mProgressTimer; @@ -195,14 +205,22 @@ //save the contact if avatar has been changed. QContact contact = contactManager()->contact(mContact->localId()); - if ( contact != *mContact ) + if ( contact != *mContact && contactManager()->error() == QContactManager::NoError) { contactManager()->saveContact(mContact); } - + mViewManager->back( mArgs ); } +/*! +Activates the root view +*/ +void CntContactCardViewPrivate::showRootView() +{ + mViewManager->back( mArgs, true ); +} + /* Activates a default view and setup name label texts */ @@ -213,8 +231,6 @@ mViewManager = aMgr; mArgs = aArgs; - mView->installEventFilter(this); - HbMainWindow* window = mView->mainWindow(); connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); connect(window, SIGNAL(keyPressed(QKeyEvent*)), this, SLOT(keyPressed(QKeyEvent*))); @@ -234,6 +250,12 @@ { mView->toolBar()->removeAction(static_cast(document()->findObject(QString("cnt:sendMyCard")))); } + if (mIsTemporary) + { + mView->menu()->clearActions(); + mView->toolBar()->clearActions(); + mView->toolBar()->addAction(static_cast(document()->findObject(QString("cnt:addtocontact")))); + } // add heading widget to the content QGraphicsWidget *c = document()->findWidget(QString("content")); @@ -241,8 +263,21 @@ mHeadingItem = static_cast(document()->findWidget(QString("cnt_contactcard_heading"))); mHeadingItem->setDetails(mContact); - connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&))); - connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(doChangeImage())); + + mImageLabel = static_cast(document()->findWidget("cnt_contactcard_image")); + + if (!mIsTemporary) + { + connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&))); + connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(doChangeImage())); + connect(mImageLabel, SIGNAL(iconClicked()), this, SLOT(doChangeImage())); + connect(mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&))); + } + else + { + mHeadingItem->ungrabGesture(Qt::TapGesture); + mImageLabel->ungrabGesture(Qt::TapGesture); + } // presence listener mPresenceListener = new CntPresenceListener(*mContact); @@ -253,9 +288,7 @@ QMap presences = mPresenceListener->initialPresences(online); mHeadingItem->setOnlineStatus(online); - mImageLabel = static_cast(document()->findWidget("cnt_contactcard_image")); - connect(mImageLabel, SIGNAL(iconClicked()), this, SLOT(doChangeImage())); - connect(mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&))); + // avatar QList details = mContact->details(); @@ -297,8 +330,12 @@ CntContactCardDetailItem* item = new CntContactCardDetailItem(index, mContainerWidget); connect(item, SIGNAL(clicked()), this, SLOT(onItemActivated())); - connect(item, SIGNAL(longPressed(const QPointF&)), this, SLOT(onLongPressed(const QPointF&))); - + + if (!mIsTemporary) + { + connect(item, SIGNAL(longPressed(const QPointF&)), this, SLOT(onLongPressed(const QPointF&))); + } + if (mContact->isPreferredDetail(dataItem->action(), dataItem->detail())) { dataItem->setSecondaryIcon(HbIcon("qtg_mono_favourites")); @@ -376,7 +413,7 @@ CntContactCardMapTileDetail* detail = new CntContactCardMapTileDetail; if( detail ) { - detail->mContactId = mContact->id().localId(); + detail->mContactId = mContact->localId(); if( dataItem->titleText() == hbTrId("txt_phob_formlabel_address") ) { @@ -416,8 +453,8 @@ setAsFavorite = CntFavourite::isMemberOfFavouriteGroup( contactManager(), mContact ); mHeadingItem->setFavoriteStatus( setAsFavorite ); // if contact is part of favourites group } - qobject_cast(document()->findObject("cnt:setasfavorite"))->setVisible( !setAsFavorite ); - qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible( setAsFavorite ); + static_cast(document()->findObject("cnt:setasfavorite"))->setVisible( !setAsFavorite ); + static_cast(document()->findObject("cnt:removefromfavorite"))->setVisible( setAsFavorite ); } document()->findWidget("viewToolbar")->setParent(mView); document()->findWidget("viewMenu")->setParent(mView); @@ -431,8 +468,15 @@ connectAction("cnt:edit", SLOT(editContact())); connectAction("cnt:history", SLOT(viewHistory())); connectAction("cnt:sendMyCard", SLOT(sendBusinessCard())); + connectAction("cnt:addtocontact", SLOT(onAddedToContacts())); connectAction("cnt:activityStream", NULL); // placeholder until this action is implemented (needed to avoid memory leak) + // disabled until this action is implemented + static_cast(document()->findObject("cnt:activityStream"))->setEnabled(false); + + connect(contactManager(), SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); + emit viewActivated( mViewManager, aArgs ); CNT_EXIT @@ -479,7 +523,7 @@ CntMapTileService::ContactAddressType sourceAddressType = static_cast ( mAddressList[index]->mAddressType ); - QContactLocalId contactId = mContact->id().localId(); + QContactLocalId contactId = mContact->localId(); if( mAddressList[index]->mDetailItem != NULL ) { @@ -578,7 +622,7 @@ //If there is no maptile displayed, return immediately if( mMaptileLabelList.count() > 0 ) { - QContactLocalId contactId = mContact->id().localId(); + QContactLocalId contactId = mContact->localId(); QList addressDetails = mContact->details(); @@ -698,7 +742,7 @@ mHeadingItem->setIcon(icon); mVCardIcon = new HbIcon(pixmap); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } CNT_EXIT @@ -710,7 +754,7 @@ void CntContactCardViewPrivate::sendToHs() { QVariantHash preferences; - preferences["contactId"] = mContact->id().localId(); + preferences["contactId"] = mContact->localId(); XQServiceRequest snd("com.nokia.symbian.IHomeScreenClient", "addWidget(QString,QVariantHash)" @@ -718,6 +762,27 @@ snd << QString("contactwidgethsplugin"); snd << preferences; snd.send(); + + /* + if (mRequest) + { + delete mRequest; + mRequest = 0; + } + + mRequest = mAppManager.create("com.nokia.symbian.IHomeScreenClient", "addWidget(QString,QVariantHash)", false); + + if (mRequest) + { + QList args; + QVariantHash preferences; + preferences["contactId"] = mContact->localId(); + args << preferences; + args << QString("contactwidgethsplugin"); + mRequest->setArguments(args); + mRequest->send(); + } + */ } /*! @@ -763,7 +828,7 @@ */ void CntContactCardViewPrivate::deleteContact() { - QString name = contactManager()->synthesizedDisplayLabel(*mContact); + QString name = contactManager()->synthesizedContactDisplayLabel(*mContact); if (name.isEmpty()) { name = hbTrId("txt_phob_list_unnamed"); @@ -780,9 +845,12 @@ { if (action == HbMessageBox::Delete) { + disconnect(contactManager(), SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); + contactManager()->removeContact(mContact->localId()); emit backPressed(); - mViewManager->back( mArgs ); + mViewManager->back( mArgs, true ); } } @@ -804,7 +872,7 @@ */ void CntContactCardViewPrivate::deactivate() { - mView->removeEventFilter(this); + } /*! @@ -812,7 +880,8 @@ */ void CntContactCardViewPrivate::sendBusinessCard() { - qDebug() << "CntContactCardViewPrivate::sendBusinessCard - IN"; + CNT_ENTRY + // Check if the contact has an image. QList avatars = mContact->details(); bool imageExists( false ); @@ -845,10 +914,11 @@ if ( !imageExists ) { - qDebug() << "CntContactCardViewPrivate::sendBusinessCard without image"; + CNT_LOG_ARGS("snd vCard without image") handleSendBusinessCard( NULL ); // no image } - qDebug() << "CntContactCardViewPrivate::sendBusinessCard - OUT"; + + CNT_EXIT } /*! @@ -897,6 +967,15 @@ */ void CntContactCardViewPrivate::executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction, CntContactCardDetailItem* aItem) { + if (mIsExecutingAction) + { + return; + } + else + { + mIsExecutingAction = true; + } + CntActionLauncher* other = new CntActionLauncher(*contactManager(), aAction); connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*))); if (aItem && aContact.preferredDetail(aAction).isEmpty()) @@ -921,6 +1000,7 @@ if (detail == aDetail && action == aAction) { detailItem = static_cast(mContainerLayout->itemAt(index)); + break; } } executeAction(aContact, aDetail, aAction, detailItem); @@ -932,6 +1012,15 @@ */ void CntContactCardViewPrivate::executeDynamicAction(QContact& aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor) { + if (mIsExecutingAction) + { + return; + } + else + { + mIsExecutingAction = true; + } + CntActionLauncher* other = new CntActionLauncher(*contactManager()); connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*))); other->execute(aContact, aDetail, aActionDescriptor); @@ -940,6 +1029,7 @@ void CntContactCardViewPrivate::actionExecuted(CntActionLauncher* aAction) { aAction->deleteLater(); + mIsExecutingAction = false; } /*! @@ -1108,8 +1198,9 @@ void CntContactCardViewPrivate::handleSendBusinessCard( HbAction* aAction ) { + CNT_ENTRY Q_UNUSED(aAction); - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - IN"; + QList list; /*if ( aAction && aAction->objectName() == "cancel" ) { @@ -1165,12 +1256,12 @@ // The vCard version needs to be 2.1 due to backward compatiblity when sending if (exporter.exportContacts(list, QVersitDocument::VCard21Type)) { - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard, VCard21Type"; + CNT_LOG_ARGS("VCard21Type"); QList docs = exporter.documents(); QFile f(vCardPath); if ( f.open(QIODevice::WriteOnly) ) { - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard write VCard"; + CNT_LOG_ARGS("write VCard"); // Start creating the vCard QVersitWriter writer; writer.setDevice(&f); @@ -1187,7 +1278,8 @@ mShareUi->send(l,false); } } - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - OUT"; + + CNT_EXIT } @@ -1231,7 +1323,7 @@ } mAvatar->setImageUrl(QUrl()); mImageLabel->clear(); - mImageLabel->setIcon(HbIcon("qtg_large_add_contact_picture")); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_contact_picture")); mHeadingItem->setIcon(HbIcon("qtg_large_add_contact_picture")); contactManager()->saveContact(mContact); } @@ -1295,22 +1387,36 @@ } if (!count) { - XQServiceRequest snd("com.nokia.services.logsservices.starter", "start(int,bool)", false); - snd << 0; // all calls - snd << true; // show dialpad - snd.send(); + if (mRequest) + { + delete mRequest; + mRequest = 0; + } + + mRequest = mAppManager.create("com.nokia.symbian.ILogsView", "show(QVariantMap)", false); + + if (mRequest) + { + QList args; + QVariantMap map; + map.insert("view_index", QVariant(int(LogsServices::ViewAll))); + map.insert("show_dialpad", QVariant(true)); + map.insert("dialpad_text", QVariant(QString())); + args.append(QVariant(map)); + mRequest->setArguments(args); + mRequest->send(); + } } else { QContactDetail preferredDetail = mContact->preferredDetail("call"); if (!preferredDetail.isEmpty()) { - executeAction(*mContact, preferredDetail, "call", NULL); + executeAction(*mContact, preferredDetail, "call"); } else if (count == 1 ) { - mContact->setPreferredDetail("call", mContact->details().first()); - executeAction( *mContact, mContact->details().first(), "call", NULL); + executeAction( *mContact, mContact->details().first(), "call"); } else if(count >= 2 && mAcceptSendKey) { @@ -1320,8 +1426,11 @@ connect( actionPopup, SIGNAL(executeContactAction(QContact&, QContactDetail, QString)), this, SLOT(executeAction(QContact&, QContactDetail, QString))); connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, - SLOT(sendKeyCancelSlot())); - + SLOT(sendKeyCancelSlot())); + } + else + { + //ignore } } } @@ -1330,4 +1439,20 @@ { mAcceptSendKey = true; } + +void CntContactCardViewPrivate::onAddedToContacts() +{ + emit addToContacts(); +} + +void CntContactCardViewPrivate::contactDeletedFromOtherSource(const QList& contactIds) +{ + if ( contactIds.contains(mContact->localId()) ) + { + // Do not switch to the previous view immediately. List views are + // not updated properly if this is not done in the event loop + QTimer::singleShot(0, this, SLOT(showRootView())); + } +} + // end of file diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -58,13 +58,27 @@ if ( detail.definitionName() == QContactBirthday::DefinitionName ) { QContactBirthday bd = detail; - editDate( bd.date(), hbTrId("txt_phob_formlabel_birthday") ); + if (bd.date().isNull()) + { + editDate( QDate::currentDate(), hbTrId("txt_phob_formlabel_birthday") ); + } + else + { + editDate( bd.date(), hbTrId("txt_phob_formlabel_birthday") ); + } } if ( detail.definitionName() == QContactAnniversary::DefinitionName ) { QContactAnniversary anniversary = detail; - editDate( anniversary.originalDate(), hbTrId("txt_phob_formlabel_anniversary") ); + if (anniversary.originalDate().isNull()) + { + editDate( QDate::currentDate(), hbTrId("txt_phob_formlabel_anniversary") ); + } + else + { + editDate( anniversary.originalDate(), hbTrId("txt_phob_formlabel_anniversary") ); + } } } @@ -78,9 +92,11 @@ QContactDetail detail = item->detail(); QString text(hbTrId("txt_phob_formlabel_val_formlabel_val_no_date_set")); + QString buttonObjName; if ( detail.definitionName() == QContactBirthday::DefinitionName ) { + buttonObjName = detail.definitionName() + " button"; QContactBirthday birthday = detail; if ( !birthday.isEmpty() ) { @@ -90,6 +106,7 @@ if ( detail.definitionName() == QContactAnniversary::DefinitionName ) { + buttonObjName = detail.definitionName() + " button"; QContactAnniversary anniversary = detail; if ( !anniversary.isEmpty() ) { @@ -97,6 +114,8 @@ } } mButton->setText( text ); + // Naming UI components for automation testability + mButton->setObjectName(buttonObjName); return mButton; } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -57,7 +57,7 @@ { case namesView: return new CntNamesView(*mExtensionManager); - case commLauncherView: + case contactCardView: return new CntContactCardView(); case myCardView: return new CntMyCardView(); @@ -67,7 +67,7 @@ return new CntCollectionView(*mExtensionManager); case collectionFavoritesView: return new CntFavoritesView(); - case FavoritesMemberView: + case favoritesMemberView: return new CntFavoritesMemberView(); case editView: return new CntEditView(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -113,14 +113,14 @@ CNT_EXIT } -void CntDefaultViewManager::back(const CntViewParameters aArgs) +void CntDefaultViewManager::back(const CntViewParameters aArgs, bool toRoot) { CNT_ENTRY mArgs.clear(); QFlags flags; - int back = mNavigator->back( flags ); + int back = mNavigator->back( flags, toRoot ); foreach( int k, aArgs.keys() ) { @@ -132,7 +132,8 @@ { switchView( mArgs, flags ); } - else { + else + { // exiting application cleanup(); closeApp(); @@ -263,4 +264,10 @@ CNT_EXIT } + +int CntDefaultViewManager::currentViewId() +{ + return mCurrent->viewId(); +} + // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdetaileditor.cpp --- a/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -37,6 +37,7 @@ #include #include +#include const char *CNT_DETAILEDITOR_XML = ":/xml/contacts_detail_editor.docml"; @@ -126,6 +127,11 @@ selectedContact = aArgs.value(ESelectedContact).value(); connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) ); } + + QContactManager* cm = mViewManager->contactManager(SYMBIAN_BACKEND); + connect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); + mEditorFactory->setupEditorView(*this, selectedContact); QString myCard = mArgs.value( EMyCard ).toString(); @@ -164,6 +170,10 @@ QContactManager* mgr = mViewManager->contactManager(SYMBIAN_BACKEND); mgr->saveContact( mDataFormModel->contact() ); } + + QContactManager *cm = mViewManager->contactManager(SYMBIAN_BACKEND); + disconnect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); } bool CntDetailEditor::isDefault() const @@ -192,33 +202,42 @@ void CntDetailEditor::handleItemShown(const QModelIndex& aIndex ) { - if ( mId == groupEditorView ) + HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex ); + + if ( modelItem->type() == HbDataFormModelItem::TextItem ) { - CntGroupEditorModel* groupModel = static_cast( mDataFormModel ); - if ( groupModel->isConferenceNumber(aIndex) ) + HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); + HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); + QString objName; + + if ( mId == groupEditorView ) { - HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); - HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); - edit->setInputMethodHints( Qt::ImhDialableCharactersOnly ); + CntGroupEditorModel* groupModel = static_cast( mDataFormModel ); + if ( groupModel->isConferenceNumber(aIndex) ) + { + edit->setInputMethodHints( Qt::ImhDialableCharactersOnly ); + objName = "Conference number line edit %1"; + } + else + { + edit->setInputMethodHints( Qt::ImhNoPredictiveText ); + objName = "Group name line edit %1"; + } } else { - HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); - HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); edit->setInputMethodHints( Qt::ImhNoPredictiveText ); + + if (modelItem->contentWidgetData( "preferDigits" ).toBool()) + { + edit->setInputMethodHints( Qt::ImhPreferNumbers ); + } + + objName = mDataFormModel->detail().definitionName() + " line edit %1"; } - } - else - { - HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); - HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); - edit->setInputMethodHints( Qt::ImhNoPredictiveText ); - HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex ); - if (modelItem->contentWidgetData( "preferDigits" ).toBool()) - { - edit->setInputMethodHints( Qt::ImhPreferNumbers ); - } + // Naming UI components for automation testability + edit->setObjectName(objName.arg(aIndex.row())); } } @@ -269,7 +288,7 @@ { mDataFormModel->saveContactDetails(); - QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedDisplayLabel(*mDataFormModel->contact()); + QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mDataFormModel->contact()); if (name.isEmpty()) { @@ -327,4 +346,28 @@ return mId; } +/*! +Go back to the root view +*/ +void CntDetailEditor::showRootView() +{ + mViewManager->back( mArgs, true ); +} + + +void CntDetailEditor::contactDeletedFromOtherSource(const QList& contactIds) +{ + CNT_ENTRY + + QContact normalContact = mArgs.value(ESelectedContact).value(); + QContact groupContact = mArgs.value(ESelectedGroupContact).value(); + if ( contactIds.contains(normalContact.localId()) || contactIds.contains(groupContact.localId()) ) + { + // Do not switch to the previous view immediately. List views are + // not updated properly if this is not done in the event loop + QTimer::singleShot(0, this, SLOT(showRootView())); + } + CNT_EXIT +} + // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdetailpopup.cpp --- a/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -18,23 +18,13 @@ #include "cntdetailpopup.h" #include -#include -#include -#include -#include -#include #include -QTM_USE_NAMESPACE - CntDetailPopup::CntDetailPopup(QGraphicsItem *parent, CntViewIdList aList ): - HbDialog(parent), + HbSelectionDialog(parent), mListModel(NULL), - mListView(NULL), - mSelectedDetail(0), mViewIdList( aList ) { - mListView = new HbListView(this); mListModel = new QStandardItemModel(this); addListItem("qtg_small_mobile", hbTrId("txt_phob_list_number"), phoneNumberEditorView ); @@ -47,41 +37,21 @@ addListItem("qtg_small_company_details", hbTrId("txt_phob_list_company_details"), companyEditorView); addListItem("qtg_small_family", hbTrId("txt_phob_list_family"), familyDetailEditorView); - mListView->setModel(mListModel); - mListView->setSelectionMode(HbAbstractItemView::NoSelection); - // ownership of prototype is not transferred - HbListViewItem* prototype = mListView->listItemPrototype(); - prototype->setGraphicsSize( HbListViewItem::SmallIcon ); - HbLabel *label = new HbLabel(this); label->setPlainText(hbTrId("txt_phob_title_add_field")); setHeadingWidget(label); - setContentWidget(mListView); - - HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"), this); - addAction(cancelAction); setTimeout(HbDialog::NoTimeout); setDismissPolicy(HbDialog::NoDismiss); setAttribute(Qt::WA_DeleteOnClose, true); setModal(true); - - connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(listItemSelected(QModelIndex))); + setSelectionMode(HbAbstractItemView::SingleSelection); + setModel(mListModel); } CntDetailPopup::~CntDetailPopup() { -} - -void CntDetailPopup::listItemSelected(QModelIndex index) -{ - mSelectedDetail = mListModel->item(index.row())->data(Qt::UserRole).toInt(); - close(); -} - -int CntDetailPopup::selectedDetail() -{ - return mSelectedDetail; + } void CntDetailPopup::selectDetail( CntViewIdList aList, QObject *receiver, const char *member ) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntdocumentloader.cpp --- a/phonebookui/pbkcommonui/src/cntdocumentloader.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdocumentloader.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -21,6 +21,7 @@ #include "cntdocumentloader.h" #include "cnteditviewheadingitem.h" #include "cntcontactcardheadingitem.h" +#include "cntfetchmarkall.h" #include "cntimagelabel.h" CntDocumentLoader::CntDocumentLoader() @@ -59,6 +60,14 @@ result->setObjectName(name); } } + else if ( type == "CntFetchMarkAll" ) + { + result = new CntFetchMarkAll(); + if ( result ) + { + result->setObjectName(name); + } + } else { result = HbDocumentLoader::createObject(type,name); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cnteditview_p.cpp --- a/phonebookui/pbkcommonui/src/cnteditview_p.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditview_p.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -23,6 +23,7 @@ #include "cntimagelabel.h" #include "cntsavemanager.h" #include "cntglobal.h" +#include "cntdebug.h" #include #include @@ -44,6 +45,7 @@ #include #include +#include const char *CNT_EDIT_XML = ":/xml/contacts_ev.docml"; @@ -52,7 +54,7 @@ mImageLabel( NULL ), mThumbnailManager( NULL ), mContact( NULL ), - mReq(0), + mReq(NULL), mMenu(NULL), mSaveManager(NULL) { @@ -140,6 +142,8 @@ void CntEditViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) { + CNT_ENTRY + mMgr = aMgr; mArgs = aArgs; @@ -220,6 +224,8 @@ this, SLOT(thumbnailReady(QPixmap, void*, int, int)) ); loadAvatar(); + + CNT_EXIT } void CntEditViewPrivate::deactivate() @@ -346,10 +352,12 @@ { CntDetailPopup *popup = static_cast(sender()); - if (popup && aAction != popup->actions().first()) + if (popup && aAction != popup->actions().first() && popup->selectedItems().count()) { - int id = popup->selectedDetail(); - + int row = popup->selectedItems().first().toInt(); + QModelIndex index = popup->model()->index(row, 0); + int id = popup->model()->data(index, Qt::UserRole).toInt(); + if (id != noView ) { mArgs.insert(EViewId, id ); @@ -454,7 +462,7 @@ else { QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND ); - QString name = cm->synthesizedDisplayLabel( *mContact ); + QString name = cm->synthesizedContactDisplayLabel( *mContact ); if (name.isEmpty()) { name = hbTrId("txt_phob_list_unnamed"); @@ -473,9 +481,11 @@ { QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND ); + disconnect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); emit q->contactRemoved(cm->removeContact( mContact->localId() )); - mMgr->back( mArgs ); + mMgr->back( mArgs, true ); } } @@ -487,22 +497,30 @@ // get a fresh one from backend. QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND); - mContact = new QContact(mgr->contact( mContact->localId() )); + setSelectedContact( mgr->contact( mContact->localId()) ); QVariant var; var.setValue(*mContact); CntViewParameters viewParameters; viewParameters.insert(ESelectedContact, var); - - mMgr->back( viewParameters ); -} + + if ( mArgs.value( EExtraAction ).toString() == CNT_ROOT_ACTION ) + { + mMgr->back( viewParameters, true ); + } + else + { + mMgr->back( viewParameters ); + } + +} void CntEditViewPrivate::saveChanges() { Q_Q(CntEditView); - QString name = mMgr->contactManager(SYMBIAN_BACKEND)->synthesizedDisplayLabel(*mContact); + QString name = mMgr->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact); if (name.isEmpty()) { @@ -512,6 +530,7 @@ CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mContact, mMgr->contactManager(SYMBIAN_BACKEND)); QVariant var; + bool backToRoot(false); switch (result) { @@ -534,15 +553,21 @@ HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!")); break; case CntSaveManager::EDeleted: - emit q->contactUpdated(KCntServicesReturnValueContactDeleted); + emit q->contactRemoved(true); + backToRoot = true; break; case CntSaveManager::ENothingDone: default: emit q->contactUpdated(KCntServicesReturnValueContactNotModified); break; } + + if ( mArgs.value( EExtraAction ).toString() == CNT_ROOT_ACTION ) + { + backToRoot = true; + } - mMgr->back( mArgs ); + mMgr->back( mArgs, backToRoot ); } void CntEditViewPrivate::openNameEditor() @@ -607,7 +632,7 @@ mHeading->setIcon(icon); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } } @@ -681,14 +706,15 @@ void CntEditViewPrivate::addDetail( CntEditViewItem* aDetail ) { QVariant id = aDetail->data( ERoleEditorViewId ); - CntViewParameters viewParameters; - viewParameters.insert(EViewId, id.toInt()); + + mArgs.insert(EViewId, id.toInt()); + mArgs.insert(ESelectedAction, CNT_ADD_ACTION ); QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); - viewParameters.insert(ESelectedAction, CNT_ADD_ACTION ); - - mMgr->changeView( viewParameters ); + + mArgs.insert(ESelectedContact, var); + + mMgr->changeView( mArgs ); } void CntEditViewPrivate::editDetail( CntEditViewItem* aDetail ) @@ -720,19 +746,37 @@ mContact = NULL; } mContact = new QContact( aContact ); - /* - mListView->setModel( NULL ); - if ( mModel ) + QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND ); + connect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&)), Qt::UniqueConnection); +} + +void CntEditViewPrivate::contactDeletedFromOtherSource(const QList& contactIds) +{ + CNT_ENTRY + + if ( contactIds.contains(mContact->localId()) ) { - delete mModel; - mModel = NULL; + // Do not switch to the previous view immediately. List views are + // not updated properly if this is not done in the event loop + QTimer::singleShot(0, this, SLOT(showRootView())); } - mModel = new CntEditViewListModel( mContact ); - if ( mListView ) - mListView->setModel( mModel ); - */ + CNT_EXIT } + +void CntEditViewPrivate::showRootView() +{ + CNT_ENTRY + + Q_Q(CntEditView); + + emit q->contactRemoved(true); + mMgr->back( mArgs, true ); + + CNT_EXIT +} + // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -69,7 +69,13 @@ connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) ); connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) ); - + + // Naming UI components for automation testability + QString editorObjName = detail.definitionName() + " line edit %1"; + mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row())); + + QString comboBoxObjName = detail.definitionName() + " combo box %1"; + mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row())); return mItem; } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntfavoritesmemberview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntglobal.h" #include @@ -137,16 +137,26 @@ membersFilter.setRelatedContactId(mContact->id()); mOriginalGroupMembers = getContactManager()->contactIds(membersFilter).toSet(); + /* if (!mFetchView) { mFetchView = new CntFetchContacts(*getContactManager()); connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageFavorites())); } mFetchView->setDetails(hbTrId("txt_phob_subtitle_favorites"), hbTrId("txt_common_button_save")); mFetchView->displayContacts(HbAbstractItemView::MultiSelection, mOriginalGroupMembers); + */ + CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup( + hbTrId("txt_phob_subtitle_favorites"), + hbTrId("txt_common_button_save"), + *getContactManager()); + connect( popup, SIGNAL(fetchReady(QSet)), this, SLOT(handleManageFavorites(QSet)) ); + popup->setSelectedContacts( mOriginalGroupMembers ); + popup->showPopup(); } -void CntFavoritesMemberView::handleManageFavorites() +void CntFavoritesMemberView::handleManageFavorites(QSet aIds) { +/* QSet selectedContacts = mFetchView->getSelectedContacts(); bool saveChanges = !mFetchView->wasCanceled(); @@ -156,11 +166,11 @@ if (!saveChanges) { return; } - +*/ for (int i = 0; i < 2; ++i) { // first iteration processes added members, second removed members - QSet members = (i == 0 ? selectedContacts - mOriginalGroupMembers - : mOriginalGroupMembers - selectedContacts); + QSet members = (i == 0 ? aIds - mOriginalGroupMembers + : mOriginalGroupMembers - aIds); QList memberships; foreach (QContactLocalId id, members) { @@ -261,7 +271,7 @@ QContact selectedContact = mModel->contact(index); CntViewParameters viewParameters; - viewParameters.insert(EViewId, commLauncherView); + viewParameters.insert(EViewId, contactCardView); QVariant var; var.setValue(selectedContact); viewParameters.insert(ESelectedContact, var); @@ -280,6 +290,9 @@ QVariant var; var.setValue(selectedContact); viewParameters.insert(ESelectedContact, var); + QVariant varGroup; + varGroup.setValue(*mContact); + viewParameters.insert(ESelectedGroupContact, varGroup); mViewManager->changeView(viewParameters); } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntfavoritesview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntfavoritesview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntglobal.h" #include #include @@ -30,8 +30,7 @@ mContact(NULL), mView(NULL), mSoftkey(NULL), - mViewManager(NULL), - mFetchView(NULL) + mViewManager(NULL) { bool ok = false; mDocumentLoader.load(CNT_FAVORITE_UI_XML, &ok); @@ -57,10 +56,7 @@ mView->deleteLater(); delete mContact; - mContact = 0; - - delete mFetchView; - mFetchView = 0; + mContact = NULL; } void CntFavoritesView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) @@ -85,50 +81,61 @@ void CntFavoritesView::openSelectionPopup() { + /* QSet emptySet; - if (!mFetchView) { mFetchView = new CntFetchContacts(*getContactManager()); connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMemberSelection())); } mFetchView->setDetails(hbTrId("txt_phob_subtitle_favorites"), hbTrId("txt_common_button_save")); mFetchView->displayContacts(HbAbstractItemView::MultiSelection, emptySet); + */ + CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup( + hbTrId("txt_phob_subtitle_favorites"), + hbTrId("txt_common_button_save"), + *getContactManager()); + connect(popup, SIGNAL(fetchReady(QSet)), + this, SLOT(handleMemberSelection(QSet))); + popup->showPopup(); } -void CntFavoritesView::handleMemberSelection() +void CntFavoritesView::handleMemberSelection( QSet aIds ) { - QSet members = mFetchView->getSelectedContacts(); - QList memberships; - bool saveChanges = !mFetchView->wasCanceled(); + //QSet members = mFetchView->getSelectedContacts(); + //bool saveChanges = !mFetchView->wasCanceled(); - delete mFetchView; - mFetchView = 0; - - if (!saveChanges || members.count() == 0) { - showPreviousView(); - return; - } + //delete mFetchView; + //mFetchView = 0; - foreach (QContactLocalId id, members) { - QContact contact = getContactManager()->contact(id); - QContactRelationship membership; - membership.setRelationshipType(QContactRelationship::HasMember); - membership.setFirst(mContact->id()); - membership.setSecond(contact.id()); - memberships.append(membership); + //if (!saveChanges || members.count() == 0) + if ( aIds.isEmpty() ) + { + showPreviousView(); } - - if (!memberships.isEmpty()) { - QMap errors; - getContactManager()->saveRelationships(&memberships, &errors); + else + { + QList memberships; + foreach (QContactLocalId id, aIds) { + QContact contact = getContactManager()->contact(id); + QContactRelationship membership; + membership.setRelationshipType(QContactRelationship::HasMember); + membership.setFirst(mContact->id()); + membership.setSecond(contact.id()); + memberships.append(membership); + } + + if (!memberships.isEmpty()) { + QMap errors; + getContactManager()->saveRelationships(&memberships, &errors); + } + + CntViewParameters viewParameters; + viewParameters.insert(EViewId, favoritesMemberView); + QVariant var; + var.setValue(*mContact); + viewParameters.insert(ESelectedGroupContact, var); + mViewManager->changeView(viewParameters); } - - CntViewParameters viewParameters; - viewParameters.insert(EViewId, FavoritesMemberView); - QVariant var; - var.setValue(*mContact); - viewParameters.insert(ESelectedGroupContact, var); - mViewManager->changeView(viewParameters); } void CntFavoritesView::setOrientation(Qt::Orientation orientation) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,403 @@ +/* +* 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 "cntfetchcontactpopup.h" +#include "cntdocumentloader.h" +#include "cntfetchmarkall.h" +#include "cntdebug.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +const char *CNT_FETCHLIST_XML = ":/xml/contacts_fetchdialog.docml"; + +CntFetchContactPopup::CntFetchContactPopup( QContactManager& aMgr ) : +mManager(aMgr), +mPopup( NULL ), +mListView( NULL ), +mEmptyView( NULL ), +mHeading( NULL ), +mPrimaryAction( NULL ), +mSearch( NULL ), +mModel( NULL ), +mMarkAll( NULL ), +mDoc( NULL ) +{ + mDoc = new CntDocumentLoader(); + + bool ok; + mDoc->load( CNT_FETCHLIST_XML, &ok ); + + if ( !ok ) + { + qFatal("Unable to read %S", CNT_FETCHLIST_XML ); + } + mPopup = static_cast( mDoc->findWidget( "dialog" ) ); + mSearch = static_cast( mDoc->findWidget( "searchPanel" ) ); + mMarkAll = static_cast( mDoc->findWidget("markAll") ); + mEmptyView = static_cast( mDoc->findWidget("emptyLabel" )); + mListView = static_cast( mDoc->findWidget("listView") ); + mHeading = static_cast( mDoc->findWidget("heading") ); + + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(closePopup()) ); + connect(mPopup, SIGNAL(aboutToClose()), this, SLOT(closePopup()) ); + connect(mSearch, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString))); + connect(mMarkAll, SIGNAL(markAll(int)), this, SLOT(selectAll(int)) ); + + HbLineEdit *editor = static_cast( mSearch->primitive("lineedit")); + editor->setInputMethodHints(Qt::ImhNoPredictiveText); + mSearch->setCancelEnabled( false ); + + mVirtualKeyboard = new HbStaticVkbHost(editor); + connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen())); + connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClosed())); +} + +CntFetchContactPopup::~CntFetchContactPopup() +{ + delete mDoc; +} + +CntFetchContactPopup* CntFetchContactPopup::createMultiSelectionPopup( QString aTitle, QString aAction, QContactManager& aManager ) +{ + CntFetchContactPopup* popup = new CntFetchContactPopup( aManager ); + popup->constructPopupDialog( aTitle, aAction, HbAbstractItemView::MultiSelection ); + + return popup; +} + +CntFetchContactPopup* CntFetchContactPopup::createSingleSelectionPopup( QString aTitle, QContactManager& aManager ) +{ + CntFetchContactPopup* popup = new CntFetchContactPopup( aManager ); + popup->constructPopupDialog( aTitle, "", HbAbstractItemView::NoSelection ); + + return popup; +} + +void CntFetchContactPopup::setSelectedContacts( QSet aIds ) +{ + CNT_ENTRY + if ( mListView->selectionMode() == HbAbstractItemView::MultiSelection ) + { + mIdList.clear(); + + foreach ( QContactLocalId id, aIds ) + { + mIdList.append( id ); + QContact contact = mManager.contact(id); + QModelIndex contactIndex = mModel->indexOfContact(contact); + mSelectionModel->select( contactIndex, QItemSelectionModel::Select ); + } + } + CNT_EXIT +} + +void CntFetchContactPopup::showPopup() +{ + CNT_ENTRY + HbMainWindow* window = mPopup->mainWindow(); + if ( window ) + { + connect(window, SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(loadLayout(Qt::Orientation)) ); + } + + mPopup->open( this, SLOT(dialogDismissed(HbAction*)) ); + CNT_EXIT +} + +void CntFetchContactPopup::handleKeypadOpen() +{ + CNT_ENTRY + qreal height = mPopup->size().height() - + mVirtualKeyboard->keyboardArea().height() - + mSearch->size().height(); + + // in single selection we don't have the "mark all" option + if ( mMarkAll ) + { + height = height - mMarkAll->size().height(); + } + + mEmptyView->setMaximumHeight( height ); + mListView->setMaximumHeight( height ); + CNT_EXIT +} + +void CntFetchContactPopup::handleKeypadClosed() +{ + CNT_ENTRY + + qreal height = mPopup->size().height() - mSearch->size().height(); + if ( mMarkAll ) + { + height = height - mMarkAll->size().height(); + } + + mListView->setMaximumHeight( height ); + mEmptyView->setMaximumHeight( height ); + CNT_EXIT +} + +void CntFetchContactPopup::contactSelected( const QModelIndex& aIndex ) +{ + CNT_ENTRY + if ( aIndex.isValid() ) + { + QContact contact = mModel->contact( aIndex ); + mIdList.append( contact.localId() ); + + emit fetchReady( mIdList.toSet() ); + } + + disconnect(mListView, SIGNAL(activated(const QModelIndex&)), + this, SLOT(contactSelected(const QModelIndex&)) ); + mPopup->close(); + CNT_EXIT +} + +void CntFetchContactPopup::contactsSelected( + const QItemSelection& aSelected, + const QItemSelection& aDeselected ) +{ + CNT_ENTRY + + // remove all deselected items + foreach ( QModelIndex index, aDeselected.indexes() ) + { + QContact contact = mModel->contact( index ); + QContactLocalId id = contact.localId(); + if ( mIdList.contains(id) ) + { + mIdList.removeAll( id ); + } + } + + // add all selected items + foreach ( QModelIndex index, aSelected.indexes() ) + { + QContact contact = mModel->contact( index ); + QContactLocalId id = contact.localId(); + if ( !mIdList.contains(id) ) + { + mIdList.append( id ); + } + } + + mMarkAll->setSelectedContactCount( mIdList.size() ); + + CNT_EXIT +} + +void CntFetchContactPopup::selectAll( int aState ) +{ + CNT_ENTRY + if ( mListView->selectionMode() == HbAbstractItemView::MultiSelection ) + { + switch ( aState ) + { + case Qt::Checked: + mListView->selectAll(); + mMarkAll->setSelectedContactCount( mIdList.count() ); + break; + + case Qt::Unchecked: + mListView->clearSelection(); + mMarkAll->setSelectedContactCount( 0 ); + break; + default: + break; + } + } + CNT_EXIT +} + +void CntFetchContactPopup::dialogDismissed( HbAction* aAction ) +{ + CNT_ENTRY + + if ( aAction != mPrimaryAction ) + { + emit fetchCancelled(); + } + else if ( aAction ) + { + disconnect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), + this, SLOT(contactsSelected(const QItemSelection&, const QItemSelection&)) ); + + QModelIndexList indexList = mSelectionModel->selectedIndexes(); + foreach ( QModelIndex index, indexList ) + { + QContact contact = mModel->contact( index ); + mIdList.append( contact.localId() ); + } + emit fetchReady( mIdList.toSet() ); + } + else + { + // ignore. + } + CNT_EXIT +} + +void CntFetchContactPopup::setFilter( const QString& aFilter ) +{ + CNT_ENTRY + QContactDetailFilter detailfilter; + detailfilter.setMatchFlags( QContactFilter::MatchStartsWith ); + detailfilter.setValue( aFilter.split(QRegExp("\\s+"), QString::SkipEmptyParts) ); + detailfilter.setDetailDefinitionName( + QContactDisplayLabel::DefinitionName, + QContactDisplayLabel::FieldLabel); + + mModel->setFilter(detailfilter); + + HbMainWindow* window = mPopup->mainWindow(); + if ( window ) + { + loadLayout( window->orientation() ); + } + + setSelectedContacts( mIdList.toSet() ); + CNT_EXIT +} + +void CntFetchContactPopup::constructPopupDialog( QString aTitle, QString aAction, HbAbstractItemView::SelectionMode aMode ) +{ + CNT_ENTRY + mIdList.clear(); + mTitle = aTitle; + + mPopup->setAttribute( Qt::WA_DeleteOnClose, true ); + + QContactDetailFilter contactsFilter; + contactsFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); + contactsFilter.setValue(QString(QLatin1String(QContactType::TypeContact))); + + mModel = new CntListModel( &mManager, contactsFilter, false); + mModel->showMyCard(false); + mSelectionModel = new QItemSelectionModel( mModel ); + + mListView->setFrictionEnabled(true); + mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); + mListView->verticalScrollBar()->setInteractive(true); + + HbIndexFeedback* indexFeedback = new HbIndexFeedback(mPopup); + indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); + indexFeedback->setItemView(mListView); + + HbListViewItem *prototype = mListView->listItemPrototype(); + prototype->setGraphicsSize(HbListViewItem::Thumbnail); + prototype->setStretchingStyle(HbListViewItem::StretchLandscape); + + mListView->setSelectionMode( aMode ); + mListView->setModel( mModel ); + mListView->setSelectionModel( mSelectionModel ); + + HbMainWindow* window = mPopup->mainWindow(); + if ( window ) + { + loadLayout( window->orientation() ); + } + + if ( !aAction.isEmpty() ) + { + mPrimaryAction = new HbAction( aAction, mPopup ); + mPopup->addAction( mPrimaryAction ); + } + + HbAction* secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mPopup); + mPopup->addAction( secondaryAction ); + + if ( aMode != HbListView::MultiSelection ) + { + connect(mListView, SIGNAL(activated(const QModelIndex&)), + this, SLOT(contactSelected(const QModelIndex&)) ); + mMarkAll->setVisible( false ); + } + else + { + mMarkAll->setSelectedContactCount( 0 ); + mMarkAll->setMaxContactCount( mModel->rowCount() ); + connect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), + this, SLOT(contactsSelected(const QItemSelection&, const QItemSelection&)) ); + + } + + CNT_EXIT +} + +void CntFetchContactPopup::loadLayout( Qt::Orientation aOrientation ) +{ + CNT_ENTRY + + bool multi = mListView->selectionMode() == HbAbstractItemView::MultiSelection; + if ( mModel->rowCount() > 0 ) + { + if ( aOrientation == Qt::Horizontal ) + { + mPopup->setHeadingWidget( NULL ); + mDoc->load( CNT_FETCHLIST_XML, "find_list_landscape"); + } + else + { + mHeading = new HbLabel( mTitle ); + mPopup->setHeadingWidget( mHeading ); + mDoc->load( CNT_FETCHLIST_XML, multi ? "find_list" : "find_list_single"); + } + } + else + { + if ( aOrientation == Qt::Horizontal ) + { + mPopup->setHeadingWidget( NULL ); + mDoc->load( CNT_FETCHLIST_XML, "find_empty_landscape" ); + } + else + { + mHeading = new HbLabel( mTitle ); + mPopup->setHeadingWidget( mHeading ); + mDoc->load( CNT_FETCHLIST_XML, multi ? "find_empty" : "find_empty_single" ); + } + } + + CNT_EXIT +} + +void CntFetchContactPopup::closePopup() +{ + CNT_ENTRY + disconnect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen())); + disconnect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClosed())); + + deleteLater(); + CNT_EXIT +} +// End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp --- a/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +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 "cntfetchcontactsview.h" - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*! -Given a contact manager, CntFetchContacts is responsible for -retrieving a set of contacts, if any were chosen by the user. -*/ -CntFetchContacts::CntFetchContacts(QContactManager &aManager) : - QObject(), - mPopup(NULL), - mCntModel(NULL), - mListView(NULL), - mEmptyListLabel(NULL), - mSelectionMode(HbAbstractItemView::MultiSelection), - mManager(&aManager), - mWasCanceled(false), - mLabel(NULL), - mVirtualKeyboard(NULL), - mPrimaryAction(NULL), - mSecondaryAction(NULL), - mIndexFeedback(NULL) -{ - mSearchPanel = new HbSearchPanel(); - mSearchPanel->setVisible(false); - mSearchPanel->setCancelEnabled(false); - connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString))); - - HbLineEdit *editor = static_cast(mSearchPanel->primitive("lineedit")); - editor->setInputMethodHints(Qt::ImhNoPredictiveText); - - mLayout = new QGraphicsLinearLayout(Qt::Vertical); - - mContainerWidget = new HbWidget(); -} - -CntFetchContacts::~CntFetchContacts() -{ - delete mCntModel; - mCntModel = NULL; -} - -/*! -Query to see if the user decided to press Cancel after selecting -group members. Must be called to see if results are valid. -*/ -bool CntFetchContacts::wasCanceled() const -{ - return mWasCanceled; -} - -void CntFetchContacts::setDetails(QString aTitle, QString aButtonText) -{ - mButtonText = aButtonText; - - if (!mLabel) { - mLabel = new HbLabel(aTitle); - } - else { - mLabel->setPlainText(aTitle); - } -} - -/*! -Brings up a list of contacts, awaiting user response. This function is asynchronous. -When a response is given, a clicked signal will be sent. -*/ -void CntFetchContacts::displayContacts(HbAbstractItemView::SelectionMode aMode, - QSet aContacts) -{ - doInitialize(aMode,aContacts); - markMembersInView(); - showPopup(); -} - -QSet CntFetchContacts::getSelectedContacts() const -{ - return mCurrentlySelected; -} - -void CntFetchContacts::setFilter(const QString &filterString) -{ - QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts); - - QContactDetailFilter detailfilter; - detailfilter.setDetailDefinitionName(QContactDisplayLabel::DefinitionName, QContactDisplayLabel::FieldLabel); - detailfilter.setMatchFlags(QContactFilter::MatchStartsWith); - detailfilter.setValue(searchList); - - mCntModel->setFilter(detailfilter); - - markMembersInView(); - - if (mCntModel->rowCount() == 0) { - mLayout->removeItem(mListView); - - if (mEmptyListLabel) { - qreal searchHeight = mSearchPanel->size().height(); - HbLabel* heading = static_cast(mPopup->headingWidget()); - qreal heightToSet = mPopup->size().height() - mVirtualKeyboard->keyboardArea().height() - searchHeight; - mEmptyListLabel->setMaximumHeight(heightToSet); - mEmptyListLabel->setVisible(true); - mLayout->insertItem(0, mEmptyListLabel); - } - - mListView->setVisible(false); - mSearchPanel->setVisible(true); - } - else { - if (mEmptyListLabel) { - mEmptyListLabel->setVisible(false); - } - mLayout->removeItem(mEmptyListLabel); - mLayout->insertItem(0, mListView); - mListView->setVisible(true); - } -} - -void CntFetchContacts::handleKeypadOpen() -{ - qreal searchHeight = mSearchPanel->size().height(); - HbLabel* heading = static_cast(mPopup->headingWidget()); - qreal heightToSet = mPopup->size().height() - mVirtualKeyboard->keyboardArea().height() - searchHeight; - - if (mEmptyListLabel) { - mEmptyListLabel->setMaximumHeight(heightToSet); - } - - mListView->setMaximumHeight(heightToSet); -} - -void CntFetchContacts::handleKeypadClose() -{ - mListView->setMaximumHeight(mPopup->size().height()); - - if (mEmptyListLabel) { - mEmptyListLabel->setMaximumHeight(mPopup->size().height()); - } -} - -/*! -Notify client that we're done. -*/ -void CntFetchContacts::handleUserResponse(HbAction* action) -{ - bool userCanceled = (action == mSecondaryAction); - if (userCanceled) { - mCurrentlySelected.clear(); - - mWasCanceled = true; - } - else { - mWasCanceled = false; - } - - mPopup->setVisible(false); - mListView->setModel(NULL); - delete mCntModel; - mCntModel = NULL; - - emit clicked(); -} - -void CntFetchContacts::memberSelectionChanged(const QModelIndex &index) -{ - if (!index.isValid()) return; - - if (mSelectionMode == HbAbstractItemView::SingleSelection) { - mCurrentlySelected.clear(); - } - - QContactLocalId contactId = mCntModel->contact(index).localId(); - - bool isSelected = mListView->selectionModel()->isSelected(index); - if (isSelected != mCurrentlySelected.contains(contactId)) { - if (isSelected) { - mCurrentlySelected.insert(contactId); - } - else { - mCurrentlySelected.remove(contactId); - } - } - - // Check for the case where there is a cancel button only. If so, - // after selecting any contact, should dismiss the dialog immediately. - if (mButtonText.isEmpty() && mSelectionMode == HbAbstractItemView::SingleSelection) { - disconnect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen())); - disconnect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClose())); - mPopup->close(); - } -} - -void CntFetchContacts::doInitialize(HbAbstractItemView::SelectionMode aMode, - QSet aContacts) -{ - mSelectionMode = aMode; - mCurrentlySelected = aContacts; - - if (!mPopup) { - mPopup = new HbDialog; - mPopup->setAttribute(Qt::WA_DeleteOnClose, true); - } - - QContactDetailFilter contactsFilter; - contactsFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - contactsFilter.setValue(QString(QLatin1String(QContactType::TypeContact))); - if (!mCntModel) { - mCntModel = new CntListModel(mManager, contactsFilter, false); - } - - if (!mListView) { - mListView = new HbListView(mPopup); - mListView->setModel(mCntModel); - mListView->setSelectionMode(mSelectionMode); - mListView->setFrictionEnabled(true); - mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); - mListView->verticalScrollBar()->setInteractive(true); - - HbListViewItem *prototype = mListView->listItemPrototype(); - prototype->setGraphicsSize(HbListViewItem::Thumbnail); - prototype->setStretchingStyle(HbListViewItem::StretchLandscape); - - mIndexFeedback = new HbIndexFeedback(mPopup); - mIndexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); - mIndexFeedback->setItemView(mListView); - - // Note that the layout takes ownership of the item(s) it contains. - if (mCntModel->rowCount()== 0) { - mListView->setVisible(false); - if (!mEmptyListLabel) { - mEmptyListLabel = new HbTextItem(hbTrId("txt_phob_info_no_matching_contacts")); - mEmptyListLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - mEmptyListLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - mEmptyListLabel->setAlignment(Qt::AlignCenter); - mLayout->insertItem(0, mEmptyListLabel); - } - } - else { - mLayout->addItem(mListView); - } - - mCntModel->showMyCard(false); - } - - // Handle the case where the model was removed for the list view - if (!mListView->model()) { - mListView->setModel(mCntModel); - } - - // Main window is NULL in unit tests - HbMainWindow* window = mListView->mainWindow(); - if (window) { - mContainerWidget->setPreferredHeight(mListView->mainWindow()->size().height()); - } - mContainerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - - mSearchPanel->setVisible(true); - mLayout->addItem(mSearchPanel); - mContainerWidget->setLayout(mLayout); - - connect(mListView, SIGNAL(activated(const QModelIndex&)), - this, SLOT(memberSelectionChanged(const QModelIndex&)), Qt::UniqueConnection); -} - -void CntFetchContacts::showPopup() -{ - mPopup->setTimeout(HbPopup::NoTimeout); - mPopup->setDismissPolicy(HbPopup::NoDismiss); - mPopup->setModal(true); - mPopup->setContentWidget(mContainerWidget); - - if (!mVirtualKeyboard) { - mVirtualKeyboard = new HbStaticVkbHost(mPopup); - connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen())); - connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClose())); - } - - if (!mLabel) { - mLabel = new HbLabel(hbTrId("txt_phob_title_contacts")); - } - mPopup->setHeadingWidget(mLabel); - - if (!mButtonText.isEmpty() && !mPrimaryAction) { - mPrimaryAction = new HbAction(mButtonText, mPopup); - mPopup->addAction(mPrimaryAction); - } - - if (!mSecondaryAction) { - mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mPopup); - mPopup->addAction(mSecondaryAction); - } - - mPopup->open(this, SLOT(handleUserResponse(HbAction*))); -} - -void CntFetchContacts::markMembersInView() -{ - // If there are no contacts matching the current filter, - // show "no matching contacts" label - if (mCntModel->rowCount() == 0) { - if (!mEmptyListLabel) { - mEmptyListLabel = new HbTextItem(hbTrId("txt_phob_info_no_matching_contacts")); - mEmptyListLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - mEmptyListLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - mEmptyListLabel->setAlignment(Qt::AlignCenter); - mLayout->insertItem(1, mEmptyListLabel); - } - } - else { - mLayout->removeItem(mEmptyListLabel); - delete mEmptyListLabel; - mEmptyListLabel = 0; - } - - // Mark group members in the listview - foreach (QContactLocalId id, mCurrentlySelected) { - QContact contact = mManager->contact(id); - QModelIndex contactIndex = mCntModel->indexOfContact(contact); - mListView->selectionModel()->select(contactIndex, QItemSelectionModel::Select); - } -} - -// End of file diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntfetchmarkall.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntfetchmarkall.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cntfetchmarkall.h" + +#include +#include +#include +#include + +CntFetchMarkAll::CntFetchMarkAll(QGraphicsItem *aParent) +: HbWidget(aParent), + mCheckBox(NULL), + mCounterLabel(NULL), + mContactCount( 0 ), + mSelectionCount( 0 ) +{ + setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + + mCheckBox = new HbCheckBox(this); + mCheckBox->setText(hbTrId("txt_common_list_mark_all_items")); + mCheckBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + connect(mCheckBox, SIGNAL(stateChanged(int)), this, SIGNAL(markAll(int)) ); + + mCounterLabel = new HbTextItem( this ); + + mFrame = new HbFrameItem(this); + mFrame->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal"); + mFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mFrame->setZValue(-2); + style()->setItemName(mFrame, "background"); + + HbStyle::setItemName(mCheckBox,"checkbox"); + HbStyle::setItemName(mCounterLabel,"counter"); +} + +void CntFetchMarkAll::setMaxContactCount( int aContactCount ) +{ + mContactCount = aContactCount; + mCounterLabel->setText( QString("%1/%2").arg(mSelectionCount).arg(mContactCount) ); +} + +void CntFetchMarkAll::setSelectedContactCount( int aSelectedCount ) +{ + mSelectionCount = aSelectedCount; + mCounterLabel->setText( QString("%1/%2").arg(mSelectionCount).arg(mContactCount) ); +} + +CntFetchMarkAll::~CntFetchMarkAll() +{ +} + +// EOF diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntgroupactionsview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -125,7 +125,8 @@ mGroupContact = new QContact(aArgs.value(ESelectedGroupContact).value()); mViewManager = aMgr; - QString groupName = mGroupContact->displayLabel(); + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); if (groupName.isEmpty()) { groupName = hbTrId("txt_phob_list_unnamed"); @@ -194,7 +195,8 @@ if (index.isValid()) { //reset flags mPopupCount=0; - mActionParams.clear(); + mEmailActionParams.clear(); + mMessageActionParams.clear(); QString action = mModel->item(index.row())->data(Qt::UserRole+1).toString(); @@ -219,11 +221,11 @@ if (!preferredDetail.isEmpty()) { if(action.compare("message", Qt::CaseInsensitive) == 0) { QContactPhoneNumber phoneNumber = contact.detail(); - mActionParams.append(phoneNumber.number()); + mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel())); } else { QContactEmailAddress email = contact.detail(); - mActionParams.append(email.emailAddress()); + mEmailActionParams.append(email.emailAddress()); } } else { @@ -245,7 +247,12 @@ if (mPopupCount==0) { QVariantMap map; QVariant params; - params.setValue(mActionParams); + if (action.compare("message", Qt::CaseInsensitive) == 0) { + params.setValue(mMessageActionParams); + } + else if (action.compare("email", Qt::CaseInsensitive) == 0) { + params.setValue(mEmailActionParams); + } map.insert(action,params); CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action); connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*))); @@ -261,11 +268,11 @@ if (action.compare("message", Qt::CaseInsensitive) == 0) { QContactPhoneNumber phoneNumber = static_cast(detail); - mActionParams.append(phoneNumber.number()); + mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel())); } else if (action.compare("email", Qt::CaseInsensitive) == 0) { QContactEmailAddress email = static_cast(detail); - mActionParams.append(email.emailAddress()); + mEmailActionParams.append(email.emailAddress()); } //actionpopup executed, decrement counter @@ -273,7 +280,12 @@ if (mPopupCount==0) { QVariantMap map; QVariant params; - params.setValue(mActionParams); + if (action.compare("message", Qt::CaseInsensitive) == 0) { + params.setValue(mMessageActionParams); + } + else if (action.compare("email", Qt::CaseInsensitive) == 0) { + params.setValue(mEmailActionParams); + } map.insert(action,params); CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntgroupmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntgroupmemberview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntcontactcardheadingitem.h" #include "cntglobal.h" #include "cntimagelabel.h" @@ -36,6 +36,7 @@ #include #include #include +#include #include "cntdocumentloader.h" @@ -63,7 +64,6 @@ mModel(NULL), mImageLabel(NULL), mListView(NULL), - mFetchView(NULL), mAvatar(NULL) { mDocument = new CntDocumentLoader; @@ -124,13 +124,10 @@ mView->deleteLater(); delete mGroupContact; - mGroupContact = 0; + mGroupContact = NULL; delete mModel; - mModel = 0; - - delete mFetchView; - mFetchView = 0; + mModel = NULL; delete mAvatar; mAvatar = NULL; @@ -203,7 +200,7 @@ if (mArgs.value(ESelectedAction).toString() == CNT_SAVE_ACTION) { - QString name = getContactManager()->synthesizedDisplayLabel(*mGroupContact); + QString name = getContactManager()->synthesizedContactDisplayLabel(*mGroupContact); HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created").arg(name))); } } @@ -240,56 +237,46 @@ membersFilter.setRelationshipType(QContactRelationship::HasMember); membersFilter.setRelatedContactRole(QContactRelationship::First); membersFilter.setRelatedContactId(mGroupContact->id()); + mOriginalGroupMembers = getContactManager()->contactIds(membersFilter); - QSet contactsSet = mOriginalGroupMembers.toSet(); - - QString groupName = mGroupContact->displayLabel(); + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); if (groupName.isEmpty()) { groupName = hbTrId("txt_phob_list_unnamed"); } - if (!mFetchView) { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageMembers())); - } - mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupName), - hbTrId("txt_common_button_save")); - mFetchView->displayContacts(HbAbstractItemView::MultiSelection, contactsSet); + CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup( + HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupName), + hbTrId("txt_common_button_save"), + *mViewManager->contactManager(SYMBIAN_BACKEND)); + connect( popup, SIGNAL(fetchReady(QSet)),this, SLOT(handleManageMembers(QSet)) ); + popup->setSelectedContacts( mOriginalGroupMembers.toSet() ); + popup->showPopup(); } -void CntGroupMemberView::handleManageMembers() +void CntGroupMemberView::handleManageMembers(QSet aIds) { - - QSet selectedContacts = mFetchView->getSelectedContacts(); - - if (mFetchView->wasCanceled()) { - delete mFetchView; - mFetchView = 0; - return; - } - QList removedMemberships; QList addedMemberships; - QSet removedMembers = mOriginalGroupMembers.toSet() - selectedContacts; + QSet removedMembers = mOriginalGroupMembers.toSet() - aIds; setRelationship(removedMembers, removedMemberships); - QSet addedMembers = selectedContacts - mOriginalGroupMembers.toSet(); + QSet addedMembers = aIds - mOriginalGroupMembers.toSet(); setRelationship(addedMembers, addedMemberships); QMap errors; - if (!addedMemberships.isEmpty()) { + if (!addedMemberships.isEmpty()) + { getContactManager()->saveRelationships(&addedMemberships, &errors); } - if (!removedMemberships.isEmpty()) { + if (!removedMemberships.isEmpty()) + { getContactManager()->removeRelationships(removedMemberships, &errors); } - - delete mFetchView; - mFetchView = 0; } void CntGroupMemberView::createModel() @@ -314,7 +301,8 @@ void CntGroupMemberView::deleteGroup() { - QString groupName = mGroupContact->displayLabel(); + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); if (groupName.isNull()) { groupName = hbTrId("txt_phob_list_unnamed"); @@ -352,14 +340,17 @@ HbAction *removeFromGroupAction = 0; HbAction *openContactAction = 0; HbAction *editContactAction = 0; + HbAction *sendToHsAction = 0; openContactAction = menu->addAction(hbTrId("txt_common_menu_open")); editContactAction = menu->addAction(hbTrId("txt_common_menu_edit")); removeFromGroupAction = menu->addAction(hbTrId("txt_phob_menu_remove_from_group")); + sendToHsAction = menu->addAction(hbTrId("txt_phob_menu_send_to_homescreen")); openContactAction->setData( data ); editContactAction->setData( data ); removeFromGroupAction->setData( data ); + sendToHsAction->setData( data ); menu->open(this, SLOT(handleMenu(HbAction*))); } @@ -382,15 +373,34 @@ { removeFromGroup(index); } + else if (action == menuItem->actions().at(3)) + { + sendToHs(index); + } } +/*! +Called after user clicked on the listview. +*/ +void CntGroupMemberView::sendToHs(const QModelIndex &index) +{ + QVariantHash preferences; + preferences["contactId"] = mModel->contact(index).id().localId(); + + XQServiceRequest snd("com.nokia.symbian.IHomeScreenClient", + "addWidget(QString,QVariantHash)", + false); + snd << QString("contactwidgethsplugin"); + snd << preferences; + snd.send(); +} /*! Called after user clicked on the listview. */ void CntGroupMemberView::showContactView(const QModelIndex &index) { - mArgs.insert(EViewId, commLauncherView); + mArgs.insert(EViewId, contactCardView); QVariant var; var.setValue(mModel->contact(index)); mArgs.insert(ESelectedContact, var); @@ -429,12 +439,11 @@ Q_UNUSED(error); if (!error) { - QIcon qicon(pixmap); - HbIcon icon(qicon); + HbIcon icon(pixmap); mHeadingItem->setIcon(icon); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } } @@ -504,7 +513,7 @@ } mAvatar->setImageUrl(QUrl()); mImageLabel->clear(); - mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture")); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture")); mHeadingItem->setIcon(HbIcon("qtg_large_add_group_picture")); mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact); } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cnthistoryview.cpp --- a/phonebookui/pbkcommonui/src/cnthistoryview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnthistoryview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -30,9 +30,12 @@ #include #include #include +#include +#include #include "cnthistoryviewitem.h" #include "cntglobal.h" +#include "cntdebug.h" const char *CNT_HISTORYVIEW_XML = ":/xml/contacts_history.docml"; @@ -99,6 +102,9 @@ */ void CntHistoryView::deactivate() { + QContactManager* cm = mViewMgr->contactManager(SYMBIAN_BACKEND); + disconnect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); } /** @@ -108,6 +114,8 @@ { mViewMgr = aMgr; mArgs = aArgs; + + QContactManager* cm = mViewMgr->contactManager(SYMBIAN_BACKEND); mContact = new QContact(mArgs.value(ESelectedContact).value()); // Set history view heading @@ -130,8 +138,7 @@ // Connect listview items to respective slots connect(mHistoryListView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); - mHistoryModel = new CntHistoryModel(mContact->localId(), - mViewMgr->contactManager(SYMBIAN_BACKEND)); + mHistoryModel = new CntHistoryModel(mContact->localId(), cm); mHistoryListView->setModel(mHistoryModel); //ownership is not taken //start listening to the events amount changing in the model @@ -155,6 +162,9 @@ HbMainWindow* mainWindow = mView->mainWindow(); connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(updateScrollingPosition())); + + connect(cm, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); } /*! @@ -220,17 +230,17 @@ operation = "dial(QString)"; args << number; createRequest = true; + + // TODO: Using XQApplicationManager is not working with calls + // The factory method cannot create a request. Find out why + createRequest = false; + QString service("com.nokia.symbian.ICallDial"); + QString type("dial(QString,int)"); + XQServiceRequest snd(interface, operation, false); + snd << number.toString() << mContact->localId(); + snd.send(); } - // TODO: Using XQApplicationManager is not working with calls - // The factory method cannot create a request. Find out why - createRequest = false; - QString service("com.nokia.symbian.ICallDial"); - QString type("dial(QString)"); - XQServiceRequest snd(interface, operation, false); - snd << number.toString(); - snd.send(); - } else if ( flags & CntMessage ) { // Open conversation view QVariant id = index.data(CntConverstaionIdRole); @@ -269,6 +279,27 @@ } /*! +Go back to the root view +*/ +void CntHistoryView::showRootView() +{ + mViewMgr->back( mArgs, true ); +} + + +void CntHistoryView::contactDeletedFromOtherSource(const QList& contactIds) +{ + CNT_ENTRY + if ( contactIds.contains(mContact->localId()) ) + { + // Do not switch to the previous view immediately. List views are + // not updated properly if this is not done in the event loop + QTimer::singleShot(0, this, SLOT(showRootView())); + } + CNT_EXIT +} + +/*! Show or hide the clear history menu */ void CntHistoryView::showClearHistoryMenu() diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntimageeditorview.cpp --- a/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -18,6 +18,7 @@ #include "cntimageeditorview.h" #include "cntimageutility.h" #include "cntsavemanager.h" +#include "cntimagelabel.h" #include #include @@ -151,7 +152,8 @@ } // set the correct image if the contact already has an image set - mImageLabel = static_cast(mDocumentLoader.findWidget(QString("cnt_image_label"))); + mImageLabel = static_cast(mDocumentLoader.findWidget(QString("cnt_image_label"))); + mImageLabel->ungrabGesture(Qt::TapGesture); QList details = mContact->details(); if (details.count() > 0) { @@ -171,7 +173,7 @@ mRemoveImage->setEnabled(false); if (mContact->type() == QContactType::TypeGroup) { - mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture")); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture")); } } @@ -307,9 +309,9 @@ mAvatar->setImageUrl(QUrl()); mImageLabel->clear(); if (mContact->type() == QContactType::TypeGroup) - mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture")); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture")); else - mImageLabel->setIcon(HbIcon("qtg_large_add_contact_picture")); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_contact_picture")); mRemoveImage->setEnabled(false); } } @@ -367,10 +369,8 @@ Q_UNUSED(id); if (!error) { - QIcon qicon(pixmap); - HbIcon icon(qicon); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } CNT_EXIT @@ -428,7 +428,7 @@ mContact->removeDetail(mAvatar); } - QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedDisplayLabel(*mContact); + QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact); if (name.isEmpty()) { diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntimagelabel.cpp --- a/phonebookui/pbkcommonui/src/cntimagelabel.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimagelabel.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -17,16 +17,40 @@ #include "cntimagelabel.h" +#include +#include + #include #include #include -#include +#include +#include +#include +#include +static const qreal ImageRounding = 1.5; // units + +/* + * Imagel label for landscape views. + */ CntImageLabel::CntImageLabel(QGraphicsItem *parent) : - HbLabel(parent) + HbWidget(parent) { + setFlag(QGraphicsItem::ItemHasNoContents, false); + + mDefaultAvatar = new HbIconItem(this); + style()->setItemName(mDefaultAvatar, "icon"); + mDefaultAvatar->setAlignment(Qt::AlignCenter); + grabGesture(Qt::TapGesture); HbEffect::add(this, "groupbox_icon_click", "iconclick"); + + //shadow effect + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this); + effect->setColor(QColor(0, 0, 0, 150)); + effect->setBlurRadius(5); + effect->setOffset(3); + setGraphicsEffect(effect); } CntImageLabel::~CntImageLabel() @@ -34,6 +58,76 @@ } +void CntImageLabel::setIcon(const QPixmap &pixmap) +{ + mPixmap = pixmap; + + if (!mPixmap.isNull()) + { + mDefaultAvatar->setVisible(false); + mDefaultAvatar->setIcon(HbIcon()); + } + else + { + mDefaultAvatar->setIconName(QLatin1String("qtg_large_add_contact_picture")); + mDefaultAvatar->setVisible(true); + } + + update(); +} + +void CntImageLabel::setAvatarIcon(const HbIcon &icon) +{ + mIcon = icon; + + if (mIcon.isNull()) + { + mDefaultAvatar->setVisible(false); + mDefaultAvatar->setIcon(HbIcon()); + } + else + { + mDefaultAvatar->setIcon(icon); + mDefaultAvatar->setVisible(true); + } +} + +HbIcon CntImageLabel::avatarIcon() const +{ + return mIcon; +} + +void CntImageLabel::clear() +{ + mIcon.clear(); + mPixmap = NULL; + mDefaultAvatar->setIconName(QLatin1String("qtg_large_add_contact_picture")); + mDefaultAvatar->setVisible(true); +} + +void CntImageLabel::paint(QPainter* painter, + const QStyleOptionGraphicsItem* option, + QWidget* widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + + if (mPixmap.isNull()) + { + return; + } + else + { + painter->save(); + QPainterPath clip; + qreal rounding = ImageRounding * HbDeviceProfile::profile(this).unitValue(); + clip.addRoundRect(rect(), rounding, rounding); + painter->setClipPath(clip); + painter->drawPixmap(rect().toRect(), mPixmap); + painter->restore(); + } +} + void CntImageLabel::gestureEvent(QGestureEvent* event) { if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntmainwindow.cpp --- a/phonebookui/pbkcommonui/src/cntmainwindow.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmainwindow.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -19,23 +19,31 @@ #include "cntdefaultviewmanager.h" #include "cntviewnavigator.h" #include +#include +#include +#include +#include #include CntMainWindow::CntMainWindow(QWidget *parent, int defaultView) : HbMainWindow(parent), - mViewManager(NULL) + mViewManager(NULL), + mDefaultView(defaultView) { CNT_ENTRY - + if (defaultView != noView) { CntViewNavigator* navigator = new CntViewNavigator(this); - navigator->addException( editView, namesView ); - navigator->addException( FavoritesMemberView, collectionView ); + navigator->addException( favoritesMemberView, collectionView ); navigator->addEffect( groupMemberView, groupActionsView ); navigator->addEffect( groupActionsView, groupMemberView ); - navigator->addEffect( commLauncherView, historyView ); - navigator->addEffect( historyView, commLauncherView ); + navigator->addEffect( contactCardView, historyView ); + navigator->addEffect( historyView, contactCardView ); + navigator->addRoot( namesView ); + navigator->addRoot( collectionView ); + navigator->addRoot( groupMemberView ); + navigator->addRoot( favoritesMemberView ); mViewManager = new CntDefaultViewManager( this ); mViewManager->setViewNavigator( navigator ); @@ -65,9 +73,29 @@ */ void CntMainWindow::keyPressEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Yes || event->key() == Qt::Key_No) + if (event->key() == Qt::Key_Yes && mDefaultView != noView) { - emit keyPressed(event); + if (mViewManager->currentViewId() == contactCardView) + { + emit keyPressed(event); + } + else + { + XQApplicationManager appManager; + XQAiwRequest* request = appManager.create("com.nokia.symbian.ILogsView", "show(QVariantMap)", false); + + if (request) + { + QList args; + QVariantMap map; + map.insert("view_index", QVariant(int(LogsServices::ViewAll))); + map.insert("show_dialpad", QVariant(true)); + map.insert("dialpad_text", QVariant(QString())); + args.append(QVariant(map)); + request->setArguments(args); + request->send(); + } + } } else { diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntmycardview.cpp --- a/phonebookui/pbkcommonui/src/cntmycardview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntmycardview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntglobal.h" #include #include @@ -28,8 +28,7 @@ CntMyCardView::CntMyCardView() : mContact(NULL), - mViewManager(NULL), - mFetchView(NULL) + mViewManager(NULL) { bool ok = false; mDocumentLoader.load(CNT_MYCARD_UI_XML, &ok); @@ -53,10 +52,7 @@ mView->deleteLater(); delete mContact; - mContact = 0; - - delete mFetchView; - mFetchView = NULL; + mContact = NULL; } /*! @@ -130,6 +126,7 @@ QVariant var; var.setValue(*mContact); viewParameters.insert(ESelectedContact, var); + viewParameters.insert(EExtraAction, CNT_ROOT_ACTION); mViewManager->changeView(viewParameters); } @@ -138,34 +135,25 @@ */ void CntMyCardView::openMyCardSelectionView() { - // Display a list of contacts to choose a mycard from. - if (!mFetchView) { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection())); - } - mFetchView->setDetails(hbTrId("txt_phob_title_select_contact"), ""); - QSet emptyContactsSet; - mFetchView->displayContacts(HbAbstractItemView::SingleSelection, emptyContactsSet); + CntFetchContactPopup* popup = CntFetchContactPopup::createSingleSelectionPopup( + hbTrId("txt_phob_title_select_contact"), + *mViewManager->contactManager(SYMBIAN_BACKEND)); + connect( popup, SIGNAL(fetchReady(QSet)), this, SLOT(handleMultiCardSelection(QSet))); + popup->showPopup(); } -void CntMyCardView::handleMultiCardSelection() +void CntMyCardView::handleMultiCardSelection( QSet aIds ) { QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND ); - QSet selectedContacts = mFetchView->getSelectedContacts(); - - if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) { - QList selectedContactsList = selectedContacts.values(); + if ( !aIds.isEmpty() ) { + QList selectedContactsList = aIds.values(); QContact contact = manager->contact(selectedContactsList.front()); removeFromGroup(&contact); manager->setSelfContactId( contact.localId() ); showPreviousView(); } - else { - delete mFetchView; - mFetchView = NULL; - } } void CntMyCardView::removeFromGroup(const QContact* aContact) diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntnamesview_p.cpp --- a/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -17,15 +17,15 @@ #include "cntnamesview_p.h" #include "cntactionlauncher.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntextensionmanager.h" #include "cntglobal.h" #include "cntdebug.h" +#include "cntapplication.h" #include #include -#include #include #include #include @@ -64,7 +64,6 @@ mNamesAction(NULL), mMenuBuilder(NULL), mHandledContactId(0), - mFetchView(NULL), mIsDefault(true), mId( namesView ), mActionGroup(NULL), @@ -137,16 +136,28 @@ connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(hideFinder())); connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString))); + HbMainWindow* win = mView->mainWindow(); + CntApplication* cntApp = static_cast(qApp); + connect(win, SIGNAL(viewReady()), cntApp, SIGNAL(applicationReady())); + +#ifdef __WINS__ + mView->menu()->addAction("Change Orientation", this, SLOT(switchOrientation()) ); +#endif CNT_EXIT } +void CntNamesViewPrivate::switchOrientation() +{ + HbMainWindow* win = mView->mainWindow(); + Qt::Orientation orientation = win->orientation(); + + win->setOrientation( orientation == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal ); +} + CntNamesViewPrivate::~CntNamesViewPrivate() { CNT_ENTRY - delete mFetchView; - mFetchView = NULL; - delete mListModel; mListModel = NULL; @@ -215,27 +226,29 @@ setScrollPosition(aArgs.value(ESelectedContact).value().localId()); } - if ( aArgs.value( EFinder ).toString() == "show" ) + if ( aArgs.value( EExtraAction ).toString() == CNT_FIND_ACTION ) { showFinder(); } - + CNT_EXIT } void CntNamesViewPrivate::deactivate() { CNT_ENTRY - + HbMainWindow* win = mView->mainWindow(); // in UTs there is no mainwindow and therefore calling HbView::visibleItems() would cause a crash - if (mView->mainWindow() != NULL) + if ( win != NULL) { if (!(mView->visibleItems() & Hb::AllItems)) { hideFinder(); } + + CntApplication* cntApp = static_cast(qApp); + disconnect(win, SIGNAL(viewReady()), cntApp, SIGNAL(applicationReady())); } - delete mMenuBuilder; mMenuBuilder = NULL; @@ -409,7 +422,7 @@ CNT_ENTRY QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND ); - QString name = manager->synthesizedDisplayLabel(aContact); + QString name = manager->synthesizedContactDisplayLabel(aContact); if (name.isEmpty()) { name = hbTrId("txt_phob_list_unnamed"); @@ -426,36 +439,26 @@ void CntNamesViewPrivate::deleteMultipleContacts() { CNT_ENTRY + CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup( + hbTrId("txt_phob_title_delete_contacts"), + hbTrId("txt_common_button_delete"), + *mViewManager->contactManager(SYMBIAN_BACKEND)); + connect(popup, SIGNAL(fetchReady(QSet)), + this, SLOT(handleDeleteMultipleContacts(QSet)) ); - if (!mFetchView) { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleDeleteMultipleContacts())); - } - - mFetchView->setDetails(hbTrId("txt_phob_title_delete_contacts"),hbTrId("txt_common_button_delete")); - QSet emptyContactsSet; - - // Pop up a list of contacts for deletion - mFetchView->displayContacts(HbAbstractItemView::MultiSelection, emptyContactsSet); + popup->showPopup(); CNT_EXIT } -void CntNamesViewPrivate::handleDeleteMultipleContacts() +void CntNamesViewPrivate::handleDeleteMultipleContacts( QSet aIds ) { CNT_ENTRY - QSet selectedContacts = mFetchView->getSelectedContacts(); - QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND ); - if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) { - foreach ( QContactLocalId id, selectedContacts.values() ) - { - manager->removeContact( id ); - } + foreach ( QContactLocalId id, aIds ) + { + manager->removeContact( id ); } - - delete mFetchView; - mFetchView = NULL; CNT_EXIT } @@ -475,7 +478,7 @@ CNT_ENTRY CntViewParameters args; - args.insert(EViewId, commLauncherView); + args.insert(EViewId, contactCardView); if (aContact.localId() == mListModel->myCardId() && aContact.details().count() <= 4) { args.insert(EViewId, myCardView); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -71,6 +71,10 @@ widget->setLayout( mLayout ); connect( mEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)) ); + + // Naming UI components for automation testability + QString editorObjName = detail.definitionName() + " line edit %1"; + mEdit->setObjectName(editorObjName.arg(modelIndex().row())); return widget; } // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -135,6 +135,12 @@ connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) ); connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) ); + // Naming UI components for automation testability + QString editorObjName = detail.definitionName() + " line edit %1"; + mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row())); + + QString comboBoxObjName = detail.definitionName() + " combo box %1"; + mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row())); return mItem; } @@ -157,6 +163,7 @@ QContactPhoneNumber number; number.setSubTypes( aSubType ); number.setContexts( aContext ); + number.setNumber( mItem->editor()->text() ); aItem->setDetail( number ); } else diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -57,7 +57,13 @@ mItem->editor()->setText( detail.url() ); connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) ); connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) ); - + + // Naming UI components for automation testability + QString editorObjName = detail.definitionName() + " line edit %1"; + mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row())); + + QString comboBoxObjName = detail.definitionName() + " combo box %1"; + mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row())); return mItem; } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/pbkcommonui/src/cntviewnavigator.cpp --- a/phonebookui/pbkcommonui/src/cntviewnavigator.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntviewnavigator.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -47,7 +47,7 @@ iViewStack.push( aId ); } -const int& CntViewNavigator::back( QFlags &flags ) +const int& CntViewNavigator::back( QFlags &flags, bool toRoot ) { qDebug() << "CntViewNavigator::back() - IN"; iTop = noView; @@ -59,8 +59,23 @@ { int top = iViewStack.top(); + // If we need to go to the latest root view + if ( toRoot ) + { + while ( !iViewStack.isEmpty() ) + { + int current = iViewStack.top(); + + if ( iRoots.contains( current ) ) + { + iTop = current; + break; + } + iViewStack.pop(); + } + } // If any exception defined for the current (top) view - if ( iExceptions.contains( top ) ) + else if ( iExceptions.contains( top ) ) { iTop = iExceptions.value( top ); // cleanup the history until the exception value is found @@ -122,5 +137,10 @@ iEffects.remove( aCurrent ); } } + +void CntViewNavigator::addRoot( const int& aCurrent ) +{ + iRoots.append( aCurrent ); +} // End of File diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookapp/inc/cntapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookapp/inc/cntapplication.h Fri Jul 23 12:43:48 2010 +0300 @@ -0,0 +1,38 @@ +/* +* 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 CNTAPP_H_ +#define CNTAPP_H_ + +#include + +class CntApplication : public HbApplication +{ + Q_OBJECT + +public: + CntApplication(int &argc, + char *argv[], + Hb::ApplicationFlags flags = Hb::DefaultApplicationFlags) : + HbApplication( argc, argv, flags ){} + +signals: + void applicationReady(); +}; + +#endif /* CNTAPP_H_ */ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookapp/phonebookapp.pro --- a/phonebookui/phonebookapp/phonebookapp.pro Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookapp/phonebookapp.pro Fri Jul 23 12:43:48 2010 +0300 @@ -44,6 +44,7 @@ SERVICE.OPTIONS = embeddable # Input +HEADERS += inc/cntapplication.h HEADERS += inc/cntinterface.h HEADERS += inc/cntappservicehandler.h diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookapp/src/main.cpp --- a/phonebookui/phonebookapp/src/main.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookapp/src/main.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -15,19 +15,19 @@ * */ -#include #include #include #include "cntmainwindow.h" #include "cntappservicehandler.h" #include "cntglobal.h" #include "cntdebug.h" +#include "cntapplication.h" int main(int argc, char **argv) { qInstallMsgHandler(MSG_HANDLER); - HbApplication a( argc, argv ); + CntApplication a( argc, argv ); QTranslator translator; QString lang = QLocale::system().name(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/inc/cntabstractserviceprovider.h --- a/phonebookui/phonebookservices/inc/cntabstractserviceprovider.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntabstractserviceprovider.h Fri Jul 23 12:43:48 2010 +0300 @@ -29,7 +29,7 @@ public: /*! - Complete the Qt Highway service (through a QqServiceProvider instance). + Complete the Qt Highway service (through a XQServiceProvider instance). Closes the app after the completing is done (message sending to client is done). */ virtual void CompleteServiceAndCloseApp(const QVariant& retValue) = 0; diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h --- a/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Fri Jul 23 12:43:48 2010 +0300 @@ -40,7 +40,6 @@ public slots: void doCloseView(); - void addActionsToToolBar(); void addToContacts(); void saveNew(); void updateExisting(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/inc/cntserviceprovideredit.h --- a/phonebookui/phonebookservices/inc/cntserviceprovideredit.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceprovideredit.h Fri Jul 23 12:43:48 2010 +0300 @@ -49,6 +49,15 @@ void editCreateNew(const QString& definitionName, const QString& value); /** + * Launch editor for creating a new contact with a given detail and subtype. + * If the given subtype string is empty, then QContactPhoneNumber::SubTypeMobile is used. + * @param definitionName The field type + * @param value The value for the field. + * @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline) + */ + void editCreateNew(const QString &definitionName, const QString &value, const QString &subType); + + /** * Launch editor for creating a new contact based on vCard file indicated in arg. * @param vCardFile The vCard file name and path. */ @@ -68,6 +77,16 @@ */ void editUpdateExisting(const QString &definitionName, const QString &value); + /** + * User can first choose a contact, and then an editor is opened. + * A new detail is provided by caller and it will be prefilled in the editor. + * The detail sub type can also be given. + * @param definitionName The field type + * @param value The value for the field. + * @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline) + */ + void editUpdateExisting(const QString &definitionName, const QString &value, const QString &subType); + private: // from CntAbstractServiceProvider void CompleteServiceAndCloseApp(const QVariant& retValue); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/inc/cntservices.h --- a/phonebookui/phonebookservices/inc/cntservices.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntservices.h Fri Jul 23 12:43:48 2010 +0300 @@ -65,9 +65,26 @@ * @param definitionName The field type * @param value The value for the field. * @param aServiceProvider The service provider + * @param defaultForOnlineAccountIsImpp If no subtype is given, default + * for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then + * the default is QContactOnlineAccount::SubTypeSipVoip. */ void editCreateNew(const QString &definitionName, const QString &value, - CntAbstractServiceProvider& aServiceProvider ); + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true ); + + /** + * Launch editor for creating a new contact with a given detail and subtype. + * If the given subtype string is empty, then QContactPhoneNumber::SubTypeMobile is used. + * @param definitionName The field type + * @param value The value for the field. + * @param subType The subtype for the field. (for eg. QContactPhoneNumber::SubTypeLandline) + * @param aServiceProvider The service provider + * @param defaultForOnlineAccountIsImpp If no subtype is given, default + * for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then + * the default is QContactOnlineAccount::SubTypeSipVoip. + */ + void editCreateNew(const QString &definitionName, const QString &value, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true ); /** * Launch editor for creating a new contact based on vCard file indicated in arg. @@ -85,7 +102,21 @@ * @param aServiceProvider The service provider */ void editUpdateExisting(const QString &definitionName, const QString &value, - CntAbstractServiceProvider& aServiceProvider ); + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true ); + + /** + * User can first choose a contact, and then an editor is opened. + * A new detail is provided by caller and it will be prefilled in the editor. + * @param definitionName The field type + * @param value The value for the field. + * @param subType The subtype for the field. (for eg. QContactPhoneNumber::SubTypeLandline) + * @param aServiceProvider The service provider + * @param defaultForOnlineAccountIsImpp If no subtype is given, default + * for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then + * the default is QContactOnlineAccount::SubTypeSipVoip. + */ + void editUpdateExisting(const QString &definitionName, const QString &value, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true ); /** * Open the editor for an existing contact.' @@ -113,20 +144,25 @@ CntAbstractServiceProvider& aServiceProvider ); /** - * Set the flag that allows quiting the application explicitly + * Set the flag that allows quitting the application explicitly * using the quitApp slot. By default the value is always true. */ - void setQuitable(bool quitable); + void setQuittable(bool quittable); public slots: /** * Quit the application */ void quitApp(); + /** + * Terminate a service + */ + void terminateService(); private: void removeNotSupportedFields(QContact& contact); void removeNotSupportedDetails(QContact& contact); + void fillOnlineAccount( QContactOnlineAccount& account, const QString& value, const QString& subType, bool defaultForOnlineAccountIsImpp); private: // from CntAbstractServiceProvider void CompleteServiceAndCloseApp(const QVariant& retValue); @@ -134,7 +170,7 @@ CntAbstractViewManager* mViewManager; // not owned QStringList m_definitionNames; CntAbstractServiceProvider* mCurrentProvider; // not owned - bool mIsQuitable; + bool mIsQuittable; }; #endif /* CNTSERVICES_H */ diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/inc/cntserviceviewmanager.h --- a/phonebookui/phonebookservices/inc/cntserviceviewmanager.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceviewmanager.h Fri Jul 23 12:43:48 2010 +0300 @@ -37,6 +37,8 @@ ~CntServiceViewManager(); protected slots: virtual void closeApp(); +signals: + void applicationClosed(); }; #endif // CNTSERVICEVIEWMANAGER_H diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp --- a/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -34,14 +34,13 @@ \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0) */ CntServiceAssignContactCardView::CntServiceAssignContactCardView( CntAbstractServiceProvider& aServiceProvider ) : - CntContactCardView(), -mProvider( aServiceProvider ) + CntContactCardView(true), + mProvider( aServiceProvider ) { CNT_ENTRY connect(this, SIGNAL(backPressed()), this, SLOT(doCloseView())); - connect(this, SIGNAL(viewActivated(CntAbstractViewManager*, QContactDetail)), this, SLOT(doViewActivated(CntAbstractViewManager*,QContactDetail))); - - addActionsToToolBar(); + connect(this, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)), this, SLOT(doViewActivated(CntAbstractViewManager*,const CntViewParameters))); + connect(this, SIGNAL(addToContacts()), this, SLOT(addToContacts())); CNT_EXIT } @@ -55,40 +54,47 @@ } /*! -Add actions to the toolbar -*/ -void CntServiceAssignContactCardView::addActionsToToolBar() -{ - CNT_ENTRY - view()->toolBar()->clearActions(); - HbAction* addToContact = view()->toolBar()->addAction("txt_phob_button_add_to_contacts"); - connect(addToContact, SIGNAL(triggered()), this, SLOT(addToContacts())); - CNT_EXIT -} - -/*! Opens the Add to Contacts popup */ void CntServiceAssignContactCardView::addToContacts() { CNT_ENTRY - HbDialog *popup = new HbDialog(); + + HbDialog* popup = new HbDialog(); popup->setDismissPolicy(HbDialog::NoDismiss); - popup->setHeadingWidget(new HbLabel(hbTrId("txt_phob_title_add_to_contacts"), popup)); + popup->setHeadingWidget( + new HbLabel(hbTrId("txt_phob_title_add_to_contacts"), popup)); popup->setAttribute(Qt::WA_DeleteOnClose); + popup->setTimeout( HbPopup::NoTimeout ); + popup->addAction( + new HbAction(hbTrId("txt_common_button_cancel"), popup)); - HbWidget *buttonWidget = new HbWidget(popup); - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); - HbPushButton *addButton = new HbPushButton(hbTrId("txt_missing_list_save_as_a_new_contact"), buttonWidget); + HbWidget* buttonWidget = new HbWidget(popup); + QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); + + HbPushButton* addButton = new HbPushButton(buttonWidget); + addButton->setStretched(true); + addButton->setText(hbTrId("txt_phob_button_save_as_a_new_contact")); + HbIcon plusIcon("qtg_mono_plus"); + addButton->setIcon(plusIcon); + connect(addButton, SIGNAL(clicked()), popup, SLOT(close())); connect(addButton, SIGNAL(clicked()), this, SLOT(saveNew())); - HbPushButton *updateButton = new HbPushButton(hbTrId("txt_missing_list_update_existing_contact"), buttonWidget); + + HbPushButton* updateButton = new HbPushButton(buttonWidget); + updateButton->setStretched(true); + updateButton->setText(hbTrId("txt_phob_button_update_existing_contact")); + updateButton->setIcon(plusIcon); + connect(updateButton, SIGNAL(clicked()), popup, SLOT(close())); connect(updateButton, SIGNAL(clicked()), this, SLOT(updateExisting())); + layout->addItem(addButton); layout->addItem(updateButton); + buttonWidget->setLayout(layout); popup->setContentWidget(buttonWidget); + + popup->open(); - popup->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), popup)); CNT_EXIT } @@ -100,6 +106,8 @@ CNT_ENTRY CntViewParameters viewParameters; viewParameters.insert(EViewId, serviceEditView); + QContactName contactName = mContact.detail(); + mContact.removeDetail(&contactName); QVariant var; var.setValue(mContact); viewParameters.insert(ESelectedContact, var); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceeditview.cpp --- a/phonebookui/phonebookservices/src/cntserviceeditview.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceeditview.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -18,7 +18,7 @@ #include "cntserviceeditview.h" #include #include - +#include "cntdebug.h" CntServiceEditView::CntServiceEditView( CntAbstractServiceProvider& aServiceProvider ) : CntEditView(), @@ -35,25 +35,37 @@ void CntServiceEditView::doContactUpdated(int aSuccess) { + CNT_ENTRY_ARGS(aSuccess) + int retValue = aSuccess ? KCntServicesReturnValueContactSaved : KCntServicesReturnValueContactNotModified; QVariant variant; variant.setValue(retValue); mProvider.CompleteServiceAndCloseApp(variant); + + CNT_EXIT } void CntServiceEditView::doContactRemoved(bool aSuccess) { + CNT_ENTRY_ARGS(aSuccess) + int retValue = aSuccess ? KCntServicesReturnValueContactDeleted : KCntServicesReturnValueContactNotModified; QVariant variant; variant.setValue(retValue); mProvider.CompleteServiceAndCloseApp(variant); + + CNT_EXIT } void CntServiceEditView::doChangesDiscarded() { + CNT_ENTRY + QVariant variant; variant.setValue(KCntServicesReturnValueContactNotModified); mProvider.CompleteServiceAndCloseApp(variant); + + CNT_EXIT } // EOF diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceprovideredit.cpp --- a/phonebookui/phonebookservices/src/cntserviceprovideredit.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceprovideredit.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -46,16 +46,25 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editCreateNew( definitionName, value, *this ); CNT_EXIT } +void CntServiceProviderEdit::editCreateNew(const QString& definitionName, const QString& value, const QString &subType) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNew( definitionName, value, subType, *this ); + CNT_EXIT + } + void CntServiceProviderEdit::editCreateNewFromVCard(const QString &vCardFile) { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editCreateNewFromVCard( vCardFile, *this ); CNT_EXIT } @@ -64,7 +73,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editExisting( contactId, *this ); CNT_EXIT } @@ -73,11 +82,19 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editUpdateExisting( definitionName, value, *this ); CNT_EXIT } +void CntServiceProviderEdit::editUpdateExisting(const QString &definitionName, const QString &value, const QString &subType) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editUpdateExisting( definitionName, value, subType, *this ); + CNT_EXIT + } void CntServiceProviderEdit::CompleteServiceAndCloseApp(const QVariant& retValue) { diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp --- a/phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -46,7 +46,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.multiFetch( title, action, *this ); CNT_EXIT } @@ -55,7 +55,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.singleFetch( title, action, *this ); CNT_EXIT } @@ -63,9 +63,9 @@ void CntServiceProviderFetch::CompleteServiceAndCloseApp(const QVariant& retValue) { CNT_ENTRY - connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); if ( mCurrentRequestIndex != 0 ) { + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); const bool success = completeRequest(mCurrentRequestIndex, retValue); if ( !success ) { diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceproviderold.cpp --- a/phonebookui/phonebookservices/src/cntserviceproviderold.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceproviderold.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -49,7 +49,7 @@ CNT_ENTRY // Ignore the filter parameter mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.multiFetch( title, action, *this ); CNT_EXIT } @@ -64,7 +64,7 @@ // Ignore the filter parameter // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching. mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.singleFetch( title, action, *this ); CNT_EXIT } @@ -77,8 +77,8 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); - mServices.editCreateNew( definitionName, value, *this ); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false CNT_EXIT } @@ -86,7 +86,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editCreateNewFromVCard( vCardFile, *this ); CNT_EXIT } @@ -99,8 +99,8 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); - mServices.editUpdateExisting( definitionName, value, *this ); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false CNT_EXIT } @@ -112,7 +112,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchContactCard( contactId, *this ); CNT_EXIT } @@ -124,7 +124,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type value = actual field value for prefilling editor CNT_EXIT } @@ -136,6 +136,7 @@ connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); if ( mCurrentRequestIndex != 0 ) { + CNT_LOG_ARGS("next, completing request.") const bool success = completeRequest(mCurrentRequestIndex, retValue); if ( !success ) { diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceproviderold2.cpp --- a/phonebookui/phonebookservices/src/cntserviceproviderold2.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceproviderold2.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -49,7 +49,7 @@ CNT_ENTRY // Ignore the filter parameter mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.multiFetch( title, action, *this ); CNT_EXIT } @@ -64,7 +64,7 @@ // Ignore the filter parameter // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching. mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.singleFetch( title, action, *this ); CNT_EXIT } @@ -77,15 +77,15 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); - mServices.editCreateNew( definitionName, value, *this ); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false } void CntServiceProviderOld2::editCreateNew(const QString &vCardFile) { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.editCreateNewFromVCard( vCardFile, *this ); CNT_EXIT } @@ -98,8 +98,8 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); - mServices.editUpdateExisting( definitionName, value, *this ); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false CNT_EXIT } @@ -111,7 +111,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchContactCard( contactId, *this ); CNT_EXIT } @@ -123,7 +123,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type value = actual field value for prefilling editor CNT_EXIT } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp --- a/phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -46,7 +46,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchContactCard( aContactId, *this ); CNT_EXIT } @@ -55,7 +55,7 @@ { CNT_ENTRY mCurrentRequestIndex = setCurrentRequestAsync(); - mServices.setQuitable(requestInfo().isEmbedded()); + mServices.setQuittable(requestInfo().isEmbedded()); mServices.launchTemporaryContactCard( aFieldName, aFieldValue, *this ); CNT_EXIT } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntservices.cpp --- a/phonebookui/phonebookservices/src/cntservices.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntservices.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -19,8 +19,10 @@ #include "cntglobal.h" #include "cntdebug.h" #include +#include "cntserviceviewmanager.h" #include "cntimageutility.h" #include "cntserviceviewparams.h" +#include #include #include @@ -37,7 +39,7 @@ CntServices::CntServices() : mViewManager(NULL), mCurrentProvider(NULL), -mIsQuitable(true) +mIsQuittable(true) { CNT_ENTRY @@ -73,6 +75,8 @@ { CNT_LOG mViewManager = &aViewManager; + CntServiceViewManager* srvMng = static_cast(mViewManager); + connect(srvMng, SIGNAL(applicationClosed()), this, SLOT(terminateService())); } @@ -112,9 +116,16 @@ CNT_EXIT } +void CntServices::editCreateNew(const QString &definitionName, const QString &value, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) +{ + CNT_ENTRY + editCreateNew( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp); + CNT_EXIT +} -void CntServices::editCreateNew(const QString &definitionName, const QString &value, - CntAbstractServiceProvider& aServiceProvider) +void CntServices::editCreateNew(const QString &definitionName, const QString &value, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) { CNT_ENTRY mCurrentProvider = &aServiceProvider; @@ -122,25 +133,32 @@ QContact contact; if (definitionName == QContactPhoneNumber::DefinitionName) - { + { QContactPhoneNumber phoneNumber; phoneNumber.setNumber(value); - phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); - contact.saveDetail(&phoneNumber); + if (!subType.isEmpty()) + { + phoneNumber.setSubTypes(subType); } + else + { + phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); // Mobile is the default if subtype is not given. + } + contact.saveDetail(&phoneNumber); + } else if (definitionName == QContactEmailAddress::DefinitionName) - { + { QContactEmailAddress email; email.setEmailAddress(value); + // Email addresses can't have subtypes. contact.saveDetail(&email); - } + } else if (definitionName == QContactOnlineAccount::DefinitionName) - { + { QContactOnlineAccount account; - account.setAccountUri(value); - account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); + fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp); contact.saveDetail(&account); - } + } // Launch editor now CntViewParameters params; @@ -212,9 +230,16 @@ CNT_EXIT } +void CntServices::editUpdateExisting(const QString &definitionName, const QString &value, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) +{ + CNT_ENTRY + editUpdateExisting( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp ); + CNT_EXIT +} -void CntServices::editUpdateExisting(const QString &definitionName, const QString &value, - CntAbstractServiceProvider& aServiceProvider ) +void CntServices::editUpdateExisting(const QString &definitionName, const QString &value, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) { CNT_ENTRY mCurrentProvider = &aServiceProvider; @@ -225,20 +250,27 @@ { QContactPhoneNumber phoneNumber; phoneNumber.setNumber(value); - phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); + if (!subType.isEmpty()) + { + phoneNumber.setSubTypes(subType); + } + else + { + phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); + } detail = phoneNumber; } else if (definitionName == QContactEmailAddress::DefinitionName) { QContactEmailAddress email; email.setEmailAddress(value); + // Email addresses can't have subtypes. detail = email; } else if (definitionName == QContactOnlineAccount::DefinitionName) { QContactOnlineAccount account; - account.setAccountUri(value); - account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); + fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp); detail = account; } @@ -299,6 +331,10 @@ QContact contact; QContactDetail detail; + QContactName name; + name.setFirstName(hbTrId("txt_phob_list_unknown")); + contact.saveDetail(&name); + if (definitionName == QContactPhoneNumber::DefinitionName) { QContactPhoneNumber phoneNumber; @@ -337,6 +373,26 @@ } +void CntServices::setQuittable(bool quittable) +{ + mIsQuittable = quittable; +} + +void CntServices::quitApp() +{ + CNT_ENTRY + + // Only embedded applications should be exited once a client + // disconnects. At the moments QtHighWay has unresolved issues + // when closing non-embedded applications. Error ou1cimx1#472852 + // has more info + if ( mIsQuittable ) + { + qApp->quit(); + } + CNT_EXIT +} + void CntServices::removeNotSupportedDetails(QContact& contact) { CNT_ENTRY @@ -352,8 +408,6 @@ CNT_EXIT } - - void CntServices::removeNotSupportedFields(QContact& contact) { CNT_ENTRY @@ -415,6 +469,41 @@ CNT_EXIT } +void CntServices::fillOnlineAccount( QContactOnlineAccount& account, const QString& value, + const QString& subType, bool defaultForOnlineAccountIsImpp ) + { + // The value should normally consist of two parts: + // : + // for eg. "serviceprovider:jack@serviceprovider.com" + QStringList accountDetails = value.split(":"); + if (accountDetails.count() == 1) + { + // For some reason it only had one part, so we're assuming it's the user ID. + account.setAccountUri(accountDetails.at(0)); + } + else if (accountDetails.count() >= 2) + { + account.setServiceProvider(accountDetails.at(0)); + account.setAccountUri(accountDetails.at(1)); // the user ID + } + + if (!subType.isEmpty()) + { + account.setSubTypes(subType); + } + else + { + if (defaultForOnlineAccountIsImpp) + { + account.setSubTypes( QContactOnlineAccount::SubTypeImpp ); + } + else + { + account.setSubTypes( QContactOnlineAccount::SubTypeSipVoip ); + } + } + } + // This method is inherited from CntAbstractServiceProvider void CntServices::CompleteServiceAndCloseApp(const QVariant& retValue) { @@ -426,26 +515,18 @@ CNT_EXIT } -void CntServices::setQuitable(bool quitable) -{ - mIsQuitable = quitable; -} - -void CntServices::quitApp() +void CntServices::terminateService() { CNT_ENTRY - - // Only embedded applications should be exited once a client - // disconnects. At the moments QtHighWay has unresolved issues - // when closing non-embedded applications. Error ou1cimx1#472852 - // has more info - if ( mIsQuitable ) - { - qApp->quit(); - } - + if ( mCurrentProvider ) + { + // Complete the service with KCntServicesTerminated return value + QVariant var(KCntServicesTerminated); + mCurrentProvider->CompleteServiceAndCloseApp( var ); + } CNT_EXIT } Q_IMPLEMENT_USER_METATYPE(CntServicesContact) Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) + diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/cntserviceviewmanager.cpp --- a/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -39,8 +39,9 @@ void CntServiceViewManager::closeApp() { - // quit happens when returnValueDelivered signal is returned - // from service handler, see constructor. + // Quit happens when returnValueDelivered signal from XQServiceProver + // is caught from service handler. + emit applicationClosed(); } // end of file diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/src/main.cpp --- a/phonebookui/phonebookservices/src/main.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/src/main.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -16,9 +16,9 @@ */ #include +#include #include #include -#include "cntmainwindow.h" #include "cntserviceproviderold.h" #include "cntserviceproviderold2.h" #include "cntserviceproviderfetch.h" @@ -28,10 +28,13 @@ #include "cntservices.h" #include "cntserviceviewmanager.h" #include "cntviewnavigator.h" +#include "cntdebug.h" #include int main(int argc, char **argv) { + qInstallMsgHandler(MSG_HANDLER); + HbApplication a( argc, argv ); QTranslator translator; @@ -40,10 +43,12 @@ translator.load(path + "contacts_" + lang); a.installTranslator(&translator); - CntMainWindow mainWindow(NULL, noView); // no parent & "noView" as default view + HbMainWindow mainWindow; CntViewNavigator* navigator = new CntViewNavigator( &mainWindow ); navigator->addException( serviceEditView, noView ); + navigator->addEffect( serviceContactCardView, historyView ); + navigator->addEffect( historyView, serviceContactCardView ); // This object actually executes the services CntServices* services = new CntServices(); diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp --- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Fri Jul 23 12:43:48 2010 +0300 @@ -28,16 +28,17 @@ #include #include #include +#include #include "cntdebug.h" -testPbkServices::testPbkServices(HbMainWindow *aParent) +testPbkServices::testPbkServices(HbMainWindow *aParent) : +mRequest(NULL), +mMainWindow(aParent), +mPopup(NULL) { - mRequest=NULL; - mMainWindow=aParent; setParent(aParent); - } testPbkServices::~testPbkServices() @@ -484,26 +485,26 @@ listWidget->addItem( contactId ); } - HbDialog *popup = new HbDialog(); - popup->setAttribute(Qt::WA_DeleteOnClose, true); + mPopup = new HbDialog(); + mPopup->setAttribute(Qt::WA_DeleteOnClose, true); // Set dismiss policy that determines what tap events will cause the popup // to be dismissed - popup->setDismissPolicy(HbDialog::NoDismiss); + mPopup->setDismissPolicy(HbDialog::NoDismiss); + mPopup->setModal(true); // Set the label as heading widget - popup->setHeadingWidget(new HbLabel(tr("Contact"))); + mPopup->setHeadingWidget(new HbLabel(tr("Contact"))); // Set a list widget as content widget in the popup - popup->setContentWidget(listWidget); - - // Sets the primary action and secondary action - //popup.setPrimaryAction(new HbAction(tr("Ok"),&popup)); - //popup.setSecondaryAction(new HbAction(tr("Cancel"),&popup)); + mPopup->setContentWidget(listWidget); + + // Add an OK action to dismiss the popup + HbAction *okAction = new HbAction(tr("Ok"), mPopup); + mPopup->addAction(okAction); // Launch popup asyncronously - popup->setTimeout(15000); - popup->open(); + mPopup->open(); } CNT_EXIT } diff -r 81c360d47083 -r e6aff7b69165 phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h --- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Wed Jul 21 11:37:51 2010 +0300 +++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Fri Jul 23 12:43:48 2010 +0300 @@ -25,6 +25,8 @@ #include class HbMainWindow; +class HbAction; +class HbDialog; /** * Launches phonebookservices highway services, for functional testing. @@ -100,6 +102,7 @@ XQAiwRequest *mRequest; HbMainWindow *mMainWindow; + HbDialog *mPopup; };