# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282113540 -10800 # Node ID a642906a277a69d7f35a73715d1e5e5e736befeb # Parent 7cbcb2896f0e3e7d2c63938f5a337b5ce5539413 Revision: 201031 Kit: 201033 diff -r 7cbcb2896f0e -r a642906a277a 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 Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts services API + Qt Highway services offered by Contacts package. + c++ + phonebookui + + + + no + no + + diff -r 7cbcb2896f0e -r a642906a277a contacts_plat/contacts_services_api/inc/cntservicescontact.h --- a/contacts_plat/contacts_services_api/inc/cntservicescontact.h Tue Jul 06 14:05:47 2010 +0300 +++ b/contacts_plat/contacts_services_api/inc/cntservicescontact.h Wed Aug 18 09:39:00 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: Data container & constants for "phonebookservices" Qt Highway services. * */ @@ -22,21 +22,27 @@ #include #include -/*Supported actions*/ +//Action filter definitions: + +/// Action filter that DOES NOT filter away based on supported action. const QString KCntActionAll("all"); +/// Action filter for showing only contacts that support calling. const QString KCntActionCall("call"); +/// Action filter for showing only contacts that suppport SMS sending. const QString KCntActionSms("sms"); +// Action filter for showing only contacts that support emailing. const QString KCntActionEmail("email"); -/*Supported filters*/ -const QString KCntFilterDisplayAll("all"); -const QString KCntFilterDisplayFavorites("favorites"); -/*Supported Fetch Selection Modes*/ -const QString KCntNoSelectionMode("No Selection"); -const QString KCntSingleSelectionMode("SingleSelect"); -const QString KCntMultiSelectionMode("MultiSelect"); +/// Return values from editing service +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. + */ class CntServicesContact { public: @@ -70,6 +76,23 @@ typedef QList CntServicesContactList; +//------------------------------------------------------------------- +// These are DEPRECATED and will be removed soon: + +/// @deprecated +const QString KCntFilterDisplayAll("all"); +/// @deprecated +const QString KCntFilterDisplayFavorites("favorites"); + +/// @deprecated +const QString KCntNoSelectionMode("No Selection"); +/// @deprecated +const QString KCntSingleSelectionMode("SingleSelect"); +/// @deprecated +const QString KCntMultiSelectionMode("MultiSelect"); + +//------------------------------------------------------------------- + Q_DECLARE_USER_METATYPE(CntServicesContact) Q_DECLARE_USER_METATYPE_NO_OPERATORS(CntServicesContactList) diff -r 7cbcb2896f0e -r a642906a277a 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 Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts UI API + Contacts UI related APIs. + c++ + phonebookui + + + + no + no + + diff -r 7cbcb2896f0e -r a642906a277a contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h --- a/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h Tue Jul 06 14:05:47 2010 +0300 +++ b/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a contacts_plat/contacts_ui_api/inc/cntviewparams.h --- a/contacts_plat/contacts_ui_api/inc/cntviewparams.h Tue Jul 06 14:05:47 2010 +0300 +++ b/contacts_plat/contacts_ui_api/inc/cntviewparams.h Wed Aug 18 09:39:00 2010 +0300 @@ -38,6 +38,7 @@ ESelectedDetail, ESelectionMode, EMyCard, + EExtraAction, ECustomParam = 100 }; @@ -45,7 +46,7 @@ { noView=0, //exit namesView, - commLauncherView, + contactCardView, serviceContactCardView, serviceAssignContactCardView, myCardView, @@ -53,7 +54,7 @@ serviceContactSelectionView, collectionView, collectionFavoritesView, - FavoritesMemberView, + favoritesMemberView, editView, serviceEditView, serviceSubEditView, @@ -76,6 +77,7 @@ importsView, settingsView, ringToneFetcherView, + serviceGroupMemberView, customPhonebookView = 100, // reserved for internal view plugins, DO NOT USE THESE customView = 200 // for all other view plugins }; diff -r 7cbcb2896f0e -r a642906a277a 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 Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,13 @@ + + + Contacts UI extensions API + Plugin APIs for extending phonebook application. + c++ + phonebookui + + + + no + no + + diff -r 7cbcb2896f0e -r a642906a277a contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h --- a/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h Tue Jul 06 14:05:47 2010 +0300 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h Wed Aug 18 09:39:00 2010 +0300 @@ -24,9 +24,18 @@ /** * UI extension class that supplies groups to phonebook groups UI. */ -class CntUiGroupSupplier +class CntUiGroupSupplier : public QObject { - public: +public: + CntUiGroupSupplier() {} + + /** + * Returns true if this supplier should be handled asynchronously and + * false otherwise. + * + * @return bool, asynchronity + */ + virtual bool isAsynch() const = 0; /** * Returns number of groups provided by the extension. @@ -49,6 +58,14 @@ { return NULL; } + +signals: + /** + * Asynchronous suppliers should re-implement this signal and emit it + * once group loading is ready. + */ + void groupsReady(); + protected: // prevent deleting by client virtual ~CntUiGroupSupplier() {} diff -r 7cbcb2896f0e -r a642906a277a contacts_plat/qt_mobility_contacts_api/qt_mobility_contacts_api.metaxml --- a/contacts_plat/qt_mobility_contacts_api/qt_mobility_contacts_api.metaxml Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - Qt Mobility Contacts API - Qt Mobility Contacts API for managing contacts data. - c++ - phonebookengines - - - - - - no - no - - diff -r 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp --- a/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -113,7 +113,11 @@ CommLauncherWidget::~CommLauncherWidget() { // Deleting request cancels all pending requests - delete mRequest; + if (mRequest) { + delete mRequest; + mRequest = NULL; + } + } /*! @@ -518,17 +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 if (event->key() == Qt::Key_No || event->key() == Qt::Key_Select) { - // End key and Select key close the communication launcher and - // forward the key event to HbPopup - close(); - HbPopup::keyPressEvent(event); } else { - HbPopup::keyPressEvent(event); + close(); + //HbPopup::keyPressEvent(event); } } @@ -549,3 +550,4 @@ return width; } + diff -r 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp --- a/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -41,6 +41,9 @@ #include "commlauncherwidget.h" #include "ihswidgetpreferenceservice.h" +const QString translationsPath = "/resource/qt/translations/"; +const QString translationsFile = "contactwidgethsplugin"; + const QString defaultAvatar = "qtg_large_avatar"; const QString addContactAvatar = "qtg_small_add"; const QString normalFrameName = "qtg_fr_hsshortcut_normal"; @@ -79,7 +82,7 @@ mTranslator(0) { // Localization file loading - mTranslator = new HbTranslator(); + mTranslator = new HbTranslator(translationsPath, translationsFile); mTranslator->loadCommon(); // UI creation done in onInitialize() @@ -132,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; + } } /*! @@ -237,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(); @@ -411,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) { @@ -444,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() @@ -579,7 +628,11 @@ */ void ContactWidgetHs::onHide() { - qDebug() << "ContactWidgetHs::onHide()"; + qDebug() << "ContactWidgetHs::onHide()"; + // close the launcher if it's open + if (mLauncher->isVisible()) { + mLauncher->close(); + } } @@ -744,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 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/contactwidgethsplugin.pro --- a/contactwidgethsplugin/contactwidgethsplugin.pro Tue Jul 06 14:05:47 2010 +0300 +++ b/contactwidgethsplugin/contactwidgethsplugin.pro Wed Aug 18 09:39:00 2010 +0300 @@ -18,8 +18,7 @@ CONFIG += plugin hb mobility MOBILITY = serviceframework contacts -TRANSLATIONS = common.ts -TRANSLATIONS += contactwidgethsplugin.ts +TRANSLATIONS = contactwidgethsplugin.ts win32: PLUGIN_SUBDIR = /hsresources/import/widgetregistry/2002C353 symbian: PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002C353 @@ -57,11 +56,10 @@ BLD_INF_RULES.prj_exports += "./resource/contactwidgethsplugin.manifest z:$$PLUGIN_SUBDIR/contactwidgethsplugin.manifest" # xml files for emulator, sisx and hw rom BLD_INF_RULES.prj_exports += "./resource/contactwidgethsplugin.xml z:$$PLUGIN_SUBDIR/contactwidgethsplugin.xml" - # copy resources graphics png, svg - BLD_INF_RULES.prj_exports += "./resource/qtg_large_friend.svg z:$$PLUGIN_SUBDIR/qtg_large_friend.svg" # copy iby file - BLD_INF_RULES.prj_exports += "./rom/contactwidgeths.iby CORE_APP_LAYER_IBY_EXPORT_PATH( contactwidgeths.iby )" + BLD_INF_RULES.prj_exports += "./rom/contactwidgeths.iby CORE_APP_LAYER_IBY_EXPORT_PATH(contactwidgeths.iby)" + BLD_INF_RULES.prj_exports += "./rom/contactwidgeths_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(contactwidgeths_resources.iby)" } symbian { diff -r 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/resource/contactwidgethsplugin.manifest --- a/contactwidgethsplugin/resource/contactwidgethsplugin.manifest Tue Jul 06 14:05:47 2010 +0300 +++ b/contactwidgethsplugin/resource/contactwidgethsplugin.manifest Wed Aug 18 09:39:00 2010 +0300 @@ -1,9 +1,10 @@ contactwidgethsplugin - Contact - Contact widget. + txt_long_caption_friend + txt_friend_widget_dblist_friend_widget_val_quickly qtg_large_friend false contactwidgethsplugin.xml + contactwidgethsplugin diff -r 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/rom/contactwidgeths.iby --- a/contactwidgethsplugin/rom/contactwidgeths.iby Tue Jul 06 14:05:47 2010 +0300 +++ b/contactwidgethsplugin/rom/contactwidgeths.iby Wed Aug 18 09:39:00 2010 +0300 @@ -17,6 +17,8 @@ #ifndef __CONTACTWIDGETHSPLUGIN_IBY__ #define __CONTACTWIDGETHSPLUGIN_IBY__ +#include + // -------- contactwidgethsplugin file=ABI_DIR\BUILD_DIR\contactwidgethsplugin.dll SHARED_LIB_DIR\contactwidgethsplugin.dll data=ZPRIVATE\20022f35\import\widgetregistry\2002C353\contactwidgethsplugin.qtplugin private\20022f35\import\widgetregistry\2002C353\contactwidgethsplugin.qtplugin @@ -25,4 +27,6 @@ data=ZPRIVATE\20022f35\import\widgetregistry\2002C353\qtg_large_friend.svg private\20022f35\import\widgetregistry\2002C353\qtg_large_friend.svg +data=DATAZ_\APP_RESOURCE_DIR\contactwidgethsplugin.rsc APP_RESOURCE_DIR\contactwidgethsplugin.rsc + #endif //__CONTACTWIDGETHSPLUGIN_IBY__ diff -r 7cbcb2896f0e -r a642906a277a contactwidgethsplugin/rom/contactwidgeths_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contactwidgethsplugin/rom/contactwidgeths_resources.iby Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__ +#define __CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__ + +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\contactwidgethsplugin.qm QT_TRANSLATIONS_DIR\contactwidgethsplugin.qm + +#endif //__CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__ diff -r 7cbcb2896f0e -r a642906a277a inc/cntdebug.h --- a/inc/cntdebug.h Tue Jul 06 14:05:47 2010 +0300 +++ b/inc/cntdebug.h Wed Aug 18 09:39:00 2010 +0300 @@ -23,6 +23,8 @@ #include // qDebug() // #define TRACK_MEMORY_LEAKS +// #define TRACES +// #define TRACE2FILE /*! \def CNT_UNUSED(name) @@ -349,8 +351,13 @@ by the streaming operator <<. */ +// traces for debug builds by default, or if +// TRACES macro is defined +#if defined (_DEBUG) && !defined (TRACES) +#define TRACES +#endif -#ifdef _DEBUG +#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; @@ -360,6 +367,9 @@ #define CNT_EXIT_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "exit," << args; #define CNT_LOG qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this; #define CNT_LOG_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << args; + #define CNT_WARNING(args) qWarning() << __PRETTY_FUNCTION__ << args; + #define CNT_CRITICAL(args) qCritical() << __PRETTY_FUNCTION__ << args; + #define CNT_FATAL(args) qFatal() << __PRETTY_FUNCTION__ << args; #else #define CNT_UNUSED(name) Q_UNUSED(name) #define CNT_STATIC_ENTRY @@ -370,8 +380,11 @@ #define CNT_EXIT_ARGS(args) #define CNT_LOG #define CNT_LOG_ARGS(args) -#endif // _DEBUG - + #define CNT_WARNING(args) + #define CNT_CRITICAL(args) + #define CNT_FATAL(args) +#endif // TRACES || TRACE2FILE + // for tracing memory leaks #ifdef TRACK_MEMORY_LEAKS #include @@ -406,4 +419,68 @@ #define CNT_TRACK_QOBJECTLIVES(obj) #endif +// filter phonebook app traces +#ifdef TRACE2FILE + #include + #include + static void cntCustomLog2File(QtMsgType type, const char *msg) + { + QFile logFile("c:/cnt_logs.log"); + if (!logFile.open(QIODevice::Append | QIODevice::Text)) + { + qFatal("error opening c:/cnt_logs.log file"); + return; + } + + QTextStream out(&logFile); + switch (type) + { + case QtDebugMsg: + out << "[CNT] Debug: " << msg; + break; + case QtWarningMsg: + out << "[CNT] Warning: " << msg; + break; + case QtCriticalMsg: + out << "[CNT] Critical: " << msg; + break; + case QtFatalMsg: + out << "[CNT] Fatal: " << msg; + abort(); + break; + default: + out << "[CNT] No Log Selection Type: " << msg; + break; + } + } + #define MSG_HANDLER cntCustomLog2File +#else + #ifdef Q_OS_SYMBIAN + #include + static void cntCustomLog(QtMsgType type, const char *msg) + { + switch (type) { + case QtDebugMsg: + RDebug::Printf("[CNT] Debug: %s\n", msg); + break; + case QtWarningMsg: + RDebug::Printf("[CNT] Warning: %s\n", msg); + break; + case QtCriticalMsg: + RDebug::Printf("[CNT] Critical: %s\n", msg); + break; + case QtFatalMsg: + RDebug::Printf("[CNT] Fatal: %s\n", msg); + abort(); + break; + default: + break; + } + } + #define MSG_HANDLER cntCustomLog + #else + #define MSG_HANDLER 0 + #endif // Q_OS_SYMBIAN +#endif // TRACE2FILE + #endif // CNTDEBUG_H diff -r 7cbcb2896f0e -r a642906a277a inc/cntglobal.h --- a/inc/cntglobal.h Tue Jul 06 14:05:47 2010 +0300 +++ b/inc/cntglobal.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp --- a/phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp Wed Aug 18 09:39:00 2010 +0300 @@ -33,8 +33,6 @@ USERINCLUDE ../group APP_LAYER_SYSTEMINCLUDE -// Symbian uses #include in cntviewfindconfig.h -SYSTEMINCLUDE /epoc32/include/ecom START RESOURCE 101f85f4.rss TARGET cntfindplugin diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp --- a/phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp Wed Aug 18 09:39:00 2010 +0300 @@ -34,8 +34,6 @@ USERINCLUDE ../group APP_LAYER_SYSTEMINCLUDE -// Symbian uses #include in cntviewsortplugin.h -SYSTEMINCLUDE /epoc32/include/ecom START RESOURCE 101f85a9.rss TARGET cntsortplugin diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntactions/inc/cntaction.h --- a/phonebookengines/cntactions/inc/cntaction.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntactions/inc/cntaction.h Wed Aug 18 09:39:00 2010 +0300 @@ -79,6 +79,7 @@ QVariantMap m_result; //result returned to client QContact m_contact; //contact passed to invokeAction QContactDetail m_detail; //detail passed to invokeAction + QVariantMap m_data; //data passed to invokeAction QContactAction::State m_state; XQAiwRequest* m_request; XQApplicationManager m_AppManager; diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntactions/inc/cntemailaction.h --- a/phonebookengines/cntactions/inc/cntemailaction.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntactions/inc/cntemailaction.h Wed Aug 18 09:39:00 2010 +0300 @@ -35,8 +35,6 @@ QList supportedDetails(const QContact& contact) const; CntEmailAction* clone() const; void performAction(); -private: - XQAiwRequest *mRequest; }; #endif diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntactions/src/cntaction.cpp --- a/phonebookengines/cntactions/src/cntaction.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntactions/src/cntaction.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -116,10 +116,11 @@ } -bool CntAction::invokeAction(const QContact& contact, const QContactDetail& detail, const QVariantMap& /*parameters*/) +bool CntAction::invokeAction(const QContact& contact, const QContactDetail& detail, const QVariantMap& data) { m_contact = contact; m_detail = detail; + m_data = data; QTimer::singleShot(1, this, SLOT(performAction())); m_state = QContactAction::ActiveState; @@ -159,77 +160,60 @@ //common code to perform a call, videocall and message action void CntAction::performNumberAction(const QString &interface, const QString &operation) { - XQApplicationManager appMng; QVariantList args; QVariant retValue; // TODO: Using XQApplicationManager is not working with calls // The factory method cannot create a request. Find out why - bool isCallAction = m_actionName == "call"; + //bool isCallAction = (m_actionName == "call" || m_actionName == "videocall"); XQServiceRequest snd(interface, operation, false); - delete m_request; - m_request = NULL; - m_request = appMng.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(); + args << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel(); + + // TODO remove once call action works + snd << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel(); + snd.send(retValue); + emitResult(snd.latestError(), retValue); } - + //QContactType == TypeContact //detail exist use it - if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) - { + else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) { const QContactPhoneNumber &phoneNumber = static_cast(m_detail); 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(); - emitResult(snd.send(retValue), retValue); - } else { - m_request->setArguments(args); - m_request->setSynchronous(true); - emitResult(m_request->send(retValue), retValue); - } + snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); + snd.send(retValue); + emitResult(snd.latestError(), retValue); } - - //if no detail, pick preferred - else if(m_detail.isEmpty()) + //QContactType == TypeContact + //if no detail, pick preferred + else if (m_detail.isEmpty()) { QContactDetail detail = m_contact.preferredDetail(m_actionName); QContactPhoneNumber phoneNumber; //if preferred is empty pick first phonenumber - if(detail.isEmpty()) - { + if (detail.isEmpty()) { phoneNumber = m_contact.detail(); } //if not empty, cast detail to phonenumber - else - { + else { phoneNumber = static_cast(detail); } 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(); - emitResult(snd.send(retValue), retValue); - } else { - m_request->setArguments(args); - m_request->setSynchronous(true); - emitResult(m_request->send(retValue), retValue); - } + snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); + snd.send(retValue); + emitResult(snd.latestError(), retValue); } - //else return an error - else - { + else { emitResult(GeneralError, retValue); } } @@ -244,11 +228,11 @@ m_result.insert("XQAiwRequest Error", m_request->lastError()); } - if (errorCode == 0){ + if (errorCode == 0) { m_state = QContactAction::FinishedState; } - else{ + else { m_state = QContactAction::FinishedWithErrorState; } diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntactions/src/cntemailaction.cpp --- a/phonebookengines/cntactions/src/cntemailaction.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntactions/src/cntemailaction.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -29,12 +29,10 @@ CntEmailAction::CntEmailAction() : CntAction("email") { - mRequest = m_AppManager.create(XQI_EMAIL_MESSAGE_SEND, "send(QVariant)", true); } CntEmailAction::~CntEmailAction() { - delete mRequest; } QContactFilter CntEmailAction::contactFilter(const QVariant& value) const @@ -65,61 +63,58 @@ void CntEmailAction::performAction() { QVariant retValue; - - if (mRequest) - { + delete m_request; + m_request = NULL; + m_request = m_AppManager.create(XQI_EMAIL_MESSAGE_SEND, "send(QVariant)", true); + + if (m_request) { QMap map; QStringList recipients; QList data; + //QContactType == TypeGroup + if (QContactType::TypeGroup == m_contact.type()) { + QStringList emails; + QVariant value = m_data.value("email"); + if (value.canConvert()) { + emails = value.toStringList(); + } + + if (!emails.isEmpty()) { + for (int i=0;isetArguments(data); + m_request->send(retValue); + emitResult(m_request->lastError(), retValue); + } + else { + emitResult(GeneralError, retValue); + } + } + //QContactType == TypeContact // If detail exists use it. - if (m_detail.definitionName() == QContactEmailAddress::DefinitionName) - { + else if (m_detail.definitionName() == QContactEmailAddress::DefinitionName) { const QContactEmailAddress &email = static_cast(m_detail); recipients.append(email.emailAddress()); map.insert(EMAIL_SEND_TO_KEY, recipients); data.append(map); - mRequest->setArguments(data); - mRequest->send(retValue); - emitResult(mRequest->lastError(), retValue); + m_request->setArguments(data); + 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); - - mRequest->setArguments(data); - mRequest->send(retValue); - emitResult(mRequest->lastError(), retValue); - } - else - { + else { emitResult(GeneralError, retValue); } } // Service not found. - else - { + else { emitResult(GeneralError, retValue); } } diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntactions/src/cntmessageaction.cpp --- a/phonebookengines/cntactions/src/cntmessageaction.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntactions/src/cntmessageaction.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookengines/cntlistmodel/src/cntcache.cpp --- a/phonebookengines/cntlistmodel/src/cntcache.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntlistmodel/src/cntcache.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -439,9 +439,9 @@ bool foundContact = false; QContactFetchHint nameOnlyFetchHint; - QStringList details; + /*QStringList details; details << QContactDisplayLabel::DefinitionName; - nameOnlyFetchHint.setDetailDefinitionsHint(details); + nameOnlyFetchHint.setDetailDefinitionsHint(details);*/ nameOnlyFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships); QContact contact = mContactManager->contact(contactId, nameOnlyFetchHint); @@ -648,7 +648,7 @@ { CNT_ENTRY - delete this; + deleteLater(); CNT_EXIT } diff -r 7cbcb2896f0e -r a642906a277a phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro --- a/phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro Wed Aug 18 09:39:00 2010 +0300 @@ -40,7 +40,6 @@ :BLD_INF_RULES.prj_exports += "data/preferredaddressmap.png /epoc32/winscw/c/maptiletest/preferredaddressmap.png" :BLD_INF_RULES.prj_exports += "data/workaddressmap.png /epoc32/winscw/c/maptiletest/workaddressmap.png" :BLD_INF_RULES.prj_exports += "data/homeaddressmap.png /epoc32/winscw/c/maptiletest/homeaddressmap.png" - SYSTEMINCLUDEPATH += \epoc32\include\stdapis } SOURCES += src/testrunner.cpp diff -r 7cbcb2896f0e -r a642906a277a phonebookengines_old/contactsmodel/groupsql/cntmodel.iby --- a/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookengines_old/contactsmodel/tsrc/Integration/TestStartUp/data/StartUpData.ini --- a/phonebookengines_old/contactsmodel/tsrc/Integration/TestStartUp/data/StartUpData.ini Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -[initial_view_settings_in_centralrep_ROM] -ApiAction = GetDefaultViewSettings -ContactsDbAction = CheckExistingViewDefsInCntsServer -NumberofViews = 1 -ViewName1 = KMainContactsAppView -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = - - - -[set_initial_view_settings_in_centralrep] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 1 -ViewName1 = KMainContactsAppView -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = - - - -[set_4_default_view_settings_in_centralrep] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 4 -ViewName1 = KMainContactsAppView1 -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = -ViewName2 = KMainContactsAppView2 -FirstViewSortOrder2 = 268440445 -SecondViewSortOrder2 = 268440444 -ThirdViewSortOrder2 = 268440333 -ViewPreferance2 = 0 -ViewType2 = 1 -SortPluginName2 = -ViewName3 = KMainContactsAppView3 -FirstViewSortOrder3 = 268440445 -SecondViewSortOrder3 = 268440444 -ThirdViewSortOrder3 = 268440333 -ViewPreferance3 = 0 -ViewType3 = 1 -SortPluginName3 = -ViewName4 = KMainContactsAppView4 -FirstViewSortOrder4 = 268440445 -SecondViewSortOrder4 = 268440444 -ThirdViewSortOrder4 = 268440333 -ViewPreferance4 = 0 -ViewType4 = 1 -SortPluginName4 = - - - -[set_invalid_view_type] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 1 -ViewName1 = invalid_view_type -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 99 -SortPluginName1 = - - - -[check_invalid_view_type] -ApiAction = GetDefaultViewSettings -ContactsDbAction = CheckExistingViewDefsInCntsServer -NumberofViews = 1 -ViewName1 = invalid_view_type -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 99 -SortPluginName1 = - - - -[set_invalid_preferance] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 1 -ViewName1 = invalid_pref -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 99 -ViewType1 = 1 -SortPluginName1 = - - - -[check_invalid_preferance] -ApiAction = GetDefaultViewSettings -ContactsDbAction = CheckExistingViewDefsInCntsServer -NumberofViews = 1 -ViewName1 = invalid_pref -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 99 -ViewType1 = 1 -SortPluginName1 = - - - -[store_invalid_sort_orders] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 1 -ViewName1 = invalid_sort_orders -FirstViewSortOrder1 = 0 -SecondViewSortOrder1 = 0 -ThirdViewSortOrder1 = 0 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = - - - -[store_invalid_plugin_name] -ApiAction = SetNewDefaultViewSettings -NumberofViews = 1 -ViewName1 = invalid_plugin_name -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = xyz - - - -[invalid_rom_setting] -ApiAction = GetDefaultViewSettings -NumberofViews = 1 -ViewName1 = KMainContactsAppView -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = abc - - - -[Append_View_Setting_To_View_Setting_List] -ApiAction = AppendNewViewSetting - - - -[delete_named_view_setting] -ApiAction = DeleteViewSettings -ViewName = TempViewName - - - -[delete_default_view] -ApiAction = DeleteViewSettings -ViewName = KMainContactsAppView - - -[launch_cnts_server] -StartupAction = LaunchProcess -StartupExeName = CNTSRV.EXE -Mode = -nontransient - - -[terminate_cnts_server] -StartupAction = TerminateProcess - - - -[check_cnts_server_is_ok] -StartupAction = CheckProcess -StartUpExitType = 3 //EExitPending -StartUpExitReason = 0 - - - -[check_cnts_server_has_terminated_ok] -StartupAction = CheckProcess -StartUpExitType = 1 //EExitTerminate -StartUpExitReason = 0 - - - -[create_default_cnts_db] -ContactsDbAction = CreateDefCntsDb - - - -[add_20_contacts_to_default_db] -ContactsDbAction = AddItemstoCntsDb -NumberOfContacts = 20 - - - -[delete_default_cnts_db] -ContactsDbAction = DeleteDefCntsDb - - - -[open_default_cnts_db] -ContactsDbAction = OpenDefCntsDb - - - -[replace_default_cnts_db] -ContactsDbAction = ReplaceDefCntsDb - - -[check_4_default_view_settings_in_centralrep] -ContactsDbAction = CheckExistingViewDefsInCntsServer -ApiAction = GetDefaultViewSettings -NumberofViews = 4 -ViewName1 = KMainContactsAppView1 -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = -ViewName2 = KMainContactsAppView2 -FirstViewSortOrder2 = 268440445 -SecondViewSortOrder2 = 268440444 -ThirdViewSortOrder2 = 268440333 -ViewPreferance2 = 0 -ViewType2 = 1 -SortPluginName2 = -ViewName3 = KMainContactsAppView3 -FirstViewSortOrder3 = 268440445 -SecondViewSortOrder3 = 268440444 -ThirdViewSortOrder3 = 268440333 -ViewPreferance3 = 0 -ViewType3 = 1 -SortPluginName3 = -ViewName4 = KMainContactsAppView4 -FirstViewSortOrder4 = 268440445 -SecondViewSortOrder4 = 268440444 -ThirdViewSortOrder4 = 268440333 -ViewPreferance4 = 0 -ViewType4 = 1 -SortPluginName4 = - - - -[check_invalid_sort_orders] -ApiAction = GetDefaultViewSettings -ContactsDbAction = CheckExistingViewDefsInCntsServer -NumberofViews = 1 -ViewName1 = invalid_sort_orders -FirstViewSortOrder1 = 0 -SecondViewSortOrder1 = 0 -ThirdViewSortOrder1 = 0 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = - - - -[check_invalid_plugin_name] -ApiAction = GetDefaultViewSettings -NumberofViews = 1 -ViewName1 = invalid_plugin_name -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = xyz - - - -[check_appended_view_Setting] -ContactsDbAction = CheckExistingViewDefsInCntsServer -ApiAction = GetDefaultViewSettings -NumberofViews = 2 -ViewName1 = KMainContactsAppView -FirstViewSortOrder1 = 268440445 -SecondViewSortOrder1 = 268440444 -ThirdViewSortOrder1 = 268440333 -ViewPreferance1 = 0 -ViewType1 = 1 -SortPluginName1 = -ViewName2 = TempViewName -FirstViewSortOrder2 = 268440445 -SecondViewSortOrder2 = 268440445 -ThirdViewSortOrder2 = 268440445 -ViewPreferance2 = 0 -ViewType2 = 1 -SortPluginName2 = - - - -[OOM_Test_GetDefaultView] -ApiAction = OutOfMemoryTestsForGetAPI - - - -[OOM_Test_SetDefaultView] -ApiAction = OutOfMemoryTestsForSetAPI -NumberofViews = 4 - - - -[check_empty_view_defs] -ContactsDbAction = CheckExistingViewDefsInCntsServer -NumberofViews = 0 diff -r 7cbcb2896f0e -r a642906a277a phonebookui/bwins/pbkcommonuiu.def --- a/phonebookui/bwins/pbkcommonuiu.def Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/bwins/pbkcommonuiu.def Wed Aug 18 09:39:00 2010 +0300 @@ -2,139 +2,172 @@ ?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *) ?setViewNavigator@CntDefaultViewManager@@QAEXPAVCntViewNavigator@@@Z @ 2 NONAME ; void CntDefaultViewManager::setViewNavigator(class CntViewNavigator *) ?tr@CntActionPopup@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString CntActionPopup::tr(char const *, char const *) - ?cleanup@CntDefaultViewManager@@AAEXXZ @ 4 NONAME ; void CntDefaultViewManager::cleanup(void) - ??0CntDefaultViewFactory@@QAE@XZ @ 5 NONAME ; CntDefaultViewFactory::CntDefaultViewFactory(void) - ??1CntMainWindow@@UAE@XZ @ 6 NONAME ; CntMainWindow::~CntMainWindow(void) - ?viewActivated@CntContactCardView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 7 NONAME ; void CntContactCardView::viewActivated(class CntAbstractViewManager *, class QMap) - ?view@CntEditView@@UBEPAVHbView@@XZ @ 8 NONAME ; class HbView * CntEditView::view(void) const - ?qt_metacall@CntBaseSelectionView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int CntBaseSelectionView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?closeView@CntBaseSelectionView@@AAEXXZ @ 10 NONAME ; void CntBaseSelectionView::closeView(void) + ?currentViewId@CntDefaultViewManager@@QAEHXZ @ 4 NONAME ; int CntDefaultViewManager::currentViewId(void) + ?cleanup@CntDefaultViewManager@@AAEXXZ @ 5 NONAME ; void CntDefaultViewManager::cleanup(void) + ??0CntDefaultViewFactory@@QAE@XZ @ 6 NONAME ; CntDefaultViewFactory::CntDefaultViewFactory(void) + ??1CntMainWindow@@UAE@XZ @ 7 NONAME ; CntMainWindow::~CntMainWindow(void) + ?viewActivated@CntContactCardView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 8 NONAME ; void CntContactCardView::viewActivated(class CntAbstractViewManager *, class QMap) + ?view@CntEditView@@UBEPAVHbView@@XZ @ 9 NONAME ; class HbView * CntEditView::view(void) const + ?qt_metacall@CntBaseSelectionView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int CntBaseSelectionView::qt_metacall(enum QMetaObject::Call, int, void * *) ?tr@CntMainWindow@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString CntMainWindow::tr(char const *, char const *) ?staticMetaObject@CntBaseSelectionView@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const CntBaseSelectionView::staticMetaObject ?d_func@CntEditView@@AAEPAVCntEditViewPrivate@@XZ @ 13 NONAME ; class CntEditViewPrivate * CntEditView::d_func(void) ?changesDiscarded@CntEditView@@IAEXXZ @ 14 NONAME ; void CntEditView::changesDiscarded(void) - ?keyPressEvent@CntMainWindow@@UAEXPAVQKeyEvent@@@Z @ 15 NONAME ; void CntMainWindow::keyPressEvent(class QKeyEvent *) - ??_ECntDefaultViewManager@@UAE@I@Z @ 16 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(unsigned int) - ??_ECntBaseSelectionView@@UAE@I@Z @ 17 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(unsigned int) - ?view@CntBaseSelectionView@@UBEPAVHbView@@XZ @ 18 NONAME ; class HbView * CntBaseSelectionView::view(void) const - ??1CntDefaultViewFactory@@UAE@XZ @ 19 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(void) - ??_ECntDefaultViewFactory@@UAE@I@Z @ 20 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(unsigned int) - ?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *, int) - ?qt_metacast@CntActionPopup@@UAEPAXPBD@Z @ 22 NONAME ; void * CntActionPopup::qt_metacast(char const *) - ?deleteOldView@CntDefaultViewManager@@AAEXXZ @ 23 NONAME ; void CntDefaultViewManager::deleteOldView(void) - ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *, int) - ?trUtf8@CntEditView@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString CntEditView::trUtf8(char const *, char const *, int) - ??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) + ??_ECntDefaultViewManager@@UAE@I@Z @ 15 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(unsigned int) + ??_ECntBaseSelectionView@@UAE@I@Z @ 16 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(unsigned int) + ?view@CntBaseSelectionView@@UBEPAVHbView@@XZ @ 17 NONAME ; class HbView * CntBaseSelectionView::view(void) const + ??1CntDefaultViewFactory@@UAE@XZ @ 18 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(void) + ??_ECntDefaultViewFactory@@UAE@I@Z @ 19 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(unsigned int) + ?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *, int) + ?qt_metacast@CntActionPopup@@UAEPAXPBD@Z @ 21 NONAME ; void * CntActionPopup::qt_metacast(char const *) + ?deleteOldView@CntDefaultViewManager@@AAEXXZ @ 22 NONAME ; void CntDefaultViewManager::deleteOldView(void) + ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *, int) + ?trUtf8@CntEditView@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString CntEditView::trUtf8(char const *, char const *, int) + ??1CntEditView@@UAE@XZ @ 25 NONAME ; CntEditView::~CntEditView(void) + ?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 26 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *) + ?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const + ?back@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@_N@Z @ 28 NONAME ; void CntDefaultViewManager::back(class QMap, bool) + ??0CntKeyGrabber@@QAE@PAVHbMainWindow@@PAVQObject@@@Z @ 29 NONAME ; CntKeyGrabber::CntKeyGrabber(class HbMainWindow *, class QObject *) + ?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@CntKeyGrabber@@SA?AVQString@@PBD0H@Z @ 33 NONAME ; class QString CntKeyGrabber::tr(char const *, char const *, int) + ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int) + ?viewId@CntEditView@@UBEHXZ @ 35 NONAME ; int CntEditView::viewId(void) const + ?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 36 NONAME ; void * CntContactCardView::qt_metacast(char const *) + ?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 37 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap) + ?viewClosed@CntBaseSelectionView@@IAEXXZ @ 38 NONAME ; void CntBaseSelectionView::viewClosed(void) + ??1CntKeyGrabber@@UAE@XZ @ 39 NONAME ; CntKeyGrabber::~CntKeyGrabber(void) + ?showActionPopup@CntActionPopup@@QAE_NVQString@@@Z @ 40 NONAME ; bool CntActionPopup::showActionPopup(class QString) + ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0@Z @ 41 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *) + ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 42 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int) + ?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const + ??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 44 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *) + ?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 45 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const + ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int) + ?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void) + ??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 48 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *) + ?actionPopupCancelPressed@CntActionPopup@@IAEXXZ @ 49 NONAME ; void CntActionPopup::actionPopupCancelPressed(void) + ?getStaticMetaObject@CntActionPopup@@SAABUQMetaObject@@XZ @ 50 NONAME ; struct QMetaObject const & CntActionPopup::getStaticMetaObject(void) + ?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 51 NONAME ; void CntViewNavigator::next(int const &, class QFlags &) + ?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 52 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int) + ?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 53 NONAME ; void * CntEditView::qt_metacast(char const *) + ??0CntContactCardView@@QAE@_N@Z @ 54 NONAME ; CntContactCardView::CntContactCardView(bool) + ?contactRemoved@CntEditView@@IAEX_N@Z @ 55 NONAME ; void CntEditView::contactRemoved(bool) + ?d_func@CntActionPopup@@ABEPBVCntActionPopupPrivate@@XZ @ 56 NONAME ; class CntActionPopupPrivate const * CntActionPopup::d_func(void) const + ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *) + ?metaObject@CntActionPopup@@UBEPBUQMetaObject@@XZ @ 58 NONAME ; struct QMetaObject const * CntActionPopup::metaObject(void) const + ?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 59 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject + ?removeException@CntViewNavigator@@QAEXABH@Z @ 60 NONAME ; void CntViewNavigator::removeException(int const &) + ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *) + ?getStaticMetaObject@CntKeyGrabber@@SAABUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const & CntKeyGrabber::getStaticMetaObject(void) + ?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const + ??_ECntMainWindow@@UAE@I@Z @ 64 NONAME ; CntMainWindow::~CntMainWindow(unsigned int) + ?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 65 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const + ?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 66 NONAME ; void CntDefaultViewManager::changeView(class QMap) + ??_ECntContactCardView@@UAE@I@Z @ 67 NONAME ; CntContactCardView::~CntContactCardView(unsigned int) + ?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 68 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject + ?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 71 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *) + ?trUtf8@CntKeyGrabber@@SA?AVQString@@PBD0H@Z @ 72 NONAME ; class QString CntKeyGrabber::trUtf8(char const *, char const *, int) + ?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject + ?isDefault@CntContactCardView@@UBE_NXZ @ 74 NONAME ; bool CntContactCardView::isDefault(void) const + ??1CntContactCardView@@UAE@XZ @ 75 NONAME ; CntContactCardView::~CntContactCardView(void) + ?qt_metacall@CntActionPopup@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 76 NONAME ; int CntActionPopup::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0CntBaseSelectionView@@QAE@XZ @ 77 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void) + ?tr@CntKeyGrabber@@SA?AVQString@@PBD0@Z @ 78 NONAME ; class QString CntKeyGrabber::tr(char const *, char const *) + ??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 79 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int) + ??1CntActionPopup@@UAE@XZ @ 80 NONAME ; CntActionPopup::~CntActionPopup(void) + ?viewId@CntContactCardView@@UBEHXZ @ 81 NONAME ; int CntContactCardView::viewId(void) const + ?removeEffect@CntViewNavigator@@QAEXABH@Z @ 82 NONAME ; void CntViewNavigator::removeEffect(int const &) + ?getStaticMetaObject@CntContactCardView@@SAABUQMetaObject@@XZ @ 83 NONAME ; struct QMetaObject const & CntContactCardView::getStaticMetaObject(void) + ?activate@CntContactCardView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 84 NONAME ; void CntContactCardView::activate(class CntAbstractViewManager *, class QMap) + ?staticMetaObject@CntActionPopup@@2UQMetaObject@@B @ 85 NONAME ; struct QMetaObject const CntActionPopup::staticMetaObject + ?staticMetaObject@CntEditView@@2UQMetaObject@@B @ 86 NONAME ; struct QMetaObject const CntEditView::staticMetaObject + ?staticMetaObject@CntKeyGrabber@@2UQMetaObject@@B @ 87 NONAME ; struct QMetaObject const CntKeyGrabber::staticMetaObject + ?viewOpened@CntBaseSelectionView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 88 NONAME ; void CntBaseSelectionView::viewOpened(class CntAbstractViewManager *, class QMap) + ?isDefault@CntEditView@@UBE_NXZ @ 89 NONAME ; bool CntEditView::isDefault(void) const + ?qt_metacall@CntKeyGrabber@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 90 NONAME ; int CntKeyGrabber::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_ECntViewNavigator@@UAE@I@Z @ 91 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int) + ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 92 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *, int) + ?metaObject@CntKeyGrabber@@UBEPBUQMetaObject@@XZ @ 93 NONAME ; struct QMetaObject const * CntKeyGrabber::metaObject(void) const + ?addException@CntViewNavigator@@QAEXABH0@Z @ 94 NONAME ; void CntViewNavigator::addException(int const &, int const &) + ?closeApp@CntDefaultViewManager@@MAEXXZ @ 95 NONAME ; void CntDefaultViewManager::closeApp(void) + ??_ECntKeyGrabber@@UAE@I@Z @ 96 NONAME ; CntKeyGrabber::~CntKeyGrabber(unsigned int) + ?deactivate@CntBaseSelectionView@@UAEXXZ @ 97 NONAME ; void CntBaseSelectionView::deactivate(void) + ?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 98 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const + ?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 99 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *) + ?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 100 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void) + ?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString CntViewNavigator::tr(char const *, char const *) + ?trUtf8@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 102 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *, int) + ?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 103 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int) + ?tr@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 104 NONAME ; class QString CntActionPopup::tr(char const *, char const *, int) + ?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 105 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *) + ?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 106 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0CntEditView@@QAE@XZ @ 107 NONAME ; CntEditView::CntEditView(void) + ?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 108 NONAME ; void * CntViewNavigator::qt_metacast(char const *) + ?view@CntContactCardView@@UBEPAVHbView@@XZ @ 109 NONAME ; class HbView * CntContactCardView::view(void) const + ?addToContacts@CntContactCardView@@IAEXXZ @ 110 NONAME ; void CntContactCardView::addToContacts(void) + ?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 111 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int) + ?addRoot@CntViewNavigator@@QAEXABH@Z @ 112 NONAME ; void CntViewNavigator::addRoot(int const &) + ?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 113 NONAME ; class QString CntContactCardView::tr(char const *, char const *) + ?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 114 NONAME ; class QString CntEditView::tr(char const *, char const *) + ?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 115 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void) + ?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const + ?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 117 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject + ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 118 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *) + ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 119 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *) + ?trUtf8@CntKeyGrabber@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString CntKeyGrabber::trUtf8(char const *, char const *) + ?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 121 NONAME ; void CntDefaultViewManager::switchView(class QMap, class QFlags) + ?deactivate@CntEditView@@UAEXXZ @ 122 NONAME ; void CntEditView::deactivate(void) + ?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 123 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &) + ?addEffect@CntViewNavigator@@QAEXABH0@Z @ 124 NONAME ; void CntViewNavigator::addEffect(int const &, int const &) + ??_ECntActionPopup@@UAE@I@Z @ 125 NONAME ; CntActionPopup::~CntActionPopup(unsigned int) + ?d_func@CntActionPopup@@AAEPAVCntActionPopupPrivate@@XZ @ 126 NONAME ; class CntActionPopupPrivate * CntActionPopup::d_func(void) + ?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 127 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const + ?contactUpdated@CntEditView@@IAEXH@Z @ 128 NONAME ; void CntEditView::contactUpdated(int) + ??1CntDefaultViewManager@@UAE@XZ @ 129 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void) + ?deactivate@CntContactCardView@@UAEXXZ @ 130 NONAME ; void CntContactCardView::deactivate(void) + ?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 131 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void) + ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int) + ?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 133 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 134 NONAME ; class QString CntEditView::tr(char const *, char const *, int) + ?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void) + ?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString CntEditView::trUtf8(char const *, char const *) + ??1CntViewNavigator@@UAE@XZ @ 137 NONAME ; CntViewNavigator::~CntViewNavigator(void) + ?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 138 NONAME ; void * CntMainWindow::qt_metacast(char const *) + ?isDefault@CntBaseSelectionView@@UBE_NXZ @ 139 NONAME ; bool CntBaseSelectionView::isDefault(void) const + ?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@_N@Z @ 140 NONAME ; int const & CntViewNavigator::back(class QFlags &, bool) + ??1CntBaseSelectionView@@UAE@XZ @ 141 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void) + ?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 142 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int) + ?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 143 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int) + ??_ECntEditView@@UAE@I@Z @ 144 NONAME ; CntEditView::~CntEditView(unsigned int) + ??0CntActionPopup@@QAE@PAVQContact@QtMobility@@@Z @ 145 NONAME ; CntActionPopup::CntActionPopup(class QtMobility::QContact *) + ?executeContactAction@CntActionPopup@@IAEXAAVQContact@QtMobility@@VQContactDetail@3@VQString@@@Z @ 146 NONAME ; void CntActionPopup::executeContactAction(class QtMobility::QContact &, class QtMobility::QContactDetail, class QString) + ?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 147 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void) + ?eventFilter@CntKeyGrabber@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 148 NONAME ; bool CntKeyGrabber::eventFilter(class QObject *, class QEvent *) + ?qt_metacast@CntKeyGrabber@@UAEPAXPBD@Z @ 149 NONAME ; void * CntKeyGrabber::qt_metacast(char const *) + ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 150 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *) + ?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 151 NONAME ; void CntDefaultViewManager::removeCurrentView(void) + ?trUtf8@CntGroupMemberView@@SA?AVQString@@PBD0H@Z @ 152 NONAME ; class QString CntGroupMemberView::trUtf8(char const *, char const *, int) + ?d_func@CntGroupMemberView@@AAEPAVCntGroupMemberViewPrivate@@XZ @ 153 NONAME ; class CntGroupMemberViewPrivate * CntGroupMemberView::d_func(void) + ?view@CntGroupMemberView@@UBEPAVHbView@@XZ @ 154 NONAME ; class HbView * CntGroupMemberView::view(void) const + ?staticMetaObject@CntGroupMemberView@@2UQMetaObject@@B @ 155 NONAME ; struct QMetaObject const CntGroupMemberView::staticMetaObject + ??1CntGroupMemberView@@UAE@XZ @ 156 NONAME ; CntGroupMemberView::~CntGroupMemberView(void) + ?tr@CntGroupMemberView@@SA?AVQString@@PBD0H@Z @ 157 NONAME ; class QString CntGroupMemberView::tr(char const *, char const *, int) + ?activate@CntGroupMemberView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 158 NONAME ; void CntGroupMemberView::activate(class CntAbstractViewManager *, class QMap) + ??_ECntGroupMemberView@@UAE@I@Z @ 159 NONAME ; CntGroupMemberView::~CntGroupMemberView(unsigned int) + ?viewId@CntGroupMemberView@@UBEHXZ @ 160 NONAME ; int CntGroupMemberView::viewId(void) const + ?isDefault@CntGroupMemberView@@UBE_NXZ @ 161 NONAME ; bool CntGroupMemberView::isDefault(void) const + ?qt_metacast@CntGroupMemberView@@UAEPAXPBD@Z @ 162 NONAME ; void * CntGroupMemberView::qt_metacast(char const *) + ?trUtf8@CntGroupMemberView@@SA?AVQString@@PBD0@Z @ 163 NONAME ; class QString CntGroupMemberView::trUtf8(char const *, char const *) + ?d_func@CntGroupMemberView@@ABEPBVCntGroupMemberViewPrivate@@XZ @ 164 NONAME ; class CntGroupMemberViewPrivate const * CntGroupMemberView::d_func(void) const + ?getStaticMetaObject@CntGroupMemberView@@SAABUQMetaObject@@XZ @ 165 NONAME ; struct QMetaObject const & CntGroupMemberView::getStaticMetaObject(void) + ??0CntGroupMemberView@@QAE@XZ @ 166 NONAME ; CntGroupMemberView::CntGroupMemberView(void) + ?deactivate@CntGroupMemberView@@UAEXXZ @ 167 NONAME ; void CntGroupMemberView::deactivate(void) + ?qt_metacall@CntGroupMemberView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 168 NONAME ; int CntGroupMemberView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?metaObject@CntGroupMemberView@@UBEPBUQMetaObject@@XZ @ 169 NONAME ; struct QMetaObject const * CntGroupMemberView::metaObject(void) const + ?tr@CntGroupMemberView@@SA?AVQString@@PBD0@Z @ 170 NONAME ; class QString CntGroupMemberView::tr(char const *, char const *) + ?backPressed@CntGroupMemberView@@IAEXXZ @ 171 NONAME ; void CntGroupMemberView::backPressed(void) diff -r 7cbcb2896f0e -r a642906a277a phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h --- a/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp --- a/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/eabi/pbkcommonuiu.def --- a/phonebookui/eabi/pbkcommonuiu.def Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/eabi/pbkcommonuiu.def Wed Aug 18 09:39:00 2010 +0300 @@ -13,152 +13,190 @@ _ZN11CntEditViewD0Ev @ 12 NONAME _ZN11CntEditViewD1Ev @ 13 NONAME _ZN11CntEditViewD2Ev @ 14 NONAME - _ZN13CntMainWindow10keyPressedEP9QKeyEvent @ 15 NONAME - _ZN13CntMainWindow11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME - _ZN13CntMainWindow11qt_metacastEPKc @ 17 NONAME - _ZN13CntMainWindow13keyPressEventEP9QKeyEvent @ 18 NONAME - _ZN13CntMainWindow16staticMetaObjectE @ 19 NONAME DATA 16 - _ZN13CntMainWindow19getStaticMetaObjectEv @ 20 NONAME - _ZN13CntMainWindowC1EP7QWidgeti @ 21 NONAME - _ZN13CntMainWindowC2EP7QWidgeti @ 22 NONAME - _ZN13CntMainWindowD0Ev @ 23 NONAME - _ZN13CntMainWindowD1Ev @ 24 NONAME - _ZN13CntMainWindowD2Ev @ 25 NONAME - _ZN14CntActionPopup11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME - _ZN14CntActionPopup11qt_metacastEPKc @ 27 NONAME - _ZN14CntActionPopup15showActionPopupE7QString @ 28 NONAME - _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 + _ZN13CntKeyGrabber11eventFilterEP7QObjectP6QEvent @ 15 NONAME + _ZN13CntKeyGrabber11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME + _ZN13CntKeyGrabber11qt_metacastEPKc @ 17 NONAME + _ZN13CntKeyGrabber16staticMetaObjectE @ 18 NONAME DATA 16 + _ZN13CntKeyGrabber19getStaticMetaObjectEv @ 19 NONAME + _ZN13CntKeyGrabberC1EP12HbMainWindowP7QObject @ 20 NONAME + _ZN13CntKeyGrabberC2EP12HbMainWindowP7QObject @ 21 NONAME + _ZN13CntKeyGrabberD0Ev @ 22 NONAME + _ZN13CntKeyGrabberD1Ev @ 23 NONAME + _ZN13CntKeyGrabberD2Ev @ 24 NONAME + _ZN13CntMainWindow11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME + _ZN13CntMainWindow11qt_metacastEPKc @ 26 NONAME + _ZN13CntMainWindow16staticMetaObjectE @ 27 NONAME DATA 16 + _ZN13CntMainWindow19getStaticMetaObjectEv @ 28 NONAME + _ZN13CntMainWindowC1EP7QWidgeti @ 29 NONAME + _ZN13CntMainWindowC2EP7QWidgeti @ 30 NONAME + _ZN13CntMainWindowD0Ev @ 31 NONAME + _ZN13CntMainWindowD1Ev @ 32 NONAME + _ZN13CntMainWindowD2Ev @ 33 NONAME + _ZN14CntActionPopup11qt_metacallEN11QMetaObject4CallEiPPv @ 34 NONAME + _ZN14CntActionPopup11qt_metacastEPKc @ 35 NONAME + _ZN14CntActionPopup15showActionPopupE7QString @ 36 NONAME + _ZN14CntActionPopup16staticMetaObjectE @ 37 NONAME DATA 16 + _ZN14CntActionPopup19getStaticMetaObjectEv @ 38 NONAME + _ZN14CntActionPopup20executeContactActionERN10QtMobility8QContactENS0_14QContactDetailE7QString @ 39 NONAME + _ZN14CntActionPopup24actionPopupCancelPressedEv @ 40 NONAME + _ZN14CntActionPopupC1EPN10QtMobility8QContactE @ 41 NONAME + _ZN14CntActionPopupC2EPN10QtMobility8QContactE @ 42 NONAME + _ZN14CntActionPopupD0Ev @ 43 NONAME + _ZN14CntActionPopupD1Ev @ 44 NONAME + _ZN14CntActionPopupD2Ev @ 45 NONAME + _ZN16CntViewNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 46 NONAME + _ZN16CntViewNavigator11qt_metacastEPKc @ 47 NONAME + _ZN16CntViewNavigator12addExceptionERKiS1_ @ 48 NONAME + _ZN16CntViewNavigator12removeEffectERKi @ 49 NONAME + _ZN16CntViewNavigator15removeExceptionERKi @ 50 NONAME + _ZN16CntViewNavigator16staticMetaObjectE @ 51 NONAME DATA 16 + _ZN16CntViewNavigator19getStaticMetaObjectEv @ 52 NONAME + _ZN16CntViewNavigator4backER6QFlagsIN2Hb14ViewSwitchFlagEEb @ 53 NONAME + _ZN16CntViewNavigator4nextERKiR6QFlagsIN2Hb14ViewSwitchFlagEE @ 54 NONAME + _ZN16CntViewNavigator7addRootERKi @ 55 NONAME + _ZN16CntViewNavigator9addEffectERKiS1_ @ 56 NONAME + _ZN16CntViewNavigatorC1EP7QObject @ 57 NONAME + _ZN16CntViewNavigatorC2EP7QObject @ 58 NONAME + _ZN16CntViewNavigatorD0Ev @ 59 NONAME + _ZN16CntViewNavigatorD1Ev @ 60 NONAME + _ZN16CntViewNavigatorD2Ev @ 61 NONAME + _ZN18CntContactCardView10deactivateEv @ 62 NONAME + _ZN18CntContactCardView11backPressedEv @ 63 NONAME + _ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 64 NONAME + _ZN18CntContactCardView11qt_metacastEPKc @ 65 NONAME + _ZN18CntContactCardView13addToContactsEv @ 66 NONAME + _ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 67 NONAME + _ZN18CntContactCardView16staticMetaObjectE @ 68 NONAME DATA 16 + _ZN18CntContactCardView19getStaticMetaObjectEv @ 69 NONAME + _ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 70 NONAME + _ZN18CntContactCardViewC1Eb @ 71 NONAME + _ZN18CntContactCardViewC2Eb @ 72 NONAME + _ZN18CntContactCardViewD0Ev @ 73 NONAME + _ZN18CntContactCardViewD1Ev @ 74 NONAME + _ZN18CntContactCardViewD2Ev @ 75 NONAME + _ZN20CntBaseSelectionView10deactivateEv @ 76 NONAME + _ZN20CntBaseSelectionView10viewClosedEv @ 77 NONAME + _ZN20CntBaseSelectionView10viewOpenedEP22CntAbstractViewManager4QMapIi8QVariantE @ 78 NONAME + _ZN20CntBaseSelectionView11qt_metacallEN11QMetaObject4CallEiPPv @ 79 NONAME + _ZN20CntBaseSelectionView11qt_metacastEPKc @ 80 NONAME + _ZN20CntBaseSelectionView16staticMetaObjectE @ 81 NONAME DATA 16 + _ZN20CntBaseSelectionView19getStaticMetaObjectEv @ 82 NONAME + _ZN20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 83 NONAME + _ZN20CntBaseSelectionViewC2Ev @ 84 NONAME + _ZN20CntBaseSelectionViewD0Ev @ 85 NONAME + _ZN20CntBaseSelectionViewD1Ev @ 86 NONAME + _ZN20CntBaseSelectionViewD2Ev @ 87 NONAME + _ZN21CntDefaultViewFactory10createViewEi @ 88 NONAME + _ZN21CntDefaultViewFactory16createPluginViewEi @ 89 NONAME + _ZN21CntDefaultViewFactoryC1Ev @ 90 NONAME + _ZN21CntDefaultViewFactoryC2Ev @ 91 NONAME + _ZN21CntDefaultViewFactoryD0Ev @ 92 NONAME + _ZN21CntDefaultViewFactoryD1Ev @ 93 NONAME + _ZN21CntDefaultViewFactoryD2Ev @ 94 NONAME + _ZN21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 95 NONAME + _ZN21CntDefaultViewManager10switchViewE4QMapIi8QVariantE6QFlagsIN2Hb14ViewSwitchFlagEE @ 96 NONAME + _ZN21CntDefaultViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 97 NONAME + _ZN21CntDefaultViewManager11qt_metacastEPKc @ 98 NONAME + _ZN21CntDefaultViewManager13currentViewIdEv @ 99 NONAME + _ZN21CntDefaultViewManager13deleteOldViewEv @ 100 NONAME + _ZN21CntDefaultViewManager14contactManagerERK7QString @ 101 NONAME + _ZN21CntDefaultViewManager14setViewFactoryEP22CntAbstractViewFactory @ 102 NONAME + _ZN21CntDefaultViewManager16setViewNavigatorEP16CntViewNavigator @ 103 NONAME + _ZN21CntDefaultViewManager16staticMetaObjectE @ 104 NONAME DATA 16 + _ZN21CntDefaultViewManager17removeCurrentViewEv @ 105 NONAME + _ZN21CntDefaultViewManager19getStaticMetaObjectEv @ 106 NONAME + _ZN21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 107 NONAME + _ZN21CntDefaultViewManager7cleanupEv @ 108 NONAME + _ZN21CntDefaultViewManager8closeAppEv @ 109 NONAME + _ZN21CntDefaultViewManagerC1EP12HbMainWindow @ 110 NONAME + _ZN21CntDefaultViewManagerC2EP12HbMainWindow @ 111 NONAME + _ZN21CntDefaultViewManagerD0Ev @ 112 NONAME + _ZN21CntDefaultViewManagerD1Ev @ 113 NONAME + _ZN21CntDefaultViewManagerD2Ev @ 114 NONAME + _ZNK11CntEditView10metaObjectEv @ 115 NONAME + _ZNK11CntEditView4viewEv @ 116 NONAME + _ZNK11CntEditView6viewIdEv @ 117 NONAME + _ZNK11CntEditView9isDefaultEv @ 118 NONAME + _ZNK13CntKeyGrabber10metaObjectEv @ 119 NONAME + _ZNK13CntMainWindow10metaObjectEv @ 120 NONAME + _ZNK14CntActionPopup10metaObjectEv @ 121 NONAME + _ZNK16CntViewNavigator10metaObjectEv @ 122 NONAME + _ZNK18CntContactCardView10metaObjectEv @ 123 NONAME + _ZNK18CntContactCardView4viewEv @ 124 NONAME + _ZNK18CntContactCardView6viewIdEv @ 125 NONAME + _ZNK18CntContactCardView9isDefaultEv @ 126 NONAME + _ZNK20CntBaseSelectionView10metaObjectEv @ 127 NONAME + _ZNK20CntBaseSelectionView4viewEv @ 128 NONAME + _ZNK20CntBaseSelectionView9isDefaultEv @ 129 NONAME + _ZNK21CntDefaultViewManager10metaObjectEv @ 130 NONAME + _ZTI11CntEditView @ 131 NONAME + _ZTI13CntKeyGrabber @ 132 NONAME + _ZTI13CntMainWindow @ 133 NONAME + _ZTI14CntActionPopup @ 134 NONAME + _ZTI16CntViewNavigator @ 135 NONAME + _ZTI18CntContactCardView @ 136 NONAME + _ZTI20CntBaseSelectionView @ 137 NONAME + _ZTI21CntDefaultViewFactory @ 138 NONAME + _ZTI21CntDefaultViewManager @ 139 NONAME + _ZTV11CntEditView @ 140 NONAME + _ZTV13CntKeyGrabber @ 141 NONAME + _ZTV13CntMainWindow @ 142 NONAME + _ZTV14CntActionPopup @ 143 NONAME + _ZTV16CntViewNavigator @ 144 NONAME + _ZTV18CntContactCardView @ 145 NONAME + _ZTV20CntBaseSelectionView @ 146 NONAME + _ZTV21CntDefaultViewFactory @ 147 NONAME + _ZTV21CntDefaultViewManager @ 148 NONAME + _ZThn8_N11CntEditView10deactivateEv @ 149 NONAME + _ZThn8_N11CntEditView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 150 NONAME + _ZThn8_N11CntEditViewD0Ev @ 151 NONAME + _ZThn8_N11CntEditViewD1Ev @ 152 NONAME + _ZThn8_N13CntMainWindowD0Ev @ 153 NONAME + _ZThn8_N13CntMainWindowD1Ev @ 154 NONAME + _ZThn8_N18CntContactCardView10deactivateEv @ 155 NONAME + _ZThn8_N18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 156 NONAME + _ZThn8_N18CntContactCardViewD0Ev @ 157 NONAME + _ZThn8_N18CntContactCardViewD1Ev @ 158 NONAME + _ZThn8_N20CntBaseSelectionView10deactivateEv @ 159 NONAME + _ZThn8_N20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 160 NONAME + _ZThn8_N20CntBaseSelectionViewD0Ev @ 161 NONAME + _ZThn8_N20CntBaseSelectionViewD1Ev @ 162 NONAME + _ZThn8_N21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 163 NONAME + _ZThn8_N21CntDefaultViewManager14contactManagerERK7QString @ 164 NONAME + _ZThn8_N21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 165 NONAME + _ZThn8_N21CntDefaultViewManagerD0Ev @ 166 NONAME + _ZThn8_N21CntDefaultViewManagerD1Ev @ 167 NONAME + _ZThn8_NK11CntEditView4viewEv @ 168 NONAME + _ZThn8_NK11CntEditView6viewIdEv @ 169 NONAME + _ZThn8_NK11CntEditView9isDefaultEv @ 170 NONAME + _ZThn8_NK18CntContactCardView4viewEv @ 171 NONAME + _ZThn8_NK18CntContactCardView6viewIdEv @ 172 NONAME + _ZThn8_NK18CntContactCardView9isDefaultEv @ 173 NONAME + _ZThn8_NK20CntBaseSelectionView4viewEv @ 174 NONAME + _ZThn8_NK20CntBaseSelectionView9isDefaultEv @ 175 NONAME + _ZN18CntGroupMemberView10deactivateEv @ 176 NONAME + _ZN18CntGroupMemberView11backPressedEv @ 177 NONAME + _ZN18CntGroupMemberView11qt_metacallEN11QMetaObject4CallEiPPv @ 178 NONAME + _ZN18CntGroupMemberView11qt_metacastEPKc @ 179 NONAME + _ZN18CntGroupMemberView16staticMetaObjectE @ 180 NONAME DATA 16 + _ZN18CntGroupMemberView19getStaticMetaObjectEv @ 181 NONAME + _ZN18CntGroupMemberView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 182 NONAME + _ZN18CntGroupMemberViewC1Ev @ 183 NONAME + _ZN18CntGroupMemberViewC2Ev @ 184 NONAME + _ZN18CntGroupMemberViewD0Ev @ 185 NONAME + _ZN18CntGroupMemberViewD1Ev @ 186 NONAME + _ZN18CntGroupMemberViewD2Ev @ 187 NONAME + _ZNK18CntGroupMemberView10metaObjectEv @ 188 NONAME + _ZNK18CntGroupMemberView4viewEv @ 189 NONAME + _ZNK18CntGroupMemberView6viewIdEv @ 190 NONAME + _ZNK18CntGroupMemberView9isDefaultEv @ 191 NONAME + _ZTI18CntGroupMemberView @ 192 NONAME + _ZTV18CntGroupMemberView @ 193 NONAME + _ZThn8_N18CntGroupMemberView10deactivateEv @ 194 NONAME + _ZThn8_N18CntGroupMemberView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 195 NONAME + _ZThn8_N18CntGroupMemberViewD0Ev @ 196 NONAME + _ZThn8_N18CntGroupMemberViewD1Ev @ 197 NONAME + _ZThn8_NK18CntGroupMemberView4viewEv @ 198 NONAME + _ZThn8_NK18CntGroupMemberView6viewIdEv @ 199 NONAME + _ZThn8_NK18CntGroupMemberView9isDefaultEv @ 200 NONAME diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntactionlauncher.h --- a/phonebookui/pbkcommonui/inc/cntactionlauncher.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntactionlauncher.h Wed Aug 18 09:39:00 2010 +0300 @@ -34,6 +34,7 @@ public: bool execute( QContact aContact, QContactDetail aDetail ); + bool execute( QContact aContact, QContactDetail aDetail, QVariantMap aParameters ); bool execute( QContact aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor ); signals: diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntactionpopup.h --- a/phonebookui/pbkcommonui/inc/cntactionpopup.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntactionpopup.h Wed Aug 18 09:39:00 2010 +0300 @@ -36,7 +36,7 @@ /* * Class for showing popup for Call, Message and Email actions if preffered number is not set */ -class Q_DECL_EXPORT CntActionPopup : public QObject +class QTPBK_EXPORT CntActionPopup : public QObject { Q_OBJECT diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntbaseselectionview.h --- a/phonebookui/pbkcommonui/inc/cntbaseselectionview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntbaseselectionview.h Wed Aug 18 09:39:00 2010 +0300 @@ -48,10 +48,7 @@ HbView* view() const; virtual int viewId() const = 0; - -private slots: - void closeView(); - + protected: HbDocumentLoader* mDocument; HbListView* mListView; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h --- a/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h Wed Aug 18 09:39:00 2010 +0300 @@ -46,17 +46,25 @@ CntCollectionListModel(QContactManager *manager, CntExtensionManager &extensionManager, QObject *parent = 0); ~CntCollectionListModel(); -public: // from QAbstractItemModel +public: + // from QAbstractItemModel QVariant data(const QModelIndex& index, int role) const; int rowCount(const QModelIndex& parent = QModelIndex()) const; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); public: + // removing and adding groups void removeGroup(int localId); + void addGroup(int localId); + + // extension (plugin) group handling bool isExtensionGroup(const QModelIndex &index); CntViewParameters extensionGroupActivated(int row); void extensionGroupLongPressed(int row, const QPointF& coords, CntExtensionGroupCallback* interface); + QModelIndex indexOfGroup(int localId); + private: void doConstruct(); void initializeStaticGroups(); @@ -69,8 +77,9 @@ bool validateRowIndex(const int index) const; private slots: - void informationUpdated(int row, const QString& secondRowText, int memberCount); + void informationUpdated(int id, const QString& secondRowText, int memberCount); void onIconReady(const QPixmap& pixmap, void *data, int id, int error); + void extensionGroupsReady(); private: QSharedDataPointer d; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h --- a/phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h Wed Aug 18 09:39:00 2010 +0300 @@ -33,6 +33,7 @@ class CntCollectionListModelWorker : public QThread { Q_OBJECT + friend class TestCntCollectionListModelWorker; public: CntCollectionListModelWorker(QString unnamed, QString noFavs, QString noMembers, int sortOrder); @@ -41,14 +42,14 @@ void run(); bool event(QEvent *event); - void scheduleJob(int row, int id); + void scheduleJob(int id); private: void processJobs(); - void fetchInformation(int row, int id); + void fetchInformation(int id); signals: - void fetchDone(int row, const QString& secondRowText, int memberCount); + void fetchDone(int id, const QString& secondRowText, int memberCount); private: bool mStarted; @@ -56,7 +57,7 @@ bool mStopped; QMutex mMutex; - QList< QPair > mJobs; + QList mJobs; QContactManager *mManager; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntcollectionview.h --- a/phonebookui/pbkcommonui/inc/cntcollectionview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionview.h Wed Aug 18 09:39:00 2010 +0300 @@ -29,7 +29,6 @@ class HbView; class HbListView; class CntCollectionListModel; -class CntFetchContacts; class QModelIndex; class QActionGroup; class HbAbstractViewItem; @@ -58,6 +57,7 @@ private slots: void showPreviousView(); + void showNamesViewWithFinder(); void openGroup(const QModelIndex &index); void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); @@ -65,12 +65,14 @@ void newGroup(); void handleNewGroup(HbAction* action); - void handleNewGroupMembers(); + void handleNewGroupMembers( QSet aMembers ); + void handleCancelGroupMembers(); + void notifyNewGroup(); void refreshDataModel(); void deleteGroup(QContact group); - void handleDeleteGroup(HbAction* action); + void handleDeleteGroup(int action); void deleteGroups(); void handleDeleteGroups(HbAction* action); @@ -95,7 +97,6 @@ HbAction* mDeleteGroupsAction; // owned by view QContact* mHandledContact; // own, needed for asynchronous popups - CntFetchContacts* mFetchView; QSet mSelectedContactsSet; QActionGroup* mActionGroup; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntcontactcardview.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntcontactcardview_p.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Wed Aug 18 09:39:00 2010 +0300 @@ -79,8 +79,11 @@ Q_DECLARE_PUBLIC(CntContactCardView) public: - CntContactCardViewPrivate(); - virtual ~CntContactCardViewPrivate(); + CntContactCardViewPrivate(bool isTemporary); + virtual ~CntContactCardViewPrivate(); + +protected: + bool eventFilter(QObject *obj, QEvent *event); public slots: void onItemActivated(); @@ -91,14 +94,14 @@ 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); private slots: void sendBusinessCard(); void addToGroup(); void deleteContact(); - void handleDeleteContact(HbAction *action); + void handleDeleteContact(int action); void setAsFavorite(); void removeFromFavorite(); void actionExecuted(CntActionLauncher* aAction); @@ -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: @@ -123,7 +128,9 @@ void setMaptileLabel( HbLabel*& mapLabel, const HbIcon& icon ); void updateMaptileImage(); HbLabel* loadMaptileLabel( int addressType ); - + + // Presence related function + void updateItemPresence(const QString& accountUri, bool online); public: CntContactCardView* q_ptr; @@ -136,7 +143,7 @@ void preferredUpdated(); void backPressed(); void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); - + void addToContacts(); #ifdef PBK_UNIT_TEST public: @@ -147,7 +154,7 @@ void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction, CntContactCardDetailItem* aItem); void executeDynamicAction(QContact& aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor); - void sendKeyPressed(); + bool sendKeyPressed(); #ifdef PBK_UNIT_TEST public: #else @@ -166,12 +173,14 @@ QContactAvatar *mAvatar; bool mIsHandlingMenu; QMap mPreferredItems; + /// maps a QContactOnlineAccount (for example "sip:sip@sip.com") to a detail item + QMap mPresenceItems; int mFavoriteGroupId; CntDocumentLoader *mLoader; QContactAction *mContactAction; HbAction *mBackKey; CntImageLabel *mImageLabel; - XQServiceRequest *mHighwayService; + XQServiceRequest *mHighwayService; HbIcon *mVCardIcon; CntViewParameters mArgs; ShareUi *mShareUi; @@ -183,6 +192,8 @@ QTimer *mProgressTimer; QList mAddressList; QMap mMaptileLabelList; + bool mIsTemporary; + bool mIsExecutingAction; }; #endif // CNTCOMMLAUNCHERVIEW_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h --- a/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntdetailconst.h --- a/phonebookui/pbkcommonui/inc/cntdetailconst.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdetailconst.h Wed Aug 18 09:39:00 2010 +0300 @@ -52,6 +52,8 @@ const int CNT_SPOUSE_MAXLENGTH = 50; const int CNT_CHILDREN_MAXLENGTH = 250; +const int CNT_GROUPNAME_MAXLENGTH = 50; + const QDate CNT_DATEPICKER_FROM(1900,0,0); const QDate CNT_DATEPICKER_TO(2050,0,0); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntdetaileditor.h --- a/phonebookui/pbkcommonui/inc/cntdetaileditor.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdetaileditor.h Wed Aug 18 09:39:00 2010 +0300 @@ -31,6 +31,7 @@ class HbView; class HbAction; class CntEditorFactory; +class CntSaveManager; class CntDetailEditor : public QObject, public CntAbstractView @@ -47,6 +48,10 @@ void insertField(); void handleItemShown(const QModelIndex& aIndex ); + void saveContact(); + void contactDeletedFromOtherSource(const QList& contactIds); + void showRootView(); + public: void setViewId( int aId ); void setHeader( QString aHeader ); @@ -79,6 +84,7 @@ HbAction *mSoftkey; HbAction *mCancel; CntViewParameters mArgs; + CntSaveManager *mSaveManager; // own friend class TestCntDetailEditor; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntdetailpopup.h --- a/phonebookui/pbkcommonui/inc/cntdetailpopup.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntdetailpopup.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cnteditview_p.h --- a/phonebookui/pbkcommonui/inc/cnteditview_p.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditview_p.h Wed Aug 18 09:39:00 2010 +0300 @@ -43,6 +43,7 @@ class QAction; class HbMenu; class XQAiwRequest; +class CntSaveManager; QTM_BEGIN_NAMESPACE class QContact; @@ -76,9 +77,10 @@ void addDetailItem(); void handleAddDetailItem(HbAction *aAction); void deleteContact(); - void handleDeleteContact(HbAction *action); + void handleDeleteContact(int action); void discardChanges(); void saveChanges(); + void showRootView(); void openNameEditor(); void openImageEditor(); @@ -88,8 +90,8 @@ void setScrollPosition(); void ringToneFetchHandleError(int errorCode, const QString& errorMessage); void ringToneFetchHandleOk(const QVariant &result); + void contactDeletedFromOtherSource(const QList& contactIds); - private: void loadAvatar(); HbMenu* createPopup( const QModelIndex aIndex, CntEditViewItem* aDetail ); @@ -97,7 +99,6 @@ void editDetail( CntEditViewItem* aDetail ); void removeDetail( CntEditViewItem* aDetail, const QModelIndex& aIndex ); void setSelectedContact( QContact aContact ); - void setPreferredDetails( QContact* aContact ); void fetchTone(); void changeEditorView(); @@ -128,6 +129,7 @@ XQAiwRequest* mReq; XQApplicationManager mAppMgr; HbMenu *mMenu; + CntSaveManager* mSaveManager; // own }; #endif /* CNTEDITVIEW_P_H_ */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h --- a/phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h Wed Aug 18 09:39:00 2010 +0300 @@ -76,6 +76,7 @@ HbTextItem *mLabel; HbTextItem *mSecondLabel; HbFrameItem *mFrameItem; + HbFrameItem *mFocusItem; HbTouchArea *mIconTouchArea; bool mIconFocused; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h --- a/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntfavoritesview.h --- a/phonebookui/pbkcommonui/inc/cntfavoritesview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfavoritesview.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntfetchcontactsview.h --- a/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h Tue Jul 06 14:05:47 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntfetchmarkall.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntfetchmarkall.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntgroupactionsview.h --- a/phonebookui/pbkcommonui/inc/cntgroupactionsview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupactionsview.h Wed Aug 18 09:39:00 2010 +0300 @@ -30,10 +30,12 @@ class HbAbstractViewItem; class QModelIndex; class QStandardItemModel; +class CntActionLauncher; QTM_BEGIN_NAMESPACE class QContact; +class QContactAction; QTM_END_NAMESPACE QTM_USE_NAMESPACE @@ -49,6 +51,9 @@ HbView* view() const { return mView; } int viewId() const { return groupActionsView; } +protected: + bool eventFilter(QObject *obj, QEvent *event); + public: CntGroupActionsView(); ~CntGroupActionsView(); @@ -61,13 +66,19 @@ void showPreviousView(); void editGroup(); + void listItemSelected(const QModelIndex &index); + void executeAction(QContact&, QContactDetail, QString); + void actionExecuted(CntActionLauncher* aAction); + void actionCancelled(); + void executeConferenceCallAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction); #ifdef PBK_UNIT_TEST public: #else private: #endif - void populatelist(QString label,HbIcon icon, QString secondaryText); + void populatelist(QString label,HbIcon icon, QString secondaryText, QString action); + bool sendKeyPressed(); #ifdef PBK_UNIT_TEST public: @@ -84,7 +95,10 @@ HbAction* mSoftkey; // owned by view HbListView* mListView; // owned by layout - + int mPopupCount; + QStringList mEmailActionParams; + QVariantMap mMessageActionParams; + bool mIsExecutingAction; }; #endif // CNTGROUPACTIONSVIEW_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h --- a/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h Wed Aug 18 09:39:00 2010 +0300 @@ -35,6 +35,7 @@ class CntGroupDeletePopup : public HbSelectionDialog { Q_OBJECT + friend class TestCntGroupDeletePopup; public: CntGroupDeletePopup(QContactManager *manager, QGraphicsItem *parent = 0); @@ -43,12 +44,7 @@ void populateListOfGroup(); QList deleteGroup() const; -#ifdef PBK_UNIT_TEST -public: -#else private: -#endif - HbListView *mListView; QContactManager *mContactManager; CntGroupDeletePopupModel *mModel; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntgroupmemberview.h --- a/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Wed Aug 18 09:39:00 2010 +0300 @@ -19,33 +19,14 @@ #define CNTGROUPMEMBERVIEW_H #include -#include -#include - #include +#include "cntglobal.h" -class CntListModel; -class CntAbstractViewManager; -class CntContactCardHeadingItem; -class CntFetchContacts; +class CntGroupMemberViewPrivate; class HbView; -class HbAction; -class HbListView; -class HbAbstractViewItem; -class ThumbnailManager; -class QModelIndex; -class CntImageLabel; -class HbDocumentLoader; -QTM_BEGIN_NAMESPACE -class QContact; -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - -class CntGroupMemberView : public QObject, public CntAbstractView +class QTPBK_EXPORT CntGroupMemberView : public QObject, public CntAbstractView { - friend class TestCntGroupMemberView; Q_OBJECT public: @@ -55,62 +36,17 @@ public: // From CntAbstractView void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); void deactivate(); - bool isDefault() const { return false; } - HbView* view() const { return mView; } - int viewId() const { return groupMemberView; } - -public slots: - void setOrientation(Qt::Orientation orientation); - - -private slots: - void showPreviousView(); - void openGroupActions(); - void manageMembers(); - void handleManageMembers(); - void editGroup(); - void deleteGroup(); - void handleDeleteGroup(HbAction *action); - - void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); - void handleMenu(HbAction* action); + bool isDefault() const; + HbView* view() const; + int viewId() const; - void showContactView(const QModelIndex &index); - void removeFromGroup(const QModelIndex &index); - void editContact(const QModelIndex &index); - void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); - void openImageEditor(); - - void drawImageMenu(const QPointF &aCoords); - void createModel(); - - void removeImage(); - -private: - QContactManager* getContactManager(); - void setRelationship(QSet &aLocalId, - QList &aRelationshipList); - +signals: + void backPressed(); + private: - QContact* mGroupContact; // own - CntAbstractViewManager* mViewManager; - HbDocumentLoader mDocumentLoader; - HbView* mView; // own - HbAction* mSoftkey; // owned by view - CntContactCardHeadingItem* mHeadingItem; // owned by layout - ThumbnailManager* mThumbnailManager; // own - HbAction* mManageAction; // owned by view - HbAction* mDeleteAction; // owned by view - HbAction* mShowActionsAction; // owned by view - HbAction* mEditGroupAction; // owned by view - CntListModel* mModel; // own - CntImageLabel* mImageLabel; - HbListView* mListView; // owned by layout - HbDocumentLoader* mDocument; - CntFetchContacts* mFetchView; - QList mOriginalGroupMembers; - QContactAvatar* mAvatar; - CntViewParameters mArgs; + CntGroupMemberViewPrivate* const d_ptr; + Q_DECLARE_PRIVATE_D(d_ptr, CntGroupMemberView) + Q_DISABLE_COPY(CntGroupMemberView) }; #endif // CNTGROUPMEMBERVIEW_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntgroupmemberview_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview_p.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CNTGROUPMEMBERVIEW_P_H +#define CNTGROUPMEMBERVIEW_P_H + +#include "cntgroupmemberview.h" +#include "cntglobal.h" + +#include +#include +#include +#include +#include + +class CntListModel; +class CntAbstractViewManager; +class CntContactCardHeadingItem; +class HbView; +class HbAction; +class HbListView; +class HbAbstractViewItem; +class ThumbnailManager; +class QModelIndex; +class CntImageLabel; +class HbDocumentLoader; + +QTM_BEGIN_NAMESPACE +class QContact; +QTM_END_NAMESPACE + +QTM_USE_NAMESPACE + +class CntGroupMemberViewPrivate : public QObject +{ + Q_OBJECT + +public: + CntGroupMemberViewPrivate(); + ~CntGroupMemberViewPrivate(); + + void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); + void deactivate(); + +public: + CntGroupMemberView* q_ptr; + +private slots: + void showPreviousView(); + void openGroupActions(); + void manageMembers(); + void handleManageMembers(QSet aIds); + void editGroup(); + void deleteGroup(); + void handleDeleteGroup(int action); // Delete action + + void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); // item owned by HbListView + void handleMenu(HbAction* action); + + void showContactView(const QModelIndex &index); + void removeFromGroup(const QModelIndex &index); + void editContact(const QModelIndex &index); + void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); + void openImageEditor(); + void setOrientation(Qt::Orientation orientation); + + void drawImageMenu(const QPointF &aCoords); + void createModel(); + + void removeImage(); + void sendToHs(const QModelIndex &index); + +private: + QContactManager* getContactManager(); + void setRelationship(QSet &aLocalId, + QList &aRelationshipList); + +private: + Q_DECLARE_PUBLIC(CntGroupMemberView) + friend class TestCntGroupMemberView; + +private: + QContact* mGroupContact; // own + CntAbstractViewManager* mViewManager; + HbDocumentLoader mDocumentLoader; + HbView* mView; // own + HbAction* mSoftkey; // owned by view + CntContactCardHeadingItem* mHeadingItem; // owned by layout + ThumbnailManager* mThumbnailManager; // own + HbAction* mManageAction; // owned by view + HbAction* mDeleteAction; // owned by view + HbAction* mShowActionsAction; // owned by view + HbAction* mEditGroupAction; // owned by view + CntListModel* mModel; // own + CntImageLabel* mImageLabel; + HbListView* mListView; // owned by layout + HbDocumentLoader* mDocument; + QList mOriginalGroupMembers; + QContactAvatar* mAvatar; + CntViewParameters mArgs; +}; + +#endif // CNTGROUPMEMBERVIEW_P_H + +// EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cnthistoryview.h --- a/phonebookui/pbkcommonui/inc/cnthistoryview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnthistoryview.h Wed Aug 18 09:39:00 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include class HbListView; class CntHistoryModel; @@ -51,10 +52,12 @@ public slots: void updateScrollingPosition(); void clearHistory(); - void handleClearHistory(HbAction *action); + void handleClearHistory(int action); void itemActivated(const QModelIndex &index); void showPreviousView(); void showClearHistoryMenu(); + void showRootView(); + void contactDeletedFromOtherSource(const QList& contactIds); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cnthistoryviewitem.h --- a/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Wed Aug 18 09:39:00 2010 +0300 @@ -50,6 +50,7 @@ * Overriden method to draw the custom item in the list view */ void updateChildItems(); + bool event(QEvent* e); bool getIncoming() const { return mIncoming; } bool isNewMessage() const { return mNewMessage; } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntimageeditorview.h --- a/phonebookui/pbkcommonui/inc/cntimageeditorview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimageeditorview.h Wed Aug 18 09:39:00 2010 +0300 @@ -19,18 +19,19 @@ #define CNTIMAGEEDITORVIEW_H #include -#include +#include #include #include -class HbLabel; +class CntImageLabel; class HbListView; class XQAiwRequest; class ThumbnailManager; class HbAction; class QStandardItemModel; class QModelIndex; +class CntSaveManager; QTM_BEGIN_NAMESPACE class QContact; @@ -75,6 +76,7 @@ void setOrientation(Qt::Orientation orientation); void listViewActivated(const QModelIndex &index); void handleError(int errorCode, const QString& errorMessage); + void saveContact(); #ifdef PBK_UNIT_TEST @@ -84,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 @@ -92,9 +94,10 @@ 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 CntViewParameters mArgs; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntimagelabel.h --- a/phonebookui/pbkcommonui/inc/cntimagelabel.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimagelabel.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntimportsview.h --- a/phonebookui/pbkcommonui/inc/cntimportsview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimportsview.h Wed Aug 18 09:39:00 2010 +0300 @@ -53,6 +53,7 @@ void importFetchResultReceivedADN(); void importFetchResultReceivedSDN(); void adnCacheStatusReady(CntSimUtility::CacheStatus& cacheStatus, int error); + void endKeyPressed(); public: CntImportsView(); @@ -117,6 +118,7 @@ int mSdnStoreEntries; bool mSimError; bool mWaitingForAdnCache; + bool mImportInProgress; }; #endif /* CNTIMPORTSVIEW_H_ */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntkeygrabber.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntkeygrabber.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CNTKEYGRABBER_H +#define CNTKEYGRABBER_H + +#include + +#include "cntglobal.h" + +class HbMainWindow; +class XQAiwRequest; + +class QTPBK_EXPORT CntKeyGrabber : public QObject +{ + Q_OBJECT + friend class TestCntKeyGrabber; + +public: + CntKeyGrabber(HbMainWindow *window, QObject *parent = NULL); + ~CntKeyGrabber(); + +protected: + bool eventFilter(QObject *obj, QEvent *event); + +private: + HbMainWindow *mMainWindow; + XQAiwRequest *mRequest; + +}; + +#endif // CNTKEYGRABBER_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntmainwindow.h --- a/phonebookui/pbkcommonui/inc/cntmainwindow.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntmainwindow.h Wed Aug 18 09:39:00 2010 +0300 @@ -19,7 +19,6 @@ #define CNTMAINWINDOW_H #include -#include #include "cntglobal.h" #include @@ -29,27 +28,15 @@ class QTPBK_EXPORT CntMainWindow : public HbMainWindow { Q_OBJECT + friend class TestCntMainWindow; public: CntMainWindow(QWidget *parent=0, int defaultView = namesView); virtual ~CntMainWindow(); - void keyPressEvent(QKeyEvent *event); - -signals: - - void keyPressed(QKeyEvent *event); - -public slots: - -private slots: - -#ifdef PBK_UNIT_TEST -public: -#else -protected: -#endif +private: CntDefaultViewManager *mViewManager; + int mDefaultView; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntmycardselectionview.h --- a/phonebookui/pbkcommonui/inc/cntmycardselectionview.h Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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 CNTMYCARDSELECTIONVIEW_H -#define CNTMYCARDSELECTIONVIEW_H - -#include "cntbaseselectionview.h" - -class QModelIndex; - -class CntMyCardSelectionView : public CntBaseSelectionView -{ - Q_OBJECT -public: - CntMyCardSelectionView(); - ~CntMyCardSelectionView(); - -public: - int viewId() const { return myCardSelectionView; } - -private slots: - void onListViewActivated(const QModelIndex& index); - -#ifdef PBK_UNIT_TEST -public: -#else -private: -#endif - void removeFromGroup(const QContact* contact); -}; - -#endif /* CNTMYCARDSELECTIONVIEW_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntmycardview.h --- a/phonebookui/pbkcommonui/inc/cntmycardview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntmycardview.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntnamesview_p.h --- a/phonebookui/pbkcommonui/inc/cntnamesview_p.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntnamesview_p.h Wed Aug 18 09:39:00 2010 +0300 @@ -60,7 +60,7 @@ void deleteContact( QContact& aContact ); void deleteMultipleContacts(); - void handleDeleteMultipleContacts(); + void handleDeleteMultipleContacts( QSet aIds ); void showPreviousView(); void showCollectionView(); @@ -70,15 +70,18 @@ void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint); void showSettings(); - void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction ); + void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction ); void actionExecuted( CntActionLauncher* aAction ); - void handleDeleteContact( HbAction* aAction ); + void handleDeleteContact( int aAction ); void importSim(); void handleContactAddition(const QList & aAddedList); 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntpresencelistener.h --- a/phonebookui/pbkcommonui/inc/cntpresencelistener.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntpresencelistener.h Wed Aug 18 09:39:00 2010 +0300 @@ -31,6 +31,11 @@ QTM_USE_NAMESPACE +/** + Presence listener for contact card. It provides aggregated + presence information for a contact and separately for each + valid QContactOnlineAccount. +*/ class CntPresenceListener : public QObject { friend class TestCntPresenceListener; @@ -50,7 +55,9 @@ bool parsePresence(QList buddyList); signals: - void accountPresenceUpdated(QString accountUri, bool online); + /// account-specific presence status + void accountPresenceUpdated(const QString& accountUri, bool online); + /// aggregated presence status for this contact void fullPresenceUpdated(bool online); private: diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntsavemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntsavemanager.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,73 @@ +/* +* 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 CNTSAVEMANAGER_H +#define CNTSAVEMANAGER_H + +#include +#include + +QTM_BEGIN_NAMESPACE +class QContact; +class QContactAvatar; +QTM_END_NAMESPACE + +QTM_USE_NAMESPACE + +/*! + Contact saving helper class. Used mainly in edit view for contact saving, + but should also be used in other (special) cases a contact needs to be saved. + For example "forcing" phonebook to shut down (end key, from task swapper etc..) + in detail editors. +*/ +class CntSaveManager : public QObject +{ + friend class TestCntSaveManager; + Q_OBJECT + +public: + enum CntSaveResult + { + ESaved = 0, + EUpdated, + EDeleted, + EFailed, + ENothingDone + }; + + enum CntContactType + { + EContact = 0, + EMyCard, + EGroup + }; + +public: + CntSaveManager(CntContactType type = EContact, QObject* parent = NULL); + ~CntSaveManager(); + + CntSaveResult saveContact(QContact* aContact, QContactManager* aManager); + +private: + void setPreferredDetails(QContact* aContact); + +private: + CntContactType mContactType; + +}; + +#endif // CNTIMAGEEDITORVIEW_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntvcarddetailhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntvcarddetailhandler.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + +#ifndef CNTVCARDDETAILHANDLER_H +#define CNTVCARDDETAILHANDLER_H + +class CntVCardDetailHandler : public QVersitContactExporterDetailHandlerV2 +{ +public: + inline CntVCardDetailHandler(){} + inline void detailProcessed(const QContact& contact, + const QContactDetail& detail, + const QSet& processedFields, + const QVersitDocument& document, + QList* toBeRemoved, + QList* toBeAdded) + { + Q_UNUSED(contact) + Q_UNUSED(detail) + Q_UNUSED(processedFields) + Q_UNUSED(document) + Q_UNUSED(toBeRemoved) + Q_UNUSED(toBeAdded) + } + + inline void contactProcessed(const QContact& contact, + QVersitDocument* document) + { + Q_UNUSED(contact) + // If there is not a FN or N value use an empty FN value. This ensures + // that the vCard created is valid. vCard standard requires a vCard to + // have atlease a name (N) of formatted name (FN) field to be valid. + bool vCardValid(false); + foreach (const QVersitProperty& property, document->properties()) { + const QString& name = property.name(); + if (name == QLatin1String("FN") || name == QLatin1String("N")) { + vCardValid = true; + break; + } + } + + if (!vCardValid) { + QVersitProperty fnProperty; + fnProperty.setName(QLatin1String("FN")); + fnProperty.setValue(QString()); + document->addProperty(fnProperty); + } + } +}; + +#endif diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/inc/cntviewnavigator.h --- a/phonebookui/pbkcommonui/inc/cntviewnavigator.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntviewnavigator.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/pbkcommonui.pro --- a/phonebookui/pbkcommonui/pbkcommonui.pro Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/pbkcommonui.pro Wed Aug 18 09:39:00 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 @@ -96,9 +97,9 @@ inc/cnteditviewdetailitem.h \ inc/cnteditviewheadingitem.h \ inc/cntstringmapper.h \ - inc/cntmycardselectionview.h \ inc/cntmycardview.h \ inc/cntgroupmemberview.h \ + inc/cntgroupmemberview_p.h \ inc/cntgroupactionsview.h \ inc/cntgroupeditormodel.h \ inc/cnthistoryview.h \ @@ -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 \ @@ -137,8 +139,9 @@ inc/cntcommondetailviewitem.h \ ../../inc/cntdebug.h \ inc/cntactionpopup_p.h \ - inc/cntactionpopup.h - + inc/cntactionpopup.h \ + inc/cntsavemanager.h \ + inc/cntkeygrabber.h SOURCES += \ @@ -174,9 +177,9 @@ src/cnteditviewdetailitem.cpp \ src/cnteditviewheadingitem.cpp \ src/cnteditviewseparator.cpp \ - src/cntmycardselectionview.cpp \ src/cntmycardview.cpp \ src/cntgroupmemberview.cpp\ + src/cntgroupmemberview_p.cpp\ src/cntgroupactionsview.cpp \ src/cntgroupeditormodel.cpp \ src/cnthistoryview.cpp \ @@ -204,16 +207,37 @@ 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 \ src/cntsettingsmodel.cpp \ src/cntcommondetailviewitem.cpp \ src/cntactionpopup_p.cpp \ - src/cntactionpopup.cpp + src/cntactionpopup.cpp \ + src/cntsavemanager.cpp \ + src/cntkeygrabber.cpp + +DOCML += resources/contacts_contactcard.docml \ + resources/contacts_ev.docml \ + resources/contacts_mc.docml \ + resources/contacts_if.docml \ + resources/contacts_list.docml \ + resources/contacts_namelist.docml \ + resources/contacts_groupactions.docml \ + resources/contacts_history.docml \ + resources/contacts_editor.docml \ + resources/contacts_sim.docml \ + resources/contacts_favorite.docml \ + resources/contacts_favmember.docml \ + resources/contacts_collections.docml \ + resources/contacts_groupmembers.docml \ + resources/contacts_detail_editor.docml \ + resources/contacts_fetchdialog.docml \ + resources/contacts_settings.docml -RESOURCES += resources\pbkcommonui.qrc +RESOURCES += resources/pbkcommonui.qrc LIBS+= -lhbcore \ -lxqservice \ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_actions.docml --- a/phonebookui/pbkcommonui/resources/contacts_actions.docml Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_contactcard.docml --- a/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Wed Aug 18 09:39:00 2010 +0300 @@ -12,6 +12,9 @@ + + + @@ -33,10 +36,7 @@ - - - @@ -94,9 +94,9 @@ - - - + + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_ev.docml --- a/phonebookui/pbkcommonui/resources/contacts_ev.docml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_ev.docml Wed Aug 18 09:39:00 2010 +0300 @@ -34,9 +34,6 @@ - - - @@ -72,9 +69,9 @@ - - - + + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + + +
diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_groupmembers.docml --- a/phonebookui/pbkcommonui/resources/contacts_groupmembers.docml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_groupmembers.docml Wed Aug 18 09:39:00 2010 +0300 @@ -30,7 +30,7 @@ - +
diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/contacts_if.docml --- a/phonebookui/pbkcommonui/resources/contacts_if.docml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_if.docml Wed Aug 18 09:39:00 2010 +0300 @@ -1,41 +1,38 @@ - + - + - - - - + + - - + - - + + - +
- - - - - + + + + +
@@ -45,9 +42,9 @@ - - - + + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/pbkcommonui.qrc --- a/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Wed Aug 18 09:39:00 2010 +0300 @@ -1,23 +1,23 @@ - contacts_actions.docml - contacts_contactcard.docml - contacts_ev.docml - contacts_mc.docml - contacts_if.docml - contacts_list.docml - contacts_namelist.docml - contacts_groupactions.docml - contacts_history.docml - contacts_editor.docml - contacts_sim.docml - contacts_favorite.docml - contacts_favmember.docml - contacts_collections.docml - contacts_groupmembers.docml - contacts_detail_editor.docml - contacts_settings.docml + contacts_contactcard.docml.bin + contacts_ev.docml.bin + contacts_mc.docml.bin + contacts_if.docml.bin + contacts_list.docml.bin + contacts_namelist.docml.bin + contacts_groupactions.docml.bin + contacts_history.docml.bin + contacts_editor.docml.bin + contacts_sim.docml.bin + contacts_favorite.docml.bin + contacts_favmember.docml.bin + contacts_collections.docml.bin + contacts_groupmembers.docml.bin + contacts_detail_editor.docml.bin + contacts_fetchdialog.docml.bin + contacts_settings.docml.bin style/cnteditviewlistitem.hblistviewitem.widgetml @@ -34,9 +34,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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml --- a/phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml Wed Aug 18 09:39:00 2010 +0300 @@ -5,9 +5,9 @@ - - - + + + @@ -19,14 +19,14 @@ - +
- - + + @@ -34,7 +34,7 @@ - + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css --- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css Wed Aug 18 09:39:00 2010 +0300 @@ -46,6 +46,13 @@ bottom:0.0un; } +CntEditViewHeadingItem::highlight{ + left:0.0un; + right:0.0un; + top:0.0un; + bottom:0.0un; +} + CntEditViewHeadingItem::iconArea{ left:0.0un; right:0.0un; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml --- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml Wed Aug 18 09:39:00 2010 +0300 @@ -22,6 +22,11 @@ + + + + + @@ -42,6 +47,11 @@ + + + + + @@ -62,6 +72,11 @@ + + + + + @@ -78,6 +93,11 @@ + + + + + @@ -90,6 +110,11 @@ + + + + + @@ -102,6 +127,11 @@ + + + + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css --- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css Wed Aug 18 09:39:00 2010 +0300 @@ -1,8 +1,16 @@ -CntEditViewHeadingItem::text{ +CntEditViewHeadingItem[state = "normal"]::text{ + color: var(qtc_groupbox_normal); +} + +CntEditViewHeadingItem[state = "normal"]::second_text{ color: var(qtc_groupbox_normal); } -CntEditViewHeadingItem::second_text{ - color: var(qtc_groupbox_normal); +CntEditViewHeadingItem[state = "pressed"]::text{ + color: var(qtc_groupbox_pressed); } +CntEditViewHeadingItem[state = "pressed"]::second_text{ + color: var(qtc_groupbox_pressed); +} + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 7cbcb2896f0e -r a642906a277a 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 Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,6 @@ +CntFetchMarkAll::counter +{ + color: var(qtc_viewtitle_normal); +} + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml --- a/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml Wed Aug 18 09:39:00 2010 +0300 @@ -11,6 +11,7 @@ + @@ -38,6 +39,7 @@ + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cntimagelabel.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.css Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,4 @@ +CntImageLabel +{ + layout: avatar_layout; +} diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntactionlauncher.cpp --- a/phonebookui/pbkcommonui/src/cntactionlauncher.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntactionlauncher.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -49,6 +49,36 @@ this, SLOT(progress(QContactAction::State))); executed = mContactAction->invokeAction( aContact, aDetail ); } + else + { + progress(QContactAction::FinishedWithErrorState); + } + + return executed; + } + +bool CntActionLauncher::execute( QContact aContact, QContactDetail aDetail, QVariantMap aParameters ) + { + bool executed = false; + QList all = QContactAction::actionDescriptors(mAction, "symbian"); + mContactAction = QContactAction::action( all.first() ); + if ( mContactAction ) + { + if (aContact.preferredDetail(mAction).isEmpty() && (mAction == "call" || mAction == "message" || mAction == "email")) + { + aContact.setPreferredDetail(mAction, aDetail); + //return value will be ignored because we cannot do anything if it fails. + mContactManager->saveContact(&aContact); + } + + connect(mContactAction, SIGNAL(stateChanged(QContactAction::State)), + this, SLOT(progress(QContactAction::State))); + executed = mContactAction->invokeAction( aContact, aDetail, aParameters ); + } + else + { + progress(QContactAction::FinishedWithErrorState); + } return executed; } @@ -67,6 +97,10 @@ this, SLOT(progress(QContactAction::State))); executed = mContactAction->invokeAction( aContact, aDetail ); } + else + { + progress(QContactAction::FinishedWithErrorState); + } return executed; } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntactionpopup_p.cpp --- a/phonebookui/pbkcommonui/src/cntactionpopup_p.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntactionpopup_p.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -40,6 +40,7 @@ mListView = new HbListView(this); mListModel = new QStandardItemModel(this); setAttribute(Qt::WA_DeleteOnClose, true); + mDataItemList.clear(); } CntActionPopupPrivate::~CntActionPopupPrivate() @@ -169,12 +170,13 @@ { buildEmailActionPopup(); } - else + + if(mDataItemList.count()) { - return false; + showPopup(); + return true; } - showPopup(); - return true; + return false; } @@ -194,6 +196,10 @@ mListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum ); QString contactName = mContact->displayLabel(); + if (contactName.isEmpty()) + { + contactName = hbTrId("txt_phob_list_unnamed"); + } HbLabel *label = new HbLabel(); label->setPlainText(contactName); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntaddressviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntbaseselectionview.cpp --- a/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -52,7 +52,7 @@ indexFeedback->setItemView(mListView); mSoftkey = new HbAction(Hb::BackNaviAction, mView); - connect( mSoftkey, SIGNAL(triggered()), this, SLOT(closeView()) ); + connect( mSoftkey, SIGNAL(triggered()), this, SIGNAL(viewClosed()) ); } CntBaseSelectionView::~CntBaseSelectionView() @@ -105,12 +105,4 @@ return mView; } -void CntBaseSelectionView::closeView() -{ - emit viewClosed(); - - CntViewParameters args; - mMgr->back( args ); -} - // EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -108,7 +108,7 @@ if (!p->fetched) { - mThread->scheduleJob(row, p->id); + mThread->scheduleJob(p->id); p->fetched = true; } @@ -163,6 +163,32 @@ } /*! + Adds a row to the model. This is called from addGroup(int localId), so no + real logic in here. + + \param row the first row which is added + \param count amount of rows to be added (not supported) + \param parent not used as all items share the same parent + \return success of the operation +*/ +bool CntCollectionListModel::insertRows(int row, int count, const QModelIndex &parent) +{ + Q_UNUSED(count); + Q_UNUSED(parent); + + if ( !validateRowIndex(row) ) + { + return false; + } + + beginInsertRows(parent, row, row); + + endInsertRows(); + + return true; +} + +/*! Remove given group from the model. Ignore plugin groups. \param localId QContactLocalId of the group that should be removed @@ -184,6 +210,87 @@ } /*! + Add a new group to the model. This also takes care of putting it in the + correct row. + + \param localId QContactLocalId of the group that should be added +*/ +void CntCollectionListModel::addGroup(int localId) +{ + CNT_ENTRY + + QContactDetailFilter groupFilter; + groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); + groupFilter.setValue(QString(QLatin1String(QContactType::TypeGroup))); + + QContactSortOrder sortOrderGroupName; + sortOrderGroupName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldCustomLabel); + sortOrderGroupName.setCaseSensitivity(Qt::CaseInsensitive); + + QList groupsOrder; + groupsOrder.append(sortOrderGroupName); + + QList groupContactIds = d->mContactManager->contactIds(groupFilter, groupsOrder); + + int row = 1; + + for (int i = 0;i < groupContactIds.count();i++) + { + if (groupContactIds.at(i) == localId) + { + row += d->mExtensions.count(); + + CollectionItemPointer item(new CntCollectionItem()); + + QContactFetchHint noRelationshipsFetchHint; + noRelationshipsFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships); + + QContact contact = d->mContactManager->contact(groupContactIds.at(i), noRelationshipsFetchHint); + QContactName contactName = contact.detail(); + QString groupName = contactName.customLabel(); + + if (groupName.isNull()) + { + item->groupName = hbTrId("txt_phob_dblist_unnamed"); + } + else + { + item->groupName = groupName; + } + + item->icon = HbIcon("qtg_large_custom"); + + QList details = contact.details(); + for (int k = 0;k < details.count();k++) + { + if (details.at(k).imageUrl().isValid()) + { + int id = d->mThumbnailManager->getThumbnail(details.at(k).imageUrl().toString()); + d->mIconRequests.insert(id, groupContactIds.at(i)); + break; + } + } + + // contact Id for identification + item->id = groupContactIds.at(i); + item->secondLineText = " "; + item->memberCount = -1; + + d->mList.insert(row, item); + insertRow(row); + break; + } + else if (groupContactIds.at(i) != d->mFavoriteGroupId) + { + row++; + } + } + + CNT_EXIT +} + +/*! Check if list item at given index is coming from an extension plugin or not. \param index the QModelIndex of the list item @@ -247,6 +354,25 @@ } /*! + Get the index for a given group id. + + \param localId the id of the group + \return QModelIndex of the group +*/ +QModelIndex CntCollectionListModel::indexOfGroup(int localId) +{ + for (int i = 0;i < d->mList.count();i++) + { + if (d->mList.at(i)->id == localId && !d->mList.at(i)->isPlugin) + { + return index(i); + } + } + + return QModelIndex(); +} + +/*! Initialize different groups. */ void CntCollectionListModel::doConstruct() @@ -295,24 +421,31 @@ CntUiGroupSupplier* groupSupplier = d->mExtensionManager.pluginAt(i)->groupSupplier(); if (groupSupplier) { - for(int j = 0;j < groupSupplier->groupCount();j++) + if (groupSupplier->isAsynch()) + { + connect(groupSupplier, SIGNAL(groupsReady()), this, SLOT(extensionGroupsReady())); + } + else { - const CntUiExtensionGroup& group = groupSupplier->groupAt(j); - - CollectionItemPointer item(new CntCollectionItem()); - - item->groupName = group.name(); - item->secondLineText = group.extraText(); - item->memberCount = group.memberCount(); - item->icon = HbIcon(group.groupIcon()); - item->secondaryIcon = HbIcon(group.extraIcon()); - - item->id = group.serviceId(); - item->isPlugin = true; - item->fetched = true; - - d->mExtensions.insert(rowCount(), groupSupplier); - d->mList.append(item); + for (int j = 0;j < groupSupplier->groupCount();j++) + { + const CntUiExtensionGroup& group = groupSupplier->groupAt(j); + + CollectionItemPointer item(new CntCollectionItem()); + + item->groupName = group.name(); + item->secondLineText = group.extraText(); + item->memberCount = group.memberCount(); + item->icon = HbIcon(group.groupIcon()); + item->secondaryIcon = HbIcon(group.extraIcon()); + + item->id = group.serviceId(); + item->isPlugin = true; + item->fetched = true; + + d->mExtensions.insert(rowCount(), groupSupplier); + d->mList.append(item); + } } } } @@ -371,7 +504,7 @@ if (details.at(k).imageUrl().isValid()) { int id = d->mThumbnailManager->getThumbnail(details.at(k).imageUrl().toString()); - d->mIconRequests.insert(id, rowCount()); + d->mIconRequests.insert(id, groupContactIds.at(i)); break; } } @@ -450,17 +583,25 @@ \param secondRowText text to be shown in the second row \param memberCount the amount of members the group has (shown in text-3 in HbListViewItem) */ -void CntCollectionListModel::informationUpdated(int row, const QString& secondRowText, int memberCount) +void CntCollectionListModel::informationUpdated(int id, const QString& secondRowText, int memberCount) { CNT_ENTRY - CollectionItemPointer item = d->mList.at(row); - - item->secondLineText = secondRowText; - item->memberCount = memberCount; - - int idx = d->mList.indexOf(item); - emit dataChanged(index(idx, 0), index(idx, 0)); + for (int i = 0;i < d->mList.count();i++) + { + if (d->mList.at(i)->id == id && !d->mList.at(i)->isPlugin) + { + CollectionItemPointer item = d->mList.at(i); + + item->secondLineText = secondRowText; + item->memberCount = memberCount; + + int idx = d->mList.indexOf(item); + emit dataChanged(index(idx, 0), index(idx, 0)); + + break; + } + } CNT_EXIT } @@ -482,15 +623,77 @@ if (error == 0) { - int row = d->mIconRequests.take(id); - - CollectionItemPointer item = d->mList.at(row); + int localId = d->mIconRequests.take(id); - item->icon = HbIcon(pixmap); - - int idx = d->mList.indexOf(item); - emit dataChanged(index(idx, 0), index(idx, 0)); + for (int i = 0;i < d->mList.count();i++) + { + if (d->mList.at(i)->id == localId && !d->mList.at(i)->isPlugin) + { + CollectionItemPointer item = d->mList.at(i); + + item->icon = HbIcon(pixmap); + + int idx = d->mList.indexOf(item); + emit dataChanged(index(idx, 0), index(idx, 0)); + + break; + } + } } CNT_EXIT } + +/*! + Slot to handle asynchronously initiated extension groups. As + these are added right after the static favorites group, this takes + also care of updating the mapping between row and CntUiGroupSuppliers + in case there was already some synchronously loaded extension groups. +*/ +void CntCollectionListModel::extensionGroupsReady() +{ + CntUiGroupSupplier* groupSupplier = static_cast(sender()); + + int addedCount = groupSupplier->groupCount(); + + if (addedCount > 0) + { + QList rowList = d->mExtensions.keys(); + QList supplierList = d->mExtensions.values(); + + d->mExtensions.clear(); + + for (int i = 0;i < rowList.count();i++) + { + int row = rowList.at(i) + addedCount; + CntUiGroupSupplier* supplier = supplierList.at(i); + + d->mExtensions.insert(row, supplier); + } + + + beginInsertRows(QModelIndex(), 1, groupSupplier->groupCount()); + + for (int j = 0;j < groupSupplier->groupCount();j++) + { + const CntUiExtensionGroup& group = groupSupplier->groupAt(j); + + CollectionItemPointer item(new CntCollectionItem()); + + item->groupName = group.name(); + item->secondLineText = group.extraText(); + item->memberCount = group.memberCount(); + item->icon = HbIcon(group.groupIcon()); + item->secondaryIcon = HbIcon(group.extraIcon()); + + item->id = group.serviceId(); + item->isPlugin = true; + item->fetched = true; + + d->mExtensions.insert(1 + j, groupSupplier); + d->mList.insert(1 + j, item); + } + + endInsertRows(); + } +} diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -109,12 +109,11 @@ } /*! - Schedule an asynch job for the given row (model) and contact id. + Schedule an asynch job for the given contact id. - \param row the row in the model - \param id the QContactLocalId of the group in the given row + \param id the QContactLocalId of the group */ -void CntCollectionListModelWorker::scheduleJob(int row, int id) +void CntCollectionListModelWorker::scheduleJob(int id) { CNT_ENTRY @@ -134,7 +133,7 @@ HbApplication::instance()->postEvent(this, new QEvent(QEvent::User)); } - mJobs.append(QPair(row, id)); + mJobs.append(id); mMutex.unlock(); @@ -163,12 +162,10 @@ else { // get next job - QPair pair = mJobs.takeFirst(); - int row = pair.first; - int id = pair.second; + int id = mJobs.takeFirst(); mMutex.unlock(); - fetchInformation(row, id); + fetchInformation(id); } HbApplication::processEvents(); @@ -182,10 +179,9 @@ and the amount of contacts in the group. Emits the result as a signal for CntCollectionListModel to handle. - \param row the row in the model \param id the QContactLocalId of the group in the given row */ -void CntCollectionListModelWorker::fetchInformation(int row, int id) +void CntCollectionListModelWorker::fetchInformation(int id) { CNT_ENTRY @@ -238,9 +234,9 @@ for(int i = 0;i < groupMemberIds.count();i++) { QContactFetchHint nameOnlyFetchHint; - QStringList details; + /*QStringList details; details << QContactDisplayLabel::DefinitionName; - nameOnlyFetchHint.setDetailDefinitionsHint(details); + nameOnlyFetchHint.setDetailDefinitionsHint(details);*/ nameOnlyFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships); QContact contact = mManager->contact(groupMemberIds.at(i), nameOnlyFetchHint); @@ -275,7 +271,7 @@ } } - emit fetchDone(row, secondLineText, memberCount); + emit fetchDone(id, secondLineText, memberCount); CNT_EXIT } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcollectionview.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,12 +16,13 @@ */ #include "cntcollectionview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntgroupdeletepopup.h" #include "cntcollectionlistmodel.h" #include "cntextensionmanager.h" #include "cntglobal.h" #include "cntfavourite.h" +#include "cntdetailconst.h" #include "cntdebug.h" #include @@ -30,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,6 +42,7 @@ #include #include +#include #include const char *CNT_COLLECTIONVIEW_XML = ":/xml/contacts_collections.docml"; @@ -61,7 +63,6 @@ mNewGroupAction(NULL), mDeleteGroupsAction(NULL), mHandledContact(NULL), - mFetchView(NULL), mActionGroup(NULL) { bool ok = false; @@ -98,8 +99,10 @@ groups->setChecked(true); mFindAction = static_cast(mDocumentLoader.findObject("cnt:find")); - mFindAction->setEnabled(false); + connect(mFindAction, SIGNAL(triggered()), this, SLOT(showNamesViewWithFinder())); mExtensionAction = static_cast (mDocumentLoader.findObject("cnt:activity")); + + connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(notifyNewGroup())); } /*! @@ -111,9 +114,6 @@ delete mHandledContact; mHandledContact = NULL; - - delete mFetchView; - mFetchView = NULL; } /*! @@ -159,9 +159,6 @@ mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this); mListView->setModel(mModel); - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleNewGroupMembers())); - CNT_EXIT } @@ -188,6 +185,16 @@ } /*! +Go back to previous view +*/ +void CntCollectionView::showNamesViewWithFinder() +{ + CntViewParameters viewParameters; + viewParameters.insert(EExtraAction, CNT_FIND_ACTION); + mViewManager->back(viewParameters); +} + +/*! Called after user clicked on the listview. */ void CntCollectionView::openGroup(const QModelIndex &index) @@ -227,7 +234,7 @@ else { CntViewParameters viewParameters; - viewParameters.insert(EViewId, FavoritesMemberView); + viewParameters.insert(EViewId, favoritesMemberView); QVariant var; var.setValue(favoriteGroup); viewParameters.insert(ESelectedGroupContact, var); @@ -257,7 +264,7 @@ else { int id = item->modelIndex().data(Qt::UserRole).toInt(); - QVariant data( item->modelIndex().row() ); + QVariant data( id ); int favoriteGrpId = CntFavourite::favouriteGroupId(mViewManager->contactManager(SYMBIAN_BACKEND)); @@ -280,22 +287,20 @@ void CntCollectionView::handleMenu(HbAction* action) { - int row = action->data().toInt(); HbMenu *menuItem = static_cast(sender()); - QModelIndex index = mModel->index(row, 0); - - int id = index.data(Qt::UserRole).toInt(); if ( action == menuItem->actions().first() ) - { + { + int id = action->data().toInt(); + QModelIndex index = mModel->indexOfGroup(id); openGroup(index); - } + } else if (action == menuItem->actions().at(1)) - { - + { + int id = action->data().toInt(); QContact groupContact = getContactManager()->contact(id); deleteGroup(groupContact); - } + } } @@ -307,6 +312,7 @@ HbLineEdit *lineEdit = popup->lineEdit(); lineEdit->setInputMethodHints(Qt::ImhNoPredictiveText); + lineEdit->setMaxLength( CNT_GROUPNAME_MAXLENGTH ); popup->setPromptText(hbTrId("txt_phob_title_new_group_name")); popup->clearActions(); @@ -343,43 +349,81 @@ QSet contactsSet = contactsList.toSet(); // Select some contact(s) to add to the group - QString groupNameCreated(mHandledContact->displayLabel()); - mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupNameCreated), - hbTrId("txt_common_button_save")); - mFetchView->displayContacts(HbAbstractItemView::MultiSelection, contactsSet); + QString groupNameCreated = mHandledContact->displayLabel(); + if (groupNameCreated.isEmpty()) + { + groupNameCreated = hbTrId("txt_phob_list_unnamed"); + } + + 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); - + CntViewParameters viewParameters; viewParameters.insert(EViewId, groupMemberView); + QVariant var; var.setValue(*mHandledContact); viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } - - QString groupNameCreated(mHandledContact->displayLabel()); - HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created")).arg(groupNameCreated)); + else + { + mModel->addGroup(mHandledContact->localId()); + mDeleteGroupsAction->setEnabled(true); + } + notifyNewGroup(); +} - // Refresh the page - refreshDataModel(); +void CntCollectionView::handleCancelGroupMembers() +{ + mSelectedContactsSet.clear(); + mModel->addGroup(mHandledContact->localId()); mDeleteGroupsAction->setEnabled(true); + + notifyNewGroup(); +} - delete mHandledContact; - mHandledContact = NULL; +void CntCollectionView::notifyNewGroup() +{ + if (mHandledContact != NULL) + { + QString groupNameCreated = mHandledContact->displayLabel(); + if (groupNameCreated.isEmpty()) + { + groupNameCreated = hbTrId("txt_phob_list_unnamed"); + } + HbDeviceNotificationDialog::notification(QString(), + HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created")).arg(groupNameCreated)); + + delete mHandledContact; + mHandledContact = NULL; + } } void CntCollectionView::refreshDataModel() { mListView->setModel(0); + delete mModel; - mModel = 0; + mModel = NULL; + mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this); mListView->setModel(mModel); } @@ -388,20 +432,22 @@ { mHandledContact = new QContact(group); QString name = mHandledContact->displayLabel(); + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } HbLabel *headingLabel = new HbLabel(); headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(name)); HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac") - , this, SLOT(handleDeleteGroup(HbAction*)), - hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel); + , this, SLOT(handleDeleteGroup(int)), HbMessageBox::Delete | HbMessageBox::Cancel, + headingLabel); } -void CntCollectionView::handleDeleteGroup(HbAction* action) +void CntCollectionView::handleDeleteGroup(int action) { - HbMessageBox *note = static_cast(sender()); - - if (note && action == note->actions().first()) + if (action == HbMessageBox::Delete) { getContactManager()->removeContact(mHandledContact->localId()); mModel->removeGroup(mHandledContact->localId()); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,6 +16,7 @@ */ #include "cntcontactcardheadingitem.h" +#include "cntdebug.h" #include #include @@ -30,6 +31,8 @@ #include #include #include +#include +#include #include #include #include @@ -48,6 +51,7 @@ mIsFavorite(false), mIsOnline(false) { + HbEffect::add("icon", "groupbox_icon_click", "iconclick"); } CntContactCardHeadingItem::~CntContactCardHeadingItem() @@ -198,7 +202,7 @@ if (!mFrameItem) { mFrameItem = new HbFrameItem(this); - mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox"); + mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal"); mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); mFrameItem->setZValue(-2); style()->setItemName(mFrameItem, "background"); @@ -214,6 +218,10 @@ { initGesture(); } + else + { + ungrabGesture(Qt::TapGesture); + } } void CntContactCardHeadingItem::setIcon(const HbIcon newIcon) @@ -354,16 +362,18 @@ int setting = settingsMng.readItemValue(nameOrderKey, XQSettingsManager::TypeInt).toInt(); QStringList nameList; - QString last; + QString last_first; switch( setting ) { case CntOrderLastFirst: nameList << name.prefix() << name.lastName() << name.firstName() << name.middleName() << name.suffix(); break; case CntOrderLastCommaFirst: - if (!name.lastName().isEmpty()) - last = name.lastName() + ","; - nameList << name.prefix() << last << name.firstName() << name.middleName() << name.suffix(); + if (!name.firstName().isEmpty() && !name.lastName().isEmpty()) + last_first = name.lastName() + ", " + name.firstName(); + else + last_first = !name.firstName().isEmpty() ? name.firstName() : name.lastName(); + nameList << name.prefix() << last_first << name.middleName() << name.suffix(); break; default: // Default to first name last name nameList << name.prefix() << name.firstName() << name.middleName() << name.lastName() << name.suffix(); @@ -432,9 +442,17 @@ case Qt::GestureUpdated: if (tap->tapStyleHint() == HbTapGesture::TapAndHold && mIcon->rect().contains(mapFromScene(tap->position()))) { + HbEffect::cancel(mIcon, QString("iconclick")); processLongPress(tap->position()); } break; + case Qt::GestureStarted: + if (tap->tapStyleHint() == HbTapGesture::Tap && mIcon->rect().contains(mapFromScene(tap->position()))) + { + HbInstantFeedback::play(HbFeedback::Basic); + HbEffect::start(mIcon, QString("icon"), QString("iconclick")); + } + default: break; } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcontactcardview.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -63,6 +63,7 @@ #include "cntactionlauncher.h" #include "cntpresencelistener.h" #include "cntactionpopup.h" +#include "cntvcarddetailhandler.h" #define CNT_MAPTILE_PROGRESS_TIMER 100 //100 msec #define CNT_UNKNOWN_MAPTILE_STATUS -1 @@ -74,7 +75,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), @@ -96,7 +97,9 @@ mSendKeyListModel(NULL), mPresenceListener(NULL), mMaptile(NULL), - mProgressTimer(NULL) + mProgressTimer(NULL), + mIsTemporary(isTemporary), + mIsExecutingAction(false) { bool ok; document()->load(CNT_CONTACTCARDVIEW_XML, &ok); @@ -119,7 +122,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 +172,8 @@ delete mPresenceListener; mPresenceListener = NULL; - delete mMaptile; + + delete mMaptile; mMaptile = NULL; delete mProgressTimer; @@ -195,14 +199,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,13 +225,14 @@ 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*))); - - setOrientation(window->orientation()); + if (window) + { + connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); + window->installEventFilter(this); + + setOrientation(window->orientation()); + } QContact contact = aArgs.value(ESelectedContact).value(); mContact = new QContact( contact ); @@ -234,6 +247,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,19 +260,32 @@ 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); connect(mPresenceListener, SIGNAL(fullPresenceUpdated(bool)), mHeadingItem, SLOT(setOnlineStatus(bool))); + connect(mPresenceListener, SIGNAL(accountPresenceUpdated(const QString&, bool)), + this, SLOT(updateItemPresence(const QString&, bool))); bool online; - mPresenceListener->initialPresences(online); + 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(); @@ -295,13 +327,36 @@ 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")); mPreferredItems.insert(dataItem->action(), item); } + + if (dataItem->detail().definitionName() == QContactOnlineAccount::DefinitionName) + { + for (int i = 0;i < presences.keys().count();i++) + { + QString fullAccount = presences.keys().at(i); + QContactOnlineAccount account = dataItem->detail(); + QString currentFullAccount = account.serviceProvider() + ':' + account.accountUri(); + if (fullAccount == currentFullAccount) + { + if (presences.values().at(i)) + { + dataItem->setSecondaryIcon(HbIcon("qtg_small_online")); + } + mPresenceItems.insert(fullAccount, item); + break; + } + } + } item->setDetails(dataItem); mContainerLayout->addItem(item); @@ -355,7 +410,7 @@ CntContactCardMapTileDetail* detail = new CntContactCardMapTileDetail; if( detail ) { - detail->mContactId = mContact->id().localId(); + detail->mContactId = mContact->localId(); if( dataItem->titleText() == hbTrId("txt_phob_formlabel_address") ) { @@ -395,8 +450,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); @@ -410,8 +465,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 @@ -458,7 +520,7 @@ CntMapTileService::ContactAddressType sourceAddressType = static_cast ( mAddressList[index]->mAddressType ); - QContactLocalId contactId = mContact->id().localId(); + QContactLocalId contactId = mContact->localId(); if( mAddressList[index]->mDetailItem != NULL ) { @@ -557,7 +619,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(); @@ -644,6 +706,27 @@ return maptileLabel; } +/* +* Update the presence status icon of action item with the given accountUri +*/ +void CntContactCardViewPrivate::updateItemPresence(const QString& accountUri, bool online) +{ + CntContactCardDetailItem* item = mPresenceItems.value(accountUri); + + if (item) + { + if (online) + { + mDataContainer->dataItem(item->index())->setSecondaryIcon(HbIcon("qtg_small_online")); + } + else + { + mDataContainer->dataItem(item->index())->setSecondaryIcon(HbIcon()); + } + item->setDetails(mDataContainer->dataItem(item->index())); + } +} + void CntContactCardViewPrivate::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) { CNT_ENTRY @@ -656,7 +739,7 @@ mHeadingItem->setIcon(icon); mVCardIcon = new HbIcon(pixmap); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } CNT_EXIT @@ -668,14 +751,35 @@ void CntContactCardViewPrivate::sendToHs() { QVariantHash preferences; - preferences["contactId"] = mContact->id().localId(); + preferences["contactId"] = mContact->localId(); - XQServiceRequest snd("com.nokia.services.hsapplication.IHomeScreenClient", + XQServiceRequest snd("com.nokia.symbian.IHomeScreenClient", "addWidget(QString,QVariantHash)" ,false); 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(); + } + */ } /*! @@ -721,23 +825,29 @@ */ void CntContactCardViewPrivate::deleteContact() { - QString name = contactManager()->synthesizedDisplayLabel(*mContact); + QString name = contactManager()->synthesizedContactDisplayLabel(*mContact); + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } - HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)), - hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel")); + HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)), + HbMessageBox::Delete | HbMessageBox::Cancel); } /*! Handle action for deleting a contact */ -void CntContactCardViewPrivate::handleDeleteContact(HbAction *action) +void CntContactCardViewPrivate::handleDeleteContact(int action) { - HbMessageBox *note = static_cast(sender()); - - if (note && action == note->actions().first()) + if (action == HbMessageBox::Delete) { - contactManager()->removeContact(mContact->localId()); - mViewManager->back( mArgs ); + disconnect(contactManager(), SIGNAL(contactsRemoved(const QList&)), + this, SLOT(contactDeletedFromOtherSource(const QList&))); + + contactManager()->removeContact(mContact->localId()); + emit backPressed(); + mViewManager->back( mArgs, true ); } } @@ -759,7 +869,7 @@ */ void CntContactCardViewPrivate::deactivate() { - mView->removeEventFilter(this); + } /*! @@ -767,7 +877,8 @@ */ void CntContactCardViewPrivate::sendBusinessCard() { - qDebug() << "CntContactCardViewPrivate::sendBusinessCard - IN"; + CNT_ENTRY + // Check if the contact has an image. QList avatars = mContact->details(); bool imageExists( false ); @@ -800,10 +911,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 } /*! @@ -852,6 +964,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()) @@ -876,6 +997,7 @@ if (detail == aDetail && action == aAction) { detailItem = static_cast(mContainerLayout->itemAt(index)); + break; } } executeAction(aContact, aDetail, aAction, detailItem); @@ -887,6 +1009,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); @@ -895,6 +1026,7 @@ void CntContactCardViewPrivate::actionExecuted(CntActionLauncher* aAction) { aAction->deleteLater(); + mIsExecutingAction = false; } /*! @@ -1063,8 +1195,9 @@ void CntContactCardViewPrivate::handleSendBusinessCard( HbAction* aAction ) { + CNT_ENTRY Q_UNUSED(aAction); - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - IN"; + QList list; /*if ( aAction && aAction->objectName() == "cancel" ) { @@ -1111,21 +1244,28 @@ } } - QString vCardName = QString(mContact->displayLabel().append(".vcf")); + QString vCardName; + if ( mContact->displayLabel().isEmpty() ) { + vCardName = hbTrId("txt_phob_list_unnamed").append(".vcf"); + } else + vCardName = mContact->displayLabel().append(".vcf"); + QString vCardPath = dir.absolutePath().append(QDir::separator()); vCardPath.append(vCardName); vCardPath = QDir::toNativeSeparators(vCardPath); - + QVersitContactExporter exporter; + CntVCardDetailHandler hanlder; + exporter.setDetailHandler(&hanlder); // 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); @@ -1142,7 +1282,8 @@ mShareUi->send(l,false); } } - qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - OUT"; + + CNT_EXIT } @@ -1186,7 +1327,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); } @@ -1200,7 +1341,7 @@ { HbMenu *menu = new HbMenu(); menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(doChangeImage()) ); - if (mAvatar) + if (mAvatar && !mAvatar->imageUrl().isEmpty()) { menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(doRemoveImage()) ); } @@ -1229,17 +1370,24 @@ return mViewManager->contactManager(SYMBIAN_BACKEND); } -void CntContactCardViewPrivate::keyPressed(QKeyEvent *event) +bool CntContactCardViewPrivate::eventFilter(QObject *obj, QEvent *event) { - if (event->key() == Qt::Key_Yes ) + if (event->type() == QEvent::KeyPress && obj == mView->mainWindow()) { - sendKeyPressed(); + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Yes) + { + return sendKeyPressed(); + } } + return false; } -void CntContactCardViewPrivate::sendKeyPressed() +bool CntContactCardViewPrivate::sendKeyPressed() { int count = 0; + bool keyConsumed = false; + for (int index = 0; index < mDataContainer->itemCount(); index++) { CntContactCardDataItem* dataItem = mDataContainer->dataItem(index); @@ -1248,41 +1396,58 @@ count++; } } - if (!count) - { - XQServiceRequest snd("com.nokia.services.logsservices.starter", "start(int,bool)", false); - snd << 0; // all calls - snd << true; // show dialpad - snd.send(); - } - else + + if (count) { QContactDetail preferredDetail = mContact->preferredDetail("call"); if (!preferredDetail.isEmpty()) { - executeAction(*mContact, preferredDetail, "call", NULL); + keyConsumed = true; + executeAction(*mContact, preferredDetail, "call"); } else if (count == 1 ) { - mContact->setPreferredDetail("call", mContact->details().first()); - executeAction( *mContact, mContact->details().first(), "call", NULL); + keyConsumed = true; + executeAction( *mContact, mContact->details().first(), "call"); } else if(count >= 2 && mAcceptSendKey) - { + { + keyConsumed = true; mAcceptSendKey = false; CntActionPopup *actionPopup = new CntActionPopup(mContact); actionPopup->showActionPopup("call"); connect( actionPopup, SIGNAL(executeContactAction(QContact&, QContactDetail, QString)), this, SLOT(executeAction(QContact&, QContactDetail, QString))); connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, - SLOT(sendKeyCancelSlot())); - + SLOT(sendKeyCancelSlot())); + } + else + { + //ignore } } + + return keyConsumed; } void CntContactCardViewPrivate::sendKeyCancelSlot() { 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -34,7 +34,6 @@ #include "cntgroupactionsview.h" #include "cnthistoryview.h" #include "cnteditview.h" -#include "cntmycardselectionview.h" #include "cntimportsview.h" #include "cntsettingsview.h" #include "cntextensionmanager.h" @@ -57,17 +56,15 @@ { case namesView: return new CntNamesView(*mExtensionManager); - case commLauncherView: + case contactCardView: return new CntContactCardView(); case myCardView: return new CntMyCardView(); - case myCardSelectionView: - return new CntMyCardSelectionView(); case collectionView: return new CntCollectionView(*mExtensionManager); case collectionFavoritesView: return new CntFavoritesView(); - case FavoritesMemberView: + case favoritesMemberView: return new CntFavoritesMemberView(); case editView: return new CntEditView(); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Wed Aug 18 09:39:00 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(); @@ -192,10 +193,6 @@ { connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deleteOldView())); } - else - { - mMainWindow->setInteractive( true ); - } CNT_EXIT } @@ -209,28 +206,22 @@ if (mOldView) { mOldView->deactivate(); - - // Due to something strange in wk16, this check will fail occationally and cause - // a memory leak... most likely when opening edit view for the first time - if (mCurrent == NULL || !mOldView->view()->isVisible()) + + HbView* oldView = mOldView->view(); + mMainWindow->removeView( oldView ); + + if (!mOldView->isDefault()) { - mMainWindow->removeView(mOldView->view()); - - if (!mOldView->isDefault()) - { - delete mOldView; - mOldView = NULL; - } - // If view id is not in defaults list, it means that view has changed - // its opinnion about preserving state to true. - else if ( !mDefaults.contains(mOldView->viewId()) ) - { - mDefaults.insert( mOldView->viewId(), mOldView ); - } + delete mOldView; + mOldView = NULL; + } + // If view id is not in defaults list, it means that view has changed + // its opinnion about preserving state to true. + else if ( !mDefaults.contains(mOldView->viewId()) ) + { + mDefaults.insert( mOldView->viewId(), mOldView ); } } - - mMainWindow->setInteractive(true); CNT_EXIT } @@ -238,8 +229,7 @@ void CntDefaultViewManager::switchView(const CntViewParameters aArgs, QFlags flags) { CNT_ENTRY - - mMainWindow->setInteractive(false); + int id = aArgs.value(EViewId).toInt(); if ( id != noView ) { @@ -268,4 +258,10 @@ CNT_EXIT } + +int CntDefaultViewManager::currentViewId() +{ + return mCurrent->viewId(); +} + // End of File diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdetaileditor.cpp --- a/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -17,7 +17,9 @@ #include "cntdetaileditor.h" #include "cnteditorfactory.h" #include "cntgroupeditormodel.h" +#include "cntsavemanager.h" #include "cntglobal.h" + #include #include #include @@ -29,6 +31,13 @@ #include #include #include +#include +#include +#include +#include + +#include +#include const char *CNT_DETAILEDITOR_XML = ":/xml/contacts_detail_editor.docml"; @@ -41,7 +50,8 @@ mLoader(NULL), mViewManager(NULL), mEditorFactory(NULL), - mCancel(NULL) + mCancel(NULL), + mSaveManager(NULL) { bool ok; document()->load(CNT_DETAILEDITOR_XML, &ok); @@ -57,16 +67,27 @@ mSoftkey = new HbAction(Hb::BackNaviAction, mView); connect( mSoftkey, SIGNAL(triggered()), this, SLOT(saveChanges()) ); + + // closing the application from task swapper or end key will cause the contact to be saved + connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveContact())); } CntDetailEditor::~CntDetailEditor() { mView->deleteLater(); + delete mDataForm; + mDataForm = NULL; delete mDataFormModel; + mDataFormModel = NULL; delete mHeader; + mHeader = NULL; delete mLoader; + mLoader = NULL; delete mEditorFactory; + mEditorFactory = NULL; + delete mSaveManager; + mSaveManager = NULL; } void CntDetailEditor::setViewId( int aId ) @@ -106,8 +127,31 @@ 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(); + QContactLocalId localId = selectedContact.localId(); + QContactLocalId selfContactId = mViewManager->contactManager(SYMBIAN_BACKEND)->selfContactId(); + bool isMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty(); + + if (isMyCard) + { + mSaveManager = new CntSaveManager(CntSaveManager::EMyCard); + } + else if ( mId == groupEditorView ) + { + mSaveManager = new CntSaveManager(CntSaveManager::EGroup); + } + else + { + mSaveManager = new CntSaveManager(); + } + mDataForm->setItemRecycling(true); // add new field if required @@ -115,6 +159,9 @@ { mDataFormModel->insertDetailField(); } + mDataForm->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded); + mDataForm->setScrollingStyle(HbScrollArea::PanWithFollowOn); + mDataForm->verticalScrollBar()->setInteractive(true); } void CntDetailEditor::deactivate() @@ -123,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 @@ -151,27 +202,42 @@ void CntDetailEditor::handleItemShown(const QModelIndex& aIndex ) { - if ( mId == groupEditorView ) - { - CntGroupEditorModel* groupModel = static_cast( mDataFormModel ); - if ( groupModel->isConferenceNumber(aIndex) ) - { - HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); - HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); - edit->setInputMethodHints( Qt::ImhDialableCharactersOnly ); - } - } - else + HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex ); + + if ( modelItem->type() == HbDataFormModelItem::TextItem ) { HbDataFormViewItem* viewItem = static_cast(mDataForm->itemByIndex( aIndex )); HbLineEdit* edit = static_cast( viewItem->dataItemContentWidget() ); - edit->setInputMethodHints( Qt::ImhNoPredictiveText ); + QString objName; - HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex ); - if (modelItem->contentWidgetData( "preferDigits" ).toBool()) + if ( mId == groupEditorView ) { - edit->setInputMethodHints( Qt::ImhPreferNumbers ); + 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 + { + edit->setInputMethodHints( Qt::ImhNoPredictiveText ); + + if (modelItem->contentWidgetData( "preferDigits" ).toBool()) + { + edit->setInputMethodHints( Qt::ImhPreferNumbers ); + } + + objName = mDataFormModel->detail().definitionName() + " line edit %1"; + } + + // Naming UI components for automation testability + edit->setObjectName(objName.arg(aIndex.row())); } } @@ -184,6 +250,10 @@ mViewManager->back( mArgs ); } +/*! + Saves all changes made to details (type of details depends on + in which editor we are) of a contact. Doesn't save the contact. +*/ void CntDetailEditor::saveChanges() { mDataFormModel->saveContactDetails(); @@ -208,6 +278,46 @@ mViewManager->back( mArgs ); } +/*! + First saves all changes made to details (type of details depends on + in which editor we are) of a contact and then saves the contact. This + is only called when phonebook is being closed either from task swapper + or by end key. +*/ +void CntDetailEditor::saveContact() +{ + mDataFormModel->saveContactDetails(); + + QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mDataFormModel->contact()); + + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } + + CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mDataFormModel->contact(), mViewManager->contactManager(SYMBIAN_BACKEND)); + + if (mId != groupEditorView) + { + switch (result) + { + case CntSaveManager::ESaved: + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name)); + break; + case CntSaveManager::EUpdated: + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name)); + break; + case CntSaveManager::EFailed: + HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!")); + break; + case CntSaveManager::EDeleted: + case CntSaveManager::ENothingDone: + default: + break; + } + } +} + void CntDetailEditor::setHeader(QString aHeader) { if (!mHeader) { @@ -236,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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdetailpopup.cpp --- a/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntdocumentloader.cpp --- a/phonebookui/pbkcommonui/src/cntdocumentloader.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdocumentloader.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cnteditview_p.cpp --- a/phonebookui/pbkcommonui/src/cnteditview_p.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditview_p.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -21,7 +21,9 @@ #include "cntdetailpopup.h" #include "cnteditviewheadingitem.h" #include "cntimagelabel.h" +#include "cntsavemanager.h" #include "cntglobal.h" +#include "cntdebug.h" #include #include @@ -39,17 +41,22 @@ #include #include #include -#include +#include + +#include +#include +#include const char *CNT_EDIT_XML = ":/xml/contacts_ev.docml"; CntEditViewPrivate::CntEditViewPrivate() : -mModel( NULL ), -mImageLabel( NULL ), -mThumbnailManager( NULL ), -mContact( NULL ), -mReq(0), -mMenu(NULL) + mModel( NULL ), + mImageLabel( NULL ), + mThumbnailManager( NULL ), + mContact( NULL ), + mReq(NULL), + mMenu(NULL), + mSaveManager(NULL) { mDocument = new CntDocumentLoader; @@ -93,19 +100,30 @@ connect( mHeading, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) ); connect( mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(activated(const QModelIndex&)) ); connect( mListView, SIGNAL(longPressed(HbAbstractViewItem*,const QPointF&)), this, SLOT(longPressed(HbAbstractViewItem*,const QPointF&)) ); + + // closing the application from task swapper or end key will cause the contact to be saved + connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveChanges())); } CntEditViewPrivate::~CntEditViewPrivate() { mView->deleteLater(); + delete mDocument; + mDocument = NULL; delete mModel; + mModel = NULL; delete mContact; + mContact = NULL; if (mMenu) { delete mMenu; + mMenu = NULL; } delete mThumbnailManager; + mThumbnailManager = NULL; + delete mSaveManager; + mSaveManager = NULL; } void CntEditViewPrivate::setOrientation(Qt::Orientation orientation) @@ -124,6 +142,8 @@ void CntEditViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) { + CNT_ENTRY + mMgr = aMgr; mArgs = aArgs; @@ -150,7 +170,16 @@ QContactLocalId localId = mContact->localId(); QContactManager* cm = mMgr->contactManager(SYMBIAN_BACKEND); QContactLocalId selfContactId = cm->selfContactId(); - mIsMyCard = ( localId == selfContactId && localId != 0 ) || myCard == "myCard"; + mIsMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty(); + + if (mIsMyCard) + { + mSaveManager = new CntSaveManager(CntSaveManager::EMyCard); + } + else + { + mSaveManager = new CntSaveManager(); + } if ( mHeading ) mHeading->setDetails( mContact, mIsMyCard ); @@ -195,6 +224,8 @@ this, SLOT(thumbnailReady(QPixmap, void*, int, int)) ); loadAvatar(); + + CNT_EXIT } void CntEditViewPrivate::deactivate() @@ -321,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 ); @@ -423,31 +456,36 @@ if ( mIsMyCard ) { HbMessageBox::question(hbTrId("txt_phob_dialog_remove_all_personal_data_from_my_c"), this, - SLOT(handleDeleteContact(HbAction*)), - hbTrId("txt_common_button_yes"), - hbTrId("txt_common_button_no")); + SLOT(handleDeleteContact(int)), + HbMessageBox::Yes | HbMessageBox::No); } else { QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND ); - QString name = cm->synthesizedDisplayLabel( *mContact ); - HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)), - hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel")); + QString name = cm->synthesizedContactDisplayLabel( *mContact ); + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } + + HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)), + HbMessageBox::Delete | HbMessageBox::Cancel); } } -void CntEditViewPrivate::handleDeleteContact(HbAction *action) +void CntEditViewPrivate::handleDeleteContact(int action) { Q_Q(CntEditView); - - HbMessageBox *dlg = static_cast(sender()); - if(dlg && action == dlg->actions().first()) + + if(action == HbMessageBox::Yes || action == HbMessageBox::Delete) { 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 ); } } @@ -459,155 +497,79 @@ // 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); - - QContactManager* mgr = mMgr->contactManager( SYMBIAN_BACKEND ); - bool isSavedContact = mContact->localId() > 0; - // if the contact is really changed or a new one - if ( (*mContact) != mgr->contact(mContact->localId()) || !isSavedContact ) + QString name = mMgr->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact); + + if (name.isEmpty()) { - int detailCount = mContact->details().count(); - - setPreferredDetails( mContact ); - - // If its a new contact - if ( !isSavedContact ) - { - if ( detailCount > 2 ) - { - bool success = mgr->saveContact( mContact ); - if ( success && mIsMyCard ) - { - mgr->setSelfContactId( mContact->localId() ); - } - - QString name = mgr->synthesizedDisplayLabel( *mContact ); - if (name.isEmpty()) - { - name = hbTrId("txt_phob_dblist_unnamed"); - } - - if ( success ) - { - emit q->contactUpdated(1); - HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name)); - } - else - { - emit q->contactUpdated(0); - //TODO: localization is missing - HbDeviceNotificationDialog::notification(QString(),qtTrId("SAVING FAILED!")); - } - - QVariant var; - var.setValue(*mContact); - mArgs.insert(ESelectedContact, var); - mArgs.insert(ESelectedAction, CNT_CREATE_ACTION); - } - else - { - // nothing happened to the contact. Flags should be used - emit q->contactUpdated(-2); - } - } - else - { - // contact details has been cleared out. - if ( detailCount <= 4 ) - { - // get the contact from database, it should have the name still in it, - // and show the delete notification to user - QContact c = mgr->contact( mContact->localId() ); - - bool success = mgr->removeContact( mContact->localId() ); - emit q->contactRemoved(success); - } - else - { - bool success = mgr->saveContact(mContact); - - QString name = mgr->synthesizedDisplayLabel( *mContact ); - if (name.isEmpty()) - { - name = hbTrId("txt_phob_dblist_unnamed"); - } - - if ( success ) - { - emit q->contactUpdated(1); - HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name)); - mArgs.insert(ESelectedAction, CNT_EDIT_ACTION); - } - else - { - emit q->contactUpdated(0); - //TODO: localization is missing - HbDeviceNotificationDialog::notification(QString(),qtTrId("SAVING FAILED!")); - } - - QVariant var; - var.setValue(*mContact); - mArgs.insert(ESelectedContact, var); - } - } - } - else - { - emit q->changesDiscarded(); + name = hbTrId("txt_phob_list_unnamed"); } - mMgr->back( mArgs ); -} - -void CntEditViewPrivate::setPreferredDetails( QContact* aContact ) -{ - QList numberList( aContact->details() ); - //set preferred number for call if there is only one phone number - if ( aContact->preferredDetail("call").isEmpty() && numberList.count() == 1 ) - { - aContact->setPreferredDetail( "call", numberList.first() ); - } - //set preferred number for message if there is only one mobile phone number - if ( aContact->preferredDetail("message").isEmpty() && numberList.count() >= 1 ) + CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mContact, mMgr->contactManager(SYMBIAN_BACKEND)); + + QVariant var; + bool backToRoot(false); + + switch (result) { - int mobileNumbers = 0; - int mobileNumberIndex = -1; - for (int i = 0; i < numberList.count(); i++) - { - if (numberList.at(i).subTypes().count() && numberList.at(i).subTypes().first() == QContactPhoneNumber::SubTypeMobile) - { - mobileNumbers++; - mobileNumberIndex = i; - } - } - if ( mobileNumbers == 1 ) - { - aContact->setPreferredDetail( "message", numberList.at(mobileNumberIndex) ); - } + case CntSaveManager::ESaved: + emit q->contactUpdated(KCntServicesReturnValueContactSaved); + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name)); + var.setValue(*mContact); + mArgs.insert(ESelectedContact, var); + mArgs.insert(ESelectedAction, CNT_CREATE_ACTION); + break; + case CntSaveManager::EUpdated: + emit q->contactUpdated(KCntServicesReturnValueContactSaved); + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name)); + var.setValue(*mContact); + mArgs.insert(ESelectedContact, var); + mArgs.insert(ESelectedAction, CNT_EDIT_ACTION); + break; + case CntSaveManager::EFailed: + emit q->contactUpdated(KCntServicesReturnValueContactNotModified); + HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!")); + break; + case CntSaveManager::EDeleted: + emit q->contactRemoved(true); + backToRoot = true; + break; + case CntSaveManager::ENothingDone: + default: + emit q->contactUpdated(KCntServicesReturnValueContactNotModified); + break; } - QList emailList( aContact->details() ); - //set preferred number for email if there is only one email address - if ( aContact->preferredDetail("email").isEmpty() && emailList.count() == 1 ) + + if ( mArgs.value( EExtraAction ).toString() == CNT_ROOT_ACTION ) { - aContact->setPreferredDetail( "email", emailList.first() ); - } + backToRoot = true; + } + + mMgr->back( mArgs, backToRoot ); } - void CntEditViewPrivate::openNameEditor() { QVariant var; @@ -670,7 +632,7 @@ mHeading->setIcon(icon); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } } @@ -744,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 ) @@ -783,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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp --- a/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -38,11 +39,13 @@ mLabel(NULL), mSecondLabel(NULL), mFrameItem(NULL), + mFocusItem(NULL), mIconTouchArea(NULL), mIconFocused(false), mTextFocused(false) { - + HbEffect::add("icon", "groupbox_icon_click", "iconclick"); + setProperty("state", "normal"); } CntEditViewHeadingItem::~CntEditViewHeadingItem() @@ -113,12 +116,22 @@ if (!mFrameItem) { mFrameItem = new HbFrameItem(this); - mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox"); + mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal"); mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); mFrameItem->setZValue(-2); style()->setItemName(mFrameItem, "background"); } + if (!mFocusItem) + { + mFocusItem = new HbFrameItem(this); + mFocusItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_pressed"); + mFocusItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mFocusItem->setZValue(-1); + mFocusItem->setVisible(false); + style()->setItemName(mFocusItem, "highlight"); + } + if (!mIconTouchArea) { mIconTouchArea = new HbTouchArea(this); @@ -152,6 +165,20 @@ void CntEditViewHeadingItem::updatePrimitives() { HbWidget::updatePrimitives(); + if (mTextFocused) + { + mFocusItem->setVisible(true); + setProperty("state", "pressed"); + } + else if (mIconFocused) + { + HbEffect::start(mIcon, QString("icon"), QString("iconclick")); + } + else + { + mFocusItem->setVisible(false); + setProperty("state", "normal"); + } } void CntEditViewHeadingItem::setDetails(const QContact* contact, bool myCard) @@ -171,16 +198,18 @@ KCntNameOrdering); int setting = settingsMng.readItemValue(nameOrderKey, XQSettingsManager::TypeInt).toInt(); QStringList nameList = QStringList(); - QString last; + QString last_first; switch( setting ) { case CntOrderLastFirst: nameList << name.prefix() << name.lastName() << name.firstName() << name.middleName() << name.suffix(); break; case CntOrderLastCommaFirst: - if (!name.lastName().isEmpty()) - last = name.lastName() + ","; - nameList << name.prefix() << last << name.firstName() << name.middleName() << name.suffix(); + if (!name.firstName().isEmpty() && !name.lastName().isEmpty()) + last_first = name.lastName() + ", " + name.firstName(); + else + last_first = !name.firstName().isEmpty() ? name.firstName() : name.lastName(); + nameList << name.prefix() << last_first << name.middleName() << name.suffix(); break; default: // Default to first name last name nameList << name.prefix() << name.firstName() << name.middleName() << name.lastName() << name.suffix(); @@ -231,10 +260,12 @@ if (mIconTouchArea->rect().contains(event->pos())) { mIconFocused = true; + updatePrimitives(); } else if (rect().contains(event->pos())) { mTextFocused = true; + updatePrimitives(); } event->accept(); @@ -249,6 +280,7 @@ else if ((!rect().contains(event->pos()) || mIconTouchArea->rect().contains(event->pos())) && mTextFocused) { mTextFocused = false; + updatePrimitives(); } event->accept(); } @@ -259,11 +291,13 @@ if (mIconTouchArea->rect().contains(event->pos()) && mIconFocused) { mIconFocused = false; + updatePrimitives(); emit iconClicked(); } else if (rect().contains(event->pos()) && !mIconTouchArea->rect().contains(event->pos()) && mTextFocused) { mTextFocused = false; + updatePrimitives(); emit textClicked(); } event->accept(); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntfavoritesview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,407 @@ +/* +* 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; + delete mModel; +} + +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 ); + qreal popupHeight = mPopup->mainWindow()->layoutRect().height(); + mPopup->setMinimumHeight(popupHeight); + 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 ); + qreal popupHeight = mPopup->mainWindow()->layoutRect().height(); + mPopup->setMinimumHeight(popupHeight); + 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp --- a/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,353 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cntfetchcontactsview.h" - -/*! -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; - - delete mVirtualKeyboard; - mVirtualKeyboard = NULL; - - delete mIndexFeedback; - mIndexFeedback = 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); - } -} - -/*! -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 - heading->size().height(); - 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 - heading->size().height(); - - if (mEmptyListLabel) { - mEmptyListLabel->setMaximumHeight( heightToSet - mEmptyListLabel->size().height() ); - } - - 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) { - mPopup->close(); - } -} - -void CntFetchContacts::doInitialize(HbAbstractItemView::SelectionMode aMode, - QSet aContacts) -{ - mSelectionMode = aMode; - mCurrentlySelected = aContacts; - - if (!mPopup) { - mPopup = new HbDialog; - } - - 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(hbTrId(mButtonText.toAscii())); - mPopup->addAction(mPrimaryAction); - } - - if (!mSecondaryAction) { - mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); - 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntfetchmarkall.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntfetchmarkall.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "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) ); + + if ( mSelectionCount < mContactCount ) + { + blockSignals( true ); + mCheckBox->setCheckState( Qt::Unchecked ); + blockSignals( false ); + } +} + +CntFetchMarkAll::~CntFetchMarkAll() +{ + delete mCheckBox; + mCheckBox = NULL; + delete mCounterLabel; + mCounterLabel = NULL; + delete mFrame; + mFrame = NULL; +} + +// EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntgroupactionsview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,6 +16,10 @@ */ #include "cntgroupactionsview.h" +#include "cntactionlauncher.h" +#include "cntglobal.h" + +#include #include #include @@ -30,7 +34,12 @@ #include #include #include +#include +#include +#include +#include "cntactionlauncher.h" +#include #include const char *CNT_GROUPACTIONSVIEW_XML = ":/xml/contacts_groupactions.docml"; @@ -39,7 +48,9 @@ mGroupContact(NULL), mModel(NULL), mViewManager(NULL), -mListView(NULL) +mListView(NULL), +mPopupCount(0), +mIsExecutingAction(false) { bool ok = false; mDocumentLoader.load(CNT_GROUPACTIONSVIEW_XML, &ok); @@ -120,9 +131,12 @@ mGroupContact = new QContact(aArgs.value(ESelectedGroupContact).value()); mViewManager = aMgr; - QContactName groupContactName = mGroupContact->detail( QContactName::DefinitionName ); - QString groupName(groupContactName.value( QContactName::FieldCustomLabel )); - + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); + if (groupName.isEmpty()) + { + groupName = hbTrId("txt_phob_list_unnamed"); + } //group box HbGroupBox* groupBox = static_cast(mDocumentLoader.findWidget(QString("groupBox"))); @@ -145,24 +159,32 @@ QContactPhoneNumber confCallNumber = mGroupContact->detail(); if(!confCallNumber.number().isEmpty()) - { + { /* * Internationalization support, activate the following code * when support available from Orbit */ //populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),HbNumberGrouping::formatPhoneNumber(confCallNumber.number())); - populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),confCallNumber.number()); - } + populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),confCallNumber.number(),"call"); + } - populatelist(hbTrId("txt_phob_dblist_send_message"),HbIcon("qtg_large_message_group"),hbTrId("txt_phob_dblist_send_message_val_members")); - populatelist(hbTrId("txt_phob_dblist_email"),HbIcon("qtg_large_email_group"),hbTrId("txt_phob_dblist_send_message_val_members")); + populatelist(hbTrId("txt_phob_dblist_send_message"),HbIcon("qtg_large_message_group"),hbTrId("txt_phob_dblist_send_message_val_members"),"message"); + populatelist(hbTrId("txt_phob_dblist_email"),HbIcon("qtg_large_email_group"),hbTrId("txt_phob_dblist_send_message_val_members"),"email"); mListView->setModel(mModel); mListView->setSelectionMode(HbAbstractItemView::NoSelection); + connect(mListView, SIGNAL(activated(const QModelIndex&)), + this, SLOT(listItemSelected(const QModelIndex&))); + + HbMainWindow* window = mView->mainWindow(); + if (window) + { + window->installEventFilter(this); + } } -void CntGroupActionsView:: populatelist(QString primaryText,HbIcon icon,QString secondaryText) +void CntGroupActionsView::populatelist(QString primaryText,HbIcon icon,QString secondaryText,QString action) { QList items; QStandardItem *labelItem = new QStandardItem(); @@ -173,7 +195,172 @@ labelItem->setData(textList, Qt::DisplayRole); labelItem->setData(icon, Qt::DecorationRole); + labelItem->setData(action, Qt::UserRole+1); items << labelItem ; mModel->appendRow(items); } + +void CntGroupActionsView::listItemSelected(const QModelIndex &index) +{ + if (index.isValid()) { + //reset flags + mPopupCount=0; + mEmailActionParams.clear(); + mMessageActionParams.clear(); + + QString action = mModel->item(index.row())->data(Qt::UserRole+1).toString(); + + //conference call + if (action.compare("call", Qt::CaseInsensitive) == 0 ) { + CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action); + connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*))); + other->execute(*mGroupContact, QContactDetail()); + } + //group email, message + else { + QContactRelationshipFilter relationshipFilter; + relationshipFilter.setRelationshipType(QContactRelationship::HasMember); + relationshipFilter.setRelatedContactRole(QContactRelationship::First); + relationshipFilter.setRelatedContactId(mGroupContact->id()); + QList groupMembers = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(relationshipFilter); + + for (int i = 0;icontactManager(SYMBIAN_BACKEND)->contact(groupMembers.at(i)); + QContactDetail preferredDetail = contact.preferredDetail(action); + //use preferred detail if exits + if (!preferredDetail.isEmpty()) { + if(action.compare("message", Qt::CaseInsensitive) == 0) { + QContactPhoneNumber phoneNumber = contact.detail(); + mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel())); + } + else { + QContactEmailAddress email = contact.detail(); + mEmailActionParams.append(email.emailAddress()); + } + } + else { + CntActionPopup *actionPopup = new CntActionPopup(&contact); + if(actionPopup->showActionPopup(action)) { + //increment actionpopup counter + mPopupCount++; + + connect( actionPopup, SIGNAL(executeContactAction(QContact&, QContactDetail, QString)), this, + SLOT(executeAction(QContact&, QContactDetail, QString))); + connect(actionPopup, SIGNAL(actionPopupCancelPressed()), this, SLOT(actionCancelled())); + } + else { + delete actionPopup; + } + } + } + //no popup dialog, execute action + if (mPopupCount==0) { + QVariantMap map; + QVariant params; + 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*))); + other->execute(*mGroupContact, QContactDetail(), map); + } + } + } +} + +void CntGroupActionsView::executeAction(QContact& contact, QContactDetail detail, QString action) +{ + Q_UNUSED(contact); + + if (action.compare("message", Qt::CaseInsensitive) == 0) { + QContactPhoneNumber phoneNumber = static_cast(detail); + mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel())); + } + else if (action.compare("email", Qt::CaseInsensitive) == 0) { + QContactEmailAddress email = static_cast(detail); + mEmailActionParams.append(email.emailAddress()); + } + + //actionpopup executed, decrement counter + mPopupCount--; + if (mPopupCount==0) { + QVariantMap map; + QVariant params; + 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*))); + other->execute(*mGroupContact, QContactDetail(), map); + } +} + +bool CntGroupActionsView::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::KeyPress && obj == mView->mainWindow()) + { + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Yes) + { + return sendKeyPressed(); + } + } + return false; +} + +bool CntGroupActionsView::sendKeyPressed() +{ + QList numberDetails = mGroupContact->details(); + bool keyConsumed = false; + + // check if conference call number is present + if (!numberDetails.isEmpty()) + { + executeConferenceCallAction( *mGroupContact, mGroupContact->details().first(), "call"); + + keyConsumed = true; + } + + return keyConsumed; +} + +void CntGroupActionsView::executeConferenceCallAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction) +{ + if (mIsExecutingAction) + { + return; + } + else + { + mIsExecutingAction = true; + } + + CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), aAction); + connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*))); + other->execute(aContact, aDetail); +} + +void CntGroupActionsView::actionCancelled() +{ + //actionpopup cancelled, decrement counter + mPopupCount--; +} + + +void CntGroupActionsView::actionExecuted(CntActionLauncher* aAction) +{ + //cleanup + aAction->deleteLater(); + mIsExecutingAction = false; +} + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp --- a/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -22,10 +22,10 @@ #include #include #include +#include CntGroupDeletePopup::CntGroupDeletePopup(QContactManager *manager, QGraphicsItem *parent): HbSelectionDialog(parent), - mListView(0), mContactManager(manager), mModel(0) { @@ -44,41 +44,30 @@ headingLabel->setHeading(hbTrId("txt_phob_opt_delete_groups")); setHeadingWidget(headingLabel); - - mListView = new HbListView(this); - + + setSelectionMode( HbAbstractItemView::MultiSelection ); mModel->initializeGroupsList(); - - //Get the index of the contacts - // Set the select option for those contacts in the selectionModel - mListView->setModel(mModel); - // set the listview to multiSelection mode, this will bring MarkAll functionality (from Orbit) - mListView->setSelectionMode(HbAbstractItemView::MultiSelection); - mListView->setFrictionEnabled(true); - mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); - - HbListViewItem *prototype = mListView->listItemPrototype(); - prototype->setGraphicsSize(HbListViewItem::Thumbnail); - prototype->setStretchingStyle(HbListViewItem::StretchLandscape); - - setContentWidget(mListView); - - setTimeout(HbDialog::NoTimeout); - setDismissPolicy(HbDialog::NoDismiss); - setModal(true); - setAttribute(Qt::WA_DeleteOnClose, true); - + setModel(mModel); clearActions(); HbAction *mPrimaryAction = new HbAction(hbTrId("txt_phob_button_delete_selected"), this); addAction(mPrimaryAction); HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), this); addAction(mSecondaryAction); + + setTimeout(HbDialog::NoTimeout); + setDismissPolicy(HbDialog::NoDismiss); + setAttribute(Qt::WA_DeleteOnClose, true); + setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum ); + + qreal heightToSet = mainWindow()->layoutRect().height(); + setMinimumHeight(heightToSet); } QList CntGroupDeletePopup::deleteGroup() const { - QModelIndexList indexes = mListView->selectionModel()->selection().indexes(); + + QModelIndexList indexes = selectedModelIndexes(); QList selectionList; for (int i = 0; i < indexes.count(); i++) { diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp --- a/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -31,7 +31,7 @@ nameDetails.append(emptyName); } - QList numberDetails = CntDetailOrderingHelper::getOrderedSupportedPhoneNumbers(*mContact); + QList numberDetails = mContact->details(); if (numberDetails.isEmpty()) { QContactPhoneNumber emptyNumber; @@ -46,6 +46,7 @@ iNumberItem = new HbDataFormModelItem(type, hbTrId("txt_phob_formlabel_conference_number")); iNameItem->setContentWidgetData("text", iGroupName.customLabel()); + iNameItem->setContentWidgetData("maxLength", CNT_GROUPNAME_MAXLENGTH); iNumberItem->setContentWidgetData("text", iGroupConfCallNumber.number() ); HbDataFormModelItem* root = invisibleRootItem(); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntgroupmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,30 +16,8 @@ */ #include "cntgroupmemberview.h" -#include "cntfetchcontactsview.h" -#include "cntcontactcardheadingitem.h" -#include "cntglobal.h" -#include "cntimagelabel.h" -#include "cntimageutility.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cntdocumentloader.h" - -const char *CNT_GROUPMEMBERVIEW_XML = ":/xml/contacts_groupmembers.docml"; +#include "cntgroupmemberview_p.h" +#include "cntabstractviewmanager.h" /*! \class CntGroupMemberView @@ -56,454 +34,44 @@ \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0) */ -CntGroupMemberView::CntGroupMemberView() : - mGroupContact(NULL), - mViewManager(NULL), - mHeadingItem(NULL), - mModel(NULL), - mImageLabel(NULL), - mListView(NULL), - mFetchView(NULL), - mAvatar(NULL) +CntGroupMemberView::CntGroupMemberView() : d_ptr(new CntGroupMemberViewPrivate()) { - mDocument = new CntDocumentLoader; - - bool ok; - mDocument->load( CNT_GROUPMEMBERVIEW_XML, &ok ); - if ( !ok ){ - qFatal( "Unable to load %S", CNT_GROUPMEMBERVIEW_XML ); - } - - mView = static_cast( mDocument->findWidget("view") ); - - //back button - mSoftkey = new HbAction(Hb::BackNaviAction, mView); - connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView())); - - mImageLabel = static_cast(mDocument->findWidget("editViewImage")); - connect( mImageLabel, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) ); - connect( mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)) ); - - mListView = static_cast( mDocument->findWidget("listView") ); - connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this, - SLOT(showContextMenu(HbAbstractViewItem*,QPointF))); - connect(mListView, SIGNAL(activated (const QModelIndex&)), this, - SLOT(showContactView(const QModelIndex&))); - - mHeadingItem = static_cast( mDocument->findWidget("editViewHeading") ); - connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(openImageEditor()) ); - connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&))); - - // menu actions - mEditGroupAction = static_cast( mDocument->findObject("cnt:editgroupdetails")); - connect(mEditGroupAction, SIGNAL(triggered()), this, SLOT(editGroup())); - - // toolbar actions - mManageAction = static_cast( mDocument->findObject("cnt:managemembers")); - connect(mManageAction, SIGNAL(triggered()), this, SLOT(manageMembers())); - mDeleteAction = static_cast( mDocument->findObject("cnt:deletegroup")); - connect(mDeleteAction, SIGNAL(triggered()), this, SLOT(deleteGroup())); - mShowActionsAction = static_cast( mDocument->findObject("cnt:groupactions")); - connect(mShowActionsAction, SIGNAL(triggered()), this, SLOT(openGroupActions())); - - // thumbnail manager - mThumbnailManager = new ThumbnailManager(this); - mThumbnailManager->setMode(ThumbnailManager::Default); - mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); - mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); - - connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), - this, SLOT(thumbnailReady(QPixmap, void*, int, int))); + Q_D( CntGroupMemberView ); + d->q_ptr = this; } -/*! -Destructor -*/ CntGroupMemberView::~CntGroupMemberView() { - mView->deleteLater(); - - delete mGroupContact; - mGroupContact = 0; - - delete mModel; - mModel = 0; - - delete mFetchView; - mFetchView = 0; - - delete mAvatar; - mAvatar = NULL; + Q_D(CntGroupMemberView); + delete d; } - -void CntGroupMemberView::setOrientation(Qt::Orientation orientation) -{ - if (orientation == Qt::Vertical) - { - // reading "portrait" section - mDocument->load( CNT_GROUPMEMBERVIEW_XML, "portrait" ); - } - else - { - // reading "landscape" section - mDocument->load( CNT_GROUPMEMBERVIEW_XML, "landscape" ); - } -} - + void CntGroupMemberView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) { - mViewManager = aMgr; - mArgs = aArgs; - - if (mView->navigationAction() != mSoftkey) - { - mView->setNavigationAction(mSoftkey); - } - - QVariant contact = mArgs.value( ESelectedGroupContact ); - mGroupContact = new QContact( contact.value() ); - - HbMainWindow* window = mView->mainWindow(); - if ( window ) - { - connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); - setOrientation(window->orientation()); - } - - mHeadingItem->setGroupDetails(mGroupContact); - - // avatar - QList details = mGroupContact->details(); - for (int i = 0;i < details.count();i++) - { - if (details.at(i).imageUrl().isValid()) - { - mAvatar = new QContactAvatar(details.at(i)); - mThumbnailManager->getThumbnail(mAvatar->imageUrl().toString()); - break; - } - } - - // create list & model - mListView->setFrictionEnabled(true); - mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); - mListView->verticalScrollBar()->setInteractive(true); - mListView->setUniformItemSizes(true); - mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail); - HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView); - indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); - indexFeedback->setItemView(mListView); - - HbFrameBackground frame; - frame.setFrameGraphicsName("qtg_fr_list_normal"); - frame.setFrameType(HbFrameDrawer::NinePieces); - mListView->itemPrototypes().first()->setDefaultFrame(frame); - - createModel(); - - if (mArgs.value(ESelectedAction).toString() == CNT_SAVE_ACTION) - { - QString name = getContactManager()->synthesizedDisplayLabel(*mGroupContact); - HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created").arg(name))); - } - - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageMembers())); + Q_D(CntGroupMemberView); + d->activate(aMgr,aArgs); } void CntGroupMemberView::deactivate() { - -} - -void CntGroupMemberView::showPreviousView() -{ - //save the contact if avatar has been changed. - QContact contact = mViewManager->contactManager( SYMBIAN_BACKEND )->contact(mGroupContact->localId()); - if ( contact != *mGroupContact ) - { - getContactManager()->saveContact(mGroupContact); - } - mViewManager->back(mArgs); -} - -void CntGroupMemberView::openGroupActions() -{ - QVariant var; - var.setValue(*mGroupContact); - - mArgs.insert(EViewId, groupActionsView); - mArgs.insert(ESelectedGroupContact, var); - mViewManager->changeView(mArgs); -} - -void CntGroupMemberView::manageMembers() -{ - QContactRelationshipFilter membersFilter; - membersFilter.setRelationshipType(QContactRelationship::HasMember); - membersFilter.setRelatedContactRole(QContactRelationship::First); - membersFilter.setRelatedContactId(mGroupContact->id()); - mOriginalGroupMembers = getContactManager()->contactIds(membersFilter); - - QSet contactsSet = mOriginalGroupMembers.toSet(); - QContactName groupContactName = mGroupContact->detail( QContactName::DefinitionName ); - QString groupName(groupContactName.value( QContactName::FieldCustomLabel )); - - 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); + Q_D(CntGroupMemberView); + d->deactivate(); } -void CntGroupMemberView::handleManageMembers() -{ - - QSet selectedContacts = mFetchView->getSelectedContacts(); - - if (mFetchView->wasCanceled()) { - delete mFetchView; - mFetchView = 0; - return; - } - - QList removedMemberships; - QList addedMemberships; - - QSet removedMembers = mOriginalGroupMembers.toSet() - selectedContacts; - setRelationship(removedMembers, removedMemberships); - - QSet addedMembers = selectedContacts - mOriginalGroupMembers.toSet(); - setRelationship(addedMembers, addedMemberships); - - QMap errors; - if (!addedMemberships.isEmpty()) { - getContactManager()->saveRelationships(&addedMemberships, &errors); - } - - if (!removedMemberships.isEmpty()) { - getContactManager()->removeRelationships(removedMemberships, &errors); - } -} - -void CntGroupMemberView::createModel() -{ - QContactRelationshipFilter rFilter; - rFilter.setRelationshipType(QContactRelationship::HasMember); - rFilter.setRelatedContactRole(QContactRelationship::First); - rFilter.setRelatedContactId(mGroupContact->id()); - - mModel = new CntListModel(getContactManager(), rFilter, false); - mListView->setModel(mModel); -} - -void CntGroupMemberView::editGroup() +bool CntGroupMemberView::isDefault() const { - mArgs.insert(EViewId, groupEditorView); - QVariant var; - var.setValue(*mGroupContact); - mArgs.insert(ESelectedGroupContact, var); - mViewManager->changeView(mArgs); -} - -void CntGroupMemberView::deleteGroup() -{ - QString groupName = mGroupContact->displayLabel(); - HbLabel *headingLabel = new HbLabel(); - headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(groupName)); - - HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac"), this, SLOT(handleDeleteGroup(HbAction*)), - hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel); -} - -void CntGroupMemberView::handleDeleteGroup(HbAction *action) -{ - HbDialog *popup = static_cast(sender()); - - if (popup && action == popup->actions().first()) - { - getContactManager()->removeContact(mGroupContact->localId()); - showPreviousView(); - } -} - -/*! -Called when a list item is longpressed -*/ -void CntGroupMemberView::showContextMenu(HbAbstractViewItem *aItem, const QPointF &aCoords) -{ - QVariant data( aItem->modelIndex().row() ); - - QModelIndex index = aItem->modelIndex(); - - HbMenu *menu = new HbMenu(); - menu->setAttribute(Qt::WA_DeleteOnClose); - menu->setPreferredPos( aCoords ); - - HbAction *removeFromGroupAction = 0; - HbAction *openContactAction = 0; - HbAction *editContactAction = 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")); - - openContactAction->setData( data ); - editContactAction->setData( data ); - removeFromGroupAction->setData( data ); - - menu->open(this, SLOT(handleMenu(HbAction*))); + return false; } -void CntGroupMemberView::handleMenu(HbAction* action) -{ - int row = action->data().toInt(); - HbMenu *menuItem = static_cast(sender()); - QModelIndex index = mModel->index(row); - - if ( action == menuItem->actions().first() ) - { - showContactView(index); - } - else if (action == menuItem->actions().at(1)) - { - editContact(index); - } - else if (action == menuItem->actions().at(2)) - { - removeFromGroup(index); - } -} - - -/*! -Called after user clicked on the listview. -*/ -void CntGroupMemberView::showContactView(const QModelIndex &index) +HbView* CntGroupMemberView::view() const { - mArgs.insert(EViewId, commLauncherView); - QVariant var; - var.setValue(mModel->contact(index)); - mArgs.insert(ESelectedContact, var); - QVariant varGroup; - varGroup.setValue(*mGroupContact); - mArgs.insert(ESelectedGroupContact, varGroup); - mViewManager->changeView(mArgs); - -} - -void CntGroupMemberView::removeFromGroup(const QModelIndex &index) -{ - // get contact id using index - QContact selectedContact = mModel->contact(index); - QContactRelationship relationship; - relationship.setRelationshipType(QContactRelationship::HasMember); - relationship.setFirst(mGroupContact->id()); - relationship.setSecond(selectedContact.id()); - getContactManager()->removeRelationship(relationship); -} - -void CntGroupMemberView::editContact(const QModelIndex &index) -{ - - mArgs.insert(EViewId, editView); - QVariant var; - var.setValue(mModel->contact(index)); - mArgs.insert(ESelectedContact, var); - mViewManager->changeView(mArgs); -} - -void CntGroupMemberView::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) -{ - Q_UNUSED(data); - Q_UNUSED(id); - Q_UNUSED(error); - if (!error) - { - QIcon qicon(pixmap); - HbIcon icon(qicon); - mHeadingItem->setIcon(icon); - - mImageLabel->clear(); - mImageLabel->setIcon(icon); - } + Q_D( const CntGroupMemberView ); + return d->mView; } -void CntGroupMemberView::openImageEditor() +int CntGroupMemberView::viewId() const { - QVariant var; - var.setValue(*mGroupContact); - - // SelectedGroupContact is needed so we know which group to show - // when we come back to this view, and selected contact is needed - // for image editor to be able to assign the image to correct contact. - mArgs.insert(ESelectedGroupContact, var); - mArgs.insert(ESelectedContact, var); - - mArgs.insert(EViewId, imageEditorView ); - - mViewManager->changeView( mArgs ); -} - -QContactManager* CntGroupMemberView::getContactManager() -{ - return mViewManager->contactManager(SYMBIAN_BACKEND); -} - -void CntGroupMemberView::setRelationship(QSet &aLocalId, - QList &aRelationshipList) -{ - foreach (QContactLocalId id, aLocalId) { - QContact contact = getContactManager()->contact(id); - - QContactRelationship membership; - membership.setRelationshipType(QContactRelationship::HasMember); - membership.setFirst(mGroupContact->id()); - membership.setSecond(contact.id()); - aRelationshipList.append(membership); - } -} + return groupMemberView; +} +// EOF -/*! -Draw the image specific content menu -*/ -void CntGroupMemberView::drawImageMenu(const QPointF &aCoords) -{ - HbMenu *menu = new HbMenu(); - HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(openImageEditor())); - if (mAvatar) - { - HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(removeImage())); - } - menu->setPreferredPos(aCoords); - menu->open(); -} - - -void CntGroupMemberView::removeImage() -{ - if (mAvatar) - { - if (!mAvatar->imageUrl().isEmpty()) - { - bool success = mGroupContact->removeDetail(mAvatar); - // Check if image removable. - CntImageUtility imageUtility; - if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString())) - { - imageUtility.removeImage(mAvatar->imageUrl().toString()); - } - mAvatar->setImageUrl(QUrl()); - mImageLabel->clear(); - mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture")); - mHeadingItem->setIcon(HbIcon("qtg_large_add_group_picture")); - mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact); - } - } -} - - - -// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntgroupmemberview_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntgroupmemberview_p.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,526 @@ +/* +* 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 "cntgroupmemberview_p.h" +#include "cntfetchcontactpopup.h" +#include "cntcontactcardheadingitem.h" +#include "cntglobal.h" +#include "cntimagelabel.h" +#include "cntimageutility.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cntdocumentloader.h" + +const char *CNT_GROUPMEMBERVIEW_XML = ":/xml/contacts_groupmembers.docml"; + +/*! +\class CntGroupMemberViewPrivate +\brief + +This is the group members view class that shows list of contacts for a user group. View contains a listview that shows actual contacts that +have been added to a particular group. There is also toolbar and menu for navigating between different views. Instance of this class is +created by our viewmanager but view itself is owned by the mainwindow which will also delete it in the end. + +*/ + +/*! +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) + +*/ +CntGroupMemberViewPrivate::CntGroupMemberViewPrivate() : + mGroupContact(NULL), + mViewManager(NULL), + mHeadingItem(NULL), + mModel(NULL), + mImageLabel(NULL), + mListView(NULL), + mAvatar(NULL) +{ + mDocument = new CntDocumentLoader; + + bool ok; + mDocument->load( CNT_GROUPMEMBERVIEW_XML, &ok ); + if ( !ok ){ + qFatal( "Unable to load %S", CNT_GROUPMEMBERVIEW_XML ); + } + + mView = static_cast( mDocument->findWidget("view") ); + + //back button + mSoftkey = new HbAction(Hb::BackNaviAction, mView); + connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView())); + + mImageLabel = static_cast(mDocument->findWidget("editViewImage")); + connect( mImageLabel, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) ); + connect( mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)) ); + + mListView = static_cast( mDocument->findWidget("listView") ); + connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this, + SLOT(showContextMenu(HbAbstractViewItem*,QPointF))); + connect(mListView, SIGNAL(activated (const QModelIndex&)), this, + SLOT(showContactView(const QModelIndex&))); + + mHeadingItem = static_cast( mDocument->findWidget("editViewHeading") ); + connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(openImageEditor()) ); + connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&))); + + // menu actions + mEditGroupAction = static_cast( mDocument->findObject("cnt:editgroupdetails")); + connect(mEditGroupAction, SIGNAL(triggered()), this, SLOT(editGroup())); + + // toolbar actions + mManageAction = static_cast( mDocument->findObject("cnt:managemembers")); + connect(mManageAction, SIGNAL(triggered()), this, SLOT(manageMembers())); + mDeleteAction = static_cast( mDocument->findObject("cnt:deletegroup")); + connect(mDeleteAction, SIGNAL(triggered()), this, SLOT(deleteGroup())); + mShowActionsAction = static_cast( mDocument->findObject("cnt:groupactions")); + connect(mShowActionsAction, SIGNAL(triggered()), this, SLOT(openGroupActions())); + + // thumbnail manager + mThumbnailManager = new ThumbnailManager(this); + mThumbnailManager->setMode(ThumbnailManager::Default); + mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); + mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); + + connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), + this, SLOT(thumbnailReady(QPixmap, void*, int, int))); +} + +/*! +Destructor +*/ +CntGroupMemberViewPrivate::~CntGroupMemberViewPrivate() +{ + mView->deleteLater(); + + delete mGroupContact; + mGroupContact = NULL; + + delete mModel; + mModel = NULL; + + delete mAvatar; + mAvatar = NULL; +} + +void CntGroupMemberViewPrivate::setOrientation(Qt::Orientation orientation) +{ + if (orientation == Qt::Vertical) + { + // reading "portrait" section + mDocument->load( CNT_GROUPMEMBERVIEW_XML, "portrait" ); + } + else + { + // reading "landscape" section + mDocument->load( CNT_GROUPMEMBERVIEW_XML, "landscape" ); + } +} + +void CntGroupMemberViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) +{ + mViewManager = aMgr; + mArgs = aArgs; + + if (mView->navigationAction() != mSoftkey) + { + mView->setNavigationAction(mSoftkey); + } + + QVariant contact = mArgs.value( ESelectedGroupContact ); + mGroupContact = new QContact( contact.value() ); + + HbMainWindow* window = mView->mainWindow(); + if ( window ) + { + connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); + setOrientation(window->orientation()); + } + + mHeadingItem->setGroupDetails(mGroupContact); + + // avatar + QList details = mGroupContact->details(); + for (int i = 0;i < details.count();i++) + { + if (details.at(i).imageUrl().isValid()) + { + mAvatar = new QContactAvatar(details.at(i)); + mThumbnailManager->getThumbnail(mAvatar->imageUrl().toString()); + break; + } + } + + // create list & model + mListView->setFrictionEnabled(true); + mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); + mListView->verticalScrollBar()->setInteractive(true); + mListView->setUniformItemSizes(true); + mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail); + HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView); + indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); + indexFeedback->setItemView(mListView); + + HbFrameBackground frame; + frame.setFrameGraphicsName("qtg_fr_list_normal"); + frame.setFrameType(HbFrameDrawer::NinePieces); + mListView->itemPrototypes().first()->setDefaultFrame(frame); + + createModel(); + + if (mArgs.value(ESelectedAction).toString() == CNT_SAVE_ACTION) + { + QString name = getContactManager()->synthesizedContactDisplayLabel(*mGroupContact); + HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created").arg(name))); + } +} + +void CntGroupMemberViewPrivate::deactivate() +{ +} + +void CntGroupMemberViewPrivate::showPreviousView() +{ + Q_Q(CntGroupMemberView); + + emit q->backPressed(); + + //save the contact if avatar has been changed. + QContact contact = mViewManager->contactManager( SYMBIAN_BACKEND )->contact(mGroupContact->localId()); + if ( contact != *mGroupContact ) + { + getContactManager()->saveContact(mGroupContact); + } + mViewManager->back(mArgs); +} + +void CntGroupMemberViewPrivate::openGroupActions() +{ + QVariant var; + var.setValue(*mGroupContact); + + mArgs.insert(EViewId, groupActionsView); + mArgs.insert(ESelectedGroupContact, var); + mViewManager->changeView(mArgs); +} + +void CntGroupMemberViewPrivate::manageMembers() +{ + QContactRelationshipFilter membersFilter; + membersFilter.setRelationshipType(QContactRelationship::HasMember); + membersFilter.setRelatedContactRole(QContactRelationship::First); + membersFilter.setRelatedContactId(mGroupContact->id()); + + mOriginalGroupMembers = getContactManager()->contactIds(membersFilter); + + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); + if (groupName.isEmpty()) + { + groupName = hbTrId("txt_phob_list_unnamed"); + } + + 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 CntGroupMemberViewPrivate::handleManageMembers( QSet aIds ) +{ + QList removedMemberships; + QList addedMemberships; + + QSet removedMembers = mOriginalGroupMembers.toSet() - aIds; + setRelationship(removedMembers, removedMemberships); + + QSet addedMembers = aIds - mOriginalGroupMembers.toSet(); + setRelationship(addedMembers, addedMemberships); + + QMap errors; + if (!addedMemberships.isEmpty()) + { + getContactManager()->saveRelationships(&addedMemberships, &errors); + } + + if (!removedMemberships.isEmpty()) + { + getContactManager()->removeRelationships(removedMemberships, &errors); + } +} + +void CntGroupMemberViewPrivate::createModel() +{ + QContactRelationshipFilter rFilter; + rFilter.setRelationshipType(QContactRelationship::HasMember); + rFilter.setRelatedContactRole(QContactRelationship::First); + rFilter.setRelatedContactId(mGroupContact->id()); + + mModel = new CntListModel(getContactManager(), rFilter, false); + mListView->setModel(mModel); +} + +void CntGroupMemberViewPrivate::editGroup() +{ + mArgs.insert(EViewId, groupEditorView); + QVariant var; + var.setValue(*mGroupContact); + mArgs.insert(ESelectedGroupContact, var); + mViewManager->changeView(mArgs); +} + +void CntGroupMemberViewPrivate::deleteGroup() +{ + QContactName contactName = mGroupContact->detail( QContactName::DefinitionName ); + QString groupName = contactName.value( QContactName::FieldCustomLabel ); + if (groupName.isNull()) + { + groupName = hbTrId("txt_phob_list_unnamed"); + } + + HbLabel *headingLabel = new HbLabel(); + headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(groupName)); + + HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac"), this, SLOT(handleDeleteGroup(int)), + HbMessageBox::Delete | HbMessageBox::Cancel, headingLabel); +} + +void CntGroupMemberViewPrivate::handleDeleteGroup(int action) +{ + if (action == HbMessageBox::Delete) + { + getContactManager()->removeContact(mGroupContact->localId()); + showPreviousView(); + } +} + +/*! +Called when a list item is longpressed +*/ +void CntGroupMemberViewPrivate::showContextMenu(HbAbstractViewItem *aItem, const QPointF &aCoords) +{ + QVariant data( aItem->modelIndex().row() ); + + QModelIndex index = aItem->modelIndex(); + + HbMenu *menu = new HbMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->setPreferredPos( aCoords ); + + 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*))); +} + +void CntGroupMemberViewPrivate::handleMenu(HbAction* action) +{ + int row = action->data().toInt(); + HbMenu *menuItem = static_cast(sender()); + QModelIndex index = mModel->index(row); + + if ( action == menuItem->actions().first() ) + { + showContactView(index); + } + else if (action == menuItem->actions().at(1)) + { + editContact(index); + } + else if (action == menuItem->actions().at(2)) + { + removeFromGroup(index); + } + else if (action == menuItem->actions().at(3)) + { + sendToHs(index); + } +} + +/*! +Called after user clicked on the listview. +*/ +void CntGroupMemberViewPrivate::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 CntGroupMemberViewPrivate::showContactView(const QModelIndex &index) +{ + mArgs.insert(EViewId, contactCardView); + QVariant var; + var.setValue(mModel->contact(index)); + mArgs.insert(ESelectedContact, var); + QVariant varGroup; + varGroup.setValue(*mGroupContact); + mArgs.insert(ESelectedGroupContact, varGroup); + mViewManager->changeView(mArgs); + +} + +void CntGroupMemberViewPrivate::removeFromGroup(const QModelIndex &index) +{ + // get contact id using index + QContact selectedContact = mModel->contact(index); + QContactRelationship relationship; + relationship.setRelationshipType(QContactRelationship::HasMember); + relationship.setFirst(mGroupContact->id()); + relationship.setSecond(selectedContact.id()); + getContactManager()->removeRelationship(relationship); +} + +void CntGroupMemberViewPrivate::editContact(const QModelIndex &index) +{ + + mArgs.insert(EViewId, editView); + QVariant var; + var.setValue(mModel->contact(index)); + mArgs.insert(ESelectedContact, var); + mViewManager->changeView(mArgs); +} + +void CntGroupMemberViewPrivate::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) +{ + Q_UNUSED(data); + Q_UNUSED(id); + Q_UNUSED(error); + if (!error) + { + HbIcon icon(pixmap); + mHeadingItem->setIcon(icon); + + mImageLabel->clear(); + mImageLabel->setIcon(pixmap); + } +} + +void CntGroupMemberViewPrivate::openImageEditor() +{ + QVariant var; + var.setValue(*mGroupContact); + + // only group contact is assigned since we want to only + // change the groups image + mArgs.insert(ESelectedGroupContact, var); + + mArgs.insert(EViewId, imageEditorView ); + + mViewManager->changeView( mArgs ); +} + +QContactManager* CntGroupMemberViewPrivate::getContactManager() +{ + return mViewManager->contactManager(SYMBIAN_BACKEND); +} + +void CntGroupMemberViewPrivate::setRelationship(QSet &aLocalId, + QList &aRelationshipList) +{ + foreach (QContactLocalId id, aLocalId) { + QContact contact = getContactManager()->contact(id); + + QContactRelationship membership; + membership.setRelationshipType(QContactRelationship::HasMember); + membership.setFirst(mGroupContact->id()); + membership.setSecond(contact.id()); + aRelationshipList.append(membership); + } +} + +/*! +Draw the image specific content menu +*/ +void CntGroupMemberViewPrivate::drawImageMenu(const QPointF &aCoords) +{ + HbMenu *menu = new HbMenu(); + HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(openImageEditor())); + if (mAvatar && !mAvatar->imageUrl().isEmpty()) + { + HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(removeImage())); + } + menu->setPreferredPos(aCoords); + menu->open(); +} + + +void CntGroupMemberViewPrivate::removeImage() +{ + if (mAvatar) + { + if (!mAvatar->imageUrl().isEmpty()) + { + bool success = mGroupContact->removeDetail(mAvatar); + // Check if image removable. + CntImageUtility imageUtility; + if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString())) + { + imageUtility.removeImage(mAvatar->imageUrl().toString()); + } + mAvatar->setImageUrl(QUrl()); + mImageLabel->clear(); + mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture")); + mHeadingItem->setIcon(HbIcon("qtg_large_add_group_picture")); + getContactManager()->saveContact(mGroupContact); + } + } +} + + + +// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cnthistoryview.cpp --- a/phonebookui/pbkcommonui/src/cnthistoryview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnthistoryview.cpp Wed Aug 18 09:39:00 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,11 +114,18 @@ { mViewMgr = aMgr; mArgs = aArgs; + + QContactManager* cm = mViewMgr->contactManager(SYMBIAN_BACKEND); mContact = new QContact(mArgs.value(ESelectedContact).value()); // Set history view heading HbGroupBox* groupBox = static_cast(docLoader()->findWidget(QString("groupBox"))); - groupBox->setHeading(hbTrId("txt_phob_subtitle_history_with_1").arg(mContact->displayLabel())); + QString name = mContact->displayLabel(); + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } + groupBox->setHeading(hbTrId("txt_phob_subtitle_history_with_1").arg(name)); //construct listview mHistoryListView = static_cast(docLoader()->findWidget(QString("listView"))); @@ -125,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 @@ -150,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&))); } /*! @@ -171,19 +186,21 @@ { // Ask the use if they want to clear the history QString name = mContact->displayLabel(); + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_clear_communications_history_with_1")).arg(name), this, - SLOT(handleClearHistory(HbAction*)), hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel")); + SLOT(handleClearHistory(int)), HbMessageBox::Delete | HbMessageBox::Cancel); } /* Handle the selected action for clearing history */ -void CntHistoryView::handleClearHistory(HbAction *action) +void CntHistoryView::handleClearHistory(int action) { - HbMessageBox *note = static_cast(sender()); - - if (note && action == note->actions().first()) + if (action == HbMessageBox::Delete) { mHistoryModel->clearHistory(); } @@ -213,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); @@ -262,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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp --- a/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include #define NEW_EVENT_FRAME "qtg_fr_list_new_item" #define INCOMING_FOCUS_FRAME "qtg_fr_convlist_received_pressed" @@ -117,4 +118,26 @@ } } } + +bool CntHistoryViewItem::event(QEvent* e) +{ + bool result; + if (e->type() == QEvent::GraphicsSceneResize) + { + // HbAbstractItemView has a performance improvement when drawing backrounds but seems + // to screw the layout of history view items. This workaround fixes the issue. There should + // be minimal performance drawbacks since GraphicsSceneResize events are quite few. + // TODO: Remove this once Orbit changes their implementation. Not known when + QGraphicsWidget *frame = static_cast(primitive("frame")); + QRectF frameGeometry = frame->geometry(); + result = HbListViewItem::event(e); + frame->setGeometry(frameGeometry); + } + else + { + result = HbListViewItem::event(e); + } + return result; +} + // EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntimageeditorview.cpp --- a/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -17,12 +17,15 @@ #include "cntimageeditorview.h" #include "cntimageutility.h" +#include "cntsavemanager.h" +#include "cntimagelabel.h" #include #include #include #include "cntdebug.h" +#include "cntglobal.h" #include #include @@ -31,8 +34,11 @@ #include #include #include +#include +#include #include +#include const char *CNT_IMAGE_XML = ":/xml/contacts_if.docml"; @@ -40,13 +46,14 @@ Constructor */ CntImageEditorView::CntImageEditorView() : - mContact(NULL), - mAvatar(NULL), - mImageLabel(NULL), - mRequest(NULL), - mViewManager(NULL), - mListView(NULL), - mModel(NULL) + mContact(NULL), + mAvatar(NULL), + mImageLabel(NULL), + mRequest(NULL), + mViewManager(NULL), + mListView(NULL), + mModel(NULL), + mSaveManager(NULL) { bool ok = false; mDocumentLoader.load(CNT_IMAGE_XML, &ok); @@ -76,6 +83,9 @@ connect( mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), this, SLOT(thumbnailReady(QPixmap, void*, int, int)) ); + + // closing the application from task swapper or end key will cause the contact to be saved + connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveContact())); } /*! @@ -88,15 +98,17 @@ mView->deleteLater(); delete mAvatar; - mAvatar = 0; + mAvatar = NULL; delete mContact; - mContact = 0; + mContact = NULL; delete mRequest; - mRequest = 0; + mRequest = NULL; delete mRemoveImage; - mRemoveImage = 0; + mRemoveImage = NULL; delete mModel; - mModel = 0; + mModel = NULL; + delete mSaveManager; + mSaveManager = NULL; CNT_EXIT } @@ -115,14 +127,41 @@ HbMainWindow* window = mView->mainWindow(); if ( window ) { - connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); - setOrientation(window->orientation()); + connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); + setOrientation(window->orientation()); + } + + if ( mArgs.contains(ESelectedContact)) + { + mContact = new QContact(mArgs.value(ESelectedContact).value()); + } + + if ( mArgs.contains(ESelectedGroupContact) && !mContact ) + { + mContact = new QContact(mArgs.value(ESelectedGroupContact).value()); } - mContact = new QContact(mArgs.value(ESelectedContact).value()); + QString myCard = mArgs.value( EMyCard ).toString(); + QContactLocalId localId = mContact->localId(); + QContactLocalId selfContactId = mViewManager->contactManager(SYMBIAN_BACKEND)->selfContactId(); + bool isMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty(); + + if (isMyCard) + { + mSaveManager = new CntSaveManager(CntSaveManager::EMyCard); + } + else if (mContact->type() == QContactType::TypeGroup) + { + mSaveManager = new CntSaveManager(CntSaveManager::EGroup); + } + else + { + mSaveManager = new CntSaveManager(); + } // 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) { @@ -142,7 +181,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")); } } @@ -196,7 +235,7 @@ mRequest = 0; } - mRequest = mAppManager.create(XQI_CAMERA_CAPTURE, "capture(int,QVariantMap)", false); + mRequest = mAppManager.create(XQI_CAMERA_CAPTURE, XQOP_CAMERA_CAPTURE, false); if ( mRequest ) { int mode = 0; //image mode @@ -257,8 +296,18 @@ QVariant var; var.setValue(*mContact); - mArgs.insert(ESelectedContact, var); - mArgs.insert(ESelectedGroupContact, var); + // If the arguments didn't originally contain "normal" contact, + // then the group contact should be updated. This case applies only + // when group image is edited + if ( !mArgs.contains(ESelectedContact) ) + { + mArgs.insert(ESelectedGroupContact, var); + } + else + { + mArgs.insert(ESelectedContact, var); + } + mArgs.insert(ECustomParam, viewId()); mViewManager->back( mArgs ); } @@ -278,9 +327,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); } } @@ -338,10 +387,8 @@ Q_UNUSED(id); if (!error) { - QIcon qicon(pixmap); - HbIcon icon(qicon); mImageLabel->clear(); - mImageLabel->setIcon(icon); + mImageLabel->setIcon(pixmap); } CNT_EXIT @@ -385,6 +432,47 @@ void CntImageEditorView::handleError(int errorCode, const QString& errorMessage) { + Q_UNUSED(errorCode); + Q_UNUSED(errorMessage); CNT_LOG_ARGS("error code = " << errorCode << "errorMessage=" << errorMessage) } +void CntImageEditorView::saveContact() +{ + mContact->saveDetail(mAvatar); + + if ( mAvatar->imageUrl().isEmpty()) + { + mContact->removeDetail(mAvatar); + } + + QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact); + + if (name.isEmpty()) + { + name = hbTrId("txt_phob_list_unnamed"); + } + + CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mContact, mViewManager->contactManager(SYMBIAN_BACKEND)); + + if (mContact->type() != QContactType::TypeGroup) + { + switch (result) + { + case CntSaveManager::ESaved: + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name)); + break; + case CntSaveManager::EUpdated: + HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name)); + break; + case CntSaveManager::EFailed: + HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!")); + break; + case CntSaveManager::EDeleted: + case CntSaveManager::ENothingDone: + default: + break; + } + } +} + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntimagelabel.cpp --- a/phonebookui/pbkcommonui/src/cntimagelabel.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimagelabel.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -17,14 +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() @@ -32,12 +58,85 @@ } +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))) { switch (tap->state()) { + case Qt::GestureStarted: + HbEffect::start(this, QString("iconclick")); + break; case Qt::GestureFinished: if (tap->tapStyleHint() == HbTapGesture::Tap) { @@ -48,8 +147,9 @@ case Qt::GestureUpdated: if (tap->tapStyleHint() == HbTapGesture::TapAndHold) { + HbEffect::cancel(this, QString("iconclick")); emit iconLongPressed(tap->scenePosition()); - } + } break; default: break; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntimportsview.cpp --- a/phonebookui/pbkcommonui/src/cntimportsview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimportsview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -37,6 +37,8 @@ #include #include #include +#include +#include const char *CNT_IMPORT_UI_XML = ":/xml/contacts_sim.docml"; const int KTimerValue = 1; // used as 1 msec timer for saving ADN contacts from SIM @@ -59,7 +61,8 @@ mAdnStoreEntries(0), mSdnStoreEntries(0), mSimError(0), - mWaitingForAdnCache(0) + mWaitingForAdnCache(0), + mImportInProgress(false) { bool ok = false; mDocumentLoader.load(CNT_IMPORT_UI_XML, &ok); @@ -111,6 +114,7 @@ Q_UNUSED(aArgs); //back button HbMainWindow* window = mView->mainWindow(); + if (mView->navigationAction() != mSoftkey) { mView->setNavigationAction(mSoftkey); @@ -168,7 +172,7 @@ mAdnStorePresent = true; mAdnEntriesPresent = true; mWaitingForAdnCache = true; - connect(mAdnSimUtility, SIGNAL(adnCacheStatusReady(SimUtility::CacheStatus&, int)), this, SLOT(adnCacheStatusReady(SimUtility::CacheStatus&, int))); + connect(mAdnSimUtility, SIGNAL(adnCacheStatusReady(CntSimUtility::CacheStatus&, int)), this, SLOT(adnCacheStatusReady(CntSimUtility::CacheStatus&, int))); if (!mAdnSimUtility->notifyAdnCacheStatus()) { mAdnStorePresent = false; mAdnEntriesPresent = false; @@ -290,6 +294,7 @@ mListView->setModel(mModel); mListView->setSelectionMode(HbAbstractItemView::NoSelection); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(endKeyPressed())); } void CntImportsView::simInfoErrorMessage(int infoError) @@ -322,7 +327,9 @@ bool CntImportsView::startSimImport() { + bool started = false; + mImportInProgress = true; delete mFetchRequestADN; mContactSimManagerADN = mViewManager->contactManager(SIM_BACKEND_ADN); @@ -370,6 +377,7 @@ void CntImportsView::stopSimImport() { mImportSimPopup->close(); + mImportInProgress = false; if (mFetchIsDone) { // indicates that timer has been started @@ -422,6 +430,7 @@ mListView->reset(); } } + } void CntImportsView::importFetchResultReceivedADN() @@ -584,6 +593,7 @@ // no SDN contacts to fetch showSimImportResults(); mImportSimPopup->close(); + mImportInProgress = false; // Importing finished, go back to NamesView showPreviousView(); } @@ -602,6 +612,7 @@ showSimImportResults(); mSaveSimContactsListSDN.clear(); mImportSimPopup->close(); + mImportInProgress = false; // Importing finished, go back to NamesView showPreviousView(); } @@ -668,6 +679,7 @@ showSimImportResults(); mSaveSimContactsListSDN.clear(); mImportSimPopup->close(); + mImportInProgress = false; // Importing finished, go back to NamesView showPreviousView(); } @@ -707,6 +719,7 @@ { //dismiss wait note mImportSimPopup->close(); + mImportInProgress = false; //and show error note simInfoErrorMessage(KErrAccessDenied); } @@ -734,4 +747,14 @@ } } +void CntImportsView::endKeyPressed() +{ + if(mImportInProgress && !mSimError) + { + QString results = hbTrId("txt_phob_dpophead_ln_contacts_imported").arg(mSaveCount).arg(mAdnStoreEntries + mSdnStoreEntries); + HbDeviceNotificationDialog::notification(QString(),results); + } +} + + // EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntkeygrabber.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntkeygrabber.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,101 @@ +/* +* 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 "cntkeygrabber.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! + Key press event handler for default actions when pressing either send or end key. + End key closes the application and send key opens dialer. Default functionality + can be overwritten to have view-specific functionality by installing an additional + event filter for the main window. + + See CntGroupActionsView for an example. +*/ +CntKeyGrabber::CntKeyGrabber(HbMainWindow *window, QObject *parent) : + QObject(parent), + mMainWindow(window), + mRequest(NULL) +{ + mMainWindow->installEventFilter(this); +} + +/*! + Destructor +*/ +CntKeyGrabber::~CntKeyGrabber() +{ + delete mRequest; +} + +/*! + Listens to events coming to the QObject obj (in this case HbMainWindow instance) and + grabs/handles the necessary ones. + + \param obj QObject to which the event was sent to + \param event QEvent that happened (key press, mouse press etc...) + \return bool true if the event was handled (and thus it wont be passed on anymore) +*/ +bool CntKeyGrabber::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::KeyPress && obj == mMainWindow) + { + QKeyEvent *keyEvent = static_cast(event); + + if (keyEvent->key() == Qt::Key_No ) + { + qApp->exit(); + + return true; + } + else if (keyEvent->key() == Qt::Key_Yes) + { + XQApplicationManager appManager; + + if (mRequest) + { + delete mRequest; + mRequest = NULL; + } + + mRequest = appManager.create(XQI_LOGS_VIEW, XQOP_LOGS_SHOW, false); + + if (mRequest) + { + QList args; + QVariantMap map; + map.insert(XQLOGS_VIEW_INDEX, QVariant(int(LogsServices::ViewAll))); + map.insert(XQLOGS_SHOW_DIALPAD, QVariant(true)); + map.insert(XQLOGS_DIALPAD_TEXT, QVariant(QString())); + args.append(QVariant(map)); + mRequest->setArguments(args); + mRequest->send(); + } + + return true; + } + } + + return QObject::eventFilter(obj, event); +} diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntmainwindow.cpp --- a/phonebookui/pbkcommonui/src/cntmainwindow.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmainwindow.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -18,24 +18,30 @@ #include "cntmainwindow.h" #include "cntdefaultviewmanager.h" #include "cntviewnavigator.h" -#include +#include "cntkeygrabber.h" #include CntMainWindow::CntMainWindow(QWidget *parent, int defaultView) : HbMainWindow(parent), - mViewManager(NULL) + mViewManager(NULL), + mDefaultView(defaultView) { CNT_ENTRY - + + CntKeyGrabber *keyGrabber = new CntKeyGrabber(this, this); + 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 ); @@ -59,20 +65,4 @@ CNT_EXIT } -/* - * Lets let views handle send/end key press events, because if toolbar or menu has been focused - * the view wont get the key press events - */ -void CntMainWindow::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Yes || event->key() == Qt::Key_No) - { - emit keyPressed(event); - } - else - { - HbMainWindow::keyPressEvent(event); - } -} - // end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntmycardselectionview.cpp --- a/phonebookui/pbkcommonui/src/cntmycardselectionview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +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 "cntmycardselectionview.h" -#include -#include -#include -#include - -CntMyCardSelectionView::CntMyCardSelectionView() : CntBaseSelectionView() -{ - connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(onListViewActivated(const QModelIndex&))); -} - -CntMyCardSelectionView::~CntMyCardSelectionView() -{ -} - -/*! -Set index to mycard -*/ -void CntMyCardSelectionView::onListViewActivated(const QModelIndex& index) -{ - if (index.isValid()) - { - QContact contact = mListModel->contact(index); - QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND); - mgr->setSelfContactId(contact.localId()); - - removeFromGroup(&contact); - - CntViewParameters params; - params.insert(EViewId, namesView); - mMgr->changeView(params); - } -} - -void CntMyCardSelectionView::removeFromGroup(const QContact* aContact) -{ - QContactDetailFilter groupFilter; - groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - groupFilter.setValue(QLatin1String(QContactType::TypeGroup)); - - QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND); - QList groupContactIds = mgr->contactIds(groupFilter); - if (!groupContactIds.isEmpty()) - { - for(int i = 0;i < groupContactIds.count();i++) - { - QContact groupContact = mgr->contact(groupContactIds.at(i)); - QContactRelationship relationship; - relationship.setRelationshipType(QContactRelationship::HasMember); - relationship.setFirst(groupContact.id()); - relationship.setSecond(aContact->id()); - mgr->removeRelationship(relationship); - } - } -} - diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntmycardview.cpp --- a/phonebookui/pbkcommonui/src/cntmycardview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp Wed Aug 18 09:39:00 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; } /*! @@ -98,11 +94,6 @@ { chooseButton->setEnabled(false); } - - if (!mFetchView) { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection())); - } } void CntMyCardView::deactivate() @@ -135,6 +126,7 @@ QVariant var; var.setValue(*mContact); viewParameters.insert(ESelectedContact, var); + viewParameters.insert(EExtraAction, CNT_ROOT_ACTION); mViewManager->changeView(viewParameters); } @@ -143,20 +135,19 @@ */ void CntMyCardView::openMyCardSelectionView() { - // Display a list of contacts to choose a mycard from. - 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); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntnamesview_p.cpp --- a/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Wed Aug 18 09:39:00 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 @@ -47,6 +47,8 @@ #include #include +#include + const char *CNT_CONTACTLIST_XML = ":/xml/contacts_namelist.docml"; static const int CNT_MIN_ROW_COUNT = 2; @@ -64,7 +66,6 @@ mNamesAction(NULL), mMenuBuilder(NULL), mHandledContactId(0), - mFetchView(NULL), mIsDefault(true), mId( namesView ), mActionGroup(NULL), @@ -137,9 +138,24 @@ 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 @@ -172,6 +188,10 @@ CNT_ENTRY mViewManager = aMgr; + if (mView->mainWindow() != NULL && !(mView->visibleItems() & Hb::AllItems)) + { + hideFinder(); + } if (!mListModel) { QContactDetailFilter filter; @@ -212,18 +232,23 @@ setScrollPosition(aArgs.value(ESelectedContact).value().localId()); } + if ( aArgs.value( EExtraAction ).toString() == CNT_FIND_ACTION ) + { + showFinder(); + } + CNT_EXIT } void CntNamesViewPrivate::deactivate() { CNT_ENTRY - - if (!(mView->visibleItems() & Hb::AllItems)) + HbMainWindow* win = mView->mainWindow(); + if ( win != NULL) { - hideFinder(); + CntApplication* cntApp = static_cast(qApp); + disconnect(win, SIGNAL(viewReady()), cntApp, SIGNAL(applicationReady())); } - delete mMenuBuilder; mMenuBuilder = NULL; @@ -252,6 +277,16 @@ { editor->setText(""); editor->setFocus(); + + // This opens the VKB + QInputContext *ic = qApp->inputContext(); + if (ic) + { + QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel); + ic->filterEvent(event); + delete event; + } + } CNT_EXIT @@ -295,6 +330,8 @@ mImportSim->setVisible(false); mNewContact->setVisible(false); mMultipleDeleter->setVisible(false); + HbAction* settings = static_cast(document()->findObject("cnt:settings") ); + settings->setVisible(false); CNT_EXIT } @@ -303,9 +340,6 @@ { CNT_ENTRY - mVirtualKeyboard->closeKeypad(); - mView->setMaximumHeight(-1); - document()->load( CNT_CONTACTLIST_XML, "no_find" ); mView->showItems(Hb::AllItems); @@ -324,6 +358,8 @@ mNewContact->setVisible(true); mImportSim->setVisible(true); mMultipleDeleter->setVisible(true); + HbAction* settings = static_cast(document()->findObject("cnt:settings") ); + settings->setVisible(true); CNT_EXIT } @@ -397,12 +433,16 @@ 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"); + } mHandledContactId = aContact.localId(); - HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)), - hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel")); + HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)), + HbMessageBox::Delete | HbMessageBox::Cancel); CNT_EXIT } @@ -410,36 +450,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 } @@ -459,7 +489,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); @@ -485,6 +515,7 @@ if (mMenu) { delete mMenu; + mMenu = NULL; } mMenu = mMenuBuilder->actionMenu( contact, mListModel->myCardId() ); mMenu->setPreferredPos( aPoint ); @@ -514,13 +545,11 @@ CNT_EXIT } -void CntNamesViewPrivate::handleDeleteContact( HbAction* aAction ) +void CntNamesViewPrivate::handleDeleteContact( int aAction ) { CNT_ENTRY - HbMessageBox *note = static_cast(sender()); - - if (note && aAction == note->actions().first()) + if (aAction == HbMessageBox::Delete) { mViewManager->contactManager( SYMBIAN_BACKEND )->removeContact(mHandledContactId); } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntpresencelistener.cpp --- a/phonebookui/pbkcommonui/src/cntpresencelistener.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntpresencelistener.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -20,6 +20,11 @@ #include #include +/*! + Presence listener for contact card. It provides aggregated + presence information for a contact and separately for each + valid QContactOnlineAccount. +*/ CntPresenceListener::CntPresenceListener(const QContact& contact, QObject* parent) : QObject(parent), mReader(NULL), @@ -30,12 +35,22 @@ this, SLOT(handlePresenceUpdate(bool, PrcPresenceBuddyInfoQt*))); } +/*! + Destructor +*/ CntPresenceListener::~CntPresenceListener() { delete mReader; mReader = NULL; } +/*! + Subscribes all valid QContactOnlineAccounts to receive status updates from presence cache and + returns initial presence statuses for each of the accounts. + + \param combinedOnlineStatus aggregated online status + \return QMap with account specific (for example "sip:sip@sip.com") online information +*/ QMap CntPresenceListener::initialPresences(bool &combinedOnlineStatus) { QMap initialMap; @@ -67,7 +82,14 @@ return initialMap; } + +/*! + Private slot that handles emitting changes for separate accounts along + with the aggregated information. + \param aSuccess information if the request/update was succesful + \param aPresenceBuddyInfo the account that got updated +*/ void CntPresenceListener::handlePresenceUpdate(bool aSuccess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo) { if (aSuccess && aPresenceBuddyInfo != NULL) @@ -90,14 +112,20 @@ } } - // emit the combined presence status + // emit the aggregated presence status emit fullPresenceUpdated(parsePresence(buddies)); qDeleteAll(buddies); } } } - + +/*! + Returns the aggregated online status. + + \param buddyList list of accounts to parse the aggregated status from + \return bool true if any of the accounts is online +*/ bool CntPresenceListener::parsePresence(QList buddyList) { foreach (PrcPresenceBuddyInfoQt* buddy, buddyList) diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntsavemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntsavemanager.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,154 @@ +/* +* 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 "cntsavemanager.h" +#include "cntdebug.h" + +/*! + Contact saving helper class. Used mainly in edit view for contact saving, + but should also be used in other (special) cases a contact needs to be saved. + For example "forcing" phonebook to shut down (end key, from task swapper etc..) + in detail editors. +*/ +CntSaveManager::CntSaveManager(CntContactType type, QObject* parent) : + QObject(parent), + mContactType(type) +{ + CNT_ENTRY + + CNT_EXIT +} + +/*! + Destructor +*/ +CntSaveManager::~CntSaveManager() +{ + CNT_ENTRY + + CNT_EXIT +} + +/*! + Saves the given QContact to the given QContactManager. Also takes care of checking + if the contact is MyCard or a group and behaves different accordingly. + + \param aContact the contact to be saved, ownership not taken + \param aManager the QContactManager which should be used for saving the contact, ownership not taken + \return CntSaveResult enum to describe what was done to the contact (saved, updated etc...) +*/ +CntSaveManager::CntSaveResult CntSaveManager::saveContact(QContact* aContact, QContactManager* aManager) +{ + CNT_ENTRY + + CntSaveResult result = ENothingDone; + bool isSavedContact = aContact->localId() > 0; + + // if the contact is really changed or a new one + if ( (*aContact) != aManager->contact(aContact->localId()) || !isSavedContact ) + { + int detailCount = aContact->details().count(); + + // Don't set preferred details for a group + if (mContactType != EGroup) + { + setPreferredDetails( aContact ); + } + + // If its a new contact + if ( !isSavedContact ) + { + // if a new contact has 2 or less details, it's still considered empty + if ( detailCount > 2 ) + { + bool success = aManager->saveContact( aContact ); + if ( success && mContactType == EMyCard ) + { + aManager->setSelfContactId( aContact->localId() ); + } + + result = success ? ESaved : EFailed; + } + } + else + { + // Contact details has been cleared out, a symbian QContact with + // 4 or less details is in reality empty. + if ( detailCount <= 4 ) + { + bool success = aManager->removeContact( aContact->localId() ); + + result = success ? EDeleted : EFailed; + } + else + { + bool success = aManager->saveContact(aContact); + + result = success ? EUpdated : EFailed; + } + } + } + + CNT_EXIT_ARGS(result) + + return result; +} + +/*! + Set the preferred call, sms and email details for a contact if possible + and needed. + + \param aContact the contact being handled +*/ +void CntSaveManager::setPreferredDetails( QContact* aContact ) +{ + CNT_ENTRY + + QList numberList( aContact->details() ); + //set preferred number for call if there is only one phone number + if ( aContact->preferredDetail("call").isEmpty() && numberList.count() == 1 ) + { + aContact->setPreferredDetail( "call", numberList.first() ); + } + //set preferred number for message if there is only one mobile phone number + if ( aContact->preferredDetail("message").isEmpty() && numberList.count() >= 1 ) + { + int mobileNumbers = 0; + int mobileNumberIndex = -1; + for (int i = 0; i < numberList.count(); i++) + { + QStringList subTypes = numberList.at(i).subTypes(); + if (subTypes.count() && subTypes.first() == QContactPhoneNumber::SubTypeMobile) + { + mobileNumbers++; + mobileNumberIndex = i; + } + } + if ( mobileNumbers == 1 ) + { + aContact->setPreferredDetail( "message", numberList.at(mobileNumberIndex) ); + } + } + QList emailList( aContact->details() ); + //set preferred number for email if there is only one email address + if ( aContact->preferredDetail("email").isEmpty() && emailList.count() == 1 ) + { + aContact->setPreferredDetail( "email", emailList.first() ); + } + + CNT_EXIT +} diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntviewnavigator.cpp --- a/phonebookui/pbkcommonui/src/cntviewnavigator.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntviewnavigator.cpp Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/phonebookapp/inc/cntapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookapp/inc/cntapplication.h Wed Aug 18 09:39:00 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 7cbcb2896f0e -r a642906a277a phonebookui/phonebookapp/phonebookapp.pro --- a/phonebookui/phonebookapp/phonebookapp.pro Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookapp/phonebookapp.pro Wed Aug 18 09:39:00 2010 +0300 @@ -44,6 +44,7 @@ SERVICE.OPTIONS = embeddable # Input +HEADERS += inc/cntapplication.h HEADERS += inc/cntinterface.h HEADERS += inc/cntappservicehandler.h @@ -63,8 +64,8 @@ SKINICON = qtg_large_phonebook - :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml \epoc32\release\winscw\udeb\z\resource\hb\splashml\phonebook.splashml - :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml \epoc32\data\z\resource\hb\splashml\phonebook.splashml - :BLD_INF_RULES.prj_exports += "resources/phonebook.docml \epoc32\release\winscw\udeb\z\resource\hb\splashml\phonebook.docml - :BLD_INF_RULES.prj_exports += "resources/phonebook.docml \epoc32\data\z\resource\hb\splashml\phonebook.docml + :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml /epoc32/release/winscw/udeb/z/resource/hb/splashml/phonebook.splashml + :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml /epoc32/data/z/resource/hb/splashml/phonebook.splashml + :BLD_INF_RULES.prj_exports += "resources/phonebook.docml /epoc32/release/winscw/udeb/z/resource/hb/splashml/phonebook.docml + :BLD_INF_RULES.prj_exports += "resources/phonebook.docml /epoc32/data/z/resource/hb/splashml/phonebook.docml } \ No newline at end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookapp/src/main.cpp --- a/phonebookui/phonebookapp/src/main.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookapp/src/main.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -15,23 +15,22 @@ * */ -#include -#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(); - QString path = "z:/resource/qt/translations/"; - translator.load(path + "contacts_" + lang); - a.installTranslator(&translator); + //For translation, loading and installing translator + HbTranslator translator("contacts"); + translator.loadCommon(); CntAppServiceHandler serviceHandler; CntMainWindow mainWindow; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntabstractserviceprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntabstractserviceprovider.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,39 @@ +/* + * 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: Abstract interface for highway providers used in phonebookservices. + * + */ + +#ifndef CNTABSTRACTSERVICEPROVIDER_H +#define CNTABSTRACTSERVICEPROVIDER_H + + +QTM_USE_NAMESPACE + +/*! + * Abstract interface for highway providers used in phonebookservices. + */ +class CntAbstractServiceProvider +{ +public: + + /*! + 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; + +}; + +#endif /* CNTABSTRACTSERVICEPROVIDER_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h --- a/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Wed Aug 18 09:39:00 2010 +0300 @@ -25,6 +25,7 @@ class CntServiceHandler; class CntAbstractViewManager; +class CntAbstractServiceProvider; QTM_BEGIN_NAMESPACE class QContact; @@ -39,7 +40,6 @@ public slots: void doCloseView(); - void addActionsToToolBar(); void addToContacts(); void saveNew(); void updateExisting(); @@ -47,13 +47,13 @@ void doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); public: - CntServiceAssignContactCardView(CntServiceHandler *aServiceHandler); + CntServiceAssignContactCardView( CntAbstractServiceProvider& aServiceController ); ~CntServiceAssignContactCardView(); int viewId() const { return serviceAssignContactCardView; } private: - CntServiceHandler *mServiceHandler; + CntAbstractServiceProvider& mProvider; CntAbstractViewManager *mViewManager; QContact mContact; QContactDetail mDetail; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicecontactcardview.h --- a/phonebookui/phonebookservices/inc/cntservicecontactcardview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntservicecontactcardview.h Wed Aug 18 09:39:00 2010 +0300 @@ -22,23 +22,23 @@ #include "cntcontactcardview.h" class CntServiceHandler; +class CntAbstractServiceProvider; class CntServiceContactCardView : public CntContactCardView { Q_OBJECT -private slots: - - void doShowPreviousView(); - public: - CntServiceContactCardView(CntServiceHandler *aServiceHandler); + CntServiceContactCardView( CntAbstractServiceProvider& aServiceProvider ); ~CntServiceContactCardView(); int viewId() const { return serviceContactCardView; } +private slots: + void closeContactCard(); + private: - CntServiceHandler *mServiceHandler; + CntAbstractServiceProvider& mProvider; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicecontactfetchview.h --- a/phonebookui/phonebookservices/inc/cntservicecontactfetchview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntservicecontactfetchview.h Wed Aug 18 09:39:00 2010 +0300 @@ -21,26 +21,39 @@ #include #include "cntbaseselectionview.h" +#include +#include "cntabstractserviceprovider.h" -class CntServiceHandler; +class CntServicesContact; class CntServiceContactFetchView : public CntBaseSelectionView { Q_OBJECT public: - CntServiceContactFetchView( CntServiceHandler *aServiceHandler ); + CntServiceContactFetchView( CntAbstractServiceProvider& aServiceProvider ); ~CntServiceContactFetchView(); int viewId() const { return serviceContactFetchView; } public slots: void aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters); - void aboutToCloseView(); + void closeFetchView(); void cancelFetch(); + void popupContactAction(QContact& aContact,QContactDetail contactDetail, QString aAction); + void actionPopupCancelSlot(); + +private: + void serviceCallMessageAction(QContact& aContact, QString aAction); + void serviceEmailAction(QContact& aContact); + void serviceAllAction(QContact& aContact); + void showPreviousView(); private: - CntServiceHandler *mServiceHandler; + CntAbstractServiceProvider& mProvider; + QString mAction; + CntServicesContactList mServiceList; + int mIndex; }; #endif /* CNTSERVICECONTACTFETCHVIEW_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicecontactselectionview.h --- a/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h Wed Aug 18 09:39:00 2010 +0300 @@ -21,6 +21,7 @@ #include #include "cntbaseselectionview.h" +#include "cntabstractserviceprovider.h" class QModelIndex; class CntServiceHandler; @@ -30,7 +31,7 @@ Q_OBJECT public: - CntServiceContactSelectionView(CntServiceHandler *aServiceHandler); + CntServiceContactSelectionView( CntAbstractServiceProvider& aServiceProvider ); ~CntServiceContactSelectionView(); int viewId() const { return serviceContactSelectionView; } @@ -41,7 +42,7 @@ void aboutToCloseView(); private: - CntServiceHandler *mServiceHandler; + CntAbstractServiceProvider& mProvider; QContactDetail mDetail; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceeditview.h --- a/phonebookui/phonebookservices/inc/cntserviceeditview.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceeditview.h Wed Aug 18 09:39:00 2010 +0300 @@ -20,6 +20,7 @@ #include #include "cnteditview.h" +#include "cntabstractserviceprovider.h" class CntServiceHandler; @@ -30,7 +31,7 @@ public: - CntServiceEditView(CntServiceHandler *aServiceHandler ); + CntServiceEditView( CntAbstractServiceProvider& aServiceProvider ); ~CntServiceEditView(); int viewId() const { return serviceEditView; } @@ -41,7 +42,7 @@ void doChangesDiscarded(); private: - CntServiceHandler *mServiceHandler; + CntAbstractServiceProvider& mProvider; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicegroupmemberview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntservicegroupmemberview.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,47 @@ +/* +* 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 CNTSERVICEGROUPMEMBERVIEW_H +#define CNTSERVICEGROUPMEMBERVIEW_H + +#include +#include "cntgroupmemberview.h" + +class CntServiceHandler; +class CntAbstractServiceProvider; + +class CntServiceGroupMemberView : public CntGroupMemberView +{ + Q_OBJECT + +public: + CntServiceGroupMemberView( CntAbstractServiceProvider& aServiceProvider ); + ~CntServiceGroupMemberView(); + + int viewId() const { return serviceGroupMemberView; } + +private slots: + void closeGroupMemberView(); + +private: + CntAbstractServiceProvider& mProvider; + +}; + +#endif // CNTSERVICEGROUPMEMBERVIEW_H + +// EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicehandler.h --- a/phonebookui/phonebookservices/inc/cntservicehandler.h Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +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 CNTSERVICEHANDLER_H -#define CNTSERVICEHANDLER_H - -#include -#include -#include -#include - -QTM_USE_NAMESPACE - -class CntServiceHandler : public XQServiceProvider -{ - Q_OBJECT -public: - CntServiceHandler(QObject *parent = 0); - ~CntServiceHandler(); - - enum CntServiceViewParams - { - ETitle = ECustomParam, - EFilter, - EAction - }; - -public: - void completeFetch(const CntServicesContactList &contactList); - void completeEdit(int result); - -public slots: - // Services offered to clients - void fetch(const QString &title, - const QString &action, - const QString &filter); - - void Dofetch(const QString &title, - const QString &action, - const QString &filter, - const QString &mode = KCntNoSelectionMode); - - void editCreateNew(const QString &definitionName, const QString &value); - void editCreateNew(const QString &vCardFile); - void editUpdateExisting(const QString &definitionName, const QString &value); - void open(int contactId); - void open(const QString &definitionName, const QString &value); - -signals: - void launchFetch(const QString &title, - const QString &action, - const QString &filter); - - void launchFetchVerified(const QString &title, - const QString &action, - const QString &filter, - const QString &mode); - - void launchEditor(QContact contact); - void launchContactSelection(QContactDetail detail); - void launchContactCard(QContact contact); - void launchAssignContactCard(QContact contact, QContactDetail detail); - -private: - void removeNotSupportedFields(QContact& contact); - void removeNotSupportedDetails(QContact& contact); - -private: - int mCurrentRequestIndex; - QStringList m_definitionNames; -}; - -#endif /* CNTSERVICEHANDLER_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicemainwindow.h --- a/phonebookui/phonebookservices/inc/cntservicemainwindow.h Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CNTSERVICEMAINWINDOW_H -#define CNTSERVICEMAINWINDOW_H - -#include -#include "cntmainwindow.h" - -class CntServiceHandler; -class CntServiceViewManager; - -class CntServiceMainWindow : public CntMainWindow -{ - Q_OBJECT - -public: - CntServiceMainWindow(CntServiceHandler *handler, QWidget *parent=0); - ~CntServiceMainWindow(); - -private: - CntServiceHandler *mServiceHandler; - CntServiceViewManager *mServiceViewManager; -}; - -#endif // CNTSERVICEMAINWINDOW_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceprovideredit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceprovideredit.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This class offers contact editing UI services. + * + */ + +#ifndef CNTSERVICEPROVIDEREDIT_H +#define CNTSERVICEPROVIDEREDIT_H + +#include +#include +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntServices; + +QTM_USE_NAMESPACE + +/*! + This class offers contact editing UI services. +*/ +class CntServiceProviderEdit : public XQServiceProvider, public CntAbstractServiceProvider +{ + Q_OBJECT +public: + CntServiceProviderEdit(CntServices& aServices, QObject *parent = 0); + ~CntServiceProviderEdit(); + +public slots: // operations offered to clients + + /** + * Launch editor for creating a new contact with a given detail. + * @param definitionName The field type + * @param value The value for the field. + */ + 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. + */ + void editCreateNewFromVCard(const QString &vCardFile); + + /** + * Open the editor for an existing contact.' + * @param contactId + */ + void editExisting(int contactId); + + /** + * 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. + */ + 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); + +private: + CntServices& mServices; + int mCurrentRequestIndex; +}; + +#endif /* CNTSERVICEPROVIDEREDIT_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceproviderfetch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceproviderfetch.h Wed Aug 18 09:39:00 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: + * + */ + +#ifndef CNTSERVICEPROVIDERFETCH_H +#define CNTSERVICEPROVIDERFETCH_H + +#include +#include +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntServices; + +QTM_USE_NAMESPACE + +/*! + This class offers services through the old interface name & old signatures. +*/ +class CntServiceProviderFetch : public XQServiceProvider, public CntAbstractServiceProvider +{ + Q_OBJECT +public: + CntServiceProviderFetch(CntServices& aServices, QObject *parent = 0); + ~CntServiceProviderFetch(); + +public slots: // operations offered to clients + + /** + * Opens contact selection view where multiple contacts can be selected. + * @param title The view title + * @param action Filter definition for filtering contacts based on supported action. Can be left empty. + */ + void multiFetch(const QString &title, + const QString &action ); + + /** + * Opens contact selection view where multiple contacts can be selected. + * @param title The view title + * @param action Filter definition for filtering contacts based on supported action. Can be left empty. + */ + void singleFetch(const QString &title, + const QString &action ); + +private: // from CntAbstractServiceProvider + void CompleteServiceAndCloseApp(const QVariant& retValue); + +private: + CntServices& mServices; + int mCurrentRequestIndex; +}; + +#endif /* CNTSERVICEPROVIDERFETCH_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceproviderold.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceproviderold.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,120 @@ +/* + * 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 CNTSERVICEPROVIDEROLD_H +#define CNTSERVICEPROVIDEROLD_H + +#include +#include +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntServices; + +QTM_USE_NAMESPACE + +/*! + This class offers services through the old interface name & old signatures. +*/ +class CntServiceProviderOld : public XQServiceProvider, public CntAbstractServiceProvider +{ + Q_OBJECT +public: + CntServiceProviderOld(CntServices& aServices, QObject *parent = 0); + ~CntServiceProviderOld(); + +public slots: // operations offered to clients + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * multiFetch(QString, QString, QString) + * com.nokia.symbian.IContactFetch. + */ + void fetch(const QString &title, + const QString &action, + const QString &filter); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * singleFetch(QString, QString, QString) + * com.nokia.symbian.IContactFetch. + */ + void Dofetch(const QString &title, + const QString &action, + const QString &filter, + const QString &mode = KCntNoSelectionMode); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editCreateNew(QString, QString) + * com.nokia.symbian.IContactEdit + */ + void editCreateNew(const QString& definitionName, const QString& value); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editCreateNewFromVCard(QString) + * com.nokia.symbian.IContactEdit + */ + void editCreateNew(const QString& vCardFile); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editUpdateExisting(QString, QString) + * com.nokia.symbian.IContactEdit + */ + void editUpdateExisting(const QString& definitionName, const QString& value); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * openContactCard(int contactId) + * com.nokia.symbian.IContactView + */ + void open(int contactId); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * openContactCard(QString, QString) + * com.nokia.symbian.IContactView + */ + void open(const QString& definitionName, const QString& value); + +private: // from CntAbstractServiceProvider + void CompleteServiceAndCloseApp(const QVariant& retValue); + +private: + CntServices& mServices; + int mCurrentRequestIndex; +}; + +#endif /* CNTSERVICEPROVIDEROLD_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceproviderold2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceproviderold2.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CNTSERVICEPROVIDEROLD2_H +#define CNTSERVICEPROVIDEROLD2_H + +#include +#include +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntServices; + +QTM_USE_NAMESPACE + +/*! + This class offers services through the old interface name & old signatures. +*/ +class CntServiceProviderOld2 : public XQServiceProvider, public CntAbstractServiceProvider +{ + Q_OBJECT +public: + CntServiceProviderOld2(CntServices& aServices, QObject *parent = 0); + ~CntServiceProviderOld2(); + +public slots: // operations offered to clients + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * multiFetch(QString, QString, QString) + * com.nokia.symbian.IContactFetch. + */ + void fetch(const QString &title, + const QString &action, + const QString &filter); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * singleFetch(QString, QString, QString) + * com.nokia.symbian.IContactFetch. + */ + void Dofetch(const QString &title, + const QString &action, + const QString &filter, + const QString &mode = KCntNoSelectionMode); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editCreateNew(QString, QString) + * com.nokia.symbian.IContactEdit + */ + void editCreateNew(const QString& definitionName, const QString& value); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editCreateNewFromVCard(QString) + * com.nokia.symbian.IContactEdit + */ + void editCreateNew(const QString& vCardFile); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * editUpdateExisting(QString, QString) + * com.nokia.symbian.IContactEdit + */ + void editUpdateExisting(const QString& definitionName, const QString& value); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * openContactCard(int contactId) + * com.nokia.symbian.IContactView + */ + void open(int contactId); + + /** + * Interface name has changed (see other impl. class) + * @deprecated + * Replaced with: + * openContactCard(QString, QString) + * com.nokia.symbian.IContactView + */ + void open(const QString& definitionName, const QString& value); + +private: // from CntAbstractServiceProvider + void CompleteServiceAndCloseApp(const QVariant& retValue); + +private: + CntServices& mServices; + int mCurrentRequestIndex; +}; + +#endif /* CNTSERVICEPROVIDEROLD2_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceproviderviewing.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceproviderviewing.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This class offers contact viewing UI services. + * + */ + +#ifndef CNTSERVICEPROVIDERVIEW_H +#define CNTSERVICEPROVIDERVIEW_H + +#include +#include +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntServices; + +QTM_USE_NAMESPACE + +/*! + This class offers contact viewing UI services. +*/ +class CntServiceProviderViewing : public XQServiceProvider, public CntAbstractServiceProvider +{ + Q_OBJECT +public: + CntServiceProviderViewing(CntServices& aServices, QObject *parent = 0); + ~CntServiceProviderViewing(); + +public slots: // operations offered to clients + + /** + * Opens Contact Card. + * @param aContactId + */ + void openContactCard( int aContactId ); + + /** + * Opens Contact Card for non-saved contact which is not saved yet. + * @param aFieldName + * @param aValue The value for the field. + */ + void openTemporaryContactCard( QString aFieldName, QString aFieldValue ); + + /** + * Opens Group Member View. + * @param aContactId + */ + void openGroup( int aContactId ); + +private: // from CntAbstractServiceProvider + void CompleteServiceAndCloseApp(const QVariant& retValue); + +private: + CntServices& mServices; + int mCurrentRequestIndex; +}; + +#endif /* CNTSERVICEPROVIDERVIEW_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservices.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntservices.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,185 @@ +/* + * 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 CNTSERVICES_H +#define CNTSERVICES_H + +#include +#include + +#include "cntabstractserviceprovider.h" + +class CntAbstractViewManager; +class XQServiceProvider; + +QTM_USE_NAMESPACE + +class CntServices : public QObject, public CntAbstractServiceProvider +{ + Q_OBJECT + +public: + CntServices(); + ~CntServices(); + +public: + + void setViewManager( CntAbstractViewManager& aViewManager ); + + /** + * Opens contact selection view where multiple contacts can be selected. + * @param title The view title + * @param action Filter definition for filtering contacts based on supported action. Can be left empty. + * @param aServiceProvider The service provider + */ + void singleFetch(const QString &title, + const QString &action, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * Opens contact selection view where multiple contacts can be selected. + * @param title The view title + * @param action Filter definition for filtering contacts based on supported action. Can be left empty. + * @param aServiceProvider The service provider + */ + void multiFetch(const QString &title, + const QString &action, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * Launch editor for creating a new contact with a given detail. + * @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, 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. + * @param vCardFile The vCard file name and path. + * @param aServiceProvider The service provider + */ + void editCreateNewFromVCard(const QString &vCardFile, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * 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 aServiceProvider The service provider + */ + void editUpdateExisting(const QString &definitionName, const QString &value, + 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.' + * @param contactId + * @param aServiceProvider The service provider + */ + void editExisting(int contactId, + CntAbstractServiceProvider& aServiceProvider); + + /** + * Opens Contact Card. + * @param contactId The contact ID + * @param aServiceProvider The service provider + */ + void launchContactCard(int contactId, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * Opens Group member view. + * @param contactId The contact ID + * @param aServiceProvider The service provider + */ + void launchGroupMemberView(int contactId, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * Opens Contact Card for non-saved contact. + * @param definitionName Field name. + * @param value The field value. + * @param aServiceProvider The service provider + */ + void launchTemporaryContactCard(const QString &definitionName, const QString &value, + CntAbstractServiceProvider& aServiceProvider ); + + /** + * Set the flag that allows quitting the application explicitly + * using the quitApp slot. By default the value is always true. + */ + 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); + QContactManager* contactManager(); + +private: // from CntAbstractServiceProvider + void CompleteServiceAndCloseApp(const QVariant& retValue); +private: + CntAbstractViewManager* mViewManager; // not owned + QStringList m_definitionNames; + CntAbstractServiceProvider* mCurrentProvider; // not owned + bool mIsQuittable; +}; + +#endif /* CNTSERVICES_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicestrings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntservicestrings.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Contacts highway service interface strings. + * + */ + +#ifndef CNTSERVICESTRINGS_H +#define CNTSERVICESTRINGS_H + +// Full interface names. The beginning part "phonebookservices" is the service name. +#define KCntServiceInterfaceView "phonebookservices.com.nokia.symbian.IContactsView" +#define KCntServiceInterfaceFetch "phonebookservices.com.nokia.symbian.IContactsFetch" +#define KCntServiceInterfaceEdit "phonebookservices.com.nokia.symbian.IContactsEdit" + + +#endif /* CNTSERVICESTRINGS_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntservicesubeditview.h --- a/phonebookui/phonebookservices/inc/cntservicesubeditview.h Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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 CNTSERVICESUBEDITVIEW_H -#define CNTSERVICESUBEDITVIEW_H - -#include -#include "cnteditview.h" - -class CntServiceHandler; - -class CntServiceSubEditView : public CntEditView -{ - -Q_OBJECT - -public: - - CntServiceSubEditView( CntServiceHandler *aServiceHandler ); - ~CntServiceSubEditView(); - - int viewId() const { return serviceSubEditView; } - -//public slots: -// void aboutToCloseView(); -// int handleExecutedCommand(QString aCommand, const QContact &aContact); -// void discardAllChanges(); - -private: - CntServiceHandler *mServiceHandler; - -}; - -#endif //CNTSERVICESUBEDITVIEW_H -// EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceviewfactory.h --- a/phonebookui/phonebookservices/inc/cntserviceviewfactory.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceviewfactory.h Wed Aug 18 09:39:00 2010 +0300 @@ -21,18 +21,18 @@ #include "cntabstractviewfactory.h" class CntAbstractView; -class CntServiceHandler; +class CntAbstractServiceProvider; class CntServiceViewFactory : public CntDefaultViewFactory { public: - CntServiceViewFactory( CntServiceHandler* aService ); + CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider ); ~CntServiceViewFactory(); public: CntAbstractView* createView( int aViewId ); private: - CntServiceHandler* mService; + CntAbstractServiceProvider& mProvider; }; #endif /* CNTSERVICEVIEWFACTORY_H_ */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceviewmanager.h --- a/phonebookui/phonebookservices/inc/cntserviceviewmanager.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceviewmanager.h Wed Aug 18 09:39:00 2010 +0300 @@ -26,28 +26,19 @@ class CntBaseView; class CntServiceHandler; +class CntAbstractServiceProvider; class CntServiceViewManager : public CntDefaultViewManager { Q_OBJECT public: - CntServiceViewManager(HbMainWindow *mainWindow, CntServiceHandler *aHandler); + CntServiceViewManager(HbMainWindow *mainWindow, CntAbstractServiceProvider& aProvider ); ~CntServiceViewManager(); - -public slots: - void handleFetch(const QString &title, const QString &action, const QString &filter); - void launchFetch(const QString &title, const QString &action, const QString &filter, const QString &mode = KCntMultiSelectionMode); - void launchEditor(QContact contact); - void launchContactSelection(QContactDetail detail); - void launchContactCard(QContact contact); - void launchAssignContactCard(QContact contact, QContactDetail detail); - protected slots: virtual void closeApp(); - -private: - CntServiceHandler *mServiceHandler; +signals: + void applicationClosed(); }; #endif // CNTSERVICEVIEWMANAGER_H diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/inc/cntserviceviewparams.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/inc/cntserviceviewparams.h Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,32 @@ +/* + * 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: View parameter constants used internally in phonebookservices. + * + */ + +#ifndef CNTSERVICEVIEWPARAMS_H +#define CNTSERVICEVIEWPARAMS_H + + +#include + +/// View parameters used inside phonebookservices. +enum CntServiceViewParams + { + /// Specifies the title string for a service view + KCntServiceViewParamTitle = ECustomParam + }; + + +#endif /* CNTSERVICEVIEWPARAMS_H */ diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/phonebookservices.pro --- a/phonebookui/phonebookservices/phonebookservices.pro Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/phonebookservices.pro Wed Aug 18 09:39:00 2010 +0300 @@ -23,35 +23,46 @@ INCLUDEPATH += ../../phonebookengines/cntimageutility/inc INCLUDEPATH += . \ - inc + inc \ + ../../inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE MOC_DIR = moc # Input -HEADERS += inc/cntservicemainwindow.h \ - inc/cntserviceviewmanager.h \ - inc/cntservicehandler.h \ +HEADERS += inc/cntserviceviewmanager.h \ + inc/cntserviceproviderold.h \ + inc/cntserviceproviderold2.h \ inc/cntservicecontactfetchview.h \ inc/cntservicecontactselectionview.h \ inc/cntserviceeditview.h \ inc/cntservicecontactcardview.h \ - inc/cntservicesubeditview.h \ + inc/cntservicegroupmemberview.h \ inc/cntserviceassigncontactcardview.h \ - inc/cntserviceviewfactory.h + inc/cntserviceviewfactory.h \ + inc/cntservices.h \ + inc/cntabstractserviceprovider.h \ + inc/cntserviceproviderfetch.h \ + inc/cntserviceproviderviewing.h \ + inc/cntserviceprovideredit.h \ + inc/cntserviceviewparams.h SOURCES += src/main.cpp \ - src/cntservicemainwindow.cpp \ src/cntserviceviewmanager.cpp \ - src/cntservicehandler.cpp \ + src/cntserviceproviderold.cpp \ + src/cntserviceproviderold2.cpp \ src/cntservicecontactfetchview.cpp \ src/cntservicecontactselectionview.cpp \ src/cntserviceeditview.cpp \ src/cntservicecontactcardview.cpp \ - src/cntservicesubeditview.cpp \ + src/cntservicegroupmemberview.cpp \ src/cntserviceassigncontactcardview.cpp \ - src/cntserviceviewfactory.cpp + src/cntserviceviewfactory.cpp \ + src/cntservices.cpp \ + src/cntserviceproviderfetch.cpp \ + src/cntserviceproviderviewing.cpp \ + src/cntserviceprovideredit.cpp # capability TARGET.CAPABILITY = CAP_APPLICATION diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/service_conf.xml --- a/phonebookui/phonebookservices/service_conf.xml Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/service_conf.xml Wed Aug 18 09:39:00 2010 +0300 @@ -1,7 +1,32 @@ - - Phonebook service - + + phonebookservices + No path + xPhonebook services + + com.nokia.symbian.IContactsFetch + 1.0 + Fetch interface + + + phonebookservices.Fetch + 1.0 Fetch interface + + Fetch + 1.0 + Fetch interface + com.nokia.services.phonebookservices + + + com.nokia.symbian.IContactsView + 1.0 + Contact viewing interface + + + com.nokia.symbian.IContactsEdit + 1.0 + Contact editing interface + \ No newline at end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp --- a/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,7 +16,8 @@ */ #include "cntserviceassigncontactcardview.h" -#include "cntservicehandler.h" +#include "cntabstractserviceprovider.h" +#include "cntdebug.h" #include #include @@ -32,14 +33,15 @@ 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) */ -CntServiceAssignContactCardView::CntServiceAssignContactCardView(CntServiceHandler *aServiceHandler) : - CntContactCardView(), - mServiceHandler(aServiceHandler) +CntServiceAssignContactCardView::CntServiceAssignContactCardView( CntAbstractServiceProvider& 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 } /*! @@ -47,17 +49,8 @@ */ CntServiceAssignContactCardView::~CntServiceAssignContactCardView() { - -} - -/*! -Add actions to the toolbar -*/ -void CntServiceAssignContactCardView::addActionsToToolBar() -{ - view()->toolBar()->clearActions(); - HbAction* addToContact = view()->toolBar()->addAction("txt_phob_button_add_to_contacts"); - connect(addToContact, SIGNAL(triggered()), this, SLOT(addToContacts())); + CNT_ENTRY + CNT_EXIT } /*! @@ -65,23 +58,44 @@ */ void CntServiceAssignContactCardView::addToContacts() { - HbDialog *popup = new HbDialog(); + CNT_ENTRY + + 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 } /*! @@ -89,12 +103,16 @@ */ void CntServiceAssignContactCardView::saveNew() { + CNT_ENTRY CntViewParameters viewParameters; viewParameters.insert(EViewId, serviceEditView); + QContactName contactName = mContact.detail(); + mContact.removeDetail(&contactName); QVariant var; var.setValue(mContact); viewParameters.insert(ESelectedContact, var); mViewManager->changeView(viewParameters); + CNT_EXIT } /*! @@ -102,12 +120,14 @@ */ void CntServiceAssignContactCardView::updateExisting() { + CNT_ENTRY CntViewParameters viewParameters; viewParameters.insert(EViewId, serviceContactSelectionView); QVariant var; var.setValue(mDetail); viewParameters.insert(ESelectedDetail, var); mViewManager->changeView(viewParameters); + CNT_EXIT } /*! @@ -115,9 +135,11 @@ */ void CntServiceAssignContactCardView::doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) { + CNT_ENTRY mViewManager = aMgr; mContact = aArgs.value(ESelectedContact).value(); mDetail = aArgs.value(ESelectedDetail).value(); + CNT_EXIT } /*! @@ -125,7 +147,9 @@ */ void CntServiceAssignContactCardView::doCloseView() { + CNT_ENTRY qApp->quit(); + CNT_EXIT } // end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicecontactcardview.cpp --- a/phonebookui/phonebookservices/src/cntservicecontactcardview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntservicecontactcardview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,18 +16,21 @@ */ #include "cntservicecontactcardview.h" -#include "cntservicehandler.h" -#include +#include "cntabstractserviceprovider.h" +#include "cntdebug.h" +#include /*! 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) */ -CntServiceContactCardView::CntServiceContactCardView(CntServiceHandler *aServiceHandler) : +CntServiceContactCardView::CntServiceContactCardView( CntAbstractServiceProvider& aServiceProvider ) : CntContactCardView(), - mServiceHandler(aServiceHandler) + mProvider( aServiceProvider ) { - connect(this, SIGNAL(backPressed()), this, SLOT(doShowPreviousView())); + CNT_ENTRY + connect(this, SIGNAL(backPressed()), this, SLOT(closeContactCard())); + CNT_EXIT } /*! @@ -35,17 +38,20 @@ */ CntServiceContactCardView::~CntServiceContactCardView() { - + CNT_ENTRY + CNT_EXIT } /*! Close the view (quits the service as well) */ -void CntServiceContactCardView::doShowPreviousView() +void CntServiceContactCardView::closeContactCard() { - int result = -2; - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - mServiceHandler->completeEdit(result); + CNT_ENTRY + QVariant variant; + variant.setValue(KCntServicesTerminated); + mProvider.CompleteServiceAndCloseApp(variant); + CNT_EXIT } // end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp --- a/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -19,25 +19,25 @@ #include #include -#include "cntservicehandler.h" +#include "cntserviceviewparams.h" #include #include #include #include #include +#include "cntactionpopup.h" #include -CntServiceContactFetchView::CntServiceContactFetchView(CntServiceHandler *aServiceHandler): +CntServiceContactFetchView::CntServiceContactFetchView( CntAbstractServiceProvider& aServiceProvider ): CntBaseSelectionView(), -mServiceHandler(aServiceHandler) -{ +mProvider( aServiceProvider ) + { HbAction* cancel = static_cast( mDocument->findObject( "cnt:cancel" ) ); mView->menu()->addAction( cancel ); - connect(cancel, SIGNAL(triggered()), this, SLOT(cancelFetch()) ); - connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) ); + connect( this, SIGNAL(viewClosed()), this, SLOT(closeFetchView()) ); connect( this, SIGNAL(viewOpened(CntAbstractViewManager*, const CntViewParameters)), this, SLOT(aboutToOpenView(CntAbstractViewManager*, const CntViewParameters)) ); } @@ -47,51 +47,182 @@ void CntServiceContactFetchView::cancelFetch() -{ - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + { CntServicesContactList serviceList; - mServiceHandler->completeFetch(serviceList); -} + QVariant variant; + variant.setValue(serviceList); + mProvider.CompleteServiceAndCloseApp(variant); + } -void CntServiceContactFetchView::aboutToCloseView() + + +void CntServiceContactFetchView::closeFetchView() { - CntServicesContactList serviceList; QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND); QModelIndexList temp = mListView->selectionModel()->selection().indexes(); + mIndex = 0; for(int i = 0; i < temp.count(); i++ ) { QContact contact = mListModel->contact(temp.at(i)); - CntServicesContact servicesContact; - - //get the name - servicesContact.mDisplayName = contact.displayLabel(); - - //get the phonenumber - QList phonenumbers = contact.details(); - if(phonenumbers.count() > 0) + if (mAction == KCntActionCall) + { + serviceCallMessageAction(contact, KCntActionCall); + } + else if (mAction == KCntActionSms ) { - servicesContact.mPhoneNumber = phonenumbers.first().number(); + serviceCallMessageAction(contact, "message"); + } + else if (mAction == KCntActionEmail) + { + serviceEmailAction(contact); } else { - servicesContact.mPhoneNumber = ""; + serviceAllAction(contact); } + } + showPreviousView(); +} + +void CntServiceContactFetchView::serviceCallMessageAction(QContact& aContact, QString aAction) +{ + CntServicesContact servicesContact; + //get the phonenumber + QList phonenumbers = aContact.details(); + + Q_ASSERT_X( phonenumbers.count() > 0, "serviceCallMessageAction", "Number count is zero"); + + QContactDetail detail = aContact.preferredDetail(aAction); + if (!detail.isEmpty()) + { + //Set preferred detail for services + QContactPhoneNumber number = detail; + servicesContact.mDisplayName = aContact.displayLabel(); + servicesContact.mPhoneNumber = number.number(); + servicesContact.mEmailAddress = ""; + servicesContact.mContactId = aContact.localId(); + mServiceList.append(servicesContact); + } + else + { + // show popup for call numbers + CntActionPopup *actionPopup = new CntActionPopup(&aContact); + bool popup = actionPopup->showActionPopup(aAction); + if(popup) + { + //if call numbers are present wait for signals + mIndex++; + connect( actionPopup, SIGNAL(executeContactAction(QContact&,QContactDetail, QString)), this, + SLOT(popupContactAction(QContact&, QContactDetail, QString))); + connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, + SLOT(actionPopupCancelSlot())); + } + else + { + //else delete popup if no call number present + delete actionPopup; + } + } +} +void CntServiceContactFetchView::serviceEmailAction(QContact& aContact) +{ + CntServicesContact servicesContact; + //get the email address + QList emailAddresses = aContact.details(); + + Q_ASSERT_X( emailAddresses.count() > 0, "serviceEmailAction", "email address count is zero"); + + QContactDetail detail = aContact.preferredDetail("email"); + if (!detail.isEmpty()) + { + //Set preferred detail for services + QContactEmailAddress email = detail; + servicesContact.mDisplayName = aContact.displayLabel(); + servicesContact.mPhoneNumber = ""; + servicesContact.mEmailAddress = email.emailAddress(); + servicesContact.mContactId = aContact.localId(); + mServiceList.append(servicesContact); + + } + else + { + // show popup for email id's + CntActionPopup *actionPopup = new CntActionPopup(&aContact); + bool popup = actionPopup->showActionPopup("email"); + if(popup) + { + //if email id's are present wait for signals + mIndex++; + connect( actionPopup, SIGNAL(executeContactAction(QContact&,QContactDetail, QString)), this, + SLOT(popupContactAction(QContact&, QContactDetail, QString))); + connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, + SLOT(actionPopupCancelSlot())); + } + else + { + //else delete popup if no email present + delete actionPopup; + } + } +} + +void CntServiceContactFetchView::serviceAllAction(QContact& aContact) +{ + CntServicesContact servicesContact; + servicesContact.mDisplayName = aContact.displayLabel(); + QContactDetail callDetail = aContact.preferredDetail("call"); + //Check for preferredDetail from call + // if not present check for preferredDetail for message + // if not present pick first phone number + if (!callDetail.isEmpty()) + { + QContactPhoneNumber number = callDetail; + servicesContact.mPhoneNumber = number.number(); + } + else + { + QContactDetail smsDetail = aContact.preferredDetail("message"); + if (!callDetail.isEmpty()) + { + QContactPhoneNumber number = smsDetail; + servicesContact.mPhoneNumber = number.number(); + } + else + { + QList phonenumbers = aContact.details(); + if(phonenumbers.count() > 0) + { + servicesContact.mPhoneNumber = phonenumbers.first().number(); + } + else + { + servicesContact.mPhoneNumber = ""; + } + } + } + + QContactDetail emailDetail = aContact.preferredDetail("email"); + if (!emailDetail.isEmpty()) + { + QContactEmailAddress email = emailDetail; + servicesContact.mEmailAddress = email.emailAddress(); + } + else + { //get first email address - QList emailAddresses = contact.details(); + QList emailAddresses = aContact.details(); if(emailAddresses.count() > 0) { servicesContact.mEmailAddress = emailAddresses.first().emailAddress(); } - //contact id - servicesContact.mContactId = contact.localId(); - - //append it to the list - serviceList.append(servicesContact); + else + { + servicesContact.mEmailAddress = ""; + } } - - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - mServiceHandler->completeFetch(serviceList); + servicesContact.mContactId = aContact.localId(); + mServiceList.append(servicesContact); } void CntServiceContactFetchView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) @@ -99,25 +230,30 @@ mMgr = aMgr; // Set title of the view. - QString title = aArgs.value(CntServiceHandler::ETitle).toString(); + QString title = aArgs.value(KCntServiceViewParamTitle).toString(); mView->setTitle(title); // Set action filter - QString filter = aArgs.value(CntServiceHandler::EFilter).toString(); - QString action = aArgs.value(CntServiceHandler::EAction).toString(); - if (action == KCntActionSms) + mAction = aArgs.value(ESelectedAction).toString(); + // ESelectedAction is defined in cntviewparams.h + + // Has never been implemented. + //QString filterStr = aArgs.value(KCntServiceViewParamFilter).toString(); + // KCntServiceViewParamFilter is defined in cntserviceviewparams.h + + if (mAction == KCntActionSms) { QContactActionFilter actionFilter; actionFilter.setActionName("message"); mListModel->setFilter(actionFilter); } - else if (action == KCntActionCall) + else if (mAction == KCntActionCall) { QContactActionFilter actionFilter; actionFilter.setActionName("call"); mListModel->setFilter(actionFilter); } - else if (action == KCntActionEmail) + else if (mAction == KCntActionEmail) { QContactActionFilter actionFilter; actionFilter.setActionName("email"); @@ -139,4 +275,59 @@ } } +void CntServiceContactFetchView::popupContactAction(QContact& aContact,QContactDetail contactDetail, QString aAction) +{ + if (aAction.compare("call", Qt::CaseInsensitive) == 0 + || aAction.compare("message", Qt::CaseInsensitive) == 0 ) + { + CntServicesContact servicesContact; + QContactPhoneNumber number = static_cast(contactDetail); + QString name = aContact.displayLabel(); + servicesContact.mDisplayName = aContact.displayLabel(); + servicesContact.mPhoneNumber = number.number(); + servicesContact.mEmailAddress = ""; + servicesContact.mContactId = aContact.localId(); + mServiceList.append(servicesContact); + mIndex--; + } + else if (aAction.compare("email", Qt::CaseInsensitive) == 0 ) + { + CntServicesContact servicesContact; + QContactEmailAddress email = static_cast(contactDetail); + servicesContact.mDisplayName = aContact.displayLabel(); + servicesContact.mPhoneNumber = ""; + servicesContact.mEmailAddress = email.emailAddress(); + servicesContact.mContactId = aContact.localId(); + mServiceList.append(servicesContact); + mIndex--; + } + + if (aContact.preferredDetail(aAction).isEmpty() && (aAction == "call" || aAction == "message" || aAction == "email")) + { + aContact.setPreferredDetail(aAction, contactDetail); + //return value will be ignored because we cannot do anything if it fails. + mMgr->contactManager(SYMBIAN_BACKEND)->saveContact(&aContact); + } + + showPreviousView(); +} + +void CntServiceContactFetchView::actionPopupCancelSlot() +{ + mIndex--; + showPreviousView(); +} + +void CntServiceContactFetchView::showPreviousView() +{ + if(mIndex==0) + { + QVariant variant; + variant.setValue(mServiceList); + mProvider.CompleteServiceAndCloseApp(variant); + + CntViewParameters args; + mMgr->back( args ); + } +} // EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp --- a/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -17,15 +17,15 @@ #include "cntservicecontactselectionview.h" +#include #include #include -#include "cntservicehandler.h" #include #include -CntServiceContactSelectionView::CntServiceContactSelectionView(CntServiceHandler *aServiceHandler): +CntServiceContactSelectionView::CntServiceContactSelectionView( CntAbstractServiceProvider& aServiceProvider ): CntBaseSelectionView(), -mServiceHandler(aServiceHandler) +mProvider( aServiceProvider ) { connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(onListViewActivated(const QModelIndex&))); connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) ); @@ -37,6 +37,7 @@ } +// An item in the selection list has been clicked void CntServiceContactSelectionView::onListViewActivated(const QModelIndex &aIndex) { QContact contact = mListModel->contact(aIndex); @@ -52,8 +53,11 @@ void CntServiceContactSelectionView::aboutToCloseView() { - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - mServiceHandler->completeEdit(0); + QVariant variant; + variant.setValue(KCntServicesReturnValueContactNotModified); + mProvider.CompleteServiceAndCloseApp(variant); + CntViewParameters args; + mMgr->back( args ); } void CntServiceContactSelectionView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters) diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceeditview.cpp --- a/phonebookui/phonebookservices/src/cntserviceeditview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceeditview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,11 +16,13 @@ */ #include "cntserviceeditview.h" -#include "cntservicehandler.h" +#include #include +#include "cntdebug.h" -CntServiceEditView::CntServiceEditView(CntServiceHandler *aServiceHandler ) : CntEditView(), -mServiceHandler(aServiceHandler) +CntServiceEditView::CntServiceEditView( CntAbstractServiceProvider& aServiceProvider ) +: CntEditView(), +mProvider( aServiceProvider ) { connect( this, SIGNAL(contactUpdated(int)), this, SLOT(doContactUpdated(int)) ); connect( this, SIGNAL(contactRemoved(bool)), this, SLOT(doContactRemoved(bool)) ); @@ -33,67 +35,37 @@ void CntServiceEditView::doContactUpdated(int aSuccess) { - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - mServiceHandler->completeEdit(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) { - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - int retValue = aSuccess ? -1 : 0; - mServiceHandler->completeEdit(retValue); + CNT_ENTRY_ARGS(aSuccess) + + int retValue = aSuccess ? KCntServicesReturnValueContactDeleted : KCntServicesReturnValueContactNotModified; + QVariant variant; + variant.setValue(retValue); + mProvider.CompleteServiceAndCloseApp(variant); + + CNT_EXIT } void CntServiceEditView::doChangesDiscarded() { - connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - mServiceHandler->completeEdit(0); + CNT_ENTRY + + QVariant variant; + variant.setValue(KCntServicesReturnValueContactNotModified); + mProvider.CompleteServiceAndCloseApp(variant); + + CNT_EXIT } -// -///*! -//Saves the contact -//*/ -//void CntServiceEditView::aboutToCloseView() -//{ -// int result = 0; -// // save contact if there is one -// if (contact() && !contact()->isEmpty()) -// { -// bool isSaved = contactManager()->saveContact(contact()); -// if (isSaved) -// { -// result = 1; -// } -// } -// -// connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); -// mServiceHandler->completeEdit(result); -//} -// -///*! -//Cancel all changes made and return to the application editor was opened from -//*/ -//void CntServiceEditView::discardAllChanges() -//{ -// connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); -// mServiceHandler->completeEdit(0); -//} -// -///* -//Handle signals emitted from CntCommands, only used for delete command for now. -//*/ -//int CntServiceEditView::handleExecutedCommand(QString aCommand, const QContact &aContact) -//{ -// Q_UNUSED(aContact); -// int result=-1; -// if (aCommand == "delete") -// { -// connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); -// mServiceHandler->completeEdit(result); -// result = 0; -// } -// return result; -//} - // EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicegroupmemberview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntservicegroupmemberview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cntservicegroupmemberview.h" +#include "cntabstractserviceprovider.h" +#include "cntdebug.h" +#include + +/*! +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) +*/ +CntServiceGroupMemberView::CntServiceGroupMemberView( CntAbstractServiceProvider& aServiceProvider ) : + CntGroupMemberView(), + mProvider( aServiceProvider ) +{ + CNT_ENTRY + connect(this, SIGNAL(backPressed()), this, SLOT(closeGroupMemberView())); + CNT_EXIT +} + +/*! +Destructor +*/ +CntServiceGroupMemberView::~CntServiceGroupMemberView() +{ + CNT_ENTRY + CNT_EXIT +} + +/*! +Close the view (quits the service as well) +*/ +void CntServiceGroupMemberView::closeGroupMemberView() +{ + CNT_ENTRY + QVariant variant; + variant.setValue(KCntServicesTerminated); + mProvider.CompleteServiceAndCloseApp(variant); + CNT_EXIT +} + +// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicehandler.cpp --- a/phonebookui/phonebookservices/src/cntservicehandler.cpp Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +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 "cntservicehandler.h" -#include "cntimageutility.h" - -#include -#include -#include - -#include -#include -#include - -/* NOTE! THIS SERVICE WILL BE RENAMED TO com.nokia.services.phonebook.Services */ -CntServiceHandler::CntServiceHandler(QObject *parent): - XQServiceProvider(QLatin1String("com.nokia.services.phonebookservices.Fetch"), parent), - mCurrentRequestIndex(0) -{ - publishAll(); - - // Definition names supported in symbian back-end - m_definitionNames << QContactName::DefinitionName; - m_definitionNames << QContactNickname::DefinitionName; - m_definitionNames << QContactPhoneNumber::DefinitionName; - m_definitionNames << QContactEmailAddress::DefinitionName; - m_definitionNames << QContactAddress::DefinitionName; - m_definitionNames << QContactUrl::DefinitionName; - m_definitionNames << QContactBirthday::DefinitionName; - m_definitionNames << QContactOrganization::DefinitionName; - m_definitionNames << QContactSyncTarget::DefinitionName; - m_definitionNames << QContactNote::DefinitionName; - m_definitionNames << QContactFamily::DefinitionName; - m_definitionNames << QContactAvatar::DefinitionName; - m_definitionNames << QContactAnniversary::DefinitionName; - m_definitionNames << QContactGeoLocation::DefinitionName; - m_definitionNames << QContactGender::DefinitionName; - m_definitionNames << QContactOnlineAccount::DefinitionName; -} - -CntServiceHandler::~CntServiceHandler() -{ -} - -/* -Complete the fetch and return the list selected contacts -*/ -void CntServiceHandler::completeFetch( const CntServicesContactList &contactList ) -{ - QVariant retValue; - retValue.setValue(contactList); - completeRequest(mCurrentRequestIndex, retValue); - mCurrentRequestIndex = 0; -} - -/* -Complete edit and return if contact wasn't modified (-2), was deleted (-1), saved (1) or if saving failed (0) -*/ -void CntServiceHandler::completeEdit(int result) -{ - QVariant retValue(result); - completeRequest(mCurrentRequestIndex, retValue); - mCurrentRequestIndex = 0; -} - -/* -Launch fetch service with given parameters -*/ -void CntServiceHandler::fetch(const QString &title, const QString &action, const QString &filter) -{ - emit launchFetch(title, action, filter); - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -Launch fetch service with given parameters. Fetching mode is No-select by default. -*/ -void CntServiceHandler::Dofetch(const QString &title, const QString &action, const QString &filter, const QString &mode) -{ - emit launchFetchVerified(title, action, filter, mode); - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -Launch new contact editor with a given detail -*/ -void CntServiceHandler::editCreateNew(const QString &definitionName, const QString &value) -{ - QContact contact; - - if (definitionName == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber phoneNumber; - phoneNumber.setNumber(value); - phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); - contact.saveDetail(&phoneNumber); - } - else if (definitionName == QContactEmailAddress::DefinitionName) - { - QContactEmailAddress email; - email.setEmailAddress(value); - contact.saveDetail(&email); - } - else if (definitionName == QContactOnlineAccount::DefinitionName) - { - QContactOnlineAccount account; - account.setAccountUri(value); - account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); - contact.saveDetail(&account); - } - - emit launchEditor(contact); - - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -Launch new contact editor with a given vCard filename -*/ -void CntServiceHandler::editCreateNew(const QString &vCardFile) -{ - CntImageUtility imageUtility; - QContact contact; - QVersitReader reader; - QFile file(vCardFile); - - if (!file.open(QIODevice::ReadOnly)) - return; - reader.setDevice(&file); - reader.startReading(); - reader.waitForFinished(); - - // Use the resulting document(s)... - QVersitContactImporter importer; - QList versitDocuments = reader.results(); - if (versitDocuments.count() > 0 - && importer.importDocuments(versitDocuments)) - { - QList contacts = importer.contacts(); - if (contacts.count() > 0) - contact = contacts.first(); - } - file.close(); - - // Save thumbnail images - QList details = contact.details(); - for (int i = 0;i < details.count();i++) - { - if (!details.at(i).thumbnail().isNull()) - { - QString imagepath; - QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail()); - if (imageUtility.createImage(pixmap,imagepath)) - { - // Update contact detail - QContactAvatar detail=details.at(i); - detail.setImageUrl(imagepath); - contact.saveDetail(&detail); - } - } - } - - removeNotSupportedDetails(contact); - removeNotSupportedFields(contact); - emit launchEditor(contact); - - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -* Remove details not supported in symbian back-end. -*/ -void CntServiceHandler::removeNotSupportedDetails(QContact& contact) -{ - // Check definition map, remove details not supported - for (int i=0; i < contact.details().count(); i++) - { - if (!m_definitionNames.contains(contact.details().at(i).definitionName())) - { - QContactDetail detail= contact.details().at(i); - contact.removeDetail(&detail); - } - } -} -/* -* Remove fields not supported in symbian back-end. -*/ -void CntServiceHandler::removeNotSupportedFields(QContact& contact) -{ - QContactManager cm("symbian"); - - // Not all fields are supported in symbian back-end - // Remove not supported fields - for (int i=0; i < contact.details().count(); i++) - { - QContactDetail detail = contact.details().at(i); - if (detail.definitionName() == QContactAddress::DefinitionName) - { - QContactAddress addrDetail = static_cast(detail); - - // Sub-types not supported - if (detail.removeValue(QContactAddress::FieldSubTypes)) - contact.saveDetail(&detail); - } - else if (detail.definitionName() == QContactAnniversary::DefinitionName) - { - QContactAnniversary annivDetail = static_cast(detail); - - // Sub-types not supported - if (detail.removeValue(QContactAnniversary::FieldSubType)) - contact.saveDetail(&detail); - - // Context not supported - if (detail.removeValue(QContactDetail::FieldContext)) - contact.saveDetail(&detail); - } - else if (detail.definitionName() == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber phoneDetail = static_cast(detail); - - if (phoneDetail.subTypes().size() == 0) - { - // No Sub-type found, set as SubTypeMobile - phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile); - contact.saveDetail(&phoneDetail); - } - else if (phoneDetail.subTypes().size() > 0 ) - { - // Sub-types not supported - if (phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice) - || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable) - || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVideo)) - { - // Replace as SubTypeMobile - phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile); - contact.saveDetail(&phoneDetail); - } - } - } - else if (detail.definitionName() == QContactUrl::DefinitionName) - { - QContactUrl urlDetail = static_cast(detail); - - QString stype=QContactUrl::SubTypeHomePage; - if (urlDetail.subType().compare(stype) != 0) - { - detail.removeValue(QContactUrl::FieldSubType); - contact.saveDetail(&detail); - } - } - } -} -/* -Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail) -*/ -void CntServiceHandler::editUpdateExisting(const QString &definitionName, const QString &value) -{ - QContactDetail detail; - - if (definitionName == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber phoneNumber; - phoneNumber.setNumber(value); - phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); - detail = phoneNumber; - } - else if (definitionName == QContactEmailAddress::DefinitionName) - { - QContactEmailAddress email; - email.setEmailAddress(value); - detail = email; - } - else if (definitionName == QContactOnlineAccount::DefinitionName) - { - QContactOnlineAccount account; - account.setAccountUri(value); - account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); - detail = account; - } - - emit launchContactSelection(detail); - - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -Launch communication launcher view for the contact with the given ID (QContactLocalId -> int) -*/ -void CntServiceHandler::open(int contactId) -{ - QContactManager manager("symbian"); - QContact contact = manager.contact(contactId); - - emit launchContactCard(contact); - - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -/* -Launch temporary communication launcher view with the given detail -*/ -void CntServiceHandler::open(const QString &definitionName, const QString &value) -{ - QContact contact; - QContactDetail detail; - - if (definitionName == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber phoneNumber; - phoneNumber.setNumber(value); - phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); - contact.saveDetail(&phoneNumber); - detail = phoneNumber; - } - else if (definitionName == QContactEmailAddress::DefinitionName) - { - QContactEmailAddress email; - email.setEmailAddress(value); - contact.saveDetail(&email); - detail = email; - } - else if (definitionName == QContactOnlineAccount::DefinitionName) - { - QContactOnlineAccount account; - account.setAccountUri(value); - account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); - contact.saveDetail(&account); - detail = account; - } - - emit launchAssignContactCard(contact, detail); - - mCurrentRequestIndex = setCurrentRequestAsync(); -} - -Q_IMPLEMENT_USER_METATYPE(CntServicesContact) -Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicemainwindow.cpp --- a/phonebookui/phonebookservices/src/cntservicemainwindow.cpp Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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 "cntservicemainwindow.h" -#include "cntservicehandler.h" -#include "cntserviceviewmanager.h" -#include "cntviewnavigator.h" - -CntServiceMainWindow::CntServiceMainWindow(CntServiceHandler *handler, QWidget *parent): - CntMainWindow(parent, noView), - mServiceHandler(handler), - mServiceViewManager(0) -{ - CntViewNavigator* navigator = new CntViewNavigator( this ); - navigator->addException( serviceEditView, noView ); - - mServiceViewManager = new CntServiceViewManager(this, mServiceHandler); - mServiceViewManager->setViewNavigator( navigator ); -} - -CntServiceMainWindow::~CntServiceMainWindow() -{ - delete mServiceViewManager; - mServiceViewManager = 0; - delete mServiceHandler; - mServiceHandler = 0; -} - -// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceprovideredit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntserviceprovideredit.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This class offers contact viewing UI services. + * + */ + +#include "cntserviceprovideredit.h" +#include "cntservices.h" +#include "cntservicestrings.h" +#include "cntdebug.h" + +#include +#include +#include +#include + +CntServiceProviderEdit::CntServiceProviderEdit(CntServices& aServices, QObject *parent): + XQServiceProvider(QLatin1String(KCntServiceInterfaceEdit), parent), + mServices(aServices), + mCurrentRequestIndex(0) +{ + CNT_ENTRY + publishAll(); + connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp())); + CNT_EXIT +} + +CntServiceProviderEdit::~CntServiceProviderEdit() +{ + CNT_ENTRY + CNT_EXIT +} + +void CntServiceProviderEdit::editCreateNew(const QString& definitionName, const QString& value) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + 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.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNewFromVCard( vCardFile, *this ); + CNT_EXIT + } + +void CntServiceProviderEdit::editExisting(int contactId) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editExisting( contactId, *this ); + CNT_EXIT + } + +void CntServiceProviderEdit::editUpdateExisting(const QString &definitionName, const QString &value) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + 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) + { + CNT_ENTRY + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + if ( mCurrentRequestIndex != 0 ) + { + const bool success = completeRequest(mCurrentRequestIndex, retValue); + if ( !success ) + { + CNT_LOG_ARGS("Failed to complete highway request."); + } + mCurrentRequestIndex = 0; + } + CNT_EXIT + } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,78 @@ +/* + * 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 "cntserviceproviderfetch.h" +#include "cntservices.h" +#include "cntservicestrings.h" +#include "cntdebug.h" + +#include +#include +#include +#include + +CntServiceProviderFetch::CntServiceProviderFetch(CntServices& aServices, QObject *parent): + XQServiceProvider(QLatin1String(KCntServiceInterfaceFetch), parent), + mServices(aServices), + mCurrentRequestIndex(0) +{ + CNT_ENTRY + publishAll(); + connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp())); + CNT_EXIT +} + +CntServiceProviderFetch::~CntServiceProviderFetch() +{ + CNT_ENTRY + CNT_EXIT +} + +void CntServiceProviderFetch::multiFetch(const QString &title, const QString &action ) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.multiFetch( title, action, *this ); + CNT_EXIT +} + +void CntServiceProviderFetch::singleFetch(const QString &title, const QString &action ) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.singleFetch( title, action, *this ); + CNT_EXIT +} + +void CntServiceProviderFetch::CompleteServiceAndCloseApp(const QVariant& retValue) +{ + CNT_ENTRY + if ( mCurrentRequestIndex != 0 ) + { + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + const bool success = completeRequest(mCurrentRequestIndex, retValue); + if ( !success ) + { + CNT_LOG_ARGS("Failed to complete highway request."); + } + mCurrentRequestIndex = 0; + } + CNT_EXIT +} + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceproviderold.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntserviceproviderold.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,150 @@ +/* + * 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 "cntserviceproviderold.h" +#include "cntservices.h" +#include "cntdebug.h" + +#include +#include +#include +#include + +CntServiceProviderOld::CntServiceProviderOld(CntServices& aServices, QObject *parent): + XQServiceProvider(QLatin1String("com.nokia.services.phonebookservices.Fetch"), parent), + mServices(aServices), + mCurrentRequestIndex(0) +{ + CNT_ENTRY + publishAll(); + connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp())); + CNT_EXIT +} + +CntServiceProviderOld::~CntServiceProviderOld() +{ + CNT_ENTRY + CNT_EXIT +} + +/*! +Launch fetch service with given parameters. OLD INTERFACE. +*/ +void CntServiceProviderOld::fetch(const QString &title, const QString &action, const QString& /*filter*/) +{ + CNT_ENTRY + // Ignore the filter parameter + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.multiFetch( title, action, *this ); + CNT_EXIT +} + + +/* +Launch fetch service with given parameters. Fetching mode is No-select by default. OLD INTERFACE. +*/ +void CntServiceProviderOld::Dofetch(const QString &title, const QString &action, const QString& /*filter*/, const QString& /*mode*/) +{ + CNT_ENTRY + // Ignore the filter parameter + // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching. + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.singleFetch( title, action, *this ); + CNT_EXIT +} + + +/* +Launch new contact editor with a given detail +*/ +void CntServiceProviderOld::editCreateNew(const QString& definitionName, const QString& value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false + CNT_EXIT +} + +void CntServiceProviderOld::editCreateNew(const QString &vCardFile) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNewFromVCard( vCardFile, *this ); + CNT_EXIT +} + + +/*! +Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail) +*/ +void CntServiceProviderOld::editUpdateExisting(const QString &definitionName, const QString &value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false + CNT_EXIT +} + + +/*! +Launch communication launcher view for the contact with the given ID (QContactLocalId -> int) +*/ +void CntServiceProviderOld::open(int contactId) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchContactCard( contactId, *this ); + CNT_EXIT +} + +/*! + Launch temporary communication launcher view with the given detail. +*/ +void CntServiceProviderOld::open(const QString &definitionName, const QString &value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type value = actual field value for prefilling editor + CNT_EXIT +} + + +void CntServiceProviderOld::CompleteServiceAndCloseApp(const QVariant& retValue) +{ + CNT_ENTRY + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + if ( mCurrentRequestIndex != 0 ) + { + CNT_LOG_ARGS("next, completing request.") + const bool success = completeRequest(mCurrentRequestIndex, retValue); + if ( !success ) + { + CNT_LOG_ARGS("Failed to complete highway request."); + } + mCurrentRequestIndex = 0; + } + CNT_EXIT +} + +// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceproviderold2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntserviceproviderold2.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,150 @@ +/* + * 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 "cntserviceproviderold2.h" +#include "cntservices.h" +#include "cntdebug.h" + +#include +#include +#include +#include + +CntServiceProviderOld2::CntServiceProviderOld2(CntServices& aServices, QObject *parent): + XQServiceProvider(QLatin1String("phonebookservices.Fetch"), parent), + mServices(aServices), + mCurrentRequestIndex(0) +{ + CNT_ENTRY + publishAll(); + connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp())); + CNT_EXIT +} + +CntServiceProviderOld2::~CntServiceProviderOld2() +{ + CNT_ENTRY + CNT_EXIT +} + +/*! +Launch fetch service with given parameters. OLD INTERFACE. +*/ +void CntServiceProviderOld2::fetch(const QString &title, const QString &action, const QString& /*filter*/) +{ + CNT_ENTRY + // Ignore the filter parameter + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.multiFetch( title, action, *this ); + CNT_EXIT +} + + +/* +Launch fetch service with given parameters. Fetching mode is No-select by default. OLD INTERFACE. +*/ +void CntServiceProviderOld2::Dofetch(const QString &title, const QString &action, const QString& /*filter*/, const QString& /*mode*/) +{ + CNT_ENTRY + // Ignore the filter parameter + // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching. + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.singleFetch( title, action, *this ); + CNT_EXIT +} + + +/* +Launch new contact editor with a given detail +*/ +void CntServiceProviderOld2::editCreateNew(const QString& definitionName, const QString& value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false +} + +void CntServiceProviderOld2::editCreateNew(const QString &vCardFile) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editCreateNewFromVCard( vCardFile, *this ); + CNT_EXIT +} + + +/*! +Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail) +*/ +void CntServiceProviderOld2::editUpdateExisting(const QString &definitionName, const QString &value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false + CNT_EXIT +} + + +/*! +Launch communication launcher view for the contact with the given ID (QContactLocalId -> int) +*/ +void CntServiceProviderOld2::open(int contactId) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchContactCard( contactId, *this ); + CNT_EXIT +} + +/*! + Launch temporary communication launcher view with the given detail. +*/ +void CntServiceProviderOld2::open(const QString &definitionName, const QString &value) +{ + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type value = actual field value for prefilling editor + CNT_EXIT +} + + +void CntServiceProviderOld2::CompleteServiceAndCloseApp(const QVariant& retValue) +{ + CNT_ENTRY + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + if ( mCurrentRequestIndex != 0 ) + { + CNT_LOG_ARGS("next, completing request.") + const bool success = completeRequest(mCurrentRequestIndex, retValue); + if ( !success ) + { + CNT_LOG_ARGS("Failed to complete highway request."); + } + mCurrentRequestIndex = 0; + } + CNT_EXIT +} + + +// end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This class offers contact viewing UI services. + * + */ + +#include "cntserviceproviderviewing.h" +#include "cntservices.h" +#include "cntservicestrings.h" +#include "cntdebug.h" + +#include +#include +#include +#include + +CntServiceProviderViewing::CntServiceProviderViewing(CntServices& aServices, QObject *parent): + XQServiceProvider(QLatin1String(KCntServiceInterfaceView), parent), + mServices(aServices), + mCurrentRequestIndex(0) +{ + CNT_ENTRY + publishAll(); + connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp())); + CNT_EXIT +} + +CntServiceProviderViewing::~CntServiceProviderViewing() +{ + CNT_ENTRY + CNT_EXIT +} + +void CntServiceProviderViewing::openContactCard( int aContactId ) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchContactCard( aContactId, *this ); + CNT_EXIT + } + +void CntServiceProviderViewing::openTemporaryContactCard( QString aFieldName, QString aFieldValue ) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchTemporaryContactCard( aFieldName, aFieldValue, *this ); + CNT_EXIT + } + +void CntServiceProviderViewing::openGroup( int aContactId ) + { + CNT_ENTRY + mCurrentRequestIndex = setCurrentRequestAsync(); + mServices.setQuittable(requestInfo().isEmbedded()); + mServices.launchGroupMemberView( aContactId, *this ); + CNT_EXIT + } + +void CntServiceProviderViewing::CompleteServiceAndCloseApp(const QVariant& retValue) + { + CNT_ENTRY + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + if ( mCurrentRequestIndex != 0 ) + { + const bool success = completeRequest(mCurrentRequestIndex, retValue); + if ( !success ) + { + CNT_LOG_ARGS("Failed to complete highway request."); + } + mCurrentRequestIndex = 0; + } + CNT_EXIT + } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservices.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookservices/src/cntservices.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -0,0 +1,557 @@ +/* + * 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 "cntservices.h" +#include "cntglobal.h" +#include "cntdebug.h" +#include +#include "cntserviceviewmanager.h" +#include "cntimageutility.h" +#include "cntserviceviewparams.h" +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +CntServices::CntServices() : +mViewManager(NULL), +mCurrentProvider(NULL), +mIsQuittable(true) +{ + CNT_ENTRY + + // Definition names supported in symbian back-end + m_definitionNames << QContactName::DefinitionName; + m_definitionNames << QContactNickname::DefinitionName; + m_definitionNames << QContactPhoneNumber::DefinitionName; + m_definitionNames << QContactEmailAddress::DefinitionName; + m_definitionNames << QContactAddress::DefinitionName; + m_definitionNames << QContactUrl::DefinitionName; + m_definitionNames << QContactBirthday::DefinitionName; + m_definitionNames << QContactOrganization::DefinitionName; + m_definitionNames << QContactSyncTarget::DefinitionName; + m_definitionNames << QContactNote::DefinitionName; + m_definitionNames << QContactFamily::DefinitionName; + m_definitionNames << QContactAvatar::DefinitionName; + m_definitionNames << QContactAnniversary::DefinitionName; + m_definitionNames << QContactGeoLocation::DefinitionName; + m_definitionNames << QContactGender::DefinitionName; + m_definitionNames << QContactOnlineAccount::DefinitionName; + + CNT_EXIT +} + + +CntServices::~CntServices() +{ + CNT_LOG +} + + +void CntServices::setViewManager( CntAbstractViewManager& aViewManager ) +{ + CNT_LOG + mViewManager = &aViewManager; + CntServiceViewManager* srvMng = static_cast(mViewManager); + connect(srvMng, SIGNAL(applicationClosed()), this, SLOT(terminateService())); +} + + +void CntServices::singleFetch( + const QString &title, const QString &action, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + CntViewParameters params; + params.insert(EViewId, serviceContactFetchView); + params.insert(ESelectedAction, action); + params.insert(KCntServiceViewParamTitle, title); + // SINGLE fetch + params.insert(ESelectionMode, HbAbstractItemView::SingleSelection); + + mViewManager->changeView(params); + CNT_EXIT +} + + +void CntServices::multiFetch( + const QString &title, const QString &action, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + CntViewParameters params; + params.insert(EViewId, serviceContactFetchView); + params.insert(ESelectedAction, action); + params.insert(KCntServiceViewParamTitle, title); + // MULTI fetch + params.insert(ESelectionMode, HbAbstractItemView::MultiSelection); + mViewManager->changeView(params); + 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, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + QContact contact; + + if (definitionName == QContactPhoneNumber::DefinitionName) + { + QContactPhoneNumber phoneNumber; + phoneNumber.setNumber(value); + 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; + fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp); + contact.saveDetail(&account); + } + + // Launch editor now + CntViewParameters params; + params.insert(EViewId, serviceEditView); + QVariant var; + var.setValue(contact); + params.insert(ESelectedContact, var); + mViewManager->changeView(params); + CNT_EXIT +} + + +void CntServices::editCreateNewFromVCard(const QString &vCardFile, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + CntImageUtility imageUtility; + QContact contact; + QVersitReader reader; + QFile file(vCardFile); + if (!file.open(QIODevice::ReadOnly)) + return; + reader.setDevice(&file); + + reader.startReading(); + reader.waitForFinished(); + // Use the resulting document(s)... + QVersitContactImporter importer; + QList versitDocuments = reader.results(); + if(versitDocuments.count() > 0 + && importer.importDocuments(versitDocuments)) + { + QList contacts = importer.contacts(); + if(contacts.count() > 0) + contact = contacts.first(); + } + file.close(); + + // Save thumbnail images + QList details = contact.details(); + for (int i = 0;i < details.count();i++) + { + if (!details.at(i).thumbnail().isNull()) + { + QString imagepath; + QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail()); + if(imageUtility.createImage(pixmap,imagepath)) + { + // Update contact detail + QContactAvatar detail=details.at(i); + detail.setImageUrl(imagepath); + contact.saveDetail(&detail); + } + } + } + + removeNotSupportedDetails(contact); + removeNotSupportedFields(contact); + + // Launch editor now + CntViewParameters params; + params.insert(EViewId, serviceEditView); + QVariant var; + var.setValue(contact); + params.insert(ESelectedContact, var); + mViewManager->changeView(params); + 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, const QString& subType, + CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + QContactDetail detail; + + if (definitionName == QContactPhoneNumber::DefinitionName) + { + QContactPhoneNumber phoneNumber; + phoneNumber.setNumber(value); + 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; + fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp); + detail = account; + } + + CntViewParameters params; + params.insert(EViewId, serviceContactSelectionView); + QVariant var; + var.setValue(detail); + params.insert(ESelectedDetail, var); + mViewManager->changeView(params); + CNT_EXIT +} + +void CntServices::editExisting(int contactId, +CntAbstractServiceProvider& aServiceProvider) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + // Give parameters for launching editor. + CntViewParameters params; + params.insert(EViewId, serviceEditView); + + QContact contact = contactManager()->contact(contactId); + QVariant varContact; + varContact.setValue(contact); + params.insert(ESelectedContact, varContact); + mViewManager->changeView(params); + CNT_EXIT +} + + +void CntServices::launchContactCard(int aContactId, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + QContact contact = contactManager()->contact(aContactId); + + // Launch Contact Card view + CntViewParameters params; + params.insert(EViewId, serviceContactCardView); + QVariant var; + var.setValue(contact); + params.insert(ESelectedContact, var); + mViewManager->changeView( params ); + CNT_EXIT +} + + +void CntServices::launchTemporaryContactCard(const QString &definitionName, const QString &value, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + QContact contact; + QContactDetail detail; + + QContactName name; + name.setFirstName(hbTrId("txt_phob_list_unknown")); + contact.saveDetail(&name); + + if (definitionName == QContactPhoneNumber::DefinitionName) + { + QContactPhoneNumber phoneNumber; + phoneNumber.setNumber(value); + phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); + contact.saveDetail(&phoneNumber); + detail = phoneNumber; + } + else if (definitionName == QContactEmailAddress::DefinitionName) + { + QContactEmailAddress email; + email.setEmailAddress(value); + contact.saveDetail(&email); + detail = email; + } + else if (definitionName == QContactOnlineAccount::DefinitionName) + { + QContactOnlineAccount account; + account.setAccountUri(value); + account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip); + contact.saveDetail(&account); + detail = account; + } + + // Launch the view + CntViewParameters params; + params.insert(EViewId, serviceAssignContactCardView); + QVariant var; + var.setValue(contact); + params.insert(ESelectedContact, var); + QVariant varDetail; + varDetail.setValue(detail); + params.insert(ESelectedDetail, varDetail); + mViewManager->changeView(params); + CNT_EXIT +} + +void CntServices::launchGroupMemberView(int aContactId, + CntAbstractServiceProvider& aServiceProvider ) +{ + CNT_ENTRY + mCurrentProvider = &aServiceProvider; + + QContact contact = contactManager()->contact(aContactId); + + // Launch Group member view + CntViewParameters params; + params.insert(EViewId, serviceGroupMemberView); + QVariant var; + var.setValue(contact); + params.insert(ESelectedGroupContact, var); + mViewManager->changeView( params ); + CNT_EXIT +} + +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 + // Check definition map, remove details not supported + for (int i=0; i < contact.details().count(); i++) + { + if (!m_definitionNames.contains(contact.details().at(i).definitionName())) + { + QContactDetail detail= contact.details().at(i); + contact.removeDetail(&detail); + } + } + CNT_EXIT +} + +void CntServices::removeNotSupportedFields(QContact& contact) +{ + CNT_ENTRY + QList removeList; + + // Not all fields are supported in symbian back-end + // Remove not supported fields + for (int i=0; i < contact.details().count(); i++) + { + QContactDetail detail = contact.details().at(i); + if(detail.definitionName() == QContactAddress::DefinitionName) + { + QContactAddress addrDetail = static_cast(detail); + + // Sub-types not supported + if(detail.removeValue(QContactAddress::FieldSubTypes)) + contact.saveDetail(&detail); + } + else if(detail.definitionName() == QContactAnniversary::DefinitionName) + { + QContactAnniversary annivDetail = static_cast(detail); + + // Sub-types not supported + if(detail.removeValue(QContactAnniversary::FieldSubType)) + contact.saveDetail(&detail); + + // Context not supported + if(detail.removeValue(QContactDetail::FieldContext)) + contact.saveDetail(&detail); + } + else if(detail.definitionName() == QContactPhoneNumber::DefinitionName) + { + QContactPhoneNumber phoneDetail = static_cast(detail); + + if(phoneDetail.subTypes().size() > 0 ) + { + // Sub-types not supported + if(phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice) + || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable)) + { + // Default to subtype mobile + QStringList l; + l << QLatin1String(QContactPhoneNumber::SubTypeMobile); + detail.setValue(QContactPhoneNumber::FieldSubTypes, l); + contact.saveDetail(&detail); + } + } + } + else if(detail.definitionName() == QContactUrl::DefinitionName) + { + QContactUrl urlDetail = static_cast(detail); + + QString stype=QContactUrl::SubTypeHomePage; + if(urlDetail.subType().compare(stype) != 0) + { + detail.removeValue(QContactUrl::FieldSubType); + contact.saveDetail(&detail); + } + } + } + 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) +{ + CNT_ENTRY + if ( mCurrentProvider ) + { + mCurrentProvider->CompleteServiceAndCloseApp( retValue ); + } + CNT_EXIT +} + +void CntServices::terminateService() +{ + CNT_ENTRY + if ( mCurrentProvider ) + { + // Complete the service with KCntServicesTerminated return value + QVariant var(KCntServicesTerminated); + mCurrentProvider->CompleteServiceAndCloseApp( var ); + } + CNT_EXIT +} + +QContactManager* CntServices::contactManager() +{ + if ( mViewManager ) + return mViewManager->contactManager(SYMBIAN_BACKEND); + return NULL; +} + +Q_IMPLEMENT_USER_METATYPE(CntServicesContact) +Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) + diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntservicesubeditview.cpp --- a/phonebookui/phonebookservices/src/cntservicesubeditview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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 "cntservicesubeditview.h" -#include "cntservicehandler.h" - -CntServiceSubEditView::CntServiceSubEditView(CntServiceHandler *aServiceHandler) : CntEditView(), -mServiceHandler(aServiceHandler) -{ - -} - -CntServiceSubEditView::~CntServiceSubEditView() -{ - -} - -///*! -//Saves the contact -//*/ -//void CntServiceSubEditView::aboutToCloseView() -//{ -// // save contact if there is one -// if (contact()) -// { -// contactManager()->saveContact(contact()); -// } -// -// CntViewParameters viewParameters; -// QVariant var; -// var.setValue(*contact()); -// viewParameters.insert(ESelectedContact, var); -// viewManager()->back(viewParameters); -//} -// -///*! -//Cancel all changes made and return to comm launcher view -//*/ -//void CntServiceSubEditView::discardAllChanges() -//{ -// QContact oldContact = contactManager()->contact(contact()->localId()); -// -// CntViewParameters viewParameters; -// QVariant var; -// var.setValue(oldContact); -// viewParameters.insert(ESelectedContact, var); -// viewManager()->back(viewParameters); -//} -// -///* -//Handle signals emitted from CntCommands, only used for delete command for now. -//*/ -//int CntServiceSubEditView::handleExecutedCommand(QString aCommand, const QContact &aContact) -//{ -// Q_UNUSED(aContact); -// int result = -1; -// if (aCommand == "delete") -// { -// connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); -// mServiceHandler->completeEdit(result); -// result = 0; -// } -// return result; -//} - -// EOF diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceviewfactory.cpp --- a/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -17,16 +17,20 @@ #include "cntserviceviewfactory.h" #include "cntabstractview.h" + + #include "cntserviceeditview.h" -#include "cntservicesubeditview.h" +#include "cntservicecontactselectionview.h" + +#include "cntservicecontactcardview.h" +#include "cntservicegroupmemberview.h" #include "cntservicecontactfetchview.h" -#include "cntservicecontactselectionview.h" -#include "cntservicecontactcardview.h" #include "cntserviceassigncontactcardview.h" -CntServiceViewFactory::CntServiceViewFactory(CntServiceHandler* aHandler) : + +CntServiceViewFactory::CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider ) : CntDefaultViewFactory(), -mService( aHandler ) +mProvider( aServiceProvider ) { } @@ -38,26 +42,26 @@ { switch ( aViewId ) { - // contact fetch service view (fetching contacts from for example messaging) + // contact fetch service view (for eg. requested by messaging) case serviceContactFetchView: - return new CntServiceContactFetchView( mService ); - + return new CntServiceContactFetchView( mProvider ); + // contact selection service view (selecting contact to edit when updating existing contact) case serviceContactSelectionView: - return new CntServiceContactSelectionView( mService ); + return new CntServiceContactSelectionView( mProvider ); case serviceEditView: - return new CntServiceEditView( mService ); - - case serviceSubEditView: - return new CntServiceSubEditView( mService ); - + return new CntServiceEditView( mProvider ); + case serviceContactCardView: - return new CntServiceContactCardView( mService ); + return new CntServiceContactCardView( mProvider ); case serviceAssignContactCardView: - return new CntServiceAssignContactCardView( mService ); + return new CntServiceAssignContactCardView( mProvider ); + case serviceGroupMemberView: + return new CntServiceGroupMemberView( mProvider ); + default: return CntDefaultViewFactory::createView( aViewId ); } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/cntserviceviewmanager.cpp --- a/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,40 +16,18 @@ */ #include "cntserviceviewmanager.h" - -#include "cntservicehandler.h" - -#include "cntservicecontactfetchview.h" -#include "cntservicecontactselectionview.h" -#include "cntserviceeditview.h" -#include "cntservicecontactcardview.h" -#include "cntservicesubeditview.h" -#include "cntserviceassigncontactcardview.h" #include "cntserviceviewfactory.h" -#include /*! Constructor */ -CntServiceViewManager::CntServiceViewManager(HbMainWindow *mainWindow, CntServiceHandler *aHandler): - CntDefaultViewManager(mainWindow), - mServiceHandler(aHandler) -{ - - setViewFactory( new CntServiceViewFactory(mServiceHandler) ); - connect(mServiceHandler, SIGNAL(launchFetch(const QString&, const QString&, const QString&)), - this, SLOT(handleFetch(const QString&, const QString&, const QString&))); - - // Handles signal with mode selected. - connect(mServiceHandler, SIGNAL(launchFetchVerified(const QString&, const QString&, const QString&, const QString&)), - this, SLOT(launchFetch(const QString&, const QString&, const QString&, const QString&))); - - connect(mServiceHandler, SIGNAL(launchEditor(QContact)), this, SLOT(launchEditor(QContact))); - connect(mServiceHandler, SIGNAL(launchContactSelection(QContactDetail)), this, SLOT(launchContactSelection(QContactDetail))); - connect(mServiceHandler, SIGNAL(launchContactCard(QContact)), this, SLOT(launchContactCard(QContact))); - connect(mServiceHandler, SIGNAL(launchAssignContactCard(QContact, QContactDetail)), this, - SLOT(launchAssignContactCard(QContact, QContactDetail))); -} +CntServiceViewManager::CntServiceViewManager( HbMainWindow *mainWindow, + CntAbstractServiceProvider& aProvider ): + CntDefaultViewManager(mainWindow) + { + // ownership of the factory is given to the base class. + setViewFactory( new CntServiceViewFactory( aProvider ) ); + } /*! Destructor @@ -61,91 +39,9 @@ void CntServiceViewManager::closeApp() { - // quit happens when returnValueDelivered signal is returned - // from service handler, see constructor. -} - -/*! -Launch fetch service view. -*/ -void CntServiceViewManager::handleFetch(const QString &title, const QString &action, const QString &filter) -{ - launchFetch(title,action,filter); -} - -/*! -Launch fetch service view. Uses a mode to determine fetching type. -*/ -void CntServiceViewManager::launchFetch(const QString &title, const QString &action, const QString &filter, const QString &mode) -{ - CntViewParameters params; - params.insert(EViewId, serviceContactFetchView); - params.insert(CntServiceHandler::EAction, action); - params.insert(CntServiceHandler::EFilter, filter); - params.insert(CntServiceHandler::ETitle, title); - - if (!mode.compare(KCntSingleSelectionMode, Qt::CaseSensitive)) { - params.insert(ESelectionMode, HbAbstractItemView::SingleSelection); - } - else { - params.insert(ESelectionMode, HbAbstractItemView::MultiSelection); - } - changeView(params); -} - -/*! -Launch editor service view -*/ -void CntServiceViewManager::launchEditor(QContact contact) -{ - CntViewParameters params; - params.insert(EViewId, serviceEditView); - QVariant var; - var.setValue(contact); - params.insert(ESelectedContact, var); - changeView(params); -} - -/*! -Launch contact selection service view (update existing contact with detail) -*/ -void CntServiceViewManager::launchContactSelection(QContactDetail detail) -{ - CntViewParameters params; - params.insert(EViewId, serviceContactSelectionView); - QVariant var; - var.setValue(detail); - params.insert(ESelectedDetail, var); - changeView(params); -} - -/*! -Launch contact card service view -*/ -void CntServiceViewManager::launchContactCard(QContact contact) -{ - CntViewParameters params; - params.insert(EViewId, serviceContactCardView); - QVariant var; - var.setValue(contact); - params.insert(ESelectedContact, var); - changeView(params); -} - -/*! -Launch assign (temporary) contact card service view -*/ -void CntServiceViewManager::launchAssignContactCard(QContact contact, QContactDetail detail) -{ - CntViewParameters params; - params.insert(EViewId, serviceAssignContactCardView); - QVariant var; - var.setValue(contact); - params.insert(ESelectedContact, var); - QVariant varDetail; - varDetail.setValue(detail); - params.insert(ESelectedDetail, varDetail); - changeView(params); + // Quit happens when returnValueDelivered signal from XQServiceProver + // is caught from service handler. + emit applicationClosed(); } // end of file diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/src/main.cpp --- a/phonebookui/phonebookservices/src/main.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/src/main.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,13 +16,26 @@ */ #include +#include #include #include -#include "cntservicemainwindow.h" -#include "cntservicehandler.h" +#include "cntserviceproviderold.h" +#include "cntserviceproviderold2.h" +#include "cntserviceproviderfetch.h" +#include "cntserviceproviderold2.h" +#include "cntserviceproviderviewing.h" +#include "cntserviceprovideredit.h" +#include "cntservices.h" +#include "cntserviceviewmanager.h" +#include "cntviewnavigator.h" +#include "cntkeygrabber.h" +#include "cntdebug.h" +#include int main(int argc, char **argv) { + qInstallMsgHandler(MSG_HANDLER); + HbApplication a( argc, argv ); QTranslator translator; @@ -30,9 +43,32 @@ QString path = "z:/resource/qt/translations/"; translator.load(path + "contacts_" + lang); a.installTranslator(&translator); - - CntServiceHandler *handler = new CntServiceHandler(); - CntServiceMainWindow mainWindow(handler); + + HbMainWindow mainWindow; + CntKeyGrabber *keyGrabber = new CntKeyGrabber(&mainWindow, &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(); + services->setParent( &mainWindow ); // for ownership + + CntServiceViewManager* viewManager = new CntServiceViewManager( + &mainWindow, + *services ); // as CntAbstractServiceProvider + viewManager->setViewNavigator( navigator ); + + services->setViewManager( *viewManager ); + + // These objects talk with QT Highway (send/receive) + CntServiceProviderOld* serviceProviderOld = new CntServiceProviderOld( *services, &mainWindow ); // com.nokia.services.phonebookservices.Fetch + CntServiceProviderOld2* serviceProviderOld2 = new CntServiceProviderOld2( *services, &mainWindow ); // phonebookservices.Fetch + CntServiceProviderFetch* serviceProviderFetch = new CntServiceProviderFetch( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactFetch + CntServiceProviderViewing* serviceProviderViewing = new CntServiceProviderViewing( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactView + CntServiceProviderEdit* serviceProviderEdit = new CntServiceProviderEdit( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactEdit mainWindow.show(); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp --- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -88,6 +88,14 @@ mainLayout->addItem(button, row, 1); row++; + button = new HbPushButton("Edit create new - number with subtype"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_numberWithSubtype())); + mainLayout->addItem(button, row, 0); + button = new HbPushButton("old"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_numberWithSubtype_old())); + mainLayout->addItem(button, row, 1); + row++; + button = new HbPushButton("Edit create new - email"); QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_email())); mainLayout->addItem(button, row, 0); @@ -104,6 +112,14 @@ mainLayout->addItem(button, row, 1); row++; + button = new HbPushButton("Edit create new - onlineAccount with subtype"); + bool res = QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_onlineAccountWithSubtype())); + mainLayout->addItem(button, row, 0); + button = new HbPushButton("old"); + res = QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_onlineAccountWithSubtype_old())); + mainLayout->addItem(button, row, 1); + row++; + button = new HbPushButton("Launch editor with vCard"); QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditorVCard())); mainLayout->addItem(button, row, 0); @@ -121,6 +137,14 @@ QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_number_old())); mainLayout->addItem(button, row, 1); row++; + + button = new HbPushButton("Edit/update existing - number with subtype"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_numberWithSubtype())); + mainLayout->addItem(button, row, 0); + button = new HbPushButton("old"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_numberWithSubtype_old())); + mainLayout->addItem(button, row, 1); + row++; button = new HbPushButton("Edit/update existing - email"); QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_email())); @@ -138,6 +162,14 @@ mainLayout->addItem(button, row, 1); row++; + button = new HbPushButton("Edit/update existing - onlineAccount with subtype"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_onlineAccountWithSubtype())); + mainLayout->addItem(button, row, 0); + button = new HbPushButton("old"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_onlineAccountWithSubtype_old())); + mainLayout->addItem(button, row, 1); + row++; + // CONTACT CARD ========================================================== button = new HbPushButton("Launch contact card"); @@ -172,6 +204,13 @@ mainLayout->addItem(button, row, 1); row++; + // Launch - Group Member View ========================================================== + + button = new HbPushButton("Launch group member view"); + QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchGroupMemberView())); + mainLayout->addItem(button, row, 0); + row++; + QGraphicsWidget *graphicsWidget = new QGraphicsWidget(); graphicsWidget->setLayout(mainLayout); HbScrollArea *scrollArea = new HbScrollArea(); diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp --- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Wed Aug 18 09:39:00 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() @@ -138,6 +139,28 @@ CNT_EXIT } +void testPbkServices::launchEditCreateNew_numberWithSubtype() +{ + CNT_ENTRY + launchEditCreateNew( + true, // aNewInterface + QContactPhoneNumber::DefinitionName, // aDetailType + "1234567", // aFieldContent + QContactPhoneNumber::SubTypeLandline); //aDetailSubtype + CNT_EXIT +} + +void testPbkServices::launchEditCreateNew_numberWithSubtype_old() +{ + CNT_ENTRY + launchEditCreateNew( + false, // aNewInterface + QContactPhoneNumber::DefinitionName, // aDetailType + "1234567", // aFieldContent + QContactPhoneNumber::SubTypeLandline); //aDetailSubtype + CNT_EXIT +} + void testPbkServices::launchEditCreateNew_email() { CNT_ENTRY @@ -178,6 +201,28 @@ CNT_EXIT } +void testPbkServices::launchEditCreateNew_onlineAccountWithSubtype() +{ + CNT_ENTRY + launchEditCreateNew( + true, // aNewInterface + QContactOnlineAccount::DefinitionName, // aDetailType + "provider:account@provider.com", // aFieldContent + QContactOnlineAccount::SubTypeImpp); // aDetailSubtype + CNT_EXIT +} + +void testPbkServices::launchEditCreateNew_onlineAccountWithSubtype_old() +{ + CNT_ENTRY + launchEditCreateNew( + false, // aNewInterface + QContactOnlineAccount::DefinitionName, // aDetailType + "provider:account@provider.com", // aFieldContent + QContactOnlineAccount::SubTypeImpp); // aDetailSubtype + CNT_EXIT +} + void testPbkServices::launchEditorVCard() { CNT_ENTRY @@ -214,6 +259,28 @@ CNT_EXIT } +void testPbkServices::launchEditUpdateExisting_numberWithSubtype() +{ + CNT_ENTRY + launchEditUpdateExisting( + true, // aNewInterface + QContactPhoneNumber::DefinitionName, // aDetailType + "1234567", // aDetailValue + QContactPhoneNumber::SubTypeLandline);// aDetailSubtype + CNT_EXIT +} + +void testPbkServices::launchEditUpdateExisting_numberWithSubtype_old() +{ + CNT_ENTRY + launchEditUpdateExisting( + false, // aNewInterface + QContactPhoneNumber::DefinitionName, // aDetailType + "1234567", // aDetailValue + QContactPhoneNumber::SubTypeLandline);// aDetailSubtype + CNT_EXIT +} + void testPbkServices::launchEditUpdateExisting_email() { CNT_ENTRY @@ -254,6 +321,28 @@ CNT_EXIT } +void testPbkServices::launchEditUpdateExisting_onlineAccountWithSubtype() +{ + CNT_ENTRY + launchEditUpdateExisting( + true, // aNewInterface + QContactOnlineAccount::DefinitionName, // aDetailType + "provider:account@provider.com", // aDetailValue + QContactOnlineAccount::SubTypeImpp); // aDetailSubtype + CNT_EXIT +} + +void testPbkServices::launchEditUpdateExisting_onlineAccountWithSubtype_old() +{ + CNT_ENTRY + launchEditUpdateExisting( + false, // aNewInterface + QContactOnlineAccount::DefinitionName, // aDetailType + "provider:account@provider.com", // aDetailValue + QContactOnlineAccount::SubTypeImpp); // aDetailSubtype + CNT_EXIT +} + void testPbkServices::launchContactCard() { CNT_ENTRY @@ -331,6 +420,67 @@ CNT_EXIT } +void testPbkServices::launchGroupMemberView() +{ + CNT_ENTRY + delete mRequest; + mRequest=0; + + // save test contact + QContactManager mgr("symbian"); + QContact contact; + QContactName name; + QContactPhoneNumber number; + + name.setFirstName("Test_Contact"); + number.setNumber("0202223344"); + contact.saveDetail(&name); + contact.saveDetail(&number); + mgr.saveContact(&contact); + + // save test group + QString text("Work"); + QContact groupContact; + groupContact.setType(QContactType::TypeGroup); + QContactName groupName; + groupName.setCustomLabel(text); + groupContact.saveDetail(&groupName); + mgr.saveContact(&groupContact); + QContactRelationship relationship; + relationship.setRelationshipType(QContactRelationship::HasMember); + relationship.setFirst(groupContact.id()); + relationship.setSecond(contact.id()); + // Save relationship + mgr.saveRelationship(&relationship); + + // get contact id + int id = groupContact.id().localId(); + + QVariantList args; + XQApplicationManager appMng; + QString interface("com.nokia.symbian.IContactsView"); + QString operation("openGroup(int)"); + // interface name is not needed + mRequest = appMng.create( interface, operation, true); // embedded + if ( mRequest ) + { + CNT_LOG_ARGS("Request created.") + // Result handlers + connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&))); + + args << id; + + mRequest->setArguments(args); + mRequest->send(); + CNT_LOG_ARGS("Request sent.") + } + else + { + CNT_LOG_ARGS("Failed to create request") + } + CNT_EXIT +} + void testPbkServices::onEditCompleted(const QVariant& value) { CNT_ENTRY @@ -396,26 +546,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 } @@ -431,8 +581,8 @@ XQApplicationManager appMng; if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactFetch"); - QString operation("multiFetch(QString,QString,QString)"); + QString interface("com.nokia.symbian.IContactsFetch"); + QString operation("multiFetch(QString,QString)"); // There are two kinds of create() methods in XQApplicationManager. The one with four arguments // takes the service name also. The one with three arguments (used below) does not take the service name. // The interface name is enough for finding the correct provider at run time. @@ -477,8 +627,8 @@ XQApplicationManager appMng; if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactFetch"); - QString operation("singleFetch(QString,QString,QString)"); + QString interface("com.nokia.symbian.IContactsFetch"); + QString operation("singleFetch(QString,QString)"); // There are two kinds of create() methods in XQApplicationManager. The one with four arguments // takes the service name also. The one with three arguments (used below) does not take the service name. // The interface name is enough for finding the correct provider at run time. @@ -517,7 +667,7 @@ CNT_EXIT } -void testPbkServices::launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent ) +void testPbkServices::launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent, QString aDetailSubtype ) { CNT_ENTRY delete mRequest; @@ -526,9 +676,14 @@ QVariantList args; XQApplicationManager appMng; QString operation("editCreateNew(QString,QString)"); + if ( !aDetailSubtype.isEmpty() ) + { + operation = "editCreateNew(QString,QString,QString)"; + } + if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactFetch"); + QString interface("com.nokia.symbian.IContactsFetch"); // service name is not needed mRequest = appMng.create( interface, operation, true); // embedded } @@ -548,6 +703,10 @@ args << aDetailType; args << aFieldContent; + if ( !aDetailSubtype.isEmpty() ) + { + args << aDetailSubtype; + } mRequest->setArguments(args); mRequest->send(); @@ -570,7 +729,7 @@ XQApplicationManager appMng; if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactEdit"); + QString interface("com.nokia.symbian.IContactsEdit"); QString operation("editCreateNewFromVCard(QString)"); // service name is not needed mRequest = appMng.create( interface, operation, true); // embedded @@ -603,7 +762,7 @@ CNT_EXIT } -void testPbkServices::launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue ) +void testPbkServices::launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue, QString aDetailSubtype ) { CNT_ENTRY delete mRequest; @@ -612,9 +771,14 @@ QVariantList args; XQApplicationManager appMng; QString operation("editUpdateExisting(QString,QString)"); + if ( !aDetailSubtype.isEmpty() ) + { + operation = "editUpdateExisting(QString,QString,QString)"; + } + if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactEdit"); + QString interface("com.nokia.symbian.IContactsEdit"); // service name is not needed mRequest = appMng.create(interface, operation, true); // embedded } @@ -633,6 +797,10 @@ args << aDetailType; args << aDetailValue; + if ( !aDetailSubtype.isEmpty() ) + { + args << aDetailSubtype; + } mRequest->setArguments(args); mRequest->send(); @@ -670,7 +838,7 @@ XQApplicationManager appMng; if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactView"); + QString interface("com.nokia.symbian.IContactsView"); QString operation("openContactCard(int)"); // interface name is not needed mRequest = appMng.create( interface, operation, true); // embedded @@ -711,8 +879,8 @@ XQApplicationManager appMng; if ( aNewInterface ) { - QString interface("com.nokia.symbian.IContactView"); - QString operation("openContactCard(QString,QString)"); + QString interface("com.nokia.symbian.IContactsView"); + QString operation("openTemporaryContactCard(QString,QString)"); // service name is not needed mRequest = appMng.create(interface, operation, true); // embedded } diff -r 7cbcb2896f0e -r a642906a277a phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h --- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Wed Aug 18 09:39:00 2010 +0300 @@ -25,6 +25,8 @@ #include class HbMainWindow; +class HbAction; +class HbDialog; /** * Launches phonebookservices highway services, for functional testing. @@ -47,20 +49,28 @@ // EDIT - create new void launchEditCreateNew_number(); void launchEditCreateNew_number_old(); + void launchEditCreateNew_numberWithSubtype(); + void launchEditCreateNew_numberWithSubtype_old(); void launchEditCreateNew_email(); void launchEditCreateNew_email_old(); void launchEditCreateNew_onlineAccount(); void launchEditCreateNew_onlineAccount_old(); + void launchEditCreateNew_onlineAccountWithSubtype(); + void launchEditCreateNew_onlineAccountWithSubtype_old(); void launchEditorVCard(); void launchEditorVCard_old(); // EDIT - update existing void launchEditUpdateExisting_number(); void launchEditUpdateExisting_number_old(); + void launchEditUpdateExisting_numberWithSubtype(); + void launchEditUpdateExisting_numberWithSubtype_old(); void launchEditUpdateExisting_email(); void launchEditUpdateExisting_email_old(); void launchEditUpdateExisting_onlineAccount(); void launchEditUpdateExisting_onlineAccount_old(); + void launchEditUpdateExisting_onlineAccountWithSubtype(); + void launchEditUpdateExisting_onlineAccountWithSubtype_old(); // CONTACT CARD void launchContactCard(); @@ -71,6 +81,9 @@ void launchContactCardEmail_old(); void launchContactCardOnlineAccount(); void launchContactCardOnlineAccount_old(); + + // GROUP MEMBER VIEW + void launchGroupMemberView(); void onEditCompleted(const QVariant& value); void onRequestCompleted(const QVariant& value); @@ -82,9 +95,9 @@ private: void launchMultiFetch( bool aNewInterface, QString aAction ); void launchSingleFetch( bool aNewInterface, QString aAction ); - void launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent ); + void launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent, QString aDetailSubtype = QString() ); void launchEditorVCard( bool aNewInterface ); - void launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue ); + void launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue, QString aDetailSubtype = QString()); void launchContactCard( bool aNewInterface ); void launchContactCard( bool aNewInterface, QString aDetailType, QString aDetailValue ); @@ -92,6 +105,7 @@ XQAiwRequest *mRequest; HbMainWindow *mMainWindow; + HbDialog *mPopup; }; diff -r 7cbcb2896f0e -r a642906a277a phonebookui/rom/phonebook.iby --- a/phonebookui/rom/phonebook.iby Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/rom/phonebook.iby Wed Aug 18 09:39:00 2010 +0300 @@ -30,7 +30,6 @@ file=ABI_DIR\BUILD_DIR\cntmaptileservice.dll SHARED_LIB_DIR\cntmaptileservice.dll UNPAGED file=ABI_DIR\BUILD_DIR\cntsimutility.dll SHARED_LIB_DIR\cntsimutility.dll UNPAGED file=ABI_DIR\BUILD_DIR\cntimageutility.dll SHARED_LIB_DIR\cntimageutility.dll UNPAGED -file=ABI_DIR\BUILD_DIR\cntsettingsutility.dll SHARED_LIB_DIR\cntsettingsutility.dll UNPAGED // UI file=ABI_DIR\BUILD_DIR\pbkcommonui.dll SHARED_LIB_DIR\pbkcommonui.dll UNPAGED diff -r 7cbcb2896f0e -r a642906a277a pimprotocols/pbap/group/bld.inf --- a/pimprotocols/pbap/group/bld.inf Tue Jul 06 14:05:47 2010 +0300 +++ b/pimprotocols/pbap/group/bld.inf Wed Aug 18 09:39:00 2010 +0300 @@ -14,7 +14,7 @@ // PRJ_EXPORTS -../client/pbapcli.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(pbapcli.h) +../client/pbapcli.h APP_LAYER_PLATFORM_EXPORT_PATH(pbapcli.h) pbap.iby /epoc32/rom/include/pbap.iby diff -r 7cbcb2896f0e -r a642906a277a pimprotocols/phonebooksync/group/BLD.INF --- a/pimprotocols/phonebooksync/group/BLD.INF Tue Jul 06 14:05:47 2010 +0300 +++ b/pimprotocols/phonebooksync/group/BLD.INF Wed Aug 18 09:39:00 2010 +0300 @@ -17,7 +17,7 @@ PRJ_EXPORTS ../group/phbksync.iby /epoc32/rom/include/phbksync.iby -../Client/phbksync.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(phbksync.h) +../Client/phbksync.h APP_LAYER_PUBLIC_EXPORT_PATH(phbksync.h) PRJ_TESTEXPORTS