# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274953519 -10800 # Node ID fd64c38c277df9e0fbebbf92fecbd5e2228e5396 # Parent 2a11b5b004703f017b3288e6675d8b6094670f5d Revision: 201019 Kit: 2010121 diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_api/inc/cntcenrepkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_api/inc/cntcenrepkeys.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CNTCENREPKEYS_H +#define CNTCENREPKEYS_H + +#include + +const TUid KCRUiContacts = {0x2002FF54}; + +const TUint32 KNameOrdering = 0x00000001; + +#endif // CNTCENREPKEYS_H diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_api/inc/cntviewparams.h --- a/contacts_plat/contacts_ui_api/inc/cntviewparams.h Fri May 14 15:42:23 2010 +0300 +++ b/contacts_plat/contacts_ui_api/inc/cntviewparams.h Thu May 27 12:45:19 2010 +0300 @@ -74,6 +74,7 @@ groupActionsView, historyView, importsView, + settingsView, customPhonebookView = 100, // reserved for internal view plugins, DO NOT USE THESE customView = 200 // for all other view plugins }; diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitem.h --- a/contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitem.h Fri May 14 15:42:23 2010 +0300 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitem.h Thu May 27 12:45:19 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include // Value enum for EditViewItemRole::ERoleItemType enum EditViewItemType @@ -52,22 +53,29 @@ * Returns data for a given role. * ETypeUiExtension must be returned for ERoleItemType * + * Other supported roles and restrictions: + * Qt::DisplayRole -> QStringList with 1-2 QStrings + * Qt::DecorationRole -> 0-1 HbIcon + * * @param int, role * @return QVariant, data for the given role - */ + */ virtual QVariant data(int role) const = 0; /** * Called when this item is activated (tapped) in the list. + * + * @param CntEditViewItemCallback*, callback interface for possible view switching and list refreshing requests, ownership NOT given */ - virtual void activated() = 0; + virtual void activated(CntEditViewItemCallback* interface) = 0; /** * Called when this item is longpressed in the list. * * @param QPointF&, coordinates from where the longpress was initiated + * @param CntEditViewItemCallback*, callback interface for possible view switching and list refreshing requests, ownership NOT given */ - virtual void longPressed(const QPointF& coords) = 0; + virtual void longPressed(const QPointF& coords, CntEditViewItemCallback* interface) = 0; }; #endif // CNTEDITVIEWITEM_H diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitemcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitemcallback.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CNTEDITVIEWITEMCALLBACK_H +#define CNTEDITVIEWITEMCALLBACK_H + +#include + +/** + * Class for asynchronously handling action callbacks from cnteditviewitems + */ +class CntEditViewItemCallback +{ +public: + + /** + * Handles the possibly needed view switching callbacks from CntEditViewItem::activated(...) + * and longPressed(...) + * + * @param CntViewParameters&, callback for view switching + */ + virtual void openView(CntViewParameters& viewParams) = 0; + + /** + * Handles the refresh requests from editviewitems + */ + virtual void requestRefresh() = 0; + +protected: + // prevent deleting by client + virtual ~CntEditViewItemCallback() {} +}; + +#endif //CNTEDITVIEWITEMCALLBACK_H diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cntextensiongroupcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntextensiongroupcallback.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CNTEXTENSIONGROUPCALLBACK_H +#define CNTEXTENSIONGROUPCALLBACK_H + +#include + +/** + * Class for asynchronously handling action callbacks from cntuiextensiongroup longPressed method + */ +class CntExtensionGroupCallback +{ +public: + + /** + * Handles the view switching callback from CntUiExtensionGroup::longPressed(...) + * + * @param CntViewParameters&, callback for view switching + */ + virtual void openView(CntViewParameters& viewParams) = 0; + +protected: + // prevent deleting by client + virtual ~CntExtensionGroupCallback() {} +}; + +#endif //CNTEXTENSIONGROUPCALLBACK_H diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cntuiactionextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuiactionextension.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Tags for contact card UI control. Use these in mobility plugin metaData() to specify + * which action details UI should show. + * + */ + +#ifndef CNTUIEXTENSIONGROUP_H +#define CNTUIEXTENSIONGROUP_H + +/* + * Tags for QContactAction metaData call. Tags describe which UI element they are affecting to. + * Action can be visualised with UI item that has three customised areas: icon, title text and value text. + * Icon reserves small space from left edge of item, title text fills top part of free space from item and + * value text fills lower part of free space from item. + * + * You can create generic contact or my card action(detail independent) by checking if + * QContactDetail in isDetailSupported is null. These items are created only once for view. + * You cannot use KCntUiActionMetaTitleTextDetail or KCntUiActionMetaValueTextDetail with this + * action UI item, since it's detail independent. + * + * If you want to create action only to "My card" view, you have to create QContactManager instance and + * and compare its "cm->selfContactId()" to local id of QContact parameter in isDetailSupported + * (contact.localId()). You cannot use KCntUiActionMetaTitleTextDetail or KCntUiActionMetaValueTextDetail + * with this action UI item, since it's detail independent. + */ + +// Default Symbian database, use this as uri parameter for QContactManager::fromUri. +const QString SYMBIAN_BACKEND = "qtcontacts:symbian:"; + +// First line in UI item +// This tag is used to specify localized freetext(QString) description for action, eg. "Send message". This +// or KCntUiActionMetaTitleTextDetail tag must be specified if UI should show action. If both set +// this is used. +const QString KCntUiActionMetaTitleText = "titleText"; + +// First line in UI item +// This tag is used to specify data field to be shown from detail, eg. QContactPhoneNumber::FieldNumber. +// This or KCntUiActionMetaTitleText tag must be specified if UI should show action. If both set +// KCntUiActionMetaTitleText is used. +// Note: Does not work with general contact actions(isDetailSupported has empty detail parameter) +const QString KCntUiActionMetaTitleTextDetail = "titleTextDetail"; + + +// Second line in UI item +// This tag is used to specify which field to show from detail in UI, eg. QContactPhoneNumber::FieldNumber. +// UI can show either this or KCntUiActionMetaValueText tag. If both set this is used. +// Note: Does not work with general contact actions(isDetailSupported has empty detail parameter) +const QString KCntUiActionMetaValueTextDetail = "valueTextDetail"; + +// Second line in UI item +// This tag can be used to specify localized freetext(QString) to UI. +// UI can show either this or KCntUiActionMetaValueTextDetail tag. If both set KCntUiActionMetaValueTextDetail +// is used. +const QString KCntUiActionMetaValueText = "valueText"; + +// Text for long press menu in UI +// This tag can be used to specify localized freetext(QString) to UI. +const QString KCntUiActionMetaValueTextLongPress = "longPressText"; + + +// This tag is used to specify custom icon for action +// Icon must be QIcon. +// TODO Supported icon dimension? +const QString KCntUiActionMetaIcon = "icon"; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cntuiextensionfactory.h --- a/contacts_plat/contacts_ui_extensions_api/inc/cntuiextensionfactory.h Fri May 14 15:42:23 2010 +0300 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuiextensionfactory.h Thu May 27 12:45:19 2010 +0300 @@ -47,6 +47,8 @@ * A factory which gives access to UI extension interfaces. * The plugin can extend the needed extensions and return null for the * unsupported extension types. + * + * Plugins must be exported to /resource/qt/plugins/contacts/extensions */ class CntUiExtensionFactory { @@ -54,12 +56,6 @@ virtual ~CntUiExtensionFactory() {} /** - * Gives access to an interface for extending UI action buttons. - * @return Returns null if not supported. Ownership is not given. - */ - virtual CntContactCardActionSupplier* contactCardActionSupplier() = 0; - - /** * Gives access to an interface for extending UI with new groups. * @return Returns null if not supported. Ownership is not given. */ diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cntuiextensiongroup.h --- a/contacts_plat/contacts_ui_extensions_api/inc/cntuiextensiongroup.h Fri May 14 15:42:23 2010 +0300 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuiextensiongroup.h Thu May 27 12:45:19 2010 +0300 @@ -20,11 +20,21 @@ #include #include +#include class QPointF; /** * Handle to specific group provided by the group supplier + * + * Example usage for CntViewParameters callbacks: + * + * MyExtensionGroup::activated(CntViewParameters& callBack) const { + * callBack.insert(EViewId, customView); <- when item is tapped, it opens the view specified here + * callBack.insert(ECustomParam, myCustomParam); <- custom parameters can also be used if needed + * } + * + * see cntviewparams.h for more information on view parameters */ class CntUiExtensionGroup { @@ -80,19 +90,21 @@ virtual int serviceId() const = 0; /** - * Called when this item is activated (tapped) in the list. + * Called when this item is activated (tapped) in the list. The callback is handled + * synchronously and therefore it is assumed that this should be used for + * opening a new view. * * @param CntViewParameters&, callback for view switching */ - virtual void activated(CntViewParameters& callBack) const = 0; + virtual void activated(CntViewParameters& callBack) = 0; /** * Called when this item is longpressed in the list. * * @param QPointF&, coordinates from where the longpress was initiated - * @param CntViewParameters&, callback for view switching + * @param CntExtensionGroupCallback*, callback interface for view switching, ownership NOT given */ - virtual void longPressed(const QPointF& coords, CntViewParameters &callBack) const = 0; + virtual void longPressed(const QPointF& coords, CntExtensionGroupCallback *interface) = 0; virtual void* GroupExtension( int /*aExtensionId*/ ) diff -r 2a11b5b00470 -r fd64c38c277d contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h --- a/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h Fri May 14 15:42:23 2010 +0300 +++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h Thu May 27 12:45:19 2010 +0300 @@ -42,7 +42,7 @@ * @param int, group index * @return CntUiExtensionGroup&, group handle */ - virtual const CntUiExtensionGroup& groupAt( int aIndex ) const = 0; + virtual CntUiExtensionGroup& groupAt( int aIndex ) const = 0; virtual void* GroupSupplierExtension( int /*aExtensionId*/ ) diff -r 2a11b5b00470 -r fd64c38c277d layers.sysdef.xml --- a/layers.sysdef.xml Fri May 14 15:42:23 2010 +0300 +++ b/layers.sysdef.xml Thu May 27 12:45:19 2010 +0300 @@ -9,6 +9,9 @@ + + + diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/CntSortPlugin/src/CCntSortPlugin.h --- a/phonebookengines/CntSortPlugin/src/CCntSortPlugin.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/CntSortPlugin/src/CCntSortPlugin.h Thu May 27 12:45:19 2010 +0300 @@ -22,6 +22,9 @@ // INCLUDES #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif // FORWARD DECLARATIONS class CSortUtil; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/bwins/mobcntmodelu.def --- a/phonebookengines/bwins/mobcntmodelu.def Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/bwins/mobcntmodelu.def Thu May 27 12:45:19 2010 +0300 @@ -12,26 +12,26 @@ ?updateContactIdsArray@MobCntModel@@AAEXXZ @ 11 NONAME ; void MobCntModel::updateContactIdsArray(void) ?doConstruct@MobCntModel@@AAEHXZ @ 12 NONAME ; int MobCntModel::doConstruct(void) ?tr@MobCntModel@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString MobCntModel::tr(char const *, char const *, int) - ?data@MobCntModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 14 NONAME ; class QVariant MobCntModel::data(class QModelIndex const &, int) const - ?trUtf8@MobCntModel@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString MobCntModel::trUtf8(char const *, char const *, int) - ?validRowId@MobCntModel@@ABE_NH@Z @ 16 NONAME ; bool MobCntModel::validRowId(int) const - ??_EMobCntModel@@UAE@I@Z @ 17 NONAME ; MobCntModel::~MobCntModel(unsigned int) - ?rowCount@MobCntModel@@UBEHABVQModelIndex@@@Z @ 18 NONAME ; int MobCntModel::rowCount(class QModelIndex const &) const - ?contact@MobCntModel@@ABE?AVQContact@QtMobility@@H@Z @ 19 NONAME ; class QtMobility::QContact MobCntModel::contact(int) const - ?tr@MobCntModel@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString MobCntModel::tr(char const *, char const *) - ??0MobCntModel@@QAE@PAVQContactManager@QtMobility@@ABVQContactFilter@2@ABV?$QList@VQContactSortOrder@QtMobility@@@@_NPAVQObject@@@Z @ 21 NONAME ; MobCntModel::MobCntModel(class QtMobility::QContactManager *, class QtMobility::QContactFilter const &, class QList const &, bool, class QObject *) - ?dataForDisplayRole@MobCntModel@@ABE?AVQVariant@@H@Z @ 22 NONAME ; class QVariant MobCntModel::dataForDisplayRole(int) const - ?qt_metacall@MobCntModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int MobCntModel::qt_metacall(enum QMetaObject::Call, int, void * *) - ?handleRemoved@MobCntModel@@IAEXABV?$QList@I@@@Z @ 24 NONAME ; void MobCntModel::handleRemoved(class QList const &) - ?myCardStatus@MobCntModel@@QBE_NXZ @ 25 NONAME ; bool MobCntModel::myCardStatus(void) const - ?qt_metacast@MobCntModel@@UAEPAXPBD@Z @ 26 NONAME ; void * MobCntModel::qt_metacast(char const *) - ?setFilterAndSortOrder@MobCntModel@@QAEXABVQContactFilter@QtMobility@@ABV?$QList@VQContactSortOrder@QtMobility@@@@@Z @ 27 NONAME ; void MobCntModel::setFilterAndSortOrder(class QtMobility::QContactFilter const &, class QList const &) - ?staticMetaObject@MobCntModel@@2UQMetaObject@@B @ 28 NONAME ; struct QMetaObject const MobCntModel::staticMetaObject - ?handleAdded@MobCntModel@@IAEXABV?$QList@I@@@Z @ 29 NONAME ; void MobCntModel::handleAdded(class QList const &) - ?handleChanged@MobCntModel@@IAEXABV?$QList@I@@@Z @ 30 NONAME ; void MobCntModel::handleChanged(class QList const &) - ?indexOfContact@MobCntModel@@QBE?AVQModelIndex@@ABVQContact@QtMobility@@@Z @ 31 NONAME ; class QModelIndex MobCntModel::indexOfContact(class QtMobility::QContact const &) const - ?findIndexes@MobCntModel@@AAE?AV?$QList@V?$QList@H@@@@ABV?$QList@I@@@Z @ 32 NONAME ; class QList > MobCntModel::findIndexes(class QList const &) - ?contactManager@MobCntModel@@QBEAAVQContactManager@QtMobility@@XZ @ 33 NONAME ; class QtMobility::QContactManager & MobCntModel::contactManager(void) const - ?updateContactIcon@MobCntModel@@QAEXH@Z @ 34 NONAME ; void MobCntModel::updateContactIcon(int) - ?myCardId@MobCntModel@@QBEIXZ @ 35 NONAME ; unsigned int MobCntModel::myCardId(void) const + ?handleContactInfoUpdated@MobCntModel@@IAEXI@Z @ 14 NONAME ; void MobCntModel::handleContactInfoUpdated(unsigned int) + ?data@MobCntModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 15 NONAME ; class QVariant MobCntModel::data(class QModelIndex const &, int) const + ?trUtf8@MobCntModel@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString MobCntModel::trUtf8(char const *, char const *, int) + ?validRowId@MobCntModel@@ABE_NH@Z @ 17 NONAME ; bool MobCntModel::validRowId(int) const + ?myCardId@MobCntModel@@QBEIXZ @ 18 NONAME ; unsigned int MobCntModel::myCardId(void) const + ??_EMobCntModel@@UAE@I@Z @ 19 NONAME ; MobCntModel::~MobCntModel(unsigned int) + ?rowCount@MobCntModel@@UBEHABVQModelIndex@@@Z @ 20 NONAME ; int MobCntModel::rowCount(class QModelIndex const &) const + ?contact@MobCntModel@@ABE?AVQContact@QtMobility@@H@Z @ 21 NONAME ; class QtMobility::QContact MobCntModel::contact(int) const + ?tr@MobCntModel@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString MobCntModel::tr(char const *, char const *) + ??0MobCntModel@@QAE@PAVQContactManager@QtMobility@@ABVQContactFilter@2@ABV?$QList@VQContactSortOrder@QtMobility@@@@_NPAVQObject@@@Z @ 23 NONAME ; MobCntModel::MobCntModel(class QtMobility::QContactManager *, class QtMobility::QContactFilter const &, class QList const &, bool, class QObject *) + ?dataForDisplayRole@MobCntModel@@ABE?AVQVariant@@H@Z @ 24 NONAME ; class QVariant MobCntModel::dataForDisplayRole(int) const + ?qt_metacall@MobCntModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int MobCntModel::qt_metacall(enum QMetaObject::Call, int, void * *) + ?handleRemoved@MobCntModel@@IAEXABV?$QList@I@@@Z @ 26 NONAME ; void MobCntModel::handleRemoved(class QList const &) + ?myCardStatus@MobCntModel@@QBE_NXZ @ 27 NONAME ; bool MobCntModel::myCardStatus(void) const + ?qt_metacast@MobCntModel@@UAEPAXPBD@Z @ 28 NONAME ; void * MobCntModel::qt_metacast(char const *) + ?setFilterAndSortOrder@MobCntModel@@QAEXABVQContactFilter@QtMobility@@ABV?$QList@VQContactSortOrder@QtMobility@@@@@Z @ 29 NONAME ; void MobCntModel::setFilterAndSortOrder(class QtMobility::QContactFilter const &, class QList const &) + ?staticMetaObject@MobCntModel@@2UQMetaObject@@B @ 30 NONAME ; struct QMetaObject const MobCntModel::staticMetaObject + ?handleAdded@MobCntModel@@IAEXABV?$QList@I@@@Z @ 31 NONAME ; void MobCntModel::handleAdded(class QList const &) + ?handleChanged@MobCntModel@@IAEXABV?$QList@I@@@Z @ 32 NONAME ; void MobCntModel::handleChanged(class QList const &) + ?indexOfContact@MobCntModel@@QBE?AVQModelIndex@@ABVQContact@QtMobility@@@Z @ 33 NONAME ; class QModelIndex MobCntModel::indexOfContact(class QtMobility::QContact const &) const + ?findIndexes@MobCntModel@@AAE?AV?$QList@V?$QList@H@@@@ABV?$QList@I@@@Z @ 34 NONAME ; class QList > MobCntModel::findIndexes(class QList const &) + ?contactManager@MobCntModel@@QBEAAVQContactManager@QtMobility@@XZ @ 35 NONAME ; class QtMobility::QContactManager & MobCntModel::contactManager(void) const diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntdbdumper/group/dbsqldumper.mmp --- a/phonebookengines/contactsmodel/cntdbdumper/group/dbsqldumper.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntdbdumper/group/dbsqldumper.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../src -systeminclude /EPOC32/INCLUDE +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../src ../../src ../../cntplsql/inc source dbsqldumper.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntmatchlog/group/cntmatchlog.mmp --- a/phonebookengines/contactsmodel/cntmatchlog/group/cntmatchlog.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntmatchlog/group/cntmatchlog.mmp Thu May 27 12:45:19 2010 +0300 @@ -29,8 +29,7 @@ SOURCE CntMatchLog.cpp USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN START RESOURCE ../src/2000862D.rss TARGET cntmatchlog.rsc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntmodel/src/ccontactdatabase.cpp --- a/phonebookengines/contactsmodel/cntmodel/src/ccontactdatabase.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntmodel/src/ccontactdatabase.cpp Thu May 27 12:45:19 2010 +0300 @@ -27,6 +27,16 @@ #include "ccontactprivate.h" #include "clplproxyfactory.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#include "cntsyncecom.h" + +const TInt KMajorVersion=1; + +const TInt KMinorVersion=0; + +const TInt KBuildNumber=40; +#endif CContactDatabase::CContactDatabase(): iDbConnectionState(EDbConnectionNotReady), @@ -4165,6 +4175,7 @@ iCntSvr->RemoveObserver(aChangeNotifier); } + void CContactDatabase::CancelNotifyRequestL() { } diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntmodel/src/ccontactprivate.cpp --- a/phonebookengines/contactsmodel/cntmodel/src/ccontactprivate.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntmodel/src/ccontactprivate.cpp Thu May 27 12:45:19 2010 +0300 @@ -28,6 +28,10 @@ #include "rcntmodel.h" #include "ccontactprivate.h" #include "cntviewprivate.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#include "cntsyncecom.h" +#endif const TInt KMaxItemsInTemplateCache = 8; // Maximum number of cached templates. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntphone/cntphone.h --- a/phonebookengines/contactsmodel/cntphone/cntphone.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntphone/cntphone.h Thu May 27 12:45:19 2010 +0300 @@ -1,26 +1,26 @@ -/* -* Copyright (c) 2001-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: -* -*/ - +// Copyright (c) 2001-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 __CNTPHONE_H__ #define __CNTPHONE_H__ #include #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif /** * Default implementation of a phone number parser diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntphone/cntphone.mmp --- a/phonebookengines/contactsmodel/cntphone/cntphone.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntphone/cntphone.mmp Thu May 27 12:45:19 2010 +0300 @@ -21,7 +21,7 @@ target cntphone.dll targettype plugin - SYSTEMINCLUDE /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN UID 0x10009D8D 0x102035FB start resource 102035FB.RSS @@ -34,7 +34,6 @@ sourcepath . userinclude ../cntphone userinclude ../inc -systeminclude /epoc32/include source cntphone.cpp library euser.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/inc/plplugins.h --- a/phonebookengines/contactsmodel/cntplsql/inc/plplugins.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/inc/plplugins.h Thu May 27 12:45:19 2010 +0300 @@ -30,6 +30,8 @@ #include "persistencelayer.h" +//Forward declarations +class CContactPhoneNumberParser; /** Base class for Contacts Model plugins. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/clplcontactproperties.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/clplcontactproperties.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/clplcontactproperties.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// /** @file @@ -23,10 +20,14 @@ */ -#include // for resource reading. +#include // For resource reading. #include -#include // for system template resources. -#include // for kuidiccglobaladnphonebook. +#include // For System template resources. +#include // For KUidIccGlobalAdnPhonebook. + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntsyncecom.h" +#endif #include "persistencelayerimpl.h" #include "clplcontactproperties.h" @@ -52,7 +53,6 @@ delete iSyncDummy; delete iSystemTemplate; delete iGroupIdList; - } diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/clplproxyfactory.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/clplproxyfactory.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/clplproxyfactory.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// /** @file @@ -27,6 +24,11 @@ #include "rcntmodel.h" #include #include + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntsyncecom.h" +#endif + #include "cntviewprivate.h" diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/cplplugins.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/cplplugins.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/cplplugins.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 2004-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: -* -*/ - +// Copyright (c) 2004-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: +// /** @file @@ -22,9 +19,13 @@ @released */ - #include "plplugins.h" #include "cntviewprivate.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#include "cntdb_internal.h" +#include "cntsyncecom.h" +#endif // The name of the test phone book sync plugin. This plugin will be used in the diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/cpplcommaddrtable.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/cpplcommaddrtable.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/cpplcommaddrtable.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,25 +1,25 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// #include "pltables.h" #include "dbsqlconstants.h" #include "plplugins.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif /** @param aDatabase A handle to the database. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/csqlitelocalview.cpp Thu May 27 12:45:19 2010 +0300 @@ -30,6 +30,9 @@ #include "cviewcontactmanager.h" #include "cntstd.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif //uncomment to test //#define __PROFILE_SORT__ @@ -607,23 +610,23 @@ #endif iOutstandingEvents.AppendL(aEvent); - // The view state is set to ENotReady when a recovery takes place, and also when the tables - // are closed, so set ready here. - if (iState == ENotReady && (aEvent.iType - == EContactDbObserverEventRecover || aEvent.iType - == EContactDbObserverEventTablesOpened)) - { + // The view state is set to ENotReady when a recovery takes place, and also when the tables + // are closed, so set ready here. + if (iState == ENotReady && (aEvent.iType + == EContactDbObserverEventRecover || aEvent.iType + == EContactDbObserverEventTablesOpened)) + { SetState(EReady); - } - // view was Initializing (sorting) before recovery or compression started! - if (iState == EInitializing && (aEvent.iType - == EContactDbObserverEventRecover || aEvent.iType - == EContactDbObserverEventCompress)) - { + } + // view was Initializing (sorting) before recovery or compression started! + if (iState == EInitializing && (aEvent.iType + == EContactDbObserverEventRecover || aEvent.iType + == EContactDbObserverEventCompress)) + { // re-read database and sort SafeResort(); - } - + } + } diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntplsql/src/cviewcontactmanager.cpp --- a/phonebookengines/contactsmodel/cntplsql/src/cviewcontactmanager.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntplsql/src/cviewcontactmanager.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// /** @file @@ -27,6 +24,9 @@ #include "cviewcontactmanager.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif const TInt KContactsArrayGranularity = 100; const TInt KUnsortedArrayGranularity = 16; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntvcard/CNTVCARD.MMP --- a/phonebookengines/contactsmodel/cntvcard/CNTVCARD.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntvcard/CNTVCARD.MMP Thu May 27 12:45:19 2010 +0300 @@ -32,8 +32,9 @@ userinclude ../cntvcard ../src userinclude ../inc +USERINCLUDE ../../../../organizer/pimappsupport/vcardandvcal/inc -APP_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source cntvcardstd.cpp cntvcardconverter.cpp source cntvcardimport.cpp cntvcardexport.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntvcard/cntvcardconverter.cpp --- a/phonebookengines/contactsmodel/cntvcard/cntvcardconverter.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntvcard/cntvcardconverter.cpp Thu May 27 12:45:19 2010 +0300 @@ -32,6 +32,10 @@ #include #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntconvertercallback.h" +#endif + /** @@ -183,7 +187,7 @@ HandleAgentsInVCardL(aConverter, agentPropertyList, *mainItem, aDb, aOption, aIncAccessCount, aDecAccessCount, aContactItems, EFalse); } - if (mainItem->CardFields().Count()) /// checks vcard is not empty + if (mainItem->CardFields().Count()) // checks vcard is not empty { ModifyAccessCountL(*mainItem, aIncAccessCount, aDecAccessCount); if (aOption & ENullTemplateId) diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntvcard/cntvcardexport.cpp --- a/phonebookengines/contactsmodel/cntvcard/cntvcardexport.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntvcard/cntvcardexport.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 1997-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: -* -*/ - +// Copyright (c) 1997-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 @@ -23,6 +20,10 @@ #include "cntvcardutils.h" #include #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "vcard3.h" +#include "cntdb_internal.h" +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntvcard/cntvcardimport.cpp --- a/phonebookengines/contactsmodel/cntvcard/cntvcardimport.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntvcard/cntvcardimport.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 1997-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: -* -*/ - +// Copyright (c) 1997-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 "cntvcardutils.h" @@ -30,6 +27,7 @@ #include #include + // Constants const TInt KVCardImportAddressArrayGranularity = 4; const TInt KContactGivenName = 1; @@ -45,6 +43,10 @@ const TInt KContactPostcode = 5; const TInt KContactCountry = 6; +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +const TInt KContactMaxFieldNumber = 32; +#endif + /** * Delete name fields from a contact * @@ -1439,7 +1441,7 @@ mapping=KUidContactFieldVCardMapNotRequired; } break; -////////////// +// default: // aka case KVersitPropertyHBufCUid: aStorageType=KStorageTypeText; mapping = KUidContactFieldVCardMapUnknown; // Initialize to something sensible diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/Groupview.cpp --- a/phonebookengines/contactsmodel/cntview/Groupview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/Groupview.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,6 +19,9 @@ #include #include "cntstd.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cnthint.h" +#endif //#define CNTVIEW_API_PROFILING diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/LocalView.cpp --- a/phonebookengines/contactsmodel/cntview/LocalView.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/LocalView.cpp Thu May 27 12:45:19 2010 +0300 @@ -24,6 +24,9 @@ #include #include "persistencelayer.h" #include "cviewiterator.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif //uncomment to test //#define __PROFILE_SORT__ diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/RemoteView.cpp --- a/phonebookengines/contactsmodel/cntview/RemoteView.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/RemoteView.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,6 +19,9 @@ #include #include "cntviewprivate.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif #include "ccntserver.h" //for kslot1 and kslot2 #include "rcntmodel.h" diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/ViewBase.cpp --- a/phonebookengines/contactsmodel/cntview/ViewBase.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/ViewBase.cpp Thu May 27 12:45:19 2010 +0300 @@ -15,7 +15,8 @@ * */ -#include "ecom/ecom.h" // for recomsession +// System includess +#include "ecom/ecom.h" // For REComSession #include // User includes @@ -25,6 +26,9 @@ #include "cviewcontactextension.h" #include #include "cntviewprivate.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif extern void DebugLogViewNotification(const TDesC& aMethod, const TContactViewEvent& aEvent); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/cntview.mmp --- a/phonebookengines/contactsmodel/cntview/cntview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/cntview.mmp Thu May 27 12:45:19 2010 +0300 @@ -28,7 +28,7 @@ userinclude ../cntview userinclude ../inc ../src -APP_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source ../cntview/ConcView.cpp source ../cntview/FilteredView.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/cntview/findview.cpp --- a/phonebookengines/contactsmodel/cntview/findview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/cntview/findview.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,6 +19,9 @@ #include #include "cntstd.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif //#define CNTVIEW_API_PROFILING // To see the diferences between class versions check the in source documentation of TContactViewEvent diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/CNTMODEL.MMP --- a/phonebookengines/contactsmodel/group/CNTMODEL.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/CNTMODEL.MMP Thu May 27 12:45:19 2010 +0300 @@ -22,11 +22,12 @@ target cntmodel.dll targettype DLL -APP_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc userinclude ../cntmodel/inc userinclude ../cntsrv/inc +USERINCLUDE ../cntplsql/inc userinclude ../src //for Panic code SOURCEPATH . diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/CNTMODEL.RSS --- a/phonebookengines/contactsmodel/group/CNTMODEL.RSS Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/CNTMODEL.RSS Thu May 27 12:45:19 2010 +0300 @@ -17,11 +17,15 @@ */ +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "../inc/cntdef_internal.hrh" +#endif #include "cntmodel.rls" #include // as existing version, but see below #include + // // There are two ways of defining custom filterable fields. The two methods cannot be mixed. // diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/CNTSRV.MMP --- a/phonebookengines/contactsmodel/group/CNTSRV.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/CNTSRV.MMP Thu May 27 12:45:19 2010 +0300 @@ -31,9 +31,7 @@ //MACRO __STATE_MACHINE_DEBUG__ //MACRO __PROFILE_DEBUG__ -APP_LAYER_SYSTEMINCLUDE - -systeminclude /epoc32/include/connect +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../src USERINCLUDE ../cntmodel/inc // For CCntPackager.h diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/COMMON.INF --- a/phonebookengines/contactsmodel/group/COMMON.INF Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/COMMON.INF Thu May 27 12:45:19 2010 +0300 @@ -22,31 +22,36 @@ */ PRJ_EXPORTS -../inc/CNTDEF.H /epoc32/include/cntdef.h -../inc/CNTDB.H /epoc32/include/cntdb.h -../inc/CNTDBOBS.H /epoc32/include/cntdbobs.h -../inc/CNTFIELD.H /epoc32/include/cntfield.h -../inc/CNTFLDST.H /epoc32/include/cntfldst.h -../inc/CNTFILT.H /epoc32/include/cntfilt.h -../inc/CNTITEM.H /epoc32/include/cntitem.h -../inc/cntview.h -../inc/cntviewbase.h -../inc/cntsync.h +../inc/CNTDEF.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntdef.h) +../inc/CNTDB.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntdb.h) +../inc/CNTDBOBS.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntdbobs.h) +../inc/CNTFIELD.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntfield.h) +../inc/CNTFLDST.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntfldst.h) +../inc/CNTFILT.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntfilt.h) +../inc/CNTITEM.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntitem.h) +../inc/cntview.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntview.h) +../inc/cntviewbase.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntviewbase.h) +../inc/cntsync.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntsync.h) //Cntmodel Find configuration Implementation definition header. -../inc/cntviewfindconfig.h -../inc/cntviewfindconfig.inl +../inc/cntviewfindconfig.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntviewfindconfig.h) +../inc/cntviewfindconfig.inl SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntviewfindconfig.inl) //CntModel Sort Plug-in implementation definition header -../inc/cntviewsortplugin.h +../inc/cntviewsortplugin.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntviewsortplugin.h) +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +../inc/cntphonenumparser.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntphonenumparser.h) +../inc/cntviewsortpluginbase.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntviewsortpluginbase.h) +../inc/cntsyncecom.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntsyncecom.h) +#endif -../inc/CNTMODEL.RH /epoc32/include/cntmodel.rh +../inc/CNTMODEL.RH SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntmodel.rh) ../inc/CNTDEF.HRH /epoc32/include/cntdef.hrh // VCard Converter Plugin -../cntvcard/CNTVCARD.H /epoc32/include/cntvcard.h +../cntvcard/CNTVCARD.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(cntvcard.h) // Default View Definition store -../inc/cntviewstore.h +../inc/cntviewstore.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(cntviewstore.h) // Documentation ../documentation/contacts_connectivityapi.doc /epoc32/engdoc/cntmodel/contacts_connectivityapi.doc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/cntview.mmp --- a/phonebookengines/contactsmodel/group/cntview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/cntview.mmp Thu May 27 12:45:19 2010 +0300 @@ -29,6 +29,7 @@ userinclude ../cntview userinclude ../inc ../src +APP_LAYER_SYSTEMINCLUDE_SYMBIAN APP_LAYER_SYSTEMINCLUDE diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/group/template.mmp --- a/phonebookengines/contactsmodel/group/template.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/group/template.mmp Thu May 27 12:45:19 2010 +0300 @@ -20,7 +20,7 @@ TARGETTYPE NONE USERINCLUDE . -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN START RESOURCE cntmodel.rss HEADERONLY diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/groupsql/cntplsql.mmp --- a/phonebookengines/contactsmodel/groupsql/cntplsql.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/groupsql/cntplsql.mmp Thu May 27 12:45:19 2010 +0300 @@ -38,10 +38,12 @@ SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore SYSTEMINCLUDE /epoc32/include/mw/hb/hbinput -USERINCLUDE ../src //for cntstd.h -USERINCLUDE ../cntsrv/inc //for persistencelayer.h -USERINCLUDE ../cntplsql/inc -USERINCLUDE ../inc //for ccontactprivate.h +userinclude ../src //for cntstd.h +userinclude ../cntsrv/inc //for persistencelayer.h +APP_LAYER_SYSTEMINCLUDE_SYMBIAN + +userinclude ../cntplsql/inc +userinclude ../inc //for ccontactprivate.h // Qt Macros MACRO UNICODE @@ -103,3 +105,5 @@ EPOCALLOWDLLDATA STDCPP SMPSAFE + + diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/inc/CNTDB.H --- a/phonebookengines/contactsmodel/inc/CNTDB.H Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/inc/CNTDB.H Thu May 27 12:45:19 2010 +0300 @@ -1,20 +1,17 @@ -/* -* Copyright (c) 1997-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: -* -*/ - +// Copyright (c) 1997-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 __CNTDB_H__ #define __CNTDB_H__ @@ -60,6 +57,10 @@ class CDataBaseChangeObserver; class CContactConverter; +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +class CContactSynchroniser; +#endif + // Constants /** @@ -82,6 +83,8 @@ */ const TInt KMaxCustomFilterableFields=4; +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS + /** @internalComponent */ const TInt KMajorVersion=1; /** @internalComponent */ @@ -89,6 +92,7 @@ /** @internalComponent */ const TInt KBuildNumber=41; +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS // // Classes used for compact @@ -135,7 +139,8 @@ class CContactActiveBase : public CBase, public MContactUiActive /** -@internalTechnology +@publishedAll +@released */ { public: @@ -526,6 +531,7 @@ virtual void HandleSortEventL(TInt aContactsSorted, TInt aContactsTotal)=0; }; +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS class MConverterCallBack /** Interface class for providing Intra-Contact Properties during a PBAP specific contacts export. @@ -540,13 +546,16 @@ */ virtual void AddIntraContactPropertiesL(const TContactItemId& aContactId, CArrayPtr* aPropertyList) = 0; }; +#else +class MConverterCallBack; +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS enum TVCardVersion /** Specifies type of export of contact items. PBAP clients should use EPBAPVCard21 and EPBAPVCard30. +@publishedAll @released -@internalTechnology */ { EVCardUDEF = -1, @@ -733,6 +742,8 @@ for such use. */ EMultiThread }; + +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS /** @internalComponent */ @@ -743,6 +754,7 @@ EUsesAllTables, EIdentityTableNotUsed //Not used }; +#endif public: IMPORT_C static CContactDatabase* OpenL(TThreadAccess aAccess=ESingleThread); IMPORT_C static CContactDatabase* OpenL(const TDesC& aFileName,TThreadAccess aAccess=ESingleThread); @@ -996,7 +1008,7 @@ public: void CancelNotifyRequestL(); TBool IsICCSynchronisedL(); - + void OpenDatabaseAsyncL(TRequestStatus& aStatus, const TDesC& aFileName = KNullDesC); static void CleanupLastLockedContact(TAny *aDatabase); @@ -1155,7 +1167,8 @@ /** The UID of the default vCard converter implemented by an ECom plugin. -@internalComponent +@publishedAll +@released */ #define KUidEComCntVCardConverterDefaultImplementation 0x102035F9 /** The UID of the default vCard converter plugin implementation. This @@ -1165,24 +1178,34 @@ */ #define KUidVCardConvDefaultImpl KUidEComCntVCardConverterDefaultImplementation -/** The UID of the vCard converter ECom plugin interface. */ +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS + +/** The UID of the vCard converter ECom plugin interface. +@released +@internalTechnology +*/ const TUid KUidEcomCntVCardConverterInterface = {0x102035F7}; -/** The UID of the phone number parser ECom plugin interface. */ +/** The UID of the phone number parser ECom plugin interface. +@released +@internalTechnology +*/ const TUid KUidEcomCntPhoneNumberParserInterface = {0x102035FA}; /** The UID of PBAP vCard Converter plugin Implementation. +@internalTechnology @released -@internalTechnology */ #define KUidPBAPVCardConvImpl 0xA00015C1 +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS + class TPluginParameters /** Class used to pack the extra arguments required for a PBAP conveter, PBAP client provides these arguments using overloaded CContactDatabase::ExportSelectedContacts. +@publishedAll @released -@internalComponent */ { public: @@ -1225,8 +1248,7 @@ /** Provides functionality to import and export vCards. One or more vCards can be imported from a read stream (the vCards are converted into contact items and added to the database). Also, contact items can be exported as vCards. - -@publishedPartner +@publishedAll @released */ { @@ -1240,7 +1262,7 @@ /** It provides Ecom Framework based facilities to resolve and load the appropriate implementations at run-time. The framework supplies a default resolver for selecting appropriate implementations. -@publishedPartner +@publishedAll @released */ { @@ -1287,7 +1309,7 @@ REComSession::DestroyedImplementation(iDtor_ID_Key); } - +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS class CContactPhoneNumberParser : public CBase /** Provides functionality to extract the real phone number from a contact's phone number field. @publishedPartner @@ -1329,7 +1351,7 @@ { REComSession::DestroyedImplementation(iDtor_ID_Key); } - +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS inline TInt CContactDatabase::TemplateCount() const /** Gets the number of contact card templates that exist in the database. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/inc/CNTFIELD.H --- a/phonebookengines/contactsmodel/inc/CNTFIELD.H Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/inc/CNTFIELD.H Thu May 27 12:45:19 2010 +0300 @@ -1,21 +1,19 @@ -/* -* Copyright (c) 1997-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: -* Persistence layer exports -* -*/ - +// Copyright (c) 1997-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: +// Persistence layer exports +// +// @@ -25,12 +23,14 @@ #include + /** Null field ID. @publishedAll @released */ const TInt KNullFieldId=-1; +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS /** @internalComponent */ const TInt KIntContactHintIsPhone=0x02; /** @internalComponent */ @@ -91,7 +91,7 @@ const TInt KHintIdMask = 0xFFC00000; #endif //_SYMBIAN_USE_SQLITE__ - +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS class RWriteStream; class RReadStream; @@ -206,6 +206,9 @@ friend class CContactTables; friend class RPplContactTable; friend class CPackagerTests; +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS + class THint; +#else class THint /** @internalComponent @@ -272,6 +275,7 @@ TInt iHintValue; }; +#endif public: IMPORT_C static CContactItemField* NewLC(); @@ -434,7 +438,7 @@ /** Constructs the CContactItemFieldDef object, with an array granularity of 8. */ {}; }; - +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS class TContactFieldAtts /** @internalComponent @@ -512,6 +516,7 @@ inline TFieldHeader::TFieldHeader(TStreamId aId,TContactFieldAtts aAtts) { iStreamId=aId; iAtts=aAtts; } #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS inline TBool CContactItemField::IsHidden() const /** Gets the value of the field's hidden attribute. @@ -560,7 +565,7 @@ @return ETrue if the field is deleted, otherwise EFalse. */ { return iAttributes&EDeleted; } - +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS inline void CContactItemField::THint::SetIsPhone() {iHintValue|=KIntContactHintIsPhone;} inline void CContactItemField::THint::SetIsMsg() @@ -625,7 +630,7 @@ #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ inline TBool CContactItemField::THint::Contains(const THint& aHint) const {return (iHintValue&aHint.iHintValue);} - +#endif inline TBool CContactItemField::OverRidesLabel() const /** Tests whether the field's label (as set by SetLabel()) overrides the label specified in the field's template. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/inc/CNTITEM.H --- a/phonebookengines/contactsmodel/inc/CNTITEM.H Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/inc/CNTITEM.H Thu May 27 12:45:19 2010 +0300 @@ -1,21 +1,19 @@ -/* -* Copyright (c) 1997-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: -* Persistence layer exports -* -*/ - +// Copyright (c) 1997-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: +// Persistence layer exports +// +// #if !defined(__CNTITEM_H__) #define __CNTITEM_H__ @@ -46,10 +44,12 @@ */ #define KUidStringSeparator '-' +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS /** Constant used by vCard import/export. @internalComponent */ #define KContactMaxFieldNumber 32 +#endif class CContactItemField; class CContactItemViewDef; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/inc/cntsync.h --- a/phonebookengines/contactsmodel/inc/cntsync.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/inc/cntsync.h Thu May 27 12:45:19 2010 +0300 @@ -1,25 +1,21 @@ -/* -* Copyright (c) 2001-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: -* -*/ - +// Copyright (c) 2001-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 __CNTSYNC_H__ #define __CNTSYNC_H__ - #include #include @@ -32,12 +28,13 @@ synchroniser API. The plug-in should have a second UID of 0x101F4A6E (KUidContactSynchroniserDll). -@internalAll +@publishedAll */ { public: /** - @internalAll + @publishedAll + @released */ enum TValidateOperation { @@ -99,10 +96,11 @@ private: IMPORT_C virtual void MContactSynchroniser_Reserved_1(); }; - + +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS /** The UID for the default phone book synchroniser ECom plugin interface. -@internalComponent +@publishedPartner */ const TUid KUidEcomCntPhBkSyncInterface = {0x102035FD}; @@ -113,7 +111,7 @@ It should be inherited by classes which implement the phonebook synchroniser API in a platform secured environment. The ECom plug-in interface uid is KUidEcomCntPhBkSyncInterface -@internalAll +@publishedPartner */ { public: @@ -137,3 +135,5 @@ }; #endif + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/inc/cntviewsortplugin.h --- a/phonebookengines/contactsmodel/inc/cntviewsortplugin.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/inc/cntviewsortplugin.h Thu May 27 12:45:19 2010 +0300 @@ -1,26 +1,23 @@ -/* -* Copyright (c) 2004-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: -* -*/ - +// Copyright (c) 2004-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 __CNTVIEWSORTPLUGIN_H__ #define __CNTVIEWSORTPLUGIN_H__ #include -#include "ecom/ecom.h" // for recomsession +#include "ecom/ecom.h" // For REComSession #include @@ -37,6 +34,7 @@ */ _LIT8(KViewSortPluginDefaultName, "/default"); +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS //******************************************************************************************** // @@ -252,6 +250,6 @@ { REComSession::DestroyedImplementation(iDtor_ID_Key); } - +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS #endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/src/CNTFIELD.CPP --- a/phonebookengines/contactsmodel/src/CNTFIELD.CPP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/src/CNTFIELD.CPP Thu May 27 12:45:19 2010 +0300 @@ -26,6 +26,11 @@ #include #include #include "cntprof.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntfieldheader.h" +#include "cnthint.h" +#include "cntfield_internal.h" +#endif // // class TContactFieldAtts @@ -1845,8 +1850,72 @@ { iHintValue |= ((aNumber << KHintAdditionalMaskShift) & KHintAdditionalMask); } - +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +inline void CContactItemField::THint::SetIsPhone() + {iHintValue|=KIntContactHintIsPhone;} +inline void CContactItemField::THint::SetIsMsg() + {iHintValue|=KIntContactHintIsMsg;} +// turn off Pronunciation bit too? +inline void CContactItemField::THint::SetIsCompanyName() + {iHintValue|=KIntContactHintIsCompanyName;} +inline void CContactItemField::THint::SetIsFamilyName() + {iHintValue|=KIntContactHintIsFamilyName;} +inline void CContactItemField::THint::SetIsGivenName() + {iHintValue|=KIntContactHintIsGivenName;} +inline void CContactItemField::THint::SetIsCompanyNamePronunciation() + {iHintValue|=KIntContactHintIsCompanyName|KIntContactHintIsPronunciation;} +inline void CContactItemField::THint::SetIsFamilyNamePronunciation() + {iHintValue|=KIntContactHintIsFamilyName|KIntContactHintIsPronunciation;} +inline void CContactItemField::THint::SetIsGivenNamePronunciation() + {iHintValue|=KIntContactHintIsGivenName|KIntContactHintIsPronunciation;} +inline void CContactItemField::THint::SetIsAddress() + {iHintValue|=KIntContactHintIsAddress;} +inline void CContactItemField::THint::SetIsAdditionalName() + {iHintValue|=KIntContactHintIsAdditionalName;} +inline void CContactItemField::THint::SetIsSuffixName() + {iHintValue|=KIntContactHintIsSuffixName;} +inline void CContactItemField::THint::SetIsPrefixName() + {iHintValue|=KIntContactHintIsPrefixName;} +inline void CContactItemField::THint::SetStorageIsInline() + {iHintValue|=KIntContactHintStorageInline;} +inline void CContactItemField::THint::SetIsEmail() + {iHintValue|=KIntContactHintIsEmail;} +inline TBool CContactItemField::THint::IsPhone() const + {return (iHintValue&KIntContactHintIsPhone);} +inline TBool CContactItemField::THint::IsMsg() const + {return (iHintValue&KIntContactHintIsMsg);} +inline TBool CContactItemField::THint::IsCompanyName() const + {return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyName);} +inline TBool CContactItemField::THint::IsFamilyName() const + {return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyName);} +inline TBool CContactItemField::THint::IsGivenName() const + {return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenName);} +inline TBool CContactItemField::THint::IsCompanyNamePronunciation() const + {return ((iHintValue&KIntContactHintIsCompanyNamePronunciation) == KIntContactHintIsCompanyNamePronunciation);} +inline TBool CContactItemField::THint::IsFamilyNamePronunciation() const + {return ((iHintValue&KIntContactHintIsFamilyNamePronunciation)==KIntContactHintIsFamilyNamePronunciation);} +inline TBool CContactItemField::THint::IsGivenNamePronunciation() const + {return ((iHintValue&KIntContactHintIsGivenNamePronunciation)==KIntContactHintIsGivenNamePronunciation);} +inline TBool CContactItemField::THint::IsAddress() const + {return (iHintValue&KIntContactHintIsAddress);} +inline TBool CContactItemField::THint::IsAdditionalName() const + {return (iHintValue&KIntContactHintIsAdditionalName);} +inline TBool CContactItemField::THint::IsSuffixName() const + {return (iHintValue&KIntContactHintIsSuffixName);} +inline TBool CContactItemField::THint::IsPrefixName() const + {return (iHintValue&KIntContactHintIsPrefixName);} +inline TBool CContactItemField::THint::IsStorageInline() const + {return (iHintValue&KIntContactHintStorageInline);} +inline TBool CContactItemField::THint::IsEmail() const + {return (iHintValue&KIntContactHintIsEmail);} +#ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__ +inline void CContactItemField::THint::SetHasAdditionalUids() + {iHintValue|=KHintAdditionalMask;} +#endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ +inline TBool CContactItemField::THint::Contains(const THint& aHint) const + {return (iHintValue&aHint.iHintValue);} +#endif // // class TFieldHeader // diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/src/CNTITEM.CPP --- a/phonebookengines/contactsmodel/src/CNTITEM.CPP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/src/CNTITEM.CPP Thu May 27 12:45:19 2010 +0300 @@ -27,6 +27,9 @@ #include "cntstd.h" #include "cntprof.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntfieldheader.h" +#endif EXPORT_C CContactItemFieldSet* CContactItemFieldSet::NewL() diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/CNTTUTIL.MMP --- a/phonebookengines/contactsmodel/tsrc/CNTTUTIL.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/CNTTUTIL.MMP Thu May 27 12:45:19 2010 +0300 @@ -30,7 +30,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc userinclude ../cntsrv/inc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/group/CntPerfTestServer.mmp --- a/phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/group/CntPerfTestServer.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/group/CntPerfTestServer.mmp Thu May 27 12:45:19 2010 +0300 @@ -58,10 +58,9 @@ USERINCLUDE ../../../NbCntTestLib USERINCLUDE ../../../../src //cntmodel source USERINCLUDE ../../../../cntsrv/inc -userinclude ../inc -systeminclude /epoc32/include -systeminclude /epoc32/include/test -systeminclude /epoc32/include/connect +USERINCLUDE ../inc +USERINCLUDE ../../../../inc +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/src/ContactUtilitiesCollection.cpp --- a/phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/src/ContactUtilitiesCollection.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/CntPerfTest/src/ContactUtilitiesCollection.cpp Thu May 27 12:45:19 2010 +0300 @@ -15,8 +15,10 @@ * */ - #include "contactutilitiescollection.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif /** * Destructor diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/PerfFuncSuite/group/Te_PerformanceFunctionalitySuite2.mmp --- a/phonebookengines/contactsmodel/tsrc/Integration/PerfFuncSuite/group/Te_PerformanceFunctionalitySuite2.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/PerfFuncSuite/group/Te_PerformanceFunctionalitySuite2.mmp Thu May 27 12:45:19 2010 +0300 @@ -50,8 +50,7 @@ USERINCLUDE ../../../../cntmodel/inc //ccontactprivate.h USERINCLUDE ../../CntPerfTest/inc -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test +APP_LAYER_SYSTEMINCLUDE_SYMBIAN //Please add your system include under here. diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TCntPolice/groupsql/TE_Cntsrv_API_Policing.MMP --- a/phonebookengines/contactsmodel/tsrc/Integration/TCntPolice/groupsql/TE_Cntsrv_API_Policing.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TCntPolice/groupsql/TE_Cntsrv_API_Policing.MMP Thu May 27 12:45:19 2010 +0300 @@ -123,9 +123,9 @@ USERINCLUDE ../incsql -USERINCLUDE ../../../../cntsrv/inc\ +USERINCLUDE ../../../../cntsrv/inc -SYSTEMINCLUDE /epoc32/include /epoc32/include/test +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib //For TEF diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestContactSuite/group/TestContactSuite.mmp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestContactSuite/group/TestContactSuite.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestContactSuite/group/TestContactSuite.mmp Thu May 27 12:45:19 2010 +0300 @@ -36,9 +36,7 @@ USERINCLUDE ../../../../cntvcard USERINCLUDE ../../../../inc -systeminclude /epoc32/include -systeminclude /epoc32/include/test -systeminclude /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib LIBRARY testexecutelogclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/group/TestImpExvCardsuite.mmp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/group/TestImpExvCardsuite.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/group/TestImpExvCardsuite.mmp Thu May 27 12:45:19 2010 +0300 @@ -49,11 +49,9 @@ USERINCLUDE ../../../../cntvcard USERINCLUDE ../inc -userinclude ../../../../inc +USERINCLUDE ../../../../inc -systeminclude /epoc32/include -systeminclude /epoc32/include/test -systeminclude /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib LIBRARY testexecutelogclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/inc/ContactsPBAPExportUtilityClass.h --- a/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/inc/ContactsPBAPExportUtilityClass.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/inc/ContactsPBAPExportUtilityClass.h Thu May 27 12:45:19 2010 +0300 @@ -11,13 +11,13 @@ * * Contributors: * -* Description: +* Description: * Utility class, which exports the contact items with PBAP version 2.1 or 3.0. Also implements AddIntraContactPropertiesL +* * */ - #ifndef __CONTACTSEXPORTUTILITYCLASS_H__ #define __CONTACTSEXPORTUTILITYCLASS_H__ @@ -34,11 +34,14 @@ #include #include #include -#include +#include // User includes #include "cntvcardutils.h" #include "testimpexvcardsuitedefs.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntconvertercallback.h" +#endif class CContactsPBAPExportUtilityClass : public CBase, public MConverterCallBack { @@ -61,10 +64,10 @@ }; -_LIT(KAddr1, "6th Floor"); -_LIT(KAddr2, "SJRi Park"); +_LIT(KAddr1, "1st Floor"); +_LIT(KAddr2, "Some Park"); _LIT(KAddr3, "Tower No.1"); -_LIT(KEmailVal, "divya@symbian.com"); +_LIT(KEmailVal, "dtest@symbianfoundation.com"); _LIT8(KPhotoVal, "PHOTO"); _LIT(KDATETIME, "DateTime"); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/ContactsPBAPExportUtilityClass.cpp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/ContactsPBAPExportUtilityClass.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/ContactsPBAPExportUtilityClass.cpp Thu May 27 12:45:19 2010 +0300 @@ -17,6 +17,9 @@ #include "contactspbapexportutilityclass.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif CContactsPBAPExportUtilityClass::~CContactsPBAPExportUtilityClass() /** diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestContactsPBAPExportPerformance.cpp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestContactsPBAPExportPerformance.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestContactsPBAPExportPerformance.cpp Thu May 27 12:45:19 2010 +0300 @@ -17,6 +17,9 @@ #include "testcontactspbapexportperformance.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif CTestContactsPBAPExportPerformance::~CTestContactsPBAPExportPerformance() /** diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestGenericImportStep.cpp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestGenericImportStep.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestGenericImportStep.cpp Thu May 27 12:45:19 2010 +0300 @@ -17,6 +17,9 @@ #include "testgenericimportstep.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif CTestGenericImportStep::~CTestGenericImportStep() /** diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/Integration/TestStartUp/group/TestStartUp.mmp --- a/phonebookengines/contactsmodel/tsrc/Integration/TestStartUp/group/TestStartUp.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/Integration/TestStartUp/group/TestStartUp.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,8 +22,7 @@ UID 0x1000007A 0x102797B0 VENDORID 0x70000001 -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../inc USERINCLUDE ../../../../inc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/NbCntTestLib/NbCntTestLib.mmp --- a/phonebookengines/contactsmodel/tsrc/NbCntTestLib/NbCntTestLib.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/NbCntTestLib/NbCntTestLib.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ UID 0x1000097a VENDORID 0x70000001 -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude . SOURCEPATH . diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_AGENT.mmp --- a/phonebookengines/contactsmodel/tsrc/T_AGENT.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_AGENT.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ./ ../inc source t_agent.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_CARDTM.MMP --- a/phonebookengines/contactsmodel/tsrc/T_CARDTM.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_CARDTM.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_CntDelete.MMP --- a/phonebookengines/contactsmodel/tsrc/T_CntDelete.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_CntDelete.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc userinclude ../tsrc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_Cnt_ViewSortProfiling.mmp --- a/phonebookengines/contactsmodel/tsrc/T_Cnt_ViewSortProfiling.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_Cnt_ViewSortProfiling.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_Cnt_ViewSortProfiling.cpp source t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_Concurrent.mmp --- a/phonebookengines/contactsmodel/tsrc/T_Concurrent.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_Concurrent.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ SOURCE T_Concurrent.cpp SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc LIBRARY euser.lib cntmodel.lib cntview.lib efsrv.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ContactViewEvents.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ContactViewEvents.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ContactViewEvents.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_ContactViewEvents.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_CustFilter.mmp --- a/phonebookengines/contactsmodel/tsrc/T_CustFilter.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_CustFilter.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_CustFilter.cpp t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_DBASE.MMP --- a/phonebookengines/contactsmodel/tsrc/T_DBASE.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_DBASE.MMP Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_DBASE.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_DBASE2.MMP --- a/phonebookengines/contactsmodel/tsrc/T_DBASE2.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_DBASE2.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_DBASE2.CPP T_FIND.CPP CContactDbEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_DBFill.mmp --- a/phonebookengines/contactsmodel/tsrc/T_DBFill.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_DBFill.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_DBFill.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ERROR.MMP --- a/phonebookengines/contactsmodel/tsrc/T_ERROR.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ERROR.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_ERROR.CPP CContactDbEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_EXPDEL.MMP --- a/phonebookengines/contactsmodel/tsrc/T_EXPDEL.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_EXPDEL.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source T_EXPDEL.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_FERROR.MMP --- a/phonebookengines/contactsmodel/tsrc/T_FERROR.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_FERROR.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_FERROR.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_FIELD.MMP --- a/phonebookengines/contactsmodel/tsrc/T_FIELD.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_FIELD.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc ../tsrc/TestSyncPlugIn source T_FIELD.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_FilterFindContacts.mmp --- a/phonebookengines/contactsmodel/tsrc/T_FilterFindContacts.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_FilterFindContacts.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCE T_FilterFindContacts.cpp SOURCE t_utils2.cpp -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib LIBRARY cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_FilteredViewEvents.mmp --- a/phonebookengines/contactsmodel/tsrc/T_FilteredViewEvents.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_FilteredViewEvents.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_FilteredViewEvents.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_FilteredViewSort.mmp --- a/phonebookengines/contactsmodel/tsrc/T_FilteredViewSort.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_FilteredViewSort.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_FilteredViewSort.cpp source CContactViewEventQueue.cpp source CContactDbEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_GENERALADDRESS.mmp --- a/phonebookengines/contactsmodel/tsrc/T_GENERALADDRESS.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_GENERALADDRESS.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_GENERALADDRESS.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_GROUPS.MMP --- a/phonebookengines/contactsmodel/tsrc/T_GROUPS.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_GROUPS.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_GROUPS.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_GroupDeleteBug.mmp --- a/phonebookengines/contactsmodel/tsrc/T_GroupDeleteBug.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_GroupDeleteBug.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_GroupDeleteBug.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_GroupViewUpdate.mmp --- a/phonebookengines/contactsmodel/tsrc/T_GroupViewUpdate.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_GroupViewUpdate.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_GroupViewUpdate.cpp source CContactViewEventQueue.cpp source CContactDbEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ITEM.MMP --- a/phonebookengines/contactsmodel/tsrc/T_ITEM.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ITEM.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_ITEM.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_LocalViewDuplicates.mmp --- a/phonebookengines/contactsmodel/tsrc/T_LocalViewDuplicates.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_LocalViewDuplicates.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_LocalViewDuplicates.cpp source CContactViewEventQueue.cpp library euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_LocalViewRemove.mmp --- a/phonebookengines/contactsmodel/tsrc/T_LocalViewRemove.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_LocalViewRemove.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude . source T_LocalViewRemove.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_NOMACH.MMP --- a/phonebookengines/contactsmodel/tsrc/T_NOMACH.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_NOMACH.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_NOMACH.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_OWNCAR.MMP --- a/phonebookengines/contactsmodel/tsrc/T_OWNCAR.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_OWNCAR.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_OWNCAR.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_OwnCardDelete.MMP --- a/phonebookengines/contactsmodel/tsrc/T_OwnCardDelete.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_OwnCardDelete.MMP Thu May 27 12:45:19 2010 +0300 @@ -26,7 +26,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_OwnCardDelete.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_PreFixFullSearch.mmp --- a/phonebookengines/contactsmodel/tsrc/T_PreFixFullSearch.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_PreFixFullSearch.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_PreFixFullSearch.cpp source CContactViewEventQueue.cpp source cfindtext.cpp t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_PreferencesBug.mmp --- a/phonebookengines/contactsmodel/tsrc/T_PreferencesBug.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_PreferencesBug.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_PreferencesBug.cpp source CContactViewEventQueue.cpp source CContactDbEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_RefineFindViewL.mmp --- a/phonebookengines/contactsmodel/tsrc/T_RefineFindViewL.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_RefineFindViewL.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_RefineFindViewL.cpp source CContactViewEventQueue.cpp source cfindtext.cpp t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_RemoteView.mmp --- a/phonebookengines/contactsmodel/tsrc/T_RemoteView.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_RemoteView.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCE t_utils2.cpp USERINCLUDE . USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib efsrv.lib cntmodel.lib pimtestclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_SEC_CNTDBASE.MMP --- a/phonebookengines/contactsmodel/tsrc/T_SEC_CNTDBASE.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_SEC_CNTDBASE.MMP Thu May 27 12:45:19 2010 +0300 @@ -26,10 +26,9 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc -systeminclude /epoc32/include/coreappstest source T_SEC_CNTDBASE.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_Sec_AsyncOpen.mmp --- a/phonebookengines/contactsmodel/tsrc/T_Sec_AsyncOpen.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_Sec_AsyncOpen.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_Sec_AsyncOpen.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_SecondName.MMP --- a/phonebookengines/contactsmodel/tsrc/T_SecondName.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_SecondName.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source T_secondname.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_TEMPL.MMP --- a/phonebookengines/contactsmodel/tsrc/T_TEMPL.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_TEMPL.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_TEMPL.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_TIME.MMP --- a/phonebookengines/contactsmodel/tsrc/T_TIME.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_TIME.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_TIME.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_TTVERS.MMP --- a/phonebookengines/contactsmodel/tsrc/T_TTVERS.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_TTVERS.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source T_TTVERS.CPP TTVCARD.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_TimeIS.MMP --- a/phonebookengines/contactsmodel/tsrc/T_TimeIS.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_TimeIS.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source T_TimeIS.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_VERS.MMP --- a/phonebookengines/contactsmodel/tsrc/T_VERS.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_VERS.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source T_VERS.CPP TVCARD.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_VExportBirthday.mmp --- a/phonebookengines/contactsmodel/tsrc/T_VExportBirthday.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_VExportBirthday.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_VExportBirthday.cpp library euser.lib estor.lib cntmodel.lib cnttutil.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_VExportORG.mmp --- a/phonebookengines/contactsmodel/tsrc/T_VExportORG.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_VExportORG.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ VENDORID 0x70000001 SOURCEPATH . source T_VExportORG.cpp -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. library euser.lib estor.lib cntmodel.lib cnttutil.lib efsrv.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_VIEW.MMP --- a/phonebookengines/contactsmodel/tsrc/T_VIEW.MMP Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_VIEW.MMP Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_VIEW.CPP diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ViewNotificationError.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ViewNotificationError.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ViewNotificationError.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_ViewNotificationError.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ViewObserversBug.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ViewObserversBug.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ViewObserversBug.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_ViewObserversBug.cpp source CContactViewEventQueue.cpp library euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ViewSort.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ViewSort.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ViewSort.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_ViewSort.cpp source CContactViewEventQueue.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ViewSortPlugin.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ViewSortPlugin.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ViewSortPlugin.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ SOURCEPATH . SOURCE T_ViewSortPlugin.cpp -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN library euser.lib efsrv.lib estor.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_ViewSortProfiling.mmp --- a/phonebookengines/contactsmodel/tsrc/T_ViewSortProfiling.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_ViewSortProfiling.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. source T_ViewSortProfiling.cpp source t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/T_viewcontactid.mmp --- a/phonebookengines/contactsmodel/tsrc/T_viewcontactid.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/T_viewcontactid.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source T_viewcontactid.cpp source CContactViewEventQueue.cpp source t_utils2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cntsyncchecker.mmp --- a/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cntsyncchecker.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cntsyncchecker.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ UID 0x1000008D 0x10000000 VENDORID 0x70000001 -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../../inc USERINCLUDE . diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsync.mmp --- a/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsync.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsync.mmp Thu May 27 12:45:19 2010 +0300 @@ -19,7 +19,7 @@ CAPABILITY All -TCB target cnttestsync.dll targettype plugin -systeminclude /epoc32/include/ecom + UID 0x10009D8D 0x102035FE start resource 102035FE.RSS @@ -27,9 +27,10 @@ end VENDORID 0x70000001 sourcepath . + +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude . userinclude ../../inc -systeminclude /epoc32/include source cnttestsync.cpp library euser.lib cntsyncchecker.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsynchroniser.h --- a/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsynchroniser.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/TestSyncPlugIn/cnttestsynchroniser.h Thu May 27 12:45:19 2010 +0300 @@ -1,24 +1,25 @@ -/* -* Copyright (c) 2003-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: -* -*/ - +// Copyright (c) 2003-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 "cntsyncchecker.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntsyncecom.h" +#endif + class CContactActiveTestSync : public CActive { public: diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/group/T_CntPBAPSupport.mmp --- a/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/group/T_CntPBAPSupport.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/group/T_CntPBAPSupport.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,8 @@ SOURCEPATH ../src USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +USERINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCE T_CntPBAPSupport.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/inc/T_CntPBAPSupport.h --- a/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/inc/T_CntPBAPSupport.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/inc/T_CntPBAPSupport.h Thu May 27 12:45:19 2010 +0300 @@ -1,27 +1,28 @@ -/* -* Copyright (c) 2006-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: -* -*/ - +// Copyright (c) 2006-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 __T_CNTPBAPSUPPORT_H__ #define __T_CNTPBAPSUPPORT_H__ +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntconvertercallback.h" +#endif -/////////////////////////////////////////////////////////////////////////////// + +// // Class CCntPBAPSupport Definition -/////////////////////////////////////////////////////////////////////////////// +// class CCntPBAPSupport : public CBase, public MConverterCallBack { diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/src/T_CntPBAPSupport.cpp --- a/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/src/T_CntPBAPSupport.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/UnitTest_CntPBAPSupport/src/T_CntPBAPSupport.cpp Thu May 27 12:45:19 2010 +0300 @@ -28,6 +28,9 @@ #include "t_cntpbapsupport.h" #include "t_testdata.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif _LIT(KTestName,"T_CntPBAPSupport"); // Configure database location diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/asynaccess/group/asynaccess.mmp --- a/phonebookengines/contactsmodel/tsrc/asynaccess/group/asynaccess.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/asynaccess/group/asynaccess.mmp Thu May 27 12:45:19 2010 +0300 @@ -30,7 +30,7 @@ USERINCLUDE ../inc ../.. -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN library euser.lib cntmodel.lib cntview.lib efsrv.lib pimtestclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntfindplugin/group/cntfindplugin.mmp --- a/phonebookengines/contactsmodel/tsrc/cntfindplugin/group/cntfindplugin.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntfindplugin/group/cntfindplugin.mmp Thu May 27 12:45:19 2010 +0300 @@ -39,7 +39,7 @@ VENDORID 0x70000001 -systeminclude /epoc32/include /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN sourcepath ../src source cntfindplugin.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntmatchlog/group/t_logcntmodel.mmp --- a/phonebookengines/contactsmodel/tsrc/cntmatchlog/group/t_logcntmodel.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntmatchlog/group/t_logcntmodel.mmp Thu May 27 12:45:19 2010 +0300 @@ -20,14 +20,12 @@ CAPABILITY ReadUserData WriteUserData TARGETTYPE exe +APP_LAYER_SYSTEMINCLUDE_SYMBIAN +USERINCLUDE ../inc + SOURCEPATH ../src SOURCE t_logcntmodel.cpp -USERINCLUDE ../inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom - LIBRARY euser.lib ecom.lib logcntmodel.lib cntmodel.lib VENDORID 0x70000001 diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntmodel2/T_AsyncOpen.mmp --- a/phonebookengines/contactsmodel/tsrc/cntmodel2/T_AsyncOpen.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntmodel2/T_AsyncOpen.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ UID 0x10210CB7 VENDORID 0x70000001 -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../../cntsrv/inc userinclude ../../cntmodel/inc userinclude ../NbCntTestLib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntmodel2/t_requeststoretest.mmp --- a/phonebookengines/contactsmodel/tsrc/cntmodel2/t_requeststoretest.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntmodel2/t_requeststoretest.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ USERINCLUDE . USERINCLUDE ../../tsrc/NbCntTestLib -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH . SOURCE t_requeststoretest.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/group/cntsimplesortplugin.mmp --- a/phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/group/cntsimplesortplugin.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/group/cntsimplesortplugin.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ UID 0x10009D8D 0x10200FBC VENDORID 0x70000001 -systeminclude /epoc32/include /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN sourcepath ../src source cntsimplesortplugin.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/src/cntsimplesortplugin.cpp --- a/phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/src/cntsimplesortplugin.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntsimplesortplugin/src/cntsimplesortplugin.cpp Thu May 27 12:45:19 2010 +0300 @@ -1,24 +1,24 @@ -/* -* Copyright (c) 2004-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: -* -*/ - +// Copyright (c) 2004-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 "cntsimplesortplugin.hrh" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntvcard/group/t_geo.mmp --- a/phonebookengines/contactsmodel/tsrc/cntvcard/group/t_geo.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntvcard/group/t_geo.mmp Thu May 27 12:45:19 2010 +0300 @@ -10,11 +10,8 @@ * Nokia Corporation - initial contribution. * * Contributors: - -* - -* Description: - +* +* Description: * */ @@ -23,7 +20,8 @@ UID 0 0xE1526DCF USERINCLUDE ../.. -SYSTEMINCLUDE /epoc32/include +USERINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../src diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntvcard/group/t_vtel_email.mmp --- a/phonebookengines/contactsmodel/tsrc/cntvcard/group/t_vtel_email.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntvcard/group/t_vtel_email.mmp Thu May 27 12:45:19 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -10,11 +10,8 @@ * Nokia Corporation - initial contribution. * * Contributors: - -* - -* Description: - +* +* Description: * */ @@ -24,7 +21,8 @@ CAPABILITY ReadUserData WriteUserData USERINCLUDE ../../../tsrc -SYSTEMINCLUDE /epoc32/include +USERINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../src SOURCE t_vtel_email.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntvcard/src/t_geo.cpp --- a/phonebookengines/contactsmodel/tsrc/cntvcard/src/t_geo.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntvcard/src/t_geo.cpp Thu May 27 12:45:19 2010 +0300 @@ -31,6 +31,9 @@ #include #include #include "t_utils.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif // Global Variables diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntvcard/src/t_vtel_email.cpp --- a/phonebookengines/contactsmodel/tsrc/cntvcard/src/t_vtel_email.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntvcard/src/t_vtel_email.cpp Thu May 27 12:45:19 2010 +0300 @@ -43,6 +43,9 @@ #include #include #include "t_utils.h" +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif // Global Variables diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/cntviewstore/t_viewstore.mmp --- a/phonebookengines/contactsmodel/tsrc/cntviewstore/t_viewstore.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/cntviewstore/t_viewstore.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ SOURCEPATH . SOURCE t_viewstore.cpp -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../../inc LIBRARY euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/performance/T_Performance.mmp --- a/phonebookengines/contactsmodel/tsrc/performance/T_Performance.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/performance/T_Performance.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ MACRO __TRANSACTION_ON__ -systeminclude /epoc32/include /epoc32/include/kernel /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../ source T_Performance.cpp T_PerfInitialSync.cpp T_PerfSyncDelete.cpp T_PerfBulkDelete.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/performance/T_SampProf.mmp --- a/phonebookengines/contactsmodel/tsrc/performance/T_SampProf.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/performance/T_SampProf.mmp Thu May 27 12:45:19 2010 +0300 @@ -21,7 +21,7 @@ CAPABILITY ReadUserData WriteUserData SOURCE T_PerfDbCreator.cpp SOURCE T_SampProf.cpp -SYSTEMINCLUDE /epoc32/include /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib cntmodel.lib ecom.lib efile.lib efsrv.lib bafl.lib VENDORID 0x70000001 diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_CaseSensitiveDB.mmp --- a/phonebookengines/contactsmodel/tsrc/t_CaseSensitiveDB.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_CaseSensitiveDB.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ SOURCE t_CaseSensitiveDB.cpp USERINCLUDE . USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_CntFindAll.mmp --- a/phonebookengines/contactsmodel/tsrc/t_CntFindAll.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_CntFindAll.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_CntMatch.mmp --- a/phonebookengines/contactsmodel/tsrc/t_CntMatch.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_CntMatch.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_CntMatch.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_GroupViewEvents.mmp --- a/phonebookengines/contactsmodel/tsrc/t_GroupViewEvents.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_GroupViewEvents.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_GroupViewEvents.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_IccImportLock.mmp --- a/phonebookengines/contactsmodel/tsrc/t_IccImportLock.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_IccImportLock.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCE t_utils2.cpp USERINCLUDE . USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib efsrv.lib cntmodel.lib cnttutil.lib pimtestclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_IccStartup.mmp --- a/phonebookengines/contactsmodel/tsrc/t_IccStartup.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_IccStartup.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,9 +24,8 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc -systeminclude /epoc32/include/ecom userinclude ../tsrc/TestSyncPlugIn source t_iccStartup.cpp ../tsrc/TestSyncPlugIn/cnttestsync.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_apac.mmp --- a/phonebookengines/contactsmodel/tsrc/t_apac.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_apac.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_apac.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_bench.mmp --- a/phonebookengines/contactsmodel/tsrc/t_bench.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_bench.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_bench.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_cnt_backup.mmp --- a/phonebookengines/contactsmodel/tsrc/t_cnt_backup.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_cnt_backup.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/connect +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_cnt_backup.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_cntidtest.mmp --- a/phonebookengines/contactsmodel/tsrc/t_cntidtest.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_cntidtest.mmp Thu May 27 12:45:19 2010 +0300 @@ -26,8 +26,8 @@ SOURCE t_cntidtest.cpp SOURCE t_cntidtestmain.cpp +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE . -SYSTEMINCLUDE /epoc32/include LIBRARY euser.lib LIBRARY cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_cntvcard.cpp --- a/phonebookengines/contactsmodel/tsrc/t_cntvcard.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_cntvcard.cpp Thu May 27 12:45:19 2010 +0300 @@ -30,6 +30,9 @@ #include "t_utils2.h" #include "t_rndutils.h" #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntdb_internal.h" +#endif _LIT(KTestName,"T_CNTVCARD"); @@ -107,7 +110,7 @@ _LIT8(KMultiParam,"BEGIN:VCARD\r\n" "VERSION:2.1\r\n" "N:;Neo;;Mr.;\r\n" - "FN:Mr. Anderson\r\n" + "FN:Mr. TestName\r\n" "TEL;TYPE=HOME;TYPE=VOICE;TYPE=CELL:123\r\n" "END:VCARD\r\n" ); @@ -228,6 +231,11 @@ "N:Cccc;Pekka;;;\r\n" "END:VCARD\r\n" ); + +_LIT8(KPartialVCard,"BEGIN:VCARD\r\n" + "\r" +); + const TAny* GNames[] = {&KFirstName, &KFirstNamePrn, &KSurName, &KSurNamePrn, &KOrgName, &KOrgNamePrn}; const TAny* GLabels[] = {&KFirstNameLabel, &KFirstNamePrnLabel, &KSurNameLabel, &KSurNamePrnLabel, &KOrgNameLabel, &KOrgNamePrnLabel}; @@ -803,9 +811,9 @@ EmptyDatabase(); } -/////////////////////////////////////////////////////////////////////////////// +// /* Test Function Implementations */ -/////////////////////////////////////////////////////////////////////////////// +// TContactItemId AddContactL (CContactDatabase& aDatabase) { TInt bit = 0; @@ -1090,25 +1098,25 @@ CContactItemFieldSet& updatedContactFieldSet = updatedContact->CardFields(); test.Next(_L("Check Updated Mobile Number 1")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,5,_L("07905001"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,5,_L("7700900329"))); test.Next(_L("Check Updated Mobile Number 2")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,6,_L("07906002"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,6,_L("07700900529"))); test.Next(_L("Check Updated Work Number 1")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,29,_L("1234567890"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,29,_L("7700900999"))); test.Next(_L("Check Updated Work Number 2")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,30,_L("2345678901"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,30,_L("7700900888"))); test.Next(_L("Check Updated Work Number 3")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,31,_L("3456789012"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,31,_L("7700900777"))); test.Next(_L("Check Updated Work Number 4")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,32,_L("4567890123"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,32,_L("7700900666"))); test.Next(_L("Check Updated Work Number 5")); - TEST_CONDITION(FieldCheck(updatedContactFieldSet,33,_L("5678901234"))); + TEST_CONDITION(FieldCheck(updatedContactFieldSet,33,_L("7700900555"))); //cleanup CleanupStack::PopAndDestroy(updatedContact); @@ -2014,6 +2022,34 @@ } /** +@SYMTestCaseID PIM-T-CNTVCARD-PDEF140328-0001 +@SYMTestType UT +@SYMTestPriority High +@SYMTestCaseDesc Partial vCard's should be processed without any panics + +@SYMTestActions +1.Import a partial vCard. + +@SYMTestExpectedResults For the above tests: +1.There should be no panics while import is happening. +*/ + void TestImportingPartialOrEmptyVCardsL() +{ + test.Next(_L("Test import of partial vCard")); + CArrayPtr* contactItems = NULL; + RDesReadStream vcard(KPartialVCard()); + CleanupClosePushL(vcard); + TInt success = EFalse; + CContactDatabase* db = CntTest->CreateDatabaseL(); + contactItems = db->ImportContactsL(TUid::Uid(KUidVCardConvDefaultImpl), vcard, success, CContactDatabase::EImportSingleContact); + CleanupStack::PushL( TCleanupItem( CleanUpResetAndDestroy, contactItems ) ); + CleanupStack::PopAndDestroy(contactItems); + CleanupStack::PopAndDestroy(&vcard); + test.Printf(_L("Import of partial vCard completed successfully")); +} + + +/** @SYMTestCaseID PIM-T-CNTVCARD-0001 @@ -2035,6 +2071,8 @@ TempFiles->RegisterL(KVCardFile5); TempFiles->RegisterL(KVCardFile6); + //without the fix this test will cause User 21 panic in versit + TestImportingPartialOrEmptyVCardsL(); VCardEmailTestL(); AccessCountTestsL(); DefaultVoiceParamTestsL(); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_cntvcard.mmp --- a/phonebookengines/contactsmodel/tsrc/t_cntvcard.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_cntvcard.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source t_cntvcard.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_connec.mmp --- a/phonebookengines/contactsmodel/tsrc/t_connec.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_connec.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_connec.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_contactat.mmp --- a/phonebookengines/contactsmodel/tsrc/t_contactat.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_contactat.mmp Thu May 27 12:45:19 2010 +0300 @@ -26,7 +26,7 @@ SOURCE t_contactat.cpp USERINCLUDE . -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib cntmodel.lib SMPSAFE diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_contactdbevent.mmp --- a/phonebookengines/contactsmodel/tsrc/t_contactdbevent.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_contactdbevent.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ UID 0 VENDORID 0x70000001 -systeminclude ../inc /EPOC32/INCLUDE /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN library EUSER.LIB cntmodel.LIB CNTVIEW.LIB EFSRV.LIB PIMTestClient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_contactsramtest.mmp --- a/phonebookengines/contactsmodel/tsrc/t_contactsramtest.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_contactsramtest.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ SOURCE t_contactsramtest.cpp USERINCLUDE . -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib cntmodel.lib efsrv.lib SMPSAFE diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_currentdb.mmp --- a/phonebookengines/contactsmodel/tsrc/t_currentdb.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_currentdb.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ SOURCE t_currentdb.cpp USERINCLUDE . USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib efsrv.lib cntmodel.lib cnttutil.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_cviewcontact.mmp --- a/phonebookengines/contactsmodel/tsrc/t_cviewcontact.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_cviewcontact.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc . source t_cviewcontact.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_database_killer.mmp --- a/phonebookengines/contactsmodel/tsrc/t_database_killer.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_database_killer.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_database_killer.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_db_sortl_test.mmp --- a/phonebookengines/contactsmodel/tsrc/t_db_sortl_test.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_db_sortl_test.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source t_db_sortl_test.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_dbnametest.mmp --- a/phonebookengines/contactsmodel/tsrc/t_dbnametest.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_dbnametest.mmp Thu May 27 12:45:19 2010 +0300 @@ -21,10 +21,10 @@ CAPABILITY ReadUserData WriteUserData VENDORID 0x70000001 +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../cntsrv/inc USERINCLUDE ../cntmodel/inc USERINCLUDE . -SYSTEMINCLUDE /epoc32/include SOURCEPATH . SOURCE t_dbnametest.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_eventorder.mmp --- a/phonebookengines/contactsmodel/tsrc/t_eventorder.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_eventorder.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_eventorder.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_filterbroadcast.mmp --- a/phonebookengines/contactsmodel/tsrc/t_filterbroadcast.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_filterbroadcast.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_filterbroadcast.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_filteredviewupdate.mmp --- a/phonebookengines/contactsmodel/tsrc/t_filteredviewupdate.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_filteredviewupdate.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source t_filteredviewupdate.cpp source CContactViewEventQueue.cpp library euser.lib cntmodel.lib cntview.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_filterview.mmp --- a/phonebookengines/contactsmodel/tsrc/t_filterview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_filterview.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_filterview.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_filterview_matching_profile.mmp --- a/phonebookengines/contactsmodel/tsrc/t_filterview_matching_profile.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_filterview_matching_profile.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_filterview_matching_profile.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_filterviewspeed.mmp --- a/phonebookengines/contactsmodel/tsrc/t_filterviewspeed.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_filterviewspeed.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH .\ -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source T_FilterViewSpeed.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_groupview.mmp --- a/phonebookengines/contactsmodel/tsrc/t_groupview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_groupview.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_groupview.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_groupview_unfiled_profile.mmp --- a/phonebookengines/contactsmodel/tsrc/t_groupview_unfiled_profile.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_groupview_unfiled_profile.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_groupview_unfiled_profile.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_groupviewmodifiedContact.mmp --- a/phonebookengines/contactsmodel/tsrc/t_groupviewmodifiedContact.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_groupviewmodifiedContact.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_groupviewmodifiedContact.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_groupviewpanic.mmp --- a/phonebookengines/contactsmodel/tsrc/t_groupviewpanic.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_groupviewpanic.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ UID 0 VENDORID 0x70000001 SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN source t_groupviewpanic.cpp source CContactViewEventQueue.cpp library euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_iccentry.mmp --- a/phonebookengines/contactsmodel/tsrc/t_iccentry.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_iccentry.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,9 +24,8 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc -systeminclude /epoc32/include/ecom userinclude ../tsrc/TestSyncPlugIn source t_iccentry.cpp ../tsrc/TestSyncPlugIn/cnttestsync.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.cpp --- a/phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.cpp Thu May 27 12:45:19 2010 +0300 @@ -23,6 +23,10 @@ #include #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntsyncecom.h" +#endif + // include templates for CleanupResetAndDestroyPushL(T) #include "cntviewprivate.h" @@ -34,8 +38,8 @@ _LIT(KGivenEditName,"edited name"); _LIT(KIccName,"icc entry name"); _LIT(KNonIccName,"non-icc name"); -_LIT(KIccNumber,"020 123 4567"); -_LIT(KNonIccNumber,"020 987 6543"); +_LIT(KIccNumber,"020 794 60123"); +_LIT(KNonIccNumber,"020 794 60060"); _LIT(KPluginName,"phone book synchronizer Implementation"); _LIT(KTestPluginName,"Test phone book synchronizer Implementation"); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.mmp --- a/phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_iccmultiplephonebook.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc ../tsrc/TestSyncPlugIn source t_iccmultiplephonebook.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_iccview.cpp --- a/phonebookengines/contactsmodel/tsrc/t_iccview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_iccview.cpp Thu May 27 12:45:19 2010 +0300 @@ -24,11 +24,15 @@ #include #include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include "cntsyncecom.h" +#endif + #include "t_utils.h" #include "cntsyncchecker.h" #include "ccontactvieweventqueue.h" #include "ccontactdbeventqueue.h" -#include +#include // include templates for CleanupResetAndDestroyPushL(T) #include "cntviewprivate.h" diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_iccview.mmp --- a/phonebookengines/contactsmodel/tsrc/t_iccview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_iccview.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include/ /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc ../tsrc/TestSyncPlugIn source t_iccview.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_longsql.mmp --- a/phonebookengines/contactsmodel/tsrc/t_longsql.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_longsql.mmp Thu May 27 12:45:19 2010 +0300 @@ -20,7 +20,7 @@ CAPABILITY ReadUserData WriteUserData SOURCEPATH ../tsrc SOURCE t_longsql.cpp -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc ../tsrc LIBRARY euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_lowdiskspace.mmp --- a/phonebookengines/contactsmodel/tsrc/t_lowdiskspace.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_lowdiskspace.mmp Thu May 27 12:45:19 2010 +0300 @@ -21,7 +21,7 @@ CAPABILITY ReadUserData WriteUserData AllFiles SOURCEPATH ../tsrc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../tsrc ../inc SOURCE t_lowdiskspace.cpp LIBRARY euser.lib cntmodel.lib efsrv.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_owncard.mmp --- a/phonebookengines/contactsmodel/tsrc/t_owncard.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_owncard.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCE t_utils2.cpp USERINCLUDE . USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib efsrv.lib cntmodel.lib pimtestclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_platsec.mmp --- a/phonebookengines/contactsmodel/tsrc/t_platsec.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_platsec.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/coreappstest /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_platsec.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_serverstart.mmp --- a/phonebookengines/contactsmodel/tsrc/t_serverstart.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_serverstart.mmp Thu May 27 12:45:19 2010 +0300 @@ -20,7 +20,7 @@ TARGETTYPE exe CAPABILITY ReadUserData WriteUserData SOURCE t_serverstart.cpp -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib cntmodel.lib VENDORID 0x70000001 diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_speeddialtest.mmp --- a/phonebookengines/contactsmodel/tsrc/t_speeddialtest.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_speeddialtest.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_speeddialtest.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_subview.mmp --- a/phonebookengines/contactsmodel/tsrc/t_subview.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_subview.mmp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ SOURCEPATH . -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_subview.cpp dbcreator.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_updateforsync.mmp --- a/phonebookengines/contactsmodel/tsrc/t_updateforsync.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_updateforsync.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ CAPABILITY ReadUserData WriteUserData SOURCEPATH . -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE .. SOURCE t_updateforsync.cpp t_utils2.cpp LIBRARY euser.lib efsrv.lib cntmodel.lib cnttutil.lib pimtestclient.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_vexporttype.mmp --- a/phonebookengines/contactsmodel/tsrc/t_vexporttype.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_vexporttype.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ VENDORID 0x70000001 SOURCEPATH . source T_VExportType.cpp -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude .. library euser.lib estor.lib cntmodel.lib cnttutil.lib efsrv.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_view2.mmp --- a/phonebookengines/contactsmodel/tsrc/t_view2.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_view2.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_view2.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_viewevents.mmp --- a/phonebookengines/contactsmodel/tsrc/t_viewevents.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_viewevents.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ VENDORID 0x70000001 SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_viewevents.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_viewsoom.mmp --- a/phonebookengines/contactsmodel/tsrc/t_viewsoom.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_viewsoom.mmp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,7 @@ SOURCEPATH ../tsrc -systeminclude /epoc32/include /epoc32/include/kernel +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc source t_viewsoom.cpp diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrc/t_wrongfieldmatch.mmp --- a/phonebookengines/contactsmodel/tsrc/t_wrongfieldmatch.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrc/t_wrongfieldmatch.mmp Thu May 27 12:45:19 2010 +0300 @@ -23,7 +23,7 @@ CAPABILITY ReadUserData WriteUserData SOURCEPATH . -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE .. SOURCE t_wrongfieldmatch.cpp LIBRARY euser.lib cntmodel.lib diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrcsql/t_persistencelayer.mmp --- a/phonebookengines/contactsmodel/tsrcsql/t_persistencelayer.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrcsql/t_persistencelayer.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ VENDORID 0x70000001 userinclude ../inc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../src userinclude ../tsrc/TestSyncPlugIn userinclude . diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/contactsmodel/tsrcsql/t_plperformance.mmp --- a/phonebookengines/contactsmodel/tsrcsql/t_plperformance.mmp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/contactsmodel/tsrcsql/t_plperformance.mmp Thu May 27 12:45:19 2010 +0300 @@ -25,7 +25,7 @@ VENDORID 0x70000001 userinclude ../inc -systeminclude /epoc32/include +APP_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../src userinclude ../cntsrv/inc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/eabi/mobcntmodelu.def --- a/phonebookengines/eabi/mobcntmodelu.def Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/eabi/mobcntmodelu.def Thu May 27 12:45:19 2010 +0300 @@ -9,11 +9,11 @@ _ZN11MobCntModel13handleRemovedERK5QListIjE @ 8 NONAME _ZN11MobCntModel14initializeDataEv @ 9 NONAME _ZN11MobCntModel16staticMetaObjectE @ 10 NONAME DATA 16 - _ZN11MobCntModel17updateContactIconEi @ 11 NONAME - _ZN11MobCntModel19getStaticMetaObjectEv @ 12 NONAME - _ZN11MobCntModel19handleMyCardChangedERKjS1_ @ 13 NONAME - _ZN11MobCntModel21setFilterAndSortOrderERKN10QtMobility14QContactFilterERK5QListINS0_17QContactSortOrderEE @ 14 NONAME - _ZN11MobCntModel21updateContactIdsArrayEv @ 15 NONAME + _ZN11MobCntModel19getStaticMetaObjectEv @ 11 NONAME + _ZN11MobCntModel19handleMyCardChangedERKjS1_ @ 12 NONAME + _ZN11MobCntModel21setFilterAndSortOrderERKN10QtMobility14QContactFilterERK5QListINS0_17QContactSortOrderEE @ 13 NONAME + _ZN11MobCntModel21updateContactIdsArrayEv @ 14 NONAME + _ZN11MobCntModel24handleContactInfoUpdatedEj @ 15 NONAME _ZN11MobCntModelC1EPN10QtMobility15QContactManagerERKNS0_14QContactFilterERK5QListINS0_17QContactSortOrderEEbP7QObject @ 16 NONAME _ZN11MobCntModelC1ERKN10QtMobility14QContactFilterERK5QListINS0_17QContactSortOrderEEbP7QObject @ 17 NONAME _ZN11MobCntModelC2EPN10QtMobility15QContactManagerERKNS0_14QContactFilterERK5QListINS0_17QContactSortOrderEEbP7QObject @ 18 NONAME @@ -31,8 +31,8 @@ _ZNK11MobCntModel5rowIdERKj @ 30 NONAME _ZNK11MobCntModel7contactERK11QModelIndex @ 31 NONAME _ZNK11MobCntModel7contactEi @ 32 NONAME - _ZNK11MobCntModel8rowCountERK11QModelIndex @ 33 NONAME - _ZTI11MobCntModel @ 34 NONAME - _ZTV11MobCntModel @ 35 NONAME - _ZNK11MobCntModel8myCardIdEv @ 36 NONAME + _ZNK11MobCntModel8myCardIdEv @ 33 NONAME + _ZNK11MobCntModel8rowCountERK11QModelIndex @ 34 NONAME + _ZTI11MobCntModel @ 35 NONAME + _ZTV11MobCntModel @ 36 NONAME diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/inc/mobcntbrowseraction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntactions/inc/mobcntbrowseraction.h Thu May 27 12:45:19 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 MOBCNTBROWSERACTION_H +#define MOBCNTBROWSERACTION_H + +#include "mobcntaction.h" + +class MobCntBrowserAction : public MobCntAction +{ + Q_OBJECT + +public: + MobCntBrowserAction(); + ~MobCntBrowserAction(); + + QContactFilter contactFilter(const QVariant& value) const; + bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const; + QList supportedDetails(const QContact& contact) const; + MobCntBrowserAction* clone() const; + void performAction(); +}; + +#endif // MOBCNTBROWSERACTION_H diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/mobcntactions.pro --- a/phonebookengines/mobcntactions/mobcntactions.pro Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/mobcntactions.pro Thu May 27 12:45:19 2010 +0300 @@ -27,7 +27,8 @@ inc/mobcntmessageaction.h \ inc/mobcntvideocallaction.h \ inc/mobcntcallaction.h \ - inc/mobcntemailaction.h + inc/mobcntemailaction.h \ + inc/mobcntbrowseraction.h SOURCES += \ src/mobcntactionfactory.cpp \ @@ -35,7 +36,8 @@ src/mobcntmessageaction.cpp \ src/mobcntvideocallaction.cpp \ src/mobcntcallaction.cpp \ - src/mobcntemailaction.cpp + src/mobcntemailaction.cpp \ + src/mobcntbrowseraction.cpp MOC_DIR = moc diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/src/mobcntactionfactory.cpp --- a/phonebookengines/mobcntactions/src/mobcntactionfactory.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/src/mobcntactionfactory.cpp Thu May 27 12:45:19 2010 +0300 @@ -26,6 +26,7 @@ #include "mobcntvideocallaction.h" #include "mobcntmessageaction.h" #include "mobcntemailaction.h" +#include "mobcntbrowseraction.h" #define makestr(x) (#x) #define makename(x) makestr(x) @@ -38,6 +39,7 @@ actionList.append(new MobCntVideoCallAction()); actionList.append(new MobCntMessageAction()); actionList.append(new MobCntEmailAction()); + actionList.append(new MobCntBrowserAction()); } MobCntActionFactory::~MobCntActionFactory() diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/src/mobcntbrowseraction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntactions/src/mobcntbrowseraction.cpp Thu May 27 12:45:19 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 "mobcntbrowseraction.h" + +#include +#include + +//Action class +MobCntBrowserAction::MobCntBrowserAction() : + MobCntAction("url") +{ +} + +MobCntBrowserAction::~MobCntBrowserAction() +{ +} + +QContactFilter MobCntBrowserAction::contactFilter(const QVariant& value) const +{ + Q_UNUSED(value); + + QContactDetailFilter urlFilter; + urlFilter.setDetailDefinitionName(QContactUrl::DefinitionName); + + return urlFilter; +} + +bool MobCntBrowserAction::isDetailSupported(const QContactDetail &detail, const QContact &/*contact*/) const +{ + return (detail.definitionName() == QContactUrl::DefinitionName); +} + +QList MobCntBrowserAction::supportedDetails(const QContact& contact) const +{ + return contact.details(QContactUrl::DefinitionName); +} + +MobCntBrowserAction* MobCntBrowserAction::clone() const +{ + return new MobCntBrowserAction(); +} + +void MobCntBrowserAction::performAction() +{ + QVariant retValue; + emitResult(GeneralError, retValue); + + /* + QString service("com.nokia.services.telephony"); + QString type("dial(QString,int)"); + + performNumberAction(service, type); + */ +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/src/mobcntcallaction.cpp --- a/phonebookengines/mobcntactions/src/mobcntcallaction.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/src/mobcntcallaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -38,7 +38,7 @@ void MobCntCallAction::performAction() { - QString service("com.nokia.services.telephony"); + QString service("com.nokia.symbian.ICallDial"); QString type("dial(QString,int)"); performNumberAction(service, type); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/src/mobcntvideocallaction.cpp --- a/phonebookengines/mobcntactions/src/mobcntvideocallaction.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/src/mobcntvideocallaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -38,7 +38,7 @@ void MobCntVideoCallAction::performAction() { - QString service("com.nokia.services.telephony"); + QString service("com.nokia.symbian.ICallDial"); QString type("dialVideo(QString,int)"); performNumberAction(service, type); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.cpp --- a/phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.cpp Thu May 27 12:45:19 2010 +0300 @@ -20,9 +20,6 @@ #include -Q_DECLARE_METATYPE(QContactAction::Status) - - #define QTRY_COMPARE(__expr, __expected) \ do { \ const int __step = 50; \ @@ -37,9 +34,7 @@ void TestMobCntActions::initTestCase() { - //Non standard types needs to be registered before they can be used by QSignalSpy - int error = qRegisterMetaType(); - + int error = qRegisterMetaType(); //create manager m_manager = new QContactManager("symbian"); @@ -53,8 +48,9 @@ void TestMobCntActions::init() { //delete all contacts from the database - QList contacts = m_manager->contacts(); - m_manager->removeContacts(&contacts); + QList contacts = m_manager->contactIds(); + QMap errorMap; + m_manager->removeContacts(&contacts, &errorMap); } void TestMobCntActions::cleanup() @@ -66,7 +62,7 @@ m_manager->saveContact(&contact); //expected no actions found - QStringList actions = contact.availableActions(); + QList actions = contact.availableActions(); QVERIFY(actions.count() == 0); } @@ -86,7 +82,13 @@ QVERIFY(numberList.count() > 0); //get the actions - QStringList actions = contact.availableActions(); + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } //verify that it includes the actiosn QVERIFY(actions.contains("call", Qt::CaseInsensitive)); @@ -96,45 +98,33 @@ QVERIFY(callActionDescriptors.count() == 1); QContactAction *callAction = QContactAction::action(callActionDescriptors.at(0)); QVERIFY(callAction != 0); - QVERIFY(callAction->supportsDetail(numberList.at(0)) == true); - QVariantMap variantMap = callAction->metadata(); + QVERIFY(callAction->isDetailSupported(numberList.at(0)) == true); + QVariantMap variantMap = callAction->metaData(); QVERIFY(variantMap.count() == 0); + variantMap = callAction->results(); QVERIFY(variantMap.count() == 0); - variantMap = callAction->result(); - QSignalSpy spyCallAction(callAction, SIGNAL(progress(QContactAction::Status, const QVariantMap &))); + QSignalSpy spyCallAction(callAction, SIGNAL(stateChanged(QContactAction::State))); callAction->invokeAction(contact, numberList.at(0)); callAction->invokeAction(contact); QTRY_COMPARE(spyCallAction.count(), 2); // make sure the signal was emitted exactly one time - //Verify that the data is correct - //QList arguments = spy.takeFirst(); // take the first signal - //QContactAction::Status status = arguments.at(0).value(); - //QVariantMap map = (arguments.at(1)).toMap(); delete callAction; } void TestMobCntActions::phonenumberNoCallSupport() { QContact contact; - - QContactPhoneNumber faxNumber; - faxNumber.setNumber("555111222"); - faxNumber.setSubTypes(QContactPhoneNumber::SubTypeFacsimile); - contact.saveDetail(&faxNumber); m_manager->saveContact(&contact); - - //one number exist in contact - QList numberList = contact.details(); - QVERIFY(numberList.count() == 1); - - QStringList subTypeList = numberList.at(0).subTypes(); - - QVERIFY(subTypeList.count() == 1); - QVERIFY(subTypeList.contains(QContactPhoneNumber::SubTypeFacsimile)); //no actions expected - QStringList actions = contact.availableActions(); + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } - QVERIFY(actions.contains("call", Qt::CaseInsensitive) == false); + QVERIFY(actions.contains("call", Qt::CaseInsensitive) == false); } void TestMobCntActions::phonenumberMessageSupport() @@ -153,7 +143,13 @@ QVERIFY(numberList.count() > 0); //get the actions - QStringList actions = contact.availableActions(); + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } //verify that it includes the actiosn QVERIFY(actions.contains("message", Qt::CaseInsensitive)); @@ -162,12 +158,12 @@ QVERIFY(messageActionDescriptors.count() == 1); QContactAction *messageAction = QContactAction::action(messageActionDescriptors.at(0)); QVERIFY(messageAction != 0); - QVERIFY(messageAction->supportsDetail(numberList.at(0)) == true); - QVariantMap variantMap = messageAction->metadata(); + QVERIFY(messageAction->isDetailSupported(numberList.at(0)) == true); + QVariantMap variantMap = messageAction->metaData(); QVERIFY(variantMap.count() == 0); - variantMap = messageAction->result(); + variantMap = messageAction->results(); QVERIFY(variantMap.count() == 0); - QSignalSpy spyMessageAction(messageAction, SIGNAL(progress(QContactAction::Status, const QVariantMap &))); + QSignalSpy spyMessageAction(messageAction, SIGNAL(stateChanged(QContactAction::State))); messageAction->invokeAction(contact, numberList.at(0)); messageAction->invokeAction(contact); QTRY_COMPARE(spyMessageAction.count(), 2); // make sure the signal was emitted exactly one time @@ -176,27 +172,18 @@ void TestMobCntActions::phonenumberNoMessageSupport() { - QContact contact; - QContactPhoneNumber faxNumber; faxNumber.setNumber("555111222"); faxNumber.setSubTypes(QContactPhoneNumber::SubTypeFacsimile); - contact.saveDetail(&faxNumber); - m_manager->saveContact(&contact); - - //one number exist in contact - QList numberList = contact.details(); - QVERIFY(numberList.count() == 1); + + QList actionDescriptors = QContactAction::actionDescriptors("message", "symbian"); + + QContactAction* contactAction = QContactAction::action(actionDescriptors.first()); + bool isSupportDetail = contactAction->isDetailSupported(faxNumber); - QStringList subTypeList = numberList.at(0).subTypes(); - - QVERIFY(subTypeList.count() == 1); - QVERIFY(subTypeList.contains(QContactPhoneNumber::SubTypeFacsimile)); - - //no actions expected - QStringList actions = contact.availableActions(); - - QVERIFY(actions.contains("message", Qt::CaseInsensitive) == false); + delete contactAction; + + QVERIFY(isSupportDetail == false); } void TestMobCntActions::phonenumberVideoCallSupport() @@ -215,7 +202,13 @@ QVERIFY(numberList.count() > 0); //get the actions - QStringList actions = contact.availableActions(); + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } //verify that it includes the actiosn QVERIFY(actions.contains("videocall", Qt::CaseInsensitive)); @@ -225,12 +218,12 @@ QVERIFY(videoCallActionDescriptors.count() == 1); QContactAction *videoCallAction = QContactAction::action(videoCallActionDescriptors.at(0)); QVERIFY(videoCallAction != 0); - QVERIFY(videoCallAction->supportsDetail(numberList.at(0)) == true); - QVariantMap variantMap = videoCallAction->metadata(); + QVERIFY(videoCallAction->isDetailSupported(numberList.at(0)) == true); + QVariantMap variantMap = videoCallAction->metaData(); QVERIFY(variantMap.count() == 0); - variantMap = videoCallAction->result(); + variantMap = videoCallAction->results(); QVERIFY(variantMap.count() == 0); - QSignalSpy spyVideoCallAction(videoCallAction, SIGNAL(progress(QContactAction::Status, const QVariantMap &))); + QSignalSpy spyVideoCallAction(videoCallAction, SIGNAL(stateChanged(QContactAction::State))); videoCallAction->invokeAction(contact, numberList.at(0)); videoCallAction->invokeAction(contact); QTRY_COMPARE(spyVideoCallAction.count(), 2); // make sure the signal was emitted exactly one time @@ -240,29 +233,20 @@ void TestMobCntActions::phonenumberNoVideoCallSupport() { QContact contact; - - QContactPhoneNumber faxNumber; - faxNumber.setNumber("555111222"); - faxNumber.setSubTypes(QContactPhoneNumber::SubTypeFacsimile); - contact.saveDetail(&faxNumber); m_manager->saveContact(&contact); - //one number exist in contact - QList numberList = contact.details(); - QVERIFY(numberList.count() == 1); - - QStringList subTypeList = numberList.at(0).subTypes(); - - QVERIFY(subTypeList.count() == 1); - QVERIFY(subTypeList.contains(QContactPhoneNumber::SubTypeFacsimile)); - - //no actions expected - QStringList actions = contact.availableActions(); - + //expected no actions found + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } QVERIFY(actions.contains("videocall", Qt::CaseInsensitive) == false); } -void TestMobCntActions::phonenumberEmailSupport() +void TestMobCntActions::emailSupport() { QContact contact; QContactEmailAddress email; @@ -274,8 +258,14 @@ QList emailList = contact.details(); QVERIFY(emailList.count() == 1); - //no actions expected - QStringList actions = contact.availableActions(); + //one action expected + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } QVERIFY(actions.count() == 1); QVERIFY(actions.contains("email", Qt::CaseInsensitive)); @@ -287,26 +277,91 @@ QVERIFY(emailActionDescriptors.count() == 1); QContactAction *emailAction = QContactAction::action(emailActionDescriptors.at(0)); QVERIFY(emailAction != 0); - QVERIFY(emailAction->supportsDetail(emailList.at(0)) == true); - QVariantMap variantMap = emailAction->metadata(); + QVERIFY(emailAction->isDetailSupported(emailList.at(0)) == true); + QVariantMap variantMap = emailAction->metaData(); QVERIFY(variantMap.count() == 0); - variantMap = emailAction->result(); + variantMap = emailAction->results(); QVERIFY(variantMap.count() == 0); - QSignalSpy spyEmailAction(emailAction, SIGNAL(progress(QContactAction::Status, const QVariantMap &))); + QSignalSpy spyEmailAction(emailAction, SIGNAL(stateChanged(QContactAction::State))); emailAction->invokeAction(contact, emailAddress); emailAction->invokeAction(contact); QTRY_COMPARE(spyEmailAction.count(), 2); // make sure the signal was emitted exactly one time delete emailAction; } -void TestMobCntActions::phonenumberNoEmailSupport() +void TestMobCntActions::noEmailSupport() { QContact contact; m_manager->saveContact(&contact); //expected no actions found - QStringList actions = contact.availableActions(); + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } QVERIFY(actions.contains("email", Qt::CaseInsensitive) == false); } +void TestMobCntActions::urlSupport() +{ + QContact contact; + QContactUrl url; + url.setUrl("www.test.com"); + contact.saveDetail(&url); + m_manager->saveContact(&contact); + + //one number exist in contact + QList urlList = contact.details(); + QVERIFY(urlList.count() == 1); + + //no actions expected + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } + QVERIFY(actions.count() == 1); + QVERIFY(actions.contains("url", Qt::CaseInsensitive)); + + //pick first number for the actions + QContactUrl urlAddress = contact.detail(); + + //Test Email action + QList urlActionDescriptors = QContactAction::actionDescriptors("url", "symbian"); + QVERIFY(urlActionDescriptors.count() == 1); + QContactAction *urlAction = QContactAction::action(urlActionDescriptors.at(0)); + QVERIFY(urlAction != 0); + QVERIFY(urlAction->isDetailSupported(urlList.at(0)) == true); + QVariantMap variantMap = urlAction->metaData(); + QVERIFY(variantMap.count() == 0); + variantMap = urlAction->results(); + QVERIFY(variantMap.count() == 0); + QSignalSpy spyUrlAction(urlAction, SIGNAL(stateChanged(QContactAction::State))); + urlAction->invokeAction(contact, urlAddress); + urlAction->invokeAction(contact); + QTRY_COMPARE(spyUrlAction.count(), 2); // make sure the signal was emitted exactly once each time + delete urlAction; +} + +void TestMobCntActions::noUrlSupport() +{ + QContact contact; + m_manager->saveContact(&contact); + + //expected no actions found + QList actionDescriptors = contact.availableActions(); + QStringList actions; + for (int i = 0;i < actionDescriptors.count();i++) + { + QString action = actionDescriptors.at(i).actionName(); + actions << action; + } + QVERIFY(actions.contains("url", Qt::CaseInsensitive) == false); +} + QTEST_MAIN(TestMobCntActions); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.h --- a/phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntactions/tsrc/mt_mobcntactions/mt_mobcntactions.h Thu May 27 12:45:19 2010 +0300 @@ -21,36 +21,42 @@ QTM_USE_NAMESPACE +Q_DECLARE_METATYPE(QContactAction::State) + class TestMobCntActions : public QObject { Q_OBJECT private slots: //Init/cleanup the test class - void initTestCase(); - void cleanupTestCase(); + void initTestCase(); + void cleanupTestCase(); - //Init/cleanup each test method - void init(); - void cleanup(); + //Init/cleanup each test method + void init(); + void cleanup(); - void emptyContactNoActionSupport(); + void emptyContactNoActionSupport(); + + //call + void phonenumberCallSupport(); + void phonenumberNoCallSupport(); - //call - void phonenumberCallSupport(); - void phonenumberNoCallSupport(); - - //message - void phonenumberMessageSupport(); - void phonenumberNoMessageSupport(); + //message + void phonenumberMessageSupport(); + void phonenumberNoMessageSupport(); - //video call - void phonenumberVideoCallSupport(); - void phonenumberNoVideoCallSupport(); + //video call + void phonenumberVideoCallSupport(); + void phonenumberNoVideoCallSupport(); - //email - void phonenumberEmailSupport(); - void phonenumberNoEmailSupport(); + //email + void emailSupport(); + void noEmailSupport(); + + //url + void urlSupport(); + void noUrlSupport(); private: QContactManager *m_manager; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/cntcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/inc/cntcache.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,120 @@ +/* +* 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: Class for asynchronously fetching and caching +* basic contact info for list views. +* +*/ + +#ifndef CNTCACHE_H +#define CNTCACHE_H + +#include +#include +#include +#include +#include + +class CntContactInfoData; +class CntCacheThread; +class CntInfoCacheItem; +class CntIconCacheItem; + +QTM_USE_NAMESPACE + +/* + Info about one contact that can be used by listviews: + - the id + - the full name, properly formatted + - text, secondary information like phone number + - icon1, the main icon + - icon2, a secondary icon + */ +class CntContactInfo : public QObject +{ + Q_OBJECT +public: + CntContactInfo(); + CntContactInfo(int id, const QString& name, const QString& text, const HbIcon& icon1, const HbIcon& icon2); + ~CntContactInfo(); + + CntContactInfo(const CntContactInfo& other); + CntContactInfo& operator=(const CntContactInfo& other); + + int id() const; + QString name() const; + QString text() const; + HbIcon icon1() const; + HbIcon icon2() const; + +private: + QSharedDataPointer d; +}; + +/* + Singleton class that acts as a proxy to get CntContactInfo objects for contacts. + It also implements caching for faster access. This is why the fetchContactInfo() + function takes a row number and the full list of contact IDs rather than just a + contact ID -- the former allows caching ahead. + + The usage pattern for clients is to call fetchContactInfo() to get at least the + name of the contact. If all the info is cached then it will be provided. If not, + then the uncached info is fetched asynchronously and contactInfoUpdated signals + are emitted as the pieces of information arrive -- up to three times per contact; + once for text, once for icon1 and once for icon2. + */ +class CntCache : public QObject +{ + Q_OBJECT +public: + static CntCache* instance(); + CntContactInfo fetchContactInfo(int row, const QList& idList); + +public slots: + void clearCache(); + +signals: + void contactInfoUpdated(QContactLocalId contactId); + +private: + CntCache(); + ~CntCache(); + bool fetchContactName(int contactId, QString& contactName); + void updateReadAheadCache(int mostRecentRow, const QList& idList); + CntInfoCacheItem* createInfoCacheItem(int contactId); + CntIconCacheItem* createIconCacheItem(const QString& iconName); + void emitContactInfoUpdated(int contactId); + +private slots: + void onNewInfo(int contactId, const ContactInfoField& infoField, const QString& infoValue); + void onInfoCancelled(int contactId); + void onNewIcon(const QString& iconName, const HbIcon& icon); + void onIconCancelled(const QString& iconName); + void onShutdown(); + void removeContactsFromCache(const QList& contactIds); + void scheduleOneReadAheadItem(); + +private: + static CntCache* mInstance; // the one and only instance of CntCache + QContactManager* mContactManager; // for fetching contact names and for getting + // notifications about changes to contacts + CntCacheThread* mWorker; // the background thread that does the actual fetching + QList mReadAheadCache; // cache with set of IDs to prefetch (they are likely to be needed soon) + QHash mInfoCache; // cache with contact info, indexed by contact ids + QHash mIconCache; // cache with icons, indexed by icon name + int mNextInfoCacheOrder; // cache order for the next item to be updated/inserted in info cache + int mNextIconCacheOrder; // cache order for the next item to be updated/inserted in icon cache + int mEmittedContactId; // id of the last contact emitted to UI +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/cntcache_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/inc/cntcache_p.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,139 @@ +/* +* 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: Private data and helper classes used by class CntCache. +* +*/ + +#ifndef CNTCACHE_P_H +#define CNTCACHE_P_H + +#include +#include +#include +#include +#include +#include +#include "cntinfoprovider.h" + +#define DP( s ); +#define DP_IN( s ); +#define DP_OUT( s ); + +class ThumbnailManager; + +QTM_USE_NAMESPACE + +/*! + Private shared data for the CntContactInfo class. + */ +class CntContactInfoData : public QSharedData +{ +public: + CntContactInfoData() : id(-1), fields(0) { } + ~CntContactInfoData() { } + +public: + int id; + int fields; + QString name; + QString text; + HbIcon icon1; + HbIcon icon2; +}; + +/*! + Cache item that holds info for one contact: name, text and two icon names. + */ +class CntInfoCacheItem +{ +public: + int cacheOrder; + int contactId; + QString name; + QString text; + QString icons[2]; +}; + +/*! + Cache item that holds one icon. Data member isFetched is false until the + icon has been fetched asynchronously. + */ +class CntIconCacheItem +{ +public: + int cacheOrder; + QString iconName; + bool isFetched; + QSet contactIds; + HbIcon icon; +}; + +/*! + Low priority thread that fetches contact info and icons in the background. + CntCacheThread uses data provider plugins and thumbnail manager to retrieve + the actual data. This class' responsibilities are 1) fetch the requested + data in a timely manner and 2) interfere with the UI as little as possible. + This is mainly orchestrated by the client, who calls postponeJobs() when + the UI is active, and who only requests urgent jobs. + + If the client sends too many requests (e.g. during a long scrolling operation + in the UI), then the oldest jobs will be cancelled. However, the cancelled jobs + will be informed back to the client later so that it can choose to reschedule + the jobs. + */ +class CntCacheThread : public QThread +{ + Q_OBJECT +public: + CntCacheThread(); + ~CntCacheThread(); + + void run(); + void scheduleInfoJob(int contactId); + void scheduleIconJob(const QString& iconName); + void postponeJobs(); + bool event(QEvent *event); + +signals: + void infoFieldUpdated(int contactId, ContactInfoField infoField, const QString& infoValue); + void infoCancelled(int contactId); + void iconUpdated(const QString& iconName, const HbIcon& icon); + void iconCancelled(const QString& iconName); + void allJobsDone(); + +private slots: + void onInfoFieldReady(CntInfoProvider* sender, int contactId, + ContactInfoField field, const QString& text); + void onIconReady(const QPixmap& pixmap, void *data, int id, int error); + void doAllJobs(); + +private: + QContactManager* mContactManager; // for fetching QContact objects + ThumbnailManager* mThumbnailManager; // for fetching icons + + // maps info providers to their responsibilities + QMap mDataProviders; + + QMutex mJobMutex; // guards access to the job lists + bool mJobLoopRunning; // true from when job loop event has been posted until job loop exits + int mPostponeJobs; // set to true by client if it needs the CPU + QList mInfoJobs; // list of all info jobs + QList mCancelledInfoJobs; // list of all cancelled info jobs + QList mIconJobs; // list of all icon jobs + QList mCancelledIconJobs; // list of all cancelled icon jobs + int mIconRequestId; // the id for the last request to thumbnail manager + QString mIconRequestName; // the name of the icon last requested from thumbnail manager +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/cntdefaultinfoprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/inc/cntdefaultinfoprovider.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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: Default info provider plugin for CntListModel. It can provide +* the phone number and the image url of a contact (text and +* icon1 field respectively). +* +*/ + +#ifndef CNTDEFAULTPROVIDER_H +#define CNTDEFAULTPROVIDER_H + +#include "cntinfoprovider.h" +#include + +QTM_USE_NAMESPACE + +/* + The default info provider plugin. It can provide the phone number and the + image url of a contact (text and icon1 field respectively). + */ +class CntDefaultInfoProvider : public CntInfoProvider +{ + Q_OBJECT +public: + QString id() const { return "default"; }; + ContactInfoFields supportedFields() const; + void requestInfo(const QContact& contact, ContactInfoFields requestedInfo); +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/cntinfoprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/inc/cntinfoprovider.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for info provider plugins to class CntListModel. +* +*/ + +#ifndef CNTINFOPROVIDER_H +#define CNTINFOPROVIDER_H + +#include +#include + +QTM_USE_NAMESPACE + +/* + Info providers may provide up to three different types of info fields: + text, icon1 and icon2. + */ +enum ContactInfoField { + ContactInfoTextField = 0x01, + ContactInfoIcon1Field = 0x02, + ContactInfoIcon2Field = 0x04, + ContactInfoAllFields = ContactInfoTextField | ContactInfoIcon1Field | ContactInfoIcon2Field +}; +Q_DECLARE_FLAGS(ContactInfoFields, ContactInfoField) +Q_DECLARE_OPERATORS_FOR_FLAGS(ContactInfoFields) + +/* + Interface for info provider plugins. Info provider plugins provide the kind of + info that a listview with contacts wants. Examples includes phone number, image url + and online status (text and/or icon). + */ +class CntInfoProvider : public QObject +{ + Q_OBJECT +public: + /* + The unqiue name of the plugin. + + /return the id of the plugin + */ + virtual QString id() const = 0; + + /* + Checks fields that the client can provide. + + /return all the ContactInfoFields that this plugin can provide to clients + */ + virtual ContactInfoFields supportedFields() const = 0; + + /* + Requests info about a contact. The requested info fields are passed + back to the client via infoFieldReady() signals. Ideally this function + should not consume more than 50 ms of time. Info that takes longer to + fetch should use some asynchronous way of getting the data. + + Info values are by default empty, so an empty value does not need not be + sent back in response to this request. However, if a value *changes* and + becomes empty, that will of course need to be signaled. + + /param contact the contact for which info is requested + /param requestedInfo one or more of the flags in ContactInfoFields + */ + virtual void requestInfo(const QContact& contact, ContactInfoFields requestedInfo) = 0; + +signals: + /* + The requested info fields are passed back to the client via infoFieldReady() + signals, one signal per field. + + /param sender the provider that sends the signal + /param contactId the if of the contact that this info is about + /param field the field that is ready (text, icon1 or icon2) + /param value the value of the info field + */ + void infoFieldReady(CntInfoProvider* sender, int contactId, ContactInfoField field, const QString& value); +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/mobcnticonmanager.h --- a/phonebookengines/mobcntmodel/inc/mobcnticonmanager.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +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: Music Player collection album art manager. -* -*/ - - -#ifndef MOBCNTICONMANAGER_H -#define MOBCNTICONMANAGER_H - -#include -#include -#include -#include -#include -#include -#include - -class ThumbnailManager; - -class MobCntIconManager : public QObject -{ - Q_OBJECT - -public: - - explicit MobCntIconManager(QObject *parent=0); - virtual ~MobCntIconManager(); - - QIcon contactIcon(const QString &avatarPath, int index); - void cancel(); - -signals: - void contactIconReady(int index); - -public slots: - void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); - void thumbnailLoad(); - void timerTimeout(); - -private: - ThumbnailManager *mThumbnailManager; - QHash mImageCache; - QMap mTnmReqMap; - - QQueue< QPair > mRequestQueue; - int mQueueCount; - QTimer* mTimer; - -}; - -#endif // MOBCNTICONMANAGER_H - diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/mobcntmodel.h --- a/phonebookengines/mobcntmodel/inc/mobcntmodel.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/inc/mobcntmodel.h Thu May 27 12:45:19 2010 +0300 @@ -30,7 +30,6 @@ class MobCntModelData; class MobCntModel; -class MobCntIconManager; /*! * MobCntModel is a list model view for contacts database @@ -47,58 +46,55 @@ friend class TestMobCntModel; public: - MobCntModel(const QContactFilter& contactFilter = QContactFilter(), + MobCntModel(const QContactFilter& contactFilter = QContactFilter(), + const QList& contactSortOrders = QList(), + bool showMyCard = true, + QObject *parent = 0); + MobCntModel(QContactManager* manager, + const QContactFilter& contactFilter = QContactFilter(), const QList& contactSortOrders = QList(), bool showMyCard = true, QObject *parent = 0); - MobCntModel(QContactManager* manager, - const QContactFilter& contactFilter = QContactFilter(), - const QList& contactSortOrders = QList(), - bool showMyCard = true, - QObject *parent = 0); - ~MobCntModel(); + ~MobCntModel(); public: // from QAbstractTableModel/QAbstractItemModel - QVariant data(const QModelIndex &index, int role) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex &index, int role) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; public: - QContact contact(const QModelIndex &index) const; - QModelIndex indexOfContact(const QContact &contact) const; - QContactManager& contactManager() const; - void setFilterAndSortOrder(const QContactFilter& contactFilter = QContactFilter(), + QContact contact(const QModelIndex &index) const; + QModelIndex indexOfContact(const QContact &contact) const; + QContactManager& contactManager() const; + void setFilterAndSortOrder(const QContactFilter& contactFilter = QContactFilter(), const QList& contactSortOrders = QList()); - void showMyCard(bool enabled); - bool myCardStatus() const; - QContactLocalId myCardId() const; + void showMyCard(bool enabled); + bool myCardStatus() const; + QContactLocalId myCardId() const; private: - // Construction helpers - int doConstruct(); - int initializeData(); - void updateContactIdsArray(); - - // Data manipulation - QContact contact(int row) const; + // Construction helpers + int doConstruct(); + int initializeData(); + void updateContactIdsArray(); - // Utility - bool validRowId(int row) const; - int rowId(const QContactLocalId &contactId) const; - QVariant dataForDisplayRole(int row) const; - QList< QList > findIndexes(const QList& contactIds); + // Data manipulation + QContact contact(int row) const; -public slots: - void updateContactIcon(int index); + // Utility + bool validRowId(int row) const; + int rowId(const QContactLocalId &contactId) const; + QVariant dataForDisplayRole(int row) const; + QList< QList > findIndexes(const QList& contactIds); protected slots: - void handleAdded(const QList& contactIds); - void handleChanged(const QList& contactIds); - void handleRemoved(const QList& contactIds); - void handleMyCardChanged(const QContactLocalId& oldId, const QContactLocalId& newId); + void handleAdded(const QList& contactIds); + void handleChanged(const QList& contactIds); + void handleRemoved(const QList& contactIds); + void handleMyCardChanged(const QContactLocalId& oldId, const QContactLocalId& newId); + void handleContactInfoUpdated(QContactLocalId contactId); private: QSharedDataPointer d; - MobCntIconManager *mIconManager; HbIcon mDefaultIcon; HbIcon mDefaultMyCardIcon; }; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/inc/mobcntmodel_p.h --- a/phonebookengines/mobcntmodel/inc/mobcntmodel_p.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/inc/mobcntmodel_p.h Thu May 27 12:45:19 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include "cntcache.h" QTM_USE_NAMESPACE @@ -44,8 +45,9 @@ public: QContactManager* m_contactManager; + CntCache* m_cache; bool ownedContactManager; - mutable QContact currentContact; + mutable CntContactInfo currentContact; mutable int currentRow; QList contactIds; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/mobcntmodel.pro --- a/phonebookengines/mobcntmodel/mobcntmodel.pro Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/mobcntmodel.pro Thu May 27 12:45:19 2010 +0300 @@ -42,18 +42,21 @@ inc/mobcntmodelglobal.h \ inc/mobcntmodel.h -HEADERS += \ - $$INTERNAL_PUBLIC_HEADERS \ - inc/mobcntmodel_p.h \ - inc/mobcnticonmanager.h +HEADERS += $$INTERNAL_PUBLIC_HEADERS \ + inc/mobcntmodel_p.h \ + inc/cntcache.h \ + inc/cntcache_p.h \ + inc/cntinfoprovider.h \ + inc/cntdefaultinfoprovider.h SOURCES += src/mobcntmodel.cpp \ - src/mobcnticonmanager.cpp + src/cntcache.cpp \ + src/cntcache_p.cpp \ + src/cntdefaultinfoprovider.cpp RESOURCES += resources/mobcntmodel.qrc -LIBS += \ - -lQtContacts \ +LIBS += -lQtContacts \ -lhbcore \ -lthumbnailmanagerqt diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/src/cntcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/src/cntcache.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,687 @@ +/* +* 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: Class for asynchronously fetching and caching basic +* contact info (see CntContactInfo) for list views. +* +*/ + +#include +#include +#include +#include "cntcache.h" +#include "cntcache_p.h" +#include "cntinfoprovider.h" + +// set the singleton instance pointer to NULL +CntCache* CntCache::mInstance = NULL; + +// value for first cache order to be assigned +static const int CacheOrderStartValue = 1; +// for avoiding wrap around with cache orders +static const int MaxCacheOrderValue = 10000000; +// number of items to read ahead into cache; this number is for one direction +static const int ItemsToCacheAhead = 24; +// cache size for info items (name, text, icon1name, icon2name) +static const int InfoCacheSize = 128; +// cache size for icon items (iconName and HbIcon) +static const int IconCacheSize = 50; +// number of icons in a CntContactInfo object +static const int IconsInCntContactInfo = 2; +// default empty text info field for a contact; it cannot be empty +// as the listview will then ignore it, causing rendering problems +static const QString EmptyTextField = " "; + +/*! + Provides a pointer to the CntCache singleton instance. + */ +CntCache* CntCache::instance() +{ + if (mInstance == NULL) { + mInstance = new CntCache(); + } + + return mInstance; +} + +/*! + Creates the CntCache singleton instance. + */ +CntCache::CntCache() + : mContactManager(new QContactManager()), + mWorker(new CntCacheThread()), + mNextInfoCacheOrder(CacheOrderStartValue), + mNextIconCacheOrder(CacheOrderStartValue), + mEmittedContactId(-1) +{ + DP_IN("CntCache::CntCache()"); + + // listen to worker updates + connect(mWorker, SIGNAL(infoFieldUpdated(int, const ContactInfoField&, const QString&)), + this, SLOT(onNewInfo(int, const ContactInfoField&, const QString&))); + connect(mWorker, SIGNAL(iconUpdated(const QString&, const HbIcon&)), + this, SLOT(onNewIcon(const QString&, const HbIcon&))); + connect(mWorker, SIGNAL(infoCancelled(int)), this, SLOT(onInfoCancelled(int))); + connect(mWorker, SIGNAL(iconCancelled(const QString&)), this, SLOT(onIconCancelled(const QString&))); + connect(mWorker, SIGNAL(allJobsDone()), this, SLOT(scheduleOneReadAheadItem())); + + // listen to the database for changes to contacts + connect(mContactManager, SIGNAL(contactsChanged(const QList&)), this, SLOT(removeContactsFromCache(const QList&))); + connect(mContactManager, SIGNAL(contactsRemoved(const QList&)), this, SLOT(removeContactsFromCache(const QList&))); + + // shutdown only when the whole application shuts down + connect(HbApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(onShutdown())); + + DP_OUT("CntCache::CntCache()"); +} + +/*! + Destructs the CntCache singleton instance. + */ +CntCache::~CntCache() +{ + DP_IN("CntCache::~CntCache()"); + + delete mWorker; + delete mContactManager; + + DP_OUT("CntCache::~CntCache()"); +} + +/*! + Fetches information about a contact: name, text (e.g. phone number or + social status) and two icons (e.g. avatar, presence). Previously cached + content - at the very least the name - will be returned immediately. + Availability of more information will be checked asynchronously and + sent to clients via contactInfoUpdated() signals. + + The function takes a row and a list rather than just a contact id because + of read ahead caching - contacts near the requested contacts are expected + to be needed soon and are therefore also scheduled for caching. + + \param row the row of the contact to fetch + \param idList a list with all the IDs in the list + \return a contact with some details filled in + */ +CntContactInfo CntCache::fetchContactInfo(int row, const QList& idList) +{ + DP_IN("CntCache::fetchContactInfo(" << row << ", idlist[" << idList.count() << "])"); + + Q_ASSERT(row >= 0 && row < idList.count()); + + QString name; + QString text = EmptyTextField; + HbIcon icons[IconsInCntContactInfo]; + + int contactId = idList.at(row); + + if (contactId != mEmittedContactId) { + // this request comes from the UI in response to some scrolling activity => + // 1) postpone all jobs so the UI can use as much of the CPU as possible + // 2) update read ahead cache to contain all IDs of all items near this item + mWorker->postponeJobs(); + updateReadAheadCache(row, idList); + } + + // fetch contact + if (mInfoCache.contains(contactId)) { + // the item is in the cache + CntInfoCacheItem* infoItem = mInfoCache.value(contactId); + for (int i = 0; i < IconsInCntContactInfo; ++i) { + QString iconName = infoItem->icons[i]; + if (!iconName.isEmpty()) { + if (mIconCache.contains(iconName)) { + CntIconCacheItem* iconItem = mIconCache.value(iconName); + iconItem->cacheOrder = mNextIconCacheOrder++; + icons[i] = iconItem->icon; + if (!iconItem->isFetched) { + // if icon has not yet been received from backend, add + // this id to the list of contacts that want to be + // notified when the icon is received + iconItem->contactIds.insert(contactId); + } + } + else { + // needed icon is not in cache, so schedule it for retrieval + CntIconCacheItem* iconItem = createIconCacheItem(iconName); + iconItem->contactIds.insert(contactId); + mWorker->scheduleIconJob(iconName); + } + } + } + + // update cache order + infoItem->cacheOrder = mNextInfoCacheOrder++; + + name = infoItem->name; + text = infoItem->text; + } + else { + // the item is not in cache, so fetch the name and schedule the rest + // of the info for retrieval + if (fetchContactName(contactId, name)) { + // contact found, so add new entry to cache + CntInfoCacheItem* item = createInfoCacheItem(contactId); + item->name = name; + item->text = text; + + // ask the worker thread to fetch the information asynchronously + mWorker->scheduleInfoJob(contactId); + } + } + + // cache read-ahead -- items near this fetched item should also be in cache + // updateReadAhead(row, idList); + + DP_OUT("CntCache::fetchContactInfo(" << row << ", idlist[" << idList.count() << "]) : name =" << name); + + return CntContactInfo(contactId, name, text, icons[0], icons[1]); +} + +/*! + Clears the cache - both names and icons. This function can be useful + for example if application goes to the background and memory needs to + be freed, or if the format of contact names change. + */ +void CntCache::clearCache() +{ + DP_IN("CntCache::clearCache()"); + + // clear info cache + foreach (CntInfoCacheItem* item, mInfoCache) { + delete item; + } + mInfoCache.clear(); + mNextInfoCacheOrder = CacheOrderStartValue; + + // clear icon cache + foreach (CntIconCacheItem* item, mIconCache) { + delete item; + } + mIconCache.clear(); + mNextIconCacheOrder = CacheOrderStartValue; + + DP_OUT("CntCache::clearCache()"); +} + +/*! + Processes a new info field that has arrived from the worker thread. + If the contact is in the info cache, then the info cache is updated + accordingly. + + A contactInfoUpdated() signal is usually also emitted. The exception + is if the info is the name of an icon and that icon is not in the icon + cache. In this case the icon is fetched before a signal is emitted. + */ +void CntCache::onNewInfo(int contactId, const ContactInfoField& infoField, const QString& infoValue) +{ + DP_IN("CntCache::onNewInfo(" << contactId << "," << infoField << "," << infoValue << ")"); + + Q_ASSERT(infoField == ContactInfoTextField || infoField == ContactInfoIcon1Field || infoField == ContactInfoIcon2Field); + + bool hasNewInfo; + + if (!mInfoCache.contains(contactId)) { + // contact is not in cache, so nothing needs to be done + // except notify clients that this contact has (possibly) + // been changed + hasNewInfo = true; + } + else if (infoField == ContactInfoTextField) { + // update cache with new text for contact + if (!infoValue.isEmpty()) + mInfoCache.value(contactId)->text = infoValue; + else + mInfoCache.value(contactId)->text = " "; + hasNewInfo = true; + } + else { + // update cache with new icon name for contact + int iconIndex = (infoField == ContactInfoIcon1Field ? 0 : 1); + + CntInfoCacheItem* item = mInfoCache.value(contactId); + QString iconName = infoValue; + if (item->icons[iconIndex] != iconName) { + item->icons[iconIndex] = iconName; + if (iconName.isEmpty()) { + hasNewInfo = true; + } + else if (mIconCache.contains(iconName)) { + CntIconCacheItem* iconItem = mIconCache.value(iconName); + if (!iconItem->isFetched) { + iconItem->contactIds.insert(contactId); + hasNewInfo = false; + } + else { + hasNewInfo = true; + } + } + else { + CntIconCacheItem* iconItem = createIconCacheItem(iconName); + iconItem->contactIds.insert(contactId); + mWorker->scheduleIconJob(iconName); + hasNewInfo = false; + } + } + else { + hasNewInfo = false; + } + } + + if (hasNewInfo) { + DP("CntCache::onNewInfo() : new info => emitting contactInfoUpdated(" << contactId << ")"); + emitContactInfoUpdated(contactId); + } + + DP_OUT("CntCache::onNewInfo(" << contactId << "," << infoField << "," << infoValue << ")"); +} + +/*! + Handle the case where a request for contact info is cancelled by the + worker because of too many subsequent requests. + */ +void CntCache::onInfoCancelled(int contactId) +{ + DP_IN("CntCache::onInfoCancelled(" << contactId << ")"); + + if (mInfoCache.contains(contactId)) { + CntInfoCacheItem* item = mInfoCache.take(contactId); + delete item; + } + + DP("CntCache::onInfoCancelled() : info cancelled => emitting contactInfoUpdated(" << contactId << ")"); + emitContactInfoUpdated(contactId); + + DP_OUT("CntCache::onInfoCancelled(" << contactId << ")"); +} + +/*! + Processes a new icon that has arrived from the worker thread. + The icon cache is updated and a contactInfoUpdated() signal is + emitted for all contacts that use this icon. + */ +void CntCache::onNewIcon(const QString& iconName, const HbIcon& icon) +{ + DP_IN("CntCache::onNewIcon(" << iconName << ", HbIcon)"); + + QSet contactsToNotify; + + if (mIconCache.contains(iconName)) { + CntIconCacheItem* item = mIconCache.value(iconName); + item->icon = icon; + item->isFetched = true; + contactsToNotify = item->contactIds; + item->contactIds.clear(); + } + + foreach (int contactId, contactsToNotify) { + DP("CntCache::onNewIcon() : new icon => emitting contactInfoUpdated(" << contactId << ")"); + emitContactInfoUpdated(contactId); + } + + DP_OUT("CntCache::onNewIcon(" << iconName << ", HbIcon)"); +} + +/*! + Handle the case where a request for an icon is cancelled by the worker because + of too many subsequent requests. + */ +void CntCache::onIconCancelled(const QString& iconName) +{ + DP_IN("CntCache::onIconCancelled(" << iconName << ")"); + + QSet contactsToNotify; + + if (mIconCache.contains(iconName)) { + CntIconCacheItem* item = mIconCache.take(iconName); + contactsToNotify = item->contactIds; + item->contactIds.clear(); + delete item; + } + + foreach (int contactId, contactsToNotify) { + DP("CntCache::onIconCancelled() : icon cancelled => emitting contactInfoUpdated(" << contactId << ")"); + emitContactInfoUpdated(contactId); + } + + DP_OUT("CntCache::onIconCancelled(" << iconName << ")"); +} + +/*! + Removes contacts from cache. + + /param contactIds ids of the contact that will be removed + */ +void CntCache::removeContactsFromCache(const QList& contactIds) +{ + DP_IN("CntCache::removeContactsFromCache(idList[" << contactIds.count() << "])"); + + foreach (QContactLocalId contactId, contactIds) { + if (mInfoCache.contains(contactId)) { + CntInfoCacheItem* item = mInfoCache.take(contactId); + delete item; + } + } + + foreach (QContactLocalId contactId, contactIds) { + emitContactInfoUpdated(contactId); + } + + DP_OUT("CntCache::removeContactsFromCache(idList[" << contactIds.count() << "])"); +} + +/*! + Uses an optimized function to fetch the name of a contact from + the database. + + /param contactId the id of the contact to fetch + /param contactName the name will be stored here if the function is successful + /return true if the name was fetched successfully + */ +bool CntCache::fetchContactName(int contactId, QString& contactName) +{ + bool foundContact = false; + DP_IN("CntCache::fetchContactName(" << contactId << "," << contactName << ")"); + + QContactFetchHint nameOnlyFetchHint; + QStringList details; + details << QContactDisplayLabel::DefinitionName; + nameOnlyFetchHint.setDetailDefinitionsHint(details); + QContact contact = mContactManager->contact(contactId, nameOnlyFetchHint); + + if (mContactManager->error() == QContactManager::NoError) { + contactName = contact.displayLabel(); + foundContact = true; + // TODO: this can be removed once qt mobility is updated (~wk20/10) + if (contactName == "Unnamed") { + contactName = ""; + } + } + + DP_OUT("CntCache::fetchContactName(" << contactId << "," << contactName << ") : " << foundContact); + + return foundContact; +} + +/*! + Collects all contact IDs near the latest fetch from the UI. These will be fetched and + precached when UI activity slows down. + + \param mostRecentRow the row of the contact that was most recently fetched + \param idList a list with all the IDs in the list + */ +void CntCache::updateReadAheadCache(int mostRecentRow, const QList& idList) +{ + DP_IN("CntCache::updateReadAheadCache(" << mostRecentRow << ", idList[" << idList.count() << "] )"); + int row; + + mReadAheadCache.clear(); + + // step through the area near to last fetch item and make sure all + // contacts in it are also in cache or in the read ahead list + for (int i = 1; i <= ItemsToCacheAhead; ++i) { + for (int j = 0; j < 2; ++j) { + if (j == 0) { + row = mostRecentRow - i; + if (row <= 0) { + continue; + } + } + else { + row = mostRecentRow + i; + if (row >= idList.count()) { + continue; + } + } + + int contactId = idList.at(row); + if (!mInfoCache.contains(contactId)) { + // contact is not in cache, so put the id to items to read into cache + mReadAheadCache.append(contactId); + } + else { + // contact is in cache; update cache order as we want to keep this item in cache + mInfoCache.value(contactId)->cacheOrder = mNextInfoCacheOrder++; + } + } + } + + DP_OUT("CntCache::updateReadAheadCache(" << mostRecentRow << ", idList[" << idList.count() << "] )"); +} + +/*! + Schedules one uncached item in the read-ahead list for retrieval. + */ +void CntCache::scheduleOneReadAheadItem() +{ + DP_IN("CntCache::scheduleOneReadAheadItem()"); + + QString name; + + while (mReadAheadCache.count() > 0) { + int contactId = mReadAheadCache.takeFirst(); + if (!mInfoCache.contains(contactId)) { + // contact is not in cache, so schedule it for retreival + if (fetchContactName(contactId, name)) { + // contact found, so add new entry to cache + CntInfoCacheItem* item = createInfoCacheItem(contactId); + item->name = name; + item->text = EmptyTextField; + + // schedule the info for retrieval + mWorker->scheduleInfoJob(contactId); + break; + } + } + } + + DP_OUT("CntCache::scheduleOneReadAheadItem()"); +} + +/*! + Creates a new item in the info cache. If the cache is full, + then the least recently accessed item is removed from cache. + + /param contactId id of contact for which to create the new cache item + /return the newly created cache item + */ +CntInfoCacheItem* CntCache::createInfoCacheItem(int contactId) +{ + DP_IN("CntCache::createInfoCacheItem(" << contactId << ")"); + + if (mInfoCache.count() >= InfoCacheSize) { + // cache is full, so remove the oldest contact + int minCacheOrder = mNextInfoCacheOrder; + CntInfoCacheItem* oldestItem = NULL; + foreach (CntInfoCacheItem* i, mInfoCache) { + if (i->cacheOrder < minCacheOrder) { + minCacheOrder = i->cacheOrder; + oldestItem = i; + } + } + mInfoCache.remove(oldestItem->contactId); + delete oldestItem; + + // cache maintenance: if the cache ids become too large, + // reduce all of them by MaxCacheOrderValue + if (mNextInfoCacheOrder >= MaxCacheOrderValue) { + mNextInfoCacheOrder -= MaxCacheOrderValue; + foreach (CntInfoCacheItem* i, mInfoCache) { + i->cacheOrder -= MaxCacheOrderValue; + } + } + } + + // create and insert the new item + CntInfoCacheItem* item = new CntInfoCacheItem(); + item->cacheOrder = mNextInfoCacheOrder++; + item->contactId = contactId; + mInfoCache.insert(contactId, item); + + DP_OUT("CntCache::createInfoCacheItem(" << contactId << ")"); + + return item; +} + +/*! + Creates a new item in the icon cache. If the cache is full, + then the least recently accessed item is removed from cache. + + /param iconName name of the icon for which to create the new cache item + /return the newly created cache item + */ +CntIconCacheItem* CntCache::createIconCacheItem(const QString& iconName) +{ + DP_IN("CntCache::createIconCacheItem(" << iconName << ")"); + + if (mIconCache.count() >= IconCacheSize) { + // cache is full, so remove the oldest icon + int minCacheOrder = mNextIconCacheOrder; + CntIconCacheItem* oldestItem = NULL; + foreach (CntIconCacheItem* i, mIconCache) { + if (i->cacheOrder < minCacheOrder) { + minCacheOrder = i->cacheOrder; + oldestItem = i; + } + } + mIconCache.remove(oldestItem->iconName); + delete oldestItem; + + // cache maintenance: if the cache orders become too large, + // reduce all of them by MaxCacheOrderValue + if (mNextIconCacheOrder >= MaxCacheOrderValue) { + mNextIconCacheOrder -= MaxCacheOrderValue; + foreach (CntIconCacheItem* i, mIconCache) { + i->cacheOrder -= MaxCacheOrderValue; + } + } + } + + // create and insert the new item + CntIconCacheItem* item = new CntIconCacheItem(); + item->cacheOrder = mNextIconCacheOrder++; + item->iconName = iconName; + item->isFetched = false; + mIconCache.insert(iconName, item); + + DP_OUT("CntCache::createIconCacheItem(" << iconName << ")"); + + return item; +} + +/*! + Notifies clients that a contact might have changed. + Clients can then request the info via fetchContactInfo() + if they are interested. + */ +void CntCache::emitContactInfoUpdated(int contactId) +{ + mEmittedContactId = contactId; + emit contactInfoUpdated(contactId); + mEmittedContactId = -1; +} + +/*! + Deletes the cache. + */ +void CntCache::onShutdown() +{ + delete this; +} + + +/*! + Creates an empty object. + */ +CntContactInfo::CntContactInfo() + : d(new CntContactInfoData()) +{ +} + +/*! + Creates an object with all info fields set. + */ +CntContactInfo::CntContactInfo(int id, const QString& name, const QString& text, const HbIcon& icon1, const HbIcon& icon2) + : d(new CntContactInfoData()) +{ + d->id = id; + d->name = name; + d->text = text; + d->icon1 = icon1; + d->icon2 = icon2; +} + +/*! + Destroys the object. + */ +CntContactInfo::~CntContactInfo() +{ +} + +/*! + Copy constructor. + */ +CntContactInfo::CntContactInfo(const CntContactInfo& other) + : d(other.d) +{ +} + +/*! + Assignment operator. + */ +CntContactInfo& CntContactInfo::operator=(const CntContactInfo& other) +{ + d = other.d; + return *this; +} + +/*! + Getter function for the id. + */ +int CntContactInfo::id() const +{ + return d->id; +} + +/*! + Getter function for the name. + */ +QString CntContactInfo::name() const +{ + return d->name; +} + +/*! + Getter function for the text. + */ +QString CntContactInfo::text() const +{ + return d->text; +} + +/*! + Getter function for the first icon. + */ +HbIcon CntContactInfo::icon1() const +{ + return d->icon1; +} + +/*! + Getter function for the second icon. + */ +HbIcon CntContactInfo::icon2() const +{ + return d->icon2; +} + diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/src/cntcache_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/src/cntcache_p.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,384 @@ +/* +* 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: Private data and helper classes used by class CntCache. +* +*/ + +#include +#include +#include +#include +#include +#include +#include "cntcache.h" +#include "cntcache_p.h" +#include "cntinfoprovider.h" +#include "cntdefaultinfoprovider.h" + +// maximum amount of info and icon jobs respectively -- if there are more jobs, +// then the oldest job is skipped and the client informed that this happened +// in this way the client can request the job again if wanted +static const int CntMaxInfoJobs = 20; +static const int CntMaxIconJobs = 20; +// amount of milliseconds to postpone the jobs if the UI is very active +static const int PostponeJobsMilliSeconds = 300; +// the event for starting to do all the outstanding jobs +static const QEvent::Type DoAllJobsEvent = QEvent::User; +// the id that states that no icon is currently pending from thumbnail manager +static const int NoIconRequest = -1; + +// TODO: Provide a way (cenrep keys?) for UI to set which provider to use for +// what info field (and what info fields are indeed even in use). + +/*! + Creates a new thread for fetching contact info and icons in the background. + */ +CntCacheThread::CntCacheThread() + : mContactManager(new QContactManager()), + mJobLoopRunning(false), + mPostponeJobs(false), + mIconRequestId(NoIconRequest) +{ + DP_IN("CntCacheThread::CntCacheThread()"); + + // create static provider plugins + mDataProviders.insert(new CntDefaultInfoProvider(), ContactInfoAllFields); + // TODO: create more static provider plugins + + // TODO: load dynamic provider plugins using QPluginLoader + + // connect the providers + QMapIterator i(mDataProviders); + while (i.hasNext()) { + i.next(); + connect(qobject_cast(i.key()), + SIGNAL(infoFieldReady(CntInfoProvider*, int, ContactInfoField, const QString&)), + this, + SLOT(onInfoFieldReady(CntInfoProvider*, int, ContactInfoField, const QString&))); + } + + // create & connect the thumbnail manager + mThumbnailManager = new ThumbnailManager(this); + mThumbnailManager->setMode(ThumbnailManager::Default); + mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForPerformance); + mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailSmall); + connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)), + this, SLOT(onIconReady(QPixmap, void *, int, int))); + + // this thread should interfere as little as possible with more time-critical tasks, + // like updating the UI during scrolling + start(QThread::IdlePriority); + + DP_OUT("CntCacheThread::CntCacheThread()"); +} + +/*! + Cleans up and destructs the thread. + */ +CntCacheThread::~CntCacheThread() +{ + DP_IN("CntCacheThread::~CntCacheThread()"); + + disconnect(this); + + mJobMutex.lock(); + mInfoJobs.clear(); + mCancelledInfoJobs.clear(); + mIconJobs.clear(); + mCancelledIconJobs.clear(); + + if (mIconRequestId != NoIconRequest) { + mThumbnailManager->cancelRequest(mIconRequestId); + mIconRequestId = NoIconRequest; + } + + QMapIterator i(mDataProviders); + while (i.hasNext()) { + i.next(); + delete i.key(); + } + mDataProviders.clear(); + + mJobMutex.unlock(); + + exit(); + wait(); + + DP_OUT("CntCacheThread::~CntCacheThread()"); +} + +/*! + Starts the event loop for this thread. + */ +void CntCacheThread::run() +{ + DP_IN("CntCacheThread::run()"); + exec(); + DP_OUT("CntCacheThread::run()"); +} + +/*! + Schedules a info to be fetched for a contact. When info has been fetched + infoFieldUpdated() signals will be emitted, once for each field. + + /param contactId the contact for which the info is wanted + */ +void CntCacheThread::scheduleInfoJob(int contactId) +{ + DP_IN("CntCacheThread::scheduleInfoJob(" << contactId << ")"); + + Q_ASSERT(contactId > 0 && !mInfoJobs.contains(contactId)); + + mJobMutex.lock(); + + if (!mJobLoopRunning) { + // new job => restart job loop + mJobLoopRunning = true; + HbApplication::instance()->postEvent(this, new QEvent(DoAllJobsEvent)); + } + + if (mInfoJobs.count() >= CntMaxInfoJobs) { + // the queue of jobs is full, so remove the oldest job + mCancelledInfoJobs.append(mInfoJobs.takeFirst()); + DP("CntCacheThread::scheduleInfoJob() :" << mCancelledInfoJobs.last() << "removed from joblist"); + } + + mInfoJobs.append(contactId); + DP("CntCacheThread::scheduleInfoJob() :" << contactId << "appended @" << mInfoJobs.indexOf(contactId)); + + // since this job has now been scheduled, remove it from the list of + // cancelled jobs in case it is there + mCancelledInfoJobs.removeOne(contactId); + + mJobMutex.unlock(); + + DP_OUT("CntCacheThread::scheduleInfoJob(" << contactId << ")"); +} + +/*! + Schedules an icon to be fetched. An iconUpdated() signal will be emitted when the icon + has been fetched. + + /param iconName the name of the icon to be fetched + */ +void CntCacheThread::scheduleIconJob(const QString& iconName) +{ + DP_IN("CntCacheThread::scheduleIconJob(" << iconName << ")"); + + mJobMutex.lock(); + + Q_ASSERT(!iconName.isEmpty() && !mIconJobs.contains(iconName)); + + if (!mJobLoopRunning) { + // new job, so restart job loop + mJobLoopRunning = true; + HbApplication::instance()->postEvent(this, new QEvent(DoAllJobsEvent)); + } + + if (mIconJobs.count() >= CntMaxIconJobs) { + // the queue of jobs is full, so remove the oldest job + mCancelledIconJobs.append(mIconJobs.takeLast()); + DP("CntCacheThread::scheduleIconJob() :" << mCancelledIconJobs.last() << "removed from joblist"); + } + + mIconJobs.append(iconName); + DP("CntCacheThread::scheduleIconJob() :" << iconName << "appended @" << mIconJobs.indexOf(iconName)); + + // since this job has now been rescheduled, remove it from the list of + // cancelled jobs in case it is there + mCancelledIconJobs.removeOne(iconName); + + mJobMutex.unlock(); + + DP_OUT("CntCacheThread::scheduleIconJob(" << iconName << ")"); +} + +/*! + Postpones outstanding jobs for a few tenths of a second. This should be called if + the client wants to reserve more CPU time for some urgent task. + */ +void CntCacheThread::postponeJobs() +{ + DP_IN("CntCacheThread::postponeJobs()"); + + mPostponeJobs = true; + + DP_OUT("CntCacheThread::postponeJobs()"); +} + +/*! + Handles a class-specific event that is sent by the scheduleOrUpdate functions + when there are jobs. + */ +bool CntCacheThread::event(QEvent* event) +{ + if (event->type() == DoAllJobsEvent) { + doAllJobs(); + return true; + } + + return QThread::event(event); +} + +/*! + Does the jobs. The loop runs until all jobs are done. It pauses + for a while if new info jobs appear -- this means that the UI is + updating and so the CPU is yielded to the UI. If there are again + new jobs after the pause, then it pauses again, and so on. + */ +void CntCacheThread::doAllJobs() +{ + DP_IN("CntCacheThread::doAllJobs()"); + + forever { + mJobMutex.lock(); + int infoJobs = mInfoJobs.count(); + int iconJobs = mIconJobs.count(); + int totalJobs = infoJobs + iconJobs + mCancelledInfoJobs.count() + mCancelledIconJobs.count(); + DP_IN("CntCacheThread::doAllJobs() : infojobs=" << infoJobs << ", iconjobs=" << iconJobs << ",icon_request=" << mIconRequestId << ", cancelledinfojobs=" << mCancelledInfoJobs.count() << ", cancellediconjobs=" << mCancelledIconJobs.count()); + + if (totalJobs == 0 || totalJobs == iconJobs && mIconRequestId != NoIconRequest || mPostponeJobs) { + if (mPostponeJobs) { + // client has requested a pause in activies (e.g. due to high UI activity) + mPostponeJobs = false; + if (totalJobs > 0) { + QTimer::singleShot(PostponeJobsMilliSeconds, this, SLOT(doAllJobs())); + DP("CntCacheThread::doAllJobs() : postponing for" << PostponeJobsMilliSeconds << "ms"); + } + else { + mJobLoopRunning = false; + } + } + else { + mJobLoopRunning = false; + } + + mJobMutex.unlock(); + + if (totalJobs == 0) { + DP("CntCacheThread::doAllJobs() : emitting all jobs done"); + emit allJobsDone(); + } + + break; + } + + bool doInfoJobs = infoJobs > 0 && (iconJobs == 0 || mIconRequestId != NoIconRequest || qrand() % (infoJobs + iconJobs) < infoJobs); + + if (doInfoJobs) { + // get next job + int contactId = mInfoJobs.takeLast(); + mJobMutex.unlock(); + + // fetch qcontact + QStringList definitionRestrictions; + definitionRestrictions.append(QContactName::DefinitionName); + definitionRestrictions.append(QContactAvatar::DefinitionName); + definitionRestrictions.append(QContactPhoneNumber::DefinitionName); + definitionRestrictions.append(QContactOrganization::DefinitionName); + QContactFetchHint restrictions; + restrictions.setDetailDefinitionsHint(definitionRestrictions); + restrictions.setOptimizationHints(QContactFetchHint::NoRelationships); + QContact contact = mContactManager->contact(contactId, restrictions); + + // request contact info from providers + DP("CntCacheThread::doAllJobs() : fetching info for" << contact.displayLabel() << " (id=" << contactId << ")"); + QMapIterator i(mDataProviders); + while (i.hasNext()) { + i.next(); + if (i.value() != 0) { + i.key()->requestInfo(contact, i.value()); + } + } + } + else if (iconJobs > 0 && mIconRequestId == NoIconRequest) { + // request icon from thumbnail manager + QString iconName = mIconJobs.takeFirst(); + DP("CntCacheThread::doAllJobs() : fetching icon" << iconName); + mIconRequestId = mThumbnailManager->getThumbnail(iconName, NULL, 0); + mIconRequestName = iconName; + mJobMutex.unlock(); + } + else { + if (mCancelledInfoJobs.count() > 0) { + int contactId = mCancelledInfoJobs.takeLast(); + mJobMutex.unlock(); + DP("CntCacheThread::doAllJobs() : emitting cancelled info job" << contactId); + emit infoCancelled(contactId); + } + else if (mCancelledIconJobs.count() > 0) { + QString iconName = mCancelledIconJobs.takeFirst(); + mJobMutex.unlock(); + DP("CntCacheThread::doAllJobs() : emitting cancelled icon job" << iconName); + emit iconCancelled(iconName); + } + } + + // allow signals to be passed from providers and from the client + HbApplication::processEvents(); + } + + DP_OUT("CntCacheThread::doAllJobs()"); +} + +/*! + Passes an info field from a data provider up to the client via signals. The + client is not in the same thread, so Qt passes the signal as an event. + */ +void CntCacheThread::onInfoFieldReady(CntInfoProvider* sender, int contactId, + ContactInfoField field, const QString& text) +{ + DP_IN("CntCacheThread::onInfoFieldReady( CntInfoProvider*," << contactId << "," << field << "," << text << ")"); + + // there can be 3rd party providers, so we cannot blindly trust them; + // info is emitted only if: + // 1) the sender is in the list of providers + // 2) exactly one field bit is set in parameter 'field' + // 3) the field bit has been assigned to this provider + if (mDataProviders.contains(sender) + && ((field & (field - 1)) == 0) + && ((field & mDataProviders.value(sender)) != 0)) { + DP("CntCacheThread::onInfoFieldReady(" << contactId << "," << field << "," << text << ") : emitting infoFieldUpdated()"); + emit infoFieldUpdated(contactId, field, text); + } + + DP_OUT("CntCacheThread::onInfoFieldReady(" << contactId << "," << field << "," << text << ")"); +} + +/*! + Passes an icon from thumbnail manager up to the client via a signal. The + client is not in the same thread, so Qt passes the signal as an event. + */ +void CntCacheThread::onIconReady(const QPixmap& pixmap, void *data, int id, int error) +{ + DP_IN("CntCacheThread::onIconReady( QPixMap, void*, " << id << "," << error << ")"); + Q_UNUSED(data); + + mJobMutex.lock(); + Q_ASSERT(id == mIconRequestId && !mIconRequestName.isEmpty()); + if (!mJobLoopRunning) { + // job loop quit while waiting for this icon, so restart it + mJobLoopRunning = true; + HbApplication::instance()->postEvent(this, new QEvent(DoAllJobsEvent)); + } + mIconRequestId = NoIconRequest; + mJobMutex.unlock(); + + if (error == 0) { + DP("CntCacheThread::onIconReady() : emitting iconUpdated(" << mIconRequestName << ")"); + emit iconUpdated(mIconRequestName, HbIcon(pixmap)); + } + + DP_OUT("CntCacheThread::onIconReady( QPixMap, void*, " << id << "," << error << ")"); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/src/cntdefaultinfoprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/mobcntmodel/src/cntdefaultinfoprovider.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,65 @@ +/* +* 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: Default info provider plugin for CntListModel. It can provide +* the phone number and the image url of a contact (text and +* icon1 field respectively). +* +*/ + +#include +#include "cntdefaultinfoprovider.h" + +/*! + /return the info fields supported by this provider + */ +ContactInfoFields CntDefaultInfoProvider::supportedFields() const +{ + // this provider does not have any info for the icon2 field + return ContactInfoIcon1Field | ContactInfoTextField; +} + +/*! + The contact contains all the info this provider needs, so signals with the requested info + fields are emitted immediately. + + /param contact the contact for which info is requested + /param requestedInfo one or more of the flags in ContactInfoFields + */ +void CntDefaultInfoProvider::requestInfo(const QContact& contact, ContactInfoFields requestedInfo) +{ + if (requestedInfo & ContactInfoTextField) { + QContactDetail detail = contact.preferredDetail("call"); + QString number; + + if (!detail.isEmpty()) + { + number = static_cast(detail).number(); + } + else + { + number = contact.detail().number(); + } + + if (!number.isEmpty()) { + emit infoFieldReady(this, contact.localId(), ContactInfoTextField, number); + } + } + + if (requestedInfo & ContactInfoIcon1Field) { + QString imageUrl = contact.detail().imageUrl().toString(); + if (!imageUrl.isEmpty()) { + emit infoFieldReady(this, contact.localId(), ContactInfoIcon1Field, imageUrl); + } + } +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/src/mobcnticonmanager.cpp --- a/phonebookengines/mobcntmodel/src/mobcnticonmanager.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +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 "mobcnticonmanager.h" -#include -#include - -const int KMaxQueueSize = 25; -const int KContactFetchTimer1 = 400; -const int KContactFetchTimer2 = 20; -/*! - Constructor - */ -MobCntIconManager::MobCntIconManager(QObject *parent) - : QObject(parent), - mQueueCount(0) -{ - mThumbnailManager = new ThumbnailManager(this); - mThumbnailManager->setMode(ThumbnailManager::Default); - mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForPerformance); - mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailSmall); - - connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)), - this, SLOT(thumbnailReady(QPixmap, void *, int, int))); - - mTimer = new QTimer(); - connect( mTimer, SIGNAL(timeout()), this, SLOT(timerTimeout()) ); - -} - -/*! - Destructor - */ -MobCntIconManager::~MobCntIconManager() -{ - cancel(); - mImageCache.clear(); - delete mTimer; -} - -/*! -Get the icon for the requested avatarPath or send a new request to the thumbnailmanager if it doesn't exist yet -*/ -QIcon MobCntIconManager::contactIcon(const QString &avatarPath, int index) -{ - QIcon icon; - if ( mImageCache.contains(avatarPath) ) - { - icon = mImageCache.value(avatarPath); - qDebug() << "MobCntIconManager::contactIcon:: image was cached"; - } - else - { - mTimer->stop(); - mTimer->start(KContactFetchTimer1); - mQueueCount++; - mRequestQueue.enqueue(qMakePair(avatarPath, index)); - if( mQueueCount > KMaxQueueSize ) - { - mRequestQueue.dequeue(); - mQueueCount--; - } - } - return icon; -} - -/*! -Cancel all requests -*/ -void MobCntIconManager::cancel() -{ - if (!mTnmReqMap.empty()) - { - QMapIterator iter(mTnmReqMap); - while (iter.hasNext()) - { - iter.next(); - bool result = mThumbnailManager->cancelRequest(iter.key()); - } - } - mTnmReqMap.clear(); - mRequestQueue.clear(); - mQueueCount = 0; -} - -/*! -Called when thumbnailmanager finishes creating a thumbnail, emits a signal for MobCntModel to update icon for a contact -*/ -void MobCntIconManager::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) -{ - qDebug() << "MobCntIconManager::thumbnailReady:: error is " << error; - - // Find the index - if (mTnmReqMap.contains(id)) - { - QString avatarPath = mTnmReqMap[id]; - mTnmReqMap.remove(id); - if ( error == 0 ) - { - int *clientData = (int *)data; - int index = *clientData; - qDebug() << "MobCntIconManager::thumbnailReady:: data is " << index; - QIcon icon(pixmap); - mImageCache.insert(avatarPath, icon); - emit contactIconReady(index); - qDebug() << "MobCntIconManager::thumbnailReady - signal emitted"; - if (!mRequestQueue.isEmpty()) - { - mTimer->start(KContactFetchTimer2); - } - - delete clientData; - - } else { - thumbnailLoad(); - } - } -} - -void MobCntIconManager::thumbnailLoad() -{ - mTimer->stop(); - if (!mRequestQueue.isEmpty()) - { - mQueueCount--; - QPair req = mRequestQueue.dequeue(); - QString avatarPath = req.first; - int index = req.second; - int *clientData = new int(index); - int reqId = mThumbnailManager->getThumbnail(avatarPath, clientData, 0); - mTnmReqMap.insert(reqId, avatarPath); - } - -} - -void MobCntIconManager::timerTimeout() -{ - thumbnailLoad(); -} - - diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/src/mobcntmodel.cpp --- a/phonebookengines/mobcntmodel/src/mobcntmodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/src/mobcntmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -16,7 +16,7 @@ */ #include "mobcntmodel_p.h" #include "mobcntmodel.h" -#include "mobcnticonmanager.h" +#include "cntcache.h" #include #include @@ -36,18 +36,16 @@ const QList& contactSortOrders, bool showMyCard, QObject *parent) - : QAbstractListModel(parent), - mIconManager(0) + : QAbstractListModel(parent) { - mIconManager = new MobCntIconManager(); - connect(mIconManager, SIGNAL(contactIconReady(int)), this, SLOT(updateContactIcon(int))); - mDefaultIcon = HbIcon("qtg_large_avatar"); mDefaultMyCardIcon = HbIcon("qtg_large_mycard"); d = new MobCntModelData(contactFilter, contactSortOrders, showMyCard); d->m_contactManager = new QContactManager; d->ownedContactManager = true; + d->m_cache = CntCache::instance(); + connect(d->m_cache, SIGNAL(contactInfoUpdated(QContactLocalId)), this, SLOT(handleContactInfoUpdated(QContactLocalId))); d->mMyCardId = d->m_contactManager->selfContactId(); if (doConstruct() != QContactManager::NoError) { throw("exception"); @@ -66,17 +64,15 @@ const QList& contactSortOrders, bool showMyCard, QObject *parent) - : QAbstractListModel(parent), - mIconManager(0) + : QAbstractListModel(parent) { - mIconManager = new MobCntIconManager(); - connect(mIconManager, SIGNAL(contactIconReady(int)), this, SLOT(updateContactIcon(int))); - mDefaultIcon = HbIcon("qtg_large_avatar"); mDefaultMyCardIcon = HbIcon("qtg_large_mycard"); d = new MobCntModelData(contactFilter, contactSortOrders, showMyCard); d->m_contactManager = manager; + d->m_cache = CntCache::instance(); + connect(d->m_cache, SIGNAL(contactInfoUpdated(QContactLocalId)), this, SLOT(handleContactInfoUpdated(QContactLocalId))); d->mMyCardId = d->m_contactManager->selfContactId(); if (doConstruct() != QContactManager::NoError) { throw("exception"); @@ -85,7 +81,6 @@ MobCntModel::~MobCntModel() { - delete mIconManager; } /*! @@ -103,27 +98,17 @@ // check that row is ok if (!validRowId(row)) { // invalid row - return QVariant(); - } + return QVariant(); + } // update current contact if needed if (row != d->currentRow ) { if (d->contactIds[row] == dummyMyCardId) { - // row contains dummy MyCard, so create dummy QContact - d->currentContact = QContact(); + // row contains dummy MyCard, so create dummy CntContactInfo + d->currentContact = CntContactInfo(); } else { - // define fields we are interested in - QStringList definitionRestrictions; - definitionRestrictions.append(QContactName::DefinitionName); - definitionRestrictions.append(QContactAvatar::DefinitionName); - definitionRestrictions.append(QContactPhoneNumber::DefinitionName); - definitionRestrictions.append(QContactOrganization::DefinitionName); - QContactFetchHint restrictions; - restrictions.setDetailDefinitionsHint(definitionRestrictions); - restrictions.setOptimizationHints(QContactFetchHint::NoRelationships); - - d->currentContact = d->m_contactManager->contact(d->contactIds[row], restrictions); + d->currentContact = d->m_cache->fetchContactInfo(row, d->contactIds); } d->currentRow = row; } @@ -132,48 +117,42 @@ return dataForDisplayRole(row); } else if (role == Hb::IndexFeedbackRole) { - return dataForDisplayRole(row).toStringList().at(0).toUpper(); + if (row == 0 && (d->mMyCardId == d->contactIds[0] || dummyMyCardId == d->contactIds[0])) { + // do not include MyCard in index feedback + return QVariant(); + } + else { + return dataForDisplayRole(row).toStringList().at(0).toUpper(); + } + } + else if (role == Qt::BackgroundRole) { + if (d->mMyCardId == d->contactIds[row] || dummyMyCardId == d->contactIds[row]) { + return HbFrameBackground("qtg_fr_list_parent_normal", HbFrameDrawer::NinePieces); + } } - else if (role == Qt::BackgroundRole) { - if (d->mMyCardId == d->contactIds[row] || - dummyMyCardId == d->contactIds[row]) { - return HbFrameBackground("qtg_fr_list_parent_normal", HbFrameDrawer::NinePieces); - } - } - else if (role == Qt::DecorationRole) { - QContactAvatar contactAvatar = d->currentContact.detail(); - QList icons; - - if(!contactAvatar.imageUrl().isEmpty()) { - QIcon icon = mIconManager->contactIcon(contactAvatar.imageUrl().toString(), row); - if (icon.isNull()) { - if (d->mMyCardId == d->contactIds[row] || - dummyMyCardId == d->contactIds[row]) { - icons.append(mDefaultMyCardIcon); - } - else { - icons.append(mDefaultIcon); - } - } - else { - icons.append(icon); - } - } - else { - if (d->mMyCardId == d->contactIds[row] || - dummyMyCardId == d->contactIds[row]) { - icons.append(mDefaultMyCardIcon); - } - else { - icons.append(mDefaultIcon); - } - - } - - return QVariant(icons); - } + else if (role == Qt::DecorationRole) { + QList icons; + HbIcon avatar = d->currentContact.icon1(); + HbIcon statusIcon = d->currentContact.icon2(); + + if (!avatar.isNull()) { + icons.append(avatar); + } + else if (d->mMyCardId == d->contactIds[row] || dummyMyCardId == d->contactIds[row]) { + icons.append(mDefaultMyCardIcon); + } + else { + icons.append(mDefaultIcon); + } - return QVariant(); + if (!statusIcon.isNull()) { + icons.append(statusIcon); + } + + return icons; + } + + return QVariant(); } /*! @@ -184,7 +163,7 @@ */ int MobCntModel::rowCount(const QModelIndex& /*parent*/) const { - return d->contactIds.count(); + return d->contactIds.count(); } /*! @@ -327,8 +306,6 @@ connect(d->m_contactManager, SIGNAL(contactsAdded(const QList&)), this, SLOT(handleAdded(const QList&))); connect(d->m_contactManager, SIGNAL(contactsChanged(const QList&)), this, SLOT(handleChanged(const QList&))); connect(d->m_contactManager, SIGNAL(contactsRemoved(const QList&)), this, SLOT(handleRemoved(const QList&))); - connect(d->m_contactManager, SIGNAL(relationshipsAdded(const QList&)), this, SLOT(handleAdded(const QList&))); - connect(d->m_contactManager, SIGNAL(relationshipsRemoved(const QList&)), this, SLOT(handleRemoved(const QList&))); connect(d->m_contactManager, SIGNAL(selfContactIdChanged(const QContactLocalId&, const QContactLocalId&)), this, SLOT(handleMyCardChanged(const QContactLocalId&, const QContactLocalId&))); return error; @@ -343,7 +320,6 @@ { int error(QContactManager::NoError); - // Get a list of all contact IDs in the database. updateContactIdsArray(); @@ -359,6 +335,7 @@ { d->contactIds = d->m_contactManager->contactIds(d->filter, d->sortOrders); + //find MyCard contact and move it to the first position QContactLocalId myCardId = d->mMyCardId; if (myCardId > 0) { @@ -427,39 +404,38 @@ { QStringList list; QString name; - QString number; + QString infoText; + bool isSelfContact = false; bool isNonEmptySelfContact = false; - bool isSelfContact = false; QContactLocalId id = d->contactIds[row]; - if (d->mMyCardId == id || - dummyMyCardId == id) { + if (d->mMyCardId == id || dummyMyCardId == id) { isSelfContact = true; - if (d->currentContact.details().count() <= 4) { - //empty card + if (d->currentContact.id() == -1) { + // empty card name = hbTrId("txt_phob_dblist_mycard"); - number = hbTrId("txt_phob_dblist_mycard_val_create_my_identity"); + infoText = hbTrId("txt_phob_dblist_mycard_val_create_my_identity"); } else { isNonEmptySelfContact = true; } } + if (!isSelfContact || isNonEmptySelfContact) { - - name = d->currentContact.displayLabel(); - - QContactPhoneNumber phoneNumber = d->currentContact.detail(); - number = phoneNumber.number(); + name = d->currentContact.name(); + if (name.isEmpty()) { + name = hbTrId("txt_phob_list_unnamed"); + } + infoText = d->currentContact.text(); } + list << name; + if (!isNonEmptySelfContact) { - list << name << number; - } - else { - list << name; + list << infoText; } - return QVariant(list); + return list; } /*! @@ -469,16 +445,43 @@ */ void MobCntModel::handleAdded(const QList& contactIds) { + //if contacts are added already, no need to do anything + bool newContacts = false; + for (int k = 0; k < contactIds.count() && !newContacts; k++) { + if(!d->contactIds.contains(contactIds.at(k))) { + newContacts = true; + } + } + if (!newContacts) { + return; + } + //invalidate cached contact - d->currentRow = -1; - + d->currentRow = -1; + + QList oldIdList = d->contactIds; updateContactIdsArray(); - QList< QList > indexSequences = findIndexes(contactIds); - - for (int i = (indexSequences.count() - 1);i >= 0; i--) - { - beginInsertRows(QModelIndex(), indexSequences.at(i).first(), indexSequences.at(i).last()); - endInsertRows(); + + //Find all new contacts (=rows) + QList newRows; + for(int i = 0; i < d->contactIds.count(); i++) { + if (!oldIdList.contains(d->contactIds.at(i))) { + newRows.append(i); + } + } + + // only 1 (or no) contact is added, it can be handled by beginInsertRows() + // and endInsertRows() + if (newRows.count() <= 1) { + for(int j = 0; j < newRows.count(); j++) { + beginInsertRows(QModelIndex(), newRows.at(j), newRows.at(j)); + endInsertRows(); + } + } + else { + beginResetModel(); + reset(); + endResetModel(); } } @@ -510,35 +513,62 @@ */ void MobCntModel::handleRemoved(const QList& contactIds) { - QList< QList > indexSequences = findIndexes(contactIds); - + bool removeContacts = false; + QList idList = d->contactIds; + for (int k = 0; k < contactIds.count() && !removeContacts; k++) { + if(idList.contains(contactIds.at(k))) { + removeContacts = true; + } + } + if (!removeContacts) { + return; + } + + //Find contacts to remove (=rows) + QList removeRows; + for(int i = 0; i < contactIds.count(); i++) { + if (idList.contains(contactIds.at(i))) { + removeRows.append(rowId(contactIds.at(i))); + } + } + // invalidate cached contact d->currentRow = -1; - // if myCard has been removed, set myCard id to zero - if (contactIds.contains(d->mMyCardId)) + + bool removeMyCard(false); + int myCardRow; + if (contactIds.contains(d->mMyCardId)) { + removeMyCard = true; + myCardRow = rowId(d->mMyCardId); d->mMyCardId = 0; - - for (int i = (indexSequences.count() - 1);i >= 0; i--) - { - if (indexSequences.at(i).first() == 0 && d->showMyCard) { - // handle removed for MyCard - d->mMyCardId = 0; + } + + int removeRowsCount=removeRows.count(); + // no of rows + for(int j = 0; j < removeRows.count(); j++) { + if (removeMyCard + && removeRows.at(j) == myCardRow + && d->showMyCard) { QModelIndex index = createIndex(0, 0); emit dataChanged(index, index); - - // handle removed for other contacts deleted besides myCard - if (indexSequences.at(i).count() > 1) { - beginRemoveRows(QModelIndex(), indexSequences.at(i).first() + 1, indexSequences.at(i).last()); - endRemoveRows(); - } + removeRowsCount--; } - else - { - beginRemoveRows(QModelIndex(), indexSequences.at(i).first(), indexSequences.at(i).last()); + else { + beginRemoveRows(QModelIndex(), removeRows.at(j), removeRows.at(j)); endRemoveRows(); } } updateContactIdsArray(); + + // check row count in new list + // if there is a mismatch, probable late events. reset model + QList updatedIdList = d->contactIds; + int rowsRemoved = idList.count() - updatedIdList.count(); + if (rowsRemoved != removeRowsCount) { + beginResetModel(); + reset(); + endResetModel(); + } } /*! @@ -547,7 +577,7 @@ * \param oldId Id of the old MyCard. * \param newId Id of the new MyCard. */ -void MobCntModel::handleMyCardChanged(const QContactLocalId& /*oldId*/, const QContactLocalId& newId) +void MobCntModel::handleMyCardChanged(const QContactLocalId& oldId, const QContactLocalId& newId) { int row = rowId(newId); @@ -555,15 +585,20 @@ d->currentRow = -1; d->mMyCardId = newId; - updateContactIdsArray(); - // if the new mycard was taken from an existing contact, // notify views that that row was removed if (row > 0) { beginRemoveRows(QModelIndex(), row, row); endRemoveRows(); } - + updateContactIdsArray(); + + // if old mycard is not 0, it means it probably appears in the list + if (oldId > 0 && rowId(oldId) > 0) { + beginInsertRows(QModelIndex(), rowId(oldId), rowId(oldId)); + endInsertRows(); + } + // notify views that mycard was updated QModelIndex index = createIndex(rowId(newId), 0); emit dataChanged(index, index); @@ -607,12 +642,16 @@ } /*! -* Update the icon for the contact with the given index (row) +* Notify views that info for a contact has become +* available or has changed. * -* \param index of the contact +* \param contactId the id of the contact */ -void MobCntModel::updateContactIcon(int index) +void MobCntModel::handleContactInfoUpdated(QContactLocalId contactId) { - QModelIndex modelIndex = createIndex(index, 0); - emit dataChanged(modelIndex, modelIndex); + QModelIndex index = createIndex(rowId(contactId), 0); + if (index.row() == d->currentRow) { + d->currentRow = -1; + } + emit dataChanged(index, index); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/inc/ut_mobcnticonmanager.h --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/inc/ut_mobcnticonmanager.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +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 - -class MobCntIconManager; - -class TestMobCntIconManager: public QObject -{ - Q_OBJECT - -private slots: - void init(); - void cleanup(); - void initTestCase(); - void cleanupTestCase(); - void testNonExistingIcon(); - void testOneExistingIcon(); - void testCancel(); - void testMultipleExistingIcon(); - -private: - - MobCntIconManager* mIconMgr; // SUT - QIcon mIcon; - -}; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/inc/ut_mobcntmodel.h --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/inc/ut_mobcntmodel.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/inc/ut_mobcntmodel.h Thu May 27 12:45:19 2010 +0300 @@ -26,11 +26,15 @@ QTM_USE_NAMESPACE class MobCntModel; +class ModelListener; class TestMobCntModel : public QObject { Q_OBJECT +private: + void contactReady(int start, int end); + private slots: void initTestCase(); void create(); @@ -47,7 +51,6 @@ void rowId(); void dataForDisplayRole(); - void updateContactIcon(); void handleAdded(); void handleChanged(); void handleRemoved(); @@ -58,4 +61,22 @@ private: QContactManager *mManager; MobCntModel *mCntModel; + ModelListener *mModelListener; + bool mDataReady; + +friend class ModelListener; }; + +class ModelListener : public QObject +{ + Q_OBJECT + +public: + ModelListener(TestMobCntModel* parent); + +private slots: + void onDataChanged(QModelIndex start, QModelIndex end); + +private: + TestMobCntModel* mParent; +}; diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/main.cpp --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/main.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/main.cpp Thu May 27 12:45:19 2010 +0300 @@ -17,7 +17,6 @@ #include "testrunner.h" -#include "ut_mobcnticonmanager.h" #include "ut_mobcntmodel.h" #include @@ -35,9 +34,6 @@ TestRunner testRunner("ut_mobcntmodel"); - TestMobCntIconManager ut_MobCntIconManager; - testRunner.runTests(ut_MobCntIconManager); - TestMobCntModel ut_MobCntModel; testRunner.runTests(ut_MobCntModel); diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcnticonmanager.cpp --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcnticonmanager.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +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 //KNullDesC -#include "mobcnticonmanager.h" -#include "ut_mobcnticonmanager.h" - -const int WAIT_TIME1 = 500; -const int WAIT_TIME2 = 900; -const QString path1 = "c:\\data\\images\\image1.png"; -const QString path2 = "c:\\data\\images\\image2.png"; -const QString path3 = "e:\\images\\non.jpeg"; - -void TestMobCntIconManager::initTestCase() -{ - mIconMgr = new MobCntIconManager(); -} - -void TestMobCntIconManager::cleanupTestCase() -{ - delete mIconMgr; - mIconMgr = 0; -} - -void TestMobCntIconManager::init() -{ - initTestCase(); -} - -void TestMobCntIconManager::cleanup() -{ - cleanupTestCase(); -} - -void TestMobCntIconManager::testNonExistingIcon() -{ - QSignalSpy spy(mIconMgr, SIGNAL(contactIconReady(int))); - Q_ASSERT(spy.isValid()); - QCOMPARE( spy.count(), 0 ); - mIcon = mIconMgr->contactIcon(path3, 0); - Q_ASSERT(mIcon.isNull()); - QTest::qWait( WAIT_TIME1 ); - QCOMPARE(spy.count(), 0); -} - -void TestMobCntIconManager::testOneExistingIcon() -{ - QSignalSpy spy(mIconMgr, SIGNAL(contactIconReady(int))); - Q_ASSERT(spy.isValid()); - QCOMPARE( spy.count(), 0 ); - mIcon = mIconMgr->contactIcon(path1, 10); - Q_ASSERT(mIcon.isNull()); - QTest::qWait( WAIT_TIME1 ); - QCOMPARE(spy.count(), 1); - QList arguments = spy.takeFirst(); - QVERIFY(arguments.at(0).toInt() == 10); - mIcon = mIconMgr->contactIcon(path1, 10); - Q_ASSERT(!mIcon.isNull()); -} - -void TestMobCntIconManager::testCancel() -{ - QSignalSpy spy(mIconMgr, SIGNAL(contactIconReady(int))); - Q_ASSERT(spy.isValid()); - QCOMPARE( spy.count(), 0 ); - mIcon = mIconMgr->contactIcon(path1, 10); - Q_ASSERT(mIcon.isNull()); - mIcon = mIconMgr->contactIcon(path2, 11); - Q_ASSERT(mIcon.isNull()); - mIcon = mIconMgr->contactIcon(path3, 0); - Q_ASSERT(mIcon.isNull()); - mIconMgr->thumbnailLoad(); - mIconMgr->cancel(); - QCOMPARE(spy.count(), 0); -} - -void TestMobCntIconManager::testMultipleExistingIcon() -{ - QSignalSpy spy(mIconMgr, SIGNAL(contactIconReady(int))); - Q_ASSERT(spy.isValid()); - QCOMPARE( spy.count(), 0 ); - QIcon icon1; - QIcon icon2; - icon1 = mIconMgr->contactIcon(path1, 10); - Q_ASSERT(icon1.isNull()); - icon2 = mIconMgr->contactIcon(path2, 11); - Q_ASSERT(icon2.isNull()); - QTest::qWait( WAIT_TIME2); - qDebug()< arguments = spy.takeFirst(); - qDebug()<< arguments.at(0).toInt(); - QVERIFY(arguments.at(0).toInt() == 10); - arguments = spy.takeLast(); - qDebug()<< arguments.at(0).toInt(); - QVERIFY(arguments.at(0).toInt() == 11 ); - mIcon = mIconMgr->contactIcon(path1, 10); - Q_ASSERT(!mIcon.isNull()); - mIcon = mIcon = mIconMgr->contactIcon(path2, 11); - Q_ASSERT(!mIcon.isNull()); -} - diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcntmodel.cpp --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcntmodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcntmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -20,7 +20,7 @@ #include "mobcntmodel_p.h" #include -#include +#include void TestMobCntModel::initTestCase() { @@ -31,12 +31,18 @@ mManager->removeContacts(ids, &errorMapInit); } +void TestMobCntModel::contactReady(int startRow, int endRow) +{ + QVERIFY(startRow == endRow); + mDataReady = true; +} + void TestMobCntModel::create() { mCntModel = new MobCntModel(); QVERIFY(mCntModel != 0); QVERIFY(mCntModel->rowCount() == 1); - QVERIFY(mCntModel->mIconManager); + QVERIFY(mCntModel->d->m_cache); QVERIFY(mCntModel->d->ownedContactManager); QVERIFY(mCntModel->d->m_contactManager != 0); @@ -47,13 +53,16 @@ QVERIFY(mCntModel != 0); QCOMPARE(mCntModel->rowCount(),1); QVERIFY(mCntModel->rowCount() == 1); - QVERIFY(mCntModel->mIconManager); + QVERIFY(mCntModel->d->m_cache); QVERIFY(!mCntModel->d->ownedContactManager); QVERIFY(mCntModel->d->m_contactManager != 0); } void TestMobCntModel::data() { + mModelListener = new ModelListener(this); + mDataReady = false; + //create and save contact QContact c; QContactName name; @@ -91,8 +100,19 @@ displayContent = ret.toStringList(); QVERIFY(displayContent.count() == 2); QVERIFY(displayContent.at(0) == "firstname lastname"); + // second string is only an empty placeholder, e.g. " ", until cache has fetched the value + + // wait for cache to signal that all contact info is ready + while (!mDataReady) { QTest::qWait(200); QApplication::processEvents(); } + mDataReady = false; + ret = mCntModel->data(modelIndex, Qt::DisplayRole); + + QVERIFY(ret.type() == QVariant::StringList); + displayContent = ret.toStringList(); + QVERIFY(displayContent.count() == 2); + QVERIFY(displayContent.at(0) == "firstname lastname"); QVERIFY(displayContent.at(1) == "1234567"); - + // check backgroundrole ret = mCntModel->data(modelIndex, Qt::BackgroundRole); QVERIFY(ret.isNull()); @@ -100,10 +120,9 @@ //check decoration role ret = mCntModel->data(modelIndex, Qt::DecorationRole); QVERIFY(ret.type() == QVariant::List); - + // add empty avatar and check decoration QContactAvatar avatar; - avatar.setSubType(QContactAvatar::SubTypeImage); c.saveDetail(&avatar); QVERIFY(mManager->saveContact(&c)); QTest::qWait(1000); @@ -111,12 +130,17 @@ QVERIFY(ret.type() == QVariant::List); // add data to the avatar and check decoration - avatar.setAvatar("dummyimagepath"); + avatar.setImageUrl(QUrl("dummyimagepath")); c.saveDetail(&avatar); QVERIFY(mManager->saveContact(&c)); QTest::qWait(1000); modelIndex = mCntModel->indexOfContact(c); ret = mCntModel->data(modelIndex, Qt::DecorationRole); + + // wait for cache to signal that all contact info is ready + while (!mDataReady) { QTest::qWait(200); QApplication::processEvents(); } + mDataReady = false; + ret = mCntModel->data(modelIndex, Qt::DecorationRole); QVERIFY(ret.type() == QVariant::List); // check MyCard info from the model @@ -140,16 +164,19 @@ ret = mCntModel->data(modelIndex, Qt::DisplayRole); QVERIFY(ret.type() == QVariant::StringList); displayContent = ret.toStringList(); - QVERIFY(displayContent.count() == 2);// "My card" ; "Create my identity" + QVERIFY(displayContent.count() == 1); // "Unnamed" // add some content to MyCard myCard.saveDetail(&number); QVERIFY(mManager->saveContact(&myCard)); QTest::qWait(1000); ret = mCntModel->data(modelIndex, Qt::DisplayRole); + // wait for cache + QTest::qWait(1000); + ret = mCntModel->data(modelIndex, Qt::DisplayRole); QVERIFY(ret.type() == QVariant::StringList); displayContent = ret.toStringList(); - QVERIFY(displayContent.contains(myCard.displayLabel())); + QVERIFY(displayContent.contains(hbTrId("txt_phob_list_unnamed"))); } void TestMobCntModel::rowCount() @@ -212,7 +239,8 @@ void TestMobCntModel::setFilterAndSortOrder() { QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -260,7 +288,8 @@ mCntModel = new MobCntModel(mManager); QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -301,7 +330,8 @@ void TestMobCntModel::rowId() { QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -321,7 +351,8 @@ void TestMobCntModel::dataForDisplayRole() { QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -339,32 +370,11 @@ QVERIFY(var.type() == QVariant::StringList); } -void TestMobCntModel::updateContactIcon() -{ - QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); - QTest::qWait(1000); - - QContact c; - QContactName name; - name.setFirstName("firstname"); - name.setLastName("lastname"); - c.saveDetail(&name); - QVERIFY(mManager->saveContact(&c)); - - int row = mCntModel->rowId(c.localId()); - - QSignalSpy spy(mCntModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))); - - mCntModel->updateContactIcon(row); - QCOMPARE(spy.count(), 1); -} - void TestMobCntModel::handleAdded() { QList ids = mManager->contactIds(); - QMap errorMapHandleAdded; - mManager->removeContacts(ids,&errorMapHandleAdded); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QSignalSpy spy(mCntModel, SIGNAL(rowsAboutToBeInserted(const QModelIndex&, int, int))); @@ -382,8 +392,8 @@ void TestMobCntModel::handleChanged() { QList ids = mManager->contactIds(); - QMap errorMapHandleChanged; - mManager->removeContacts(ids,&errorMapHandleChanged); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -407,8 +417,8 @@ QSignalSpy spy(mCntModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int))); QList ids = mManager->contactIds(); - QMap errorMapHandle; - mManager->removeContacts(ids,&errorMapHandle); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QCOMPARE(spy.count(), 1); @@ -417,7 +427,8 @@ void TestMobCntModel::handleMyCardChanged() { QList ids = mManager->contactIds(); - mManager->removeContacts(&ids); + QMap errorMap; + mManager->removeContacts(ids,&errorMap); QTest::qWait(1000); QContact c; @@ -445,5 +456,19 @@ mManager->removeContacts(ids, &errorMap); delete mManager; mManager = 0; + delete mModelListener; + mModelListener = 0; } + +ModelListener::ModelListener(TestMobCntModel* parent) + : mParent(parent) +{ + connect(mParent->mCntModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(onDataChanged(QModelIndex,QModelIndex))); +} + +void ModelListener::onDataChanged(QModelIndex start, QModelIndex end) +{ + mParent->contactReady(start.row(), end.row()); +} + diff -r 2a11b5b00470 -r fd64c38c277d phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/ut_mobcntmodel.pro --- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/ut_mobcntmodel.pro Fri May 14 15:42:23 2010 +0300 +++ b/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/ut_mobcntmodel.pro Thu May 27 12:45:19 2010 +0300 @@ -37,19 +37,22 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE HEADERS += inc/testrunner.h -HEADERS += inc/ut_mobcnticonmanager.h HEADERS += inc/ut_mobcntmodel.h HEADERS += ../../inc/mobcntmodelglobal.h \ ../../inc/mobcntmodel.h \ ../../inc/mobcntmodel_p.h \ - ../../inc/mobcnticonmanager.h + ../../inc/cntcache.h \ + ../../inc/cntcache_p.h \ + ../../inc/cntinfoprovider.h \ + ../../inc/cntdefaultinfoprovider.h SOURCES += src/testrunner.cpp SOURCES += src/main.cpp -SOURCES += src/ut_mobcnticonmanager.cpp SOURCES += src/ut_mobcntmodel.cpp -SOURCES += ../../src/mobcntmodel.cpp \ - ../../src/mobcnticonmanager.cpp +SOURCES += ../../src/mobcntmodel.cpp +SOURCES += ../../src/cntcache.cpp +SOURCES += ../../src/cntcache_p.cpp +SOURCES += ../../src/cntdefaultinfoprovider.cpp RESOURCES += ../../resources/mobcntmodel.qrc diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/bwins/pbkcommonuiu.def --- a/phonebookui/bwins/pbkcommonuiu.def Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/bwins/pbkcommonuiu.def Thu May 27 12:45:19 2010 +0300 @@ -7,9 +7,9 @@ ?setViewNavigator@CntDefaultViewManager@@QAEXPAVCntViewNavigator@@@Z @ 6 NONAME ; void CntDefaultViewManager::setViewNavigator(class CntViewNavigator *) ??0CntDefaultViewFactory@@QAE@XZ @ 7 NONAME ; CntDefaultViewFactory::CntDefaultViewFactory(void) ??1CntMainWindow@@UAE@XZ @ 8 NONAME ; CntMainWindow::~CntMainWindow(void) - ?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 * *) - ?viewActivated@CntContactCardView@@IAEXVQContact@QtMobility@@VQContactDetail@3@@Z @ 11 NONAME ; void CntContactCardView::viewActivated(class QtMobility::QContact, class QtMobility::QContactDetail) + ?viewActivated@CntContactCardView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 9 NONAME ; void CntContactCardView::viewActivated(class CntAbstractViewManager *, class QMap) + ?view@CntEditView@@UBEPAVHbView@@XZ @ 10 NONAME ; class HbView * CntEditView::view(void) const + ?qt_metacall@CntBaseSelectionView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 11 NONAME ; int CntBaseSelectionView::qt_metacall(enum QMetaObject::Call, int, void * *) ?closeView@CntBaseSelectionView@@AAEXXZ @ 12 NONAME ; void CntBaseSelectionView::closeView(void) ?isDefault@CntEditView@@UBE_NXZ @ 13 NONAME ; bool CntEditView::isDefault(void) const ??_ECntViewNavigator@@UAE@I@Z @ 14 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int) diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/cnthistorymodel/src/cnthistorymodel.cpp --- a/phonebookui/cnthistorymodel/src/cnthistorymodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/cnthistorymodel/src/cnthistorymodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -416,12 +416,15 @@ HItemPointer item = d->m_logsMap.value( i ); int index = d->m_List.indexOf( item ); if ( index > -1 ) { - d->m_List.removeAt( index ); d->m_logsMap.remove( i ); indices.append( index ); } } + foreach(int i, indices) { + d->m_List.removeAt( i ); + } + // Remove list items in batches if ( !indices.isEmpty() ) { QList< QList > batches = findIndices(indices); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.cpp --- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -202,9 +202,9 @@ QModelIndex modelIndex = model->index(0, 0); QVERIFY(modelIndex.isValid()); - // Branded icon path - //QVariant var = modelIndex.data(Qt::DecorationRole); - //QVERIFY(var.type() == QVariant::String); + // HbIcon + QVariant var = modelIndex.data(Qt::DecorationRole); + QVERIFY(var.isValid()); // FlagsRole var = modelIndex.data(CntHistoryModel::FlagsRole); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/conf/contacts.confml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/conf/contacts.confml Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,22 @@ + + + + Contacts app ui settings + + Displays name label order in names lists + + + + + 0 + + + + + true + + + \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/conf/contacts_2002FF54.crml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/conf/contacts_2002FF54.crml Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/eabi/pbkcommonuiu.def --- a/phonebookui/eabi/pbkcommonuiu.def Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/eabi/pbkcommonuiu.def Thu May 27 12:45:19 2010 +0300 @@ -43,7 +43,7 @@ _ZN18CntContactCardView11backPressedEv @ 42 NONAME _ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 43 NONAME _ZN18CntContactCardView11qt_metacastEPKc @ 44 NONAME - _ZN18CntContactCardView13viewActivatedEN10QtMobility8QContactENS0_14QContactDetailE @ 45 NONAME + _ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 45 NONAME _ZN18CntContactCardView16staticMetaObjectE @ 46 NONAME DATA 16 _ZN18CntContactCardView19getStaticMetaObjectEv @ 47 NONAME _ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 48 NONAME diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntactionmenubuilder.h --- a/phonebookui/pbkcommonui/inc/cntactionmenubuilder.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntactionmenubuilder.h Thu May 27 12:45:19 2010 +0300 @@ -37,7 +37,7 @@ ~CntActionMenuBuilder(); public: - HbMenu* actionMenu( QContact& aContact ); + HbMenu* actionMenu( QContact& aContact, QContactLocalId myCardId ); public: HbMenu* buildActionMenu( QContact& aContact ); @@ -65,6 +65,8 @@ void createCallAction( HbMenu& aMenu, QContact& aContact ); void createMessageAction( HbMenu& aMenu, QContact& aContact ); void createEmailAction( HbMenu& aMenu, QContact& aContact ); + bool isSupportedDetails( const QString &actionName, const QContact &contact ); + private: QContactLocalId iMyCardId; QContact* mContact; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h --- a/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h Thu May 27 12:45:19 2010 +0300 @@ -55,11 +55,9 @@ int rowCount(const QModelIndex &parent = QModelIndex()) const; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); void removeGroup(int localId); - bool isFavoriteGroupCreated(); - int favoriteGroupId(); bool isExtensionGroup(const QModelIndex &index); CntViewParameters extensionGroupActivated(int row); - CntViewParameters extensionGroupLongPressed(int row, const QPointF& coords); + void extensionGroupLongPressed(int row, const QPointF& coords, CntExtensionGroupCallback* interface); #ifdef PBK_UNIT_TEST public: diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcollectionview.h --- a/phonebookui/pbkcommonui/inc/cntcollectionview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcollectionview.h Thu May 27 12:45:19 2010 +0300 @@ -23,6 +23,7 @@ #include #include +#include class HbAction; class HbView; @@ -35,7 +36,7 @@ QTM_USE_NAMESPACE -class CntCollectionView : public QObject, public CntAbstractView +class CntCollectionView : public QObject, public CntAbstractView, public CntExtensionGroupCallback { Q_OBJECT friend class TestCntCollectionView; @@ -50,6 +51,9 @@ bool isDefault() const { return false; } HbView* view() const { return mView; } int viewId() const { return collectionView; } + +public: // From CntExtensionGroupCallback + void openView(CntViewParameters& viewParams); private slots: void showPreviousView(); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcarddatacontainer.h --- a/phonebookui/pbkcommonui/inc/cntcontactcarddatacontainer.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcarddatacontainer.h Thu May 27 12:45:19 2010 +0300 @@ -30,7 +30,7 @@ Q_OBJECT public: - CntContactCardDataContainer(QContact* contact, QObject *parent = 0); + CntContactCardDataContainer(QContact* contact, QObject *parent = 0, bool myCard = false); virtual ~CntContactCardDataContainer(); public: @@ -43,13 +43,14 @@ #else private: #endif - void initializeActionsData(); + void initializeActionsData(bool myCard); void initializeGroupData(); void initializeDetailsData(); QList actionDetails(const QString &actionName, const QContact &contact); bool supportsDetail(const QString &actionName, const QContactDetail &contactDetail); void addSeparator(int index); void sortDataItems(); + int getPosition(const QString& aId, const QString& aContext, bool dynamicAction = false); #ifdef PBK_UNIT_TEST public: diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcarddataitem.h --- a/phonebookui/pbkcommonui/inc/cntcontactcarddataitem.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcarddataitem.h Thu May 27 12:45:19 2010 +0300 @@ -30,6 +30,71 @@ Q_OBJECT public: + +enum CntContactCardPosition +{ + EInternalServices = 0, + ECallMobile = 100, + ECallMobileSendMessage, + ECallMobileHome, + ECallMobileHomeSendMessage, + ECallMobileWork, + ECallMobileWorkSendMessage, + ECallPhone, + ECallPhoneHome, + ECallPhoneWork, + ECallFax, + ECallFaxHome, + ECallFaxWork, + ECallPager, + ECallAssistant, + ECallCar, + EEmail, + EEmailHome, + EEmailWork, + EUrl, + EUrlHome, + EUrlWork, + ECallDynamic, + ECallDynamicHome, + ECallDynamicWork, + EEmailDynamic, + EEmailDynamicHome, + EEmailDynamicWork, + EUrlDynamic, + EUrlDynamicHome, + EUrlDynamicWork, + EInternetDynamic, + EInternetDynamicHome, + EInternetDynamicWork, + EAddressDynamic, + EAddressDynamicHome, + EAddressDynamicWork, + EDynamic, + EGenericDynamic, + ELastAction = 200, + ELastActionHome, + ELastActionWork, + EExternalServices = 250, + ESeparator = 300, + EInternetTelephone, + EInternetTelephoneHome, + EInternetTelephoneWork, + ESip, + EAddress, + EAddressHome, + EAddressWork, + ECompanyDetails, + EBirthday, + EAnniversary, + ERingtone, + ENote, + ESpouse, + EChildren, + EOther = 400 +}; + +public: CntContactCardDataItem(const QString& aTitle, int aPosition, bool aIsFocusable); virtual ~CntContactCardDataItem(); @@ -40,6 +105,8 @@ void setSecondaryIcon(HbIcon aSecondaryIcon); void setAction(const QString& aAction); void setContactDetail(QContactDetail aDetail); + void setActionDescriptor(const QContactActionDescriptor& aActionDescriptor); + void setLongPressText(const QString& aLongPressText); public: QString titleText() { return mTitle; } @@ -50,20 +117,24 @@ QContactDetail detail() { return mDetail; } Qt::TextElideMode elideMode() { return mValueTextElideMode; } bool isFocusable() { return mIsFocusable; } + QContactActionDescriptor actionDescriptor() { return mActionDescriptor; } + QString longPressText() { return mLongPressText; } int position() { return mPosition; } private: - HbIcon mIcon; - HbIcon mSecondaryIcon; - QString mTitle; - QString mValueText; - QString mAction; - QContactDetail mDetail; - Qt::TextElideMode mValueTextElideMode; - bool mIsFocusable; + HbIcon mIcon; + HbIcon mSecondaryIcon; + QString mTitle; + QString mValueText; + QString mAction; + QContactDetail mDetail; + Qt::TextElideMode mValueTextElideMode; + bool mIsFocusable; + QContactActionDescriptor mActionDescriptor; + QString mLongPressText; public: - int mPosition; + int mPosition; }; #endif /* CNTCONTACTCARDDATAITEM_H */ diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcarddetailitem.h --- a/phonebookui/pbkcommonui/inc/cntcontactcarddetailitem.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcarddetailitem.h Thu May 27 12:45:19 2010 +0300 @@ -25,10 +25,7 @@ class HbTextItem; class QGraphicsGridLayout; class HbFrameItem; -class HbTouchArea; class CntContactCardDataItem; -class QTapGesture; -class QTapAndHoldGesture; class CntContactCardDetailItem : public HbWidget { @@ -43,14 +40,7 @@ ~CntContactCardDetailItem(); protected: - //void mousePressEvent(QGraphicsSceneMouseEvent *event); - //void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - //void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void gestureEvent(QGestureEvent* event); - -private: - void tapTriggered(QTapGesture *gesture); - void tapAndHoldTriggered(QTapAndHoldGesture *gesture); public: void initGesture(); @@ -84,7 +74,6 @@ HbTextItem *mSecondLineText; HbFrameItem *mFrameItem; HbFrameItem *mFocusItem; - HbTouchArea *mTouchArea; bool mHasFocus; int mIndex; bool mIsFocusable; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcardheadingitem.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardheadingitem.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardheadingitem.h Thu May 27 12:45:19 2010 +0300 @@ -62,9 +62,11 @@ signals: void clicked(); void passLongPressed(const QPointF &point); + void passShortPressed(const QPointF &point); public slots: void processLongPress(const QPointF &point); + void processShortPress(const QPointF &point); protected: void gestureEvent(QGestureEvent* event); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcardview.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview.h Thu May 27 12:45:19 2010 +0300 @@ -43,7 +43,7 @@ signals: void backPressed(); - void viewActivated(QContact, QContactDetail); + void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); public: // From CntAbstractView void activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); @@ -58,7 +58,6 @@ Q_DECLARE_PRIVATE_D(d_ptr, CntContactCardView) Q_DISABLE_COPY(CntContactCardView) }; - #endif // CNTCONTACTCARDVIEW_H // EOF diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntcontactcardview_p.h --- a/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Thu May 27 12:45:19 2010 +0300 @@ -93,7 +93,7 @@ signals: void preferredUpdated(); void backPressed(); - void viewActivated(QContact, QContactDetail); + void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); protected: bool eventFilter(QObject *obj, QEvent *event); @@ -104,9 +104,7 @@ private: #endif void launchAction(QContact contact, QContactDetail detail, QString action); - //bool createVCard(QString& vCardPath); - bool isFavoriteGroupContact(); - bool isFavoriteGroupCreated(); + void launchDynamicAction(QContact contact, QContactDetail detail, QContactActionDescriptor actionDescriptor); #ifdef PBK_UNIT_TEST public: @@ -123,11 +121,11 @@ CntContactCardDataContainer *mDataContainer; CntContactCardHeadingItem *mHeadingItem; ThumbnailManager *mThumbnailManager; - QContact *mGroupContact; + //QContact *mGroupContact; QContactAvatar *mAvatar; - bool mIsGroupMember; + //bool mIsGroupMember; bool mIsHandlingMenu; - bool mIsPreviousImageEditorView; + //bool mIsPreviousImageEditorView; QMap mPreferredItems; int mFavoriteGroupId; CntDocumentLoader *mLoader; @@ -136,6 +134,7 @@ CntImageLabel *mImageLabel; XQServiceRequest *mHighwayService; HbIcon *mVCardIcon; + CntViewParameters mArgs; }; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cnteditview_p.h --- a/phonebookui/pbkcommonui/inc/cnteditview_p.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditview_p.h Thu May 27 12:45:19 2010 +0300 @@ -23,6 +23,7 @@ #include "cnteditview.h" #include "qtpbkglobal.h" #include +#include class CntAbstractViewManager; class CntEditViewListModel; @@ -46,7 +47,7 @@ QTM_END_NAMESPACE QTM_USE_NAMESPACE -class CntEditViewPrivate : public QObject +class CntEditViewPrivate : public QObject, public CntEditViewItemCallback { Q_OBJECT @@ -57,6 +58,10 @@ void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); void deactivate(); +public: // From CntEditViewItemCallback + void openView(CntViewParameters& viewParams); + void requestRefresh(); + signals: void contactUpdated(bool aSuccess); void contactRemoved(bool aSuccess); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cnteditviewdetailitem.h --- a/phonebookui/pbkcommonui/inc/cnteditviewdetailitem.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditviewdetailitem.h Thu May 27 12:45:19 2010 +0300 @@ -53,8 +53,8 @@ public:// From CntEditViewItem QVariant data(int role) const; - void activated(); - void longPressed(const QPointF &coords); + void activated(CntEditViewItemCallback* interface); + void longPressed(const QPointF &coords, CntEditViewItemCallback* interface); private: QStringList mTextList; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cnteditviewlistmodel.h --- a/phonebookui/pbkcommonui/inc/cnteditviewlistmodel.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnteditviewlistmodel.h Thu May 27 12:45:19 2010 +0300 @@ -63,8 +63,8 @@ ~CntEditViewSeparator(); QVariant data(int role) const; - void activated(); - void longPressed(const QPointF &coords); + void activated(CntEditViewItemCallback* interface); + void longPressed(const QPointF &coords, CntEditViewItemCallback* interface); }; class CntEditViewListModel : public QAbstractListModel @@ -83,7 +83,7 @@ CntEditViewItem* itemAt( const QModelIndex& aIndex ) const; void removeItem( CntEditViewItem* aItem, const QModelIndex& aIndex ); bool isEmptyItem( CntEditViewItem* aItem ); - void refreshExtensionItems( const QModelIndex& aIndex ); + void refreshExtensionItems(); void allInUseFields( CntViewIdList& aList ); private: diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h --- a/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Thu May 27 12:45:19 2010 +0300 @@ -44,6 +44,7 @@ bool isDefault() const { return false; } HbView* view() const { return mView; } int viewId() const { return FavoritesMemberView; } + void createModel(); public: CntFavoritesMemberView(); @@ -64,6 +65,7 @@ void openContact(const QModelIndex &index); void editContact(const QModelIndex &index); void removeFromFavorites(const QModelIndex &index); + void sendToHs(const QModelIndex &index); void showPreviousView(); #ifdef PBK_UNIT_TEST diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntfavourite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntfavourite.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CNTFAVOURITE_H_ +#define CNTFAVOURITE_H_ + +#include +#include + +QTM_BEGIN_NAMESPACE +class QContact; +class QContactManager; +QTM_END_NAMESPACE + +QTM_USE_NAMESPACE + +#define FavouriteGroupName "Favorites" + +class CntFavourite +{ +public: + static QContactLocalId createFavouriteGroup( QContactManager* aManager ); + static QContactLocalId favouriteGroupId( QContactManager* aManager ); + static bool isMemberOfFavouriteGroup( QContactManager* aManager, QContact* aContact ); + static void addContactToFavouriteGroup( QContactManager* aManager, QContactId& aId ); + static void removeContactFromFavouriteGroup( QContactManager* aManager, QContactId& aId ); +}; +#endif /* CNTFAVOURITE_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntfetchcontactsview.h --- a/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h Thu May 27 12:45:19 2010 +0300 @@ -57,7 +57,6 @@ private slots: void memberSelectionChanged(const QModelIndex &index); - void closeFind(); void setFilter(const QString &filterString); void handleKeypadOpen(); @@ -81,6 +80,9 @@ signals: void clicked(); + +private: + friend class TestCntFetchUtility; private: HbDialog* mPopup; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntgroupmemberview.h --- a/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Thu May 27 12:45:19 2010 +0300 @@ -75,7 +75,6 @@ void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); void handleMenu(HbAction* action); - void showContactView(const QModelIndex &index); void removeFromGroup(const QModelIndex &index); void editContact(const QModelIndex &index); @@ -83,10 +82,9 @@ void openImageEditor(); void drawImageMenu(const QPointF &aCoords); - void handleImageMenu(HbAction* action); + void createModel(); private: - void changeImage(); void removeImage(); private: @@ -110,7 +108,6 @@ HbDocumentLoader* mDocument; CntFetchContacts* mFetchView; QList mOriginalGroupMembers; - bool mIsPreviousImageEditorView; QContactAvatar* mAvatar; }; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cnthistoryview.h --- a/phonebookui/pbkcommonui/inc/cnthistoryview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnthistoryview.h Thu May 27 12:45:19 2010 +0300 @@ -73,6 +73,7 @@ HbAction* mBackKey; // not own QContact* mContact; // own HbAction* mClearHistory; // not own + CntViewParameters mArgs; }; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cnthistoryviewitem.h --- a/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Thu May 27 12:45:19 2010 +0300 @@ -54,11 +54,18 @@ bool getIncoming() const { return mIncoming; } bool isNewMessage() const { return mNewMessage; } +protected: + /* + * Overriden method to overwrite the default "pressed" effect + */ + void pressStateChanged(bool pressed, bool animate); + private: bool mIncoming; bool mNewMessage; HbFrameItem* mNewItem; + HbFrameItem* mFocusItem; }; #endif // CNTHISTORYVIEWITEM_H diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntimagelabel.h --- a/phonebookui/pbkcommonui/inc/cntimagelabel.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntimagelabel.h Thu May 27 12:45:19 2010 +0300 @@ -21,6 +21,8 @@ #include #include +class QGesture; + class CntImageLabel : public HbLabel { Q_OBJECT @@ -30,11 +32,11 @@ ~CntImageLabel(); protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void gestureEvent(QGestureEvent* event); signals: void iconClicked(); + void iconLongPressed(const QPointF&); }; #endif // CNTEDITVIEWHEADINGITEM_H diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntmycardview.h --- a/phonebookui/pbkcommonui/inc/cntmycardview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntmycardview.h Thu May 27 12:45:19 2010 +0300 @@ -60,6 +60,10 @@ void openMyCardSelectionView(); void handleMultiCardSelection(); void setOrientation(Qt::Orientation orientation); + +private: + + void removeFromGroup(const QContact* contact); private: QContact* mContact; // own diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntnamesview_p.h --- a/phonebookui/pbkcommonui/inc/cntnamesview_p.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntnamesview_p.h Thu May 27 12:45:19 2010 +0300 @@ -74,17 +74,25 @@ void showContactView( const QModelIndex& ); void showContactEditorView( QContact& aContact ); void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint); - + void showSettings(); + void executeAction( QContact& aContact, QString aAction ); void actionExecuted( CntAction* aAction ); void handleDeleteContact( HbAction* aAction ); void importSim(); - + + void handleContactAddition(const QList & aAddedList); + void handleContactRemoval(const QList & aRemovedList); + void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId); + public: bool isFinderVisible(); void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); void deactivate(); +private: + void disableDeleteAction(); + public: CntNamesView *q_ptr; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntsettingsview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/inc/cntsettingsview.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef _CNTSETTINGSVIEW_H__ +#define _CNTSETTINGSVIEW_H__ + +#include +#include +#include + +class HbAction; +class HbView; +class HbDataForm; +class HbDataFormModelItem; +class HbDocumentLoader; + +class CntSettingsModel : public HbDataFormModel +{ + Q_OBJECT + +public: + virtual ~CntSettingsModel(){} + virtual void saveSettings() = 0; + virtual void loadSettings() = 0; +}; + +class CntDefaultSettingsModel : public CntSettingsModel +{ + Q_OBJECT + +public: + CntDefaultSettingsModel(); + ~CntDefaultSettingsModel(); + +public: + void saveSettings(); + void loadSettings(); + +private: + HbDataFormModelItem* mOrder; +}; + +class CntSettingsView : public QObject, public CntAbstractView +{ + Q_OBJECT + +public: + CntSettingsView(); + ~CntSettingsView(); + +protected: // From CntAbstractView + void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ); + void deactivate(); + bool isDefault() const; + HbView* view() const; + int viewId() const; + +private slots: + void back(); + +private: + HbDocumentLoader* document(); + +private: + HbView* mView; + HbDocumentLoader* mDoc; + HbDataForm* mForm; + HbAction* mBack; + + CntAbstractViewManager* mViewMgr; + CntViewParameters mArgs; + + CntSettingsModel* mModel; + + friend class TestCntEditView; +}; +#endif + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/inc/cntstringmapper.h --- a/phonebookui/pbkcommonui/inc/cntstringmapper.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/inc/cntstringmapper.h Thu May 27 12:45:19 2010 +0300 @@ -97,12 +97,14 @@ mContactEditorAddLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_add_email"))); mContactEditorAddLocList.append(Loc(QContactFamily::DefinitionName, "", hbTrId("txt_phob_menu_add_family_details"))); mContactEditorAddLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_add_number"))); + mContactEditorAddLocList.append(Loc(QContactOnlineAccount::DefinitionName, "", hbTrId("txt_phob_menu_add_number"))); mContactEditorAddLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_menu_add_url"))); + mContactEditorAddLocList.append(Loc(QContactNote::DefinitionName, "", hbTrId("txt_phob_menu_add_note"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_edit_mobile"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_mobile_home"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_mobile_work"))); - mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant"))); + mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_edit_assistant"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_assistant"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_assistant"))); mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_edit_car"))); @@ -131,22 +133,25 @@ mContactEditorEditLocList.append(Loc(QContactAnniversary::DefinitionName, "", hbTrId("txt_phob_menu_edit_anniversary"))); mContactEditorEditLocList.append(Loc(QContactBirthday::DefinitionName, "", hbTrId("txt_phob_menu_edit_birthday"))); mContactEditorEditLocList.append(Loc(QContactNote::DefinitionName, "", hbTrId("txt_phob_menu_edit_note"))); - mContactEditorEditLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_edit_children"))); - mContactEditorEditLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_edit_spouse"))); - + mContactEditorEditLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_edit_children"))); + mContactEditorEditLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_edit_spouse"))); + mContactEditorEditLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_menu_edit_url"))); + mContactEditorEditLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_url_home"))); + mContactEditorEditLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_url_work"))); + mContactEditorEditLocList.append(Loc(QContactOrganization::DefinitionName, "", hbTrId("txt_phob_menu_edit_company_details"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_delete_mobile"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_mobile_home"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_mobile_work"))); - mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant"))); + mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_delete_assistant"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_assistant"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_assistant"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_delete_car"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_car"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_car"))); - mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_menu_delete_mobile"))); - mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_menu_delete_mobile_home"))); - mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_delete_mobile_work"))); + mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_delete_mobile"))); + mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_mobile_home"))); + mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_mobile_work"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_menu_delete_phone"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_phone_home"))); mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_phone_work"))); @@ -167,8 +172,12 @@ mContactEditorDelLocList.append(Loc(QContactAnniversary::DefinitionName, "", hbTrId("txt_phob_menu_delete_anniversary"))); mContactEditorDelLocList.append(Loc(QContactBirthday::DefinitionName, "", hbTrId("txt_phob_menu_delete_birthday"))); mContactEditorDelLocList.append(Loc(QContactNote::DefinitionName, "", hbTrId("txt_phob_menu_delete_note"))); - mContactEditorDelLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_delete_children"))); - mContactEditorDelLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_delete_spouse"))); + mContactEditorDelLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_delete_children"))); + mContactEditorDelLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_delete_spouse"))); + mContactEditorDelLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_menu_delete_url"))); + mContactEditorDelLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_url_home"))); + mContactEditorDelLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_url_work"))); + mContactEditorDelLocList.append(Loc(QContactOrganization::DefinitionName, "", hbTrId("txt_phob_menu_delete_company_details"))); //contact card item specific menu mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_call_mobile"))); @@ -197,6 +206,9 @@ mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_email"))); mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_email_home"))); mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_email_work"))); + mItemSpecificMenuLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_menu_url"))); + mItemSpecificMenuLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_url_home"))); + mItemSpecificMenuLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_url_work"))); //contact card list items mContactCardLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_dblist_call_mobile"))); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/pbkcommonui.pro --- a/phonebookui/pbkcommonui/pbkcommonui.pro Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/pbkcommonui.pro Thu May 27 12:45:19 2010 +0300 @@ -47,14 +47,18 @@ :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_api/inc/cntviewparams.h APP_LAYER_PLATFORM_EXPORT_PATH(cntviewparams.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_api/inc/cntabstractview.h APP_LAYER_PLATFORM_EXPORT_PATH(cntabstractview.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h APP_LAYER_PLATFORM_EXPORT_PATH(cntabstractviewmanager.h)" + :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_api/inc/cntcenrepkeys.h APP_LAYER_PLATFORM_EXPORT_PATH(cntcenrepkeys.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntuiextensionfactory.h APP_LAYER_PLATFORM_EXPORT_PATH(cntuiextensionfactory.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h APP_LAYER_PLATFORM_EXPORT_PATH(cntuigroupsupplier.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntuisocialextension.h APP_LAYER_PLATFORM_EXPORT_PATH(cntuisocialextension.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntuiextensiongroup.h APP_LAYER_PLATFORM_EXPORT_PATH(cntuiextensiongroup.h)" + :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntextensiongroupcallback.h APP_LAYER_PLATFORM_EXPORT_PATH(cntextensiongroupcallback.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntviewsupplier.h APP_LAYER_PLATFORM_EXPORT_PATH(cntviewsupplier.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitemsupplier.h APP_LAYER_PLATFORM_EXPORT_PATH(cnteditviewitemsupplier.h)" :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitem.h APP_LAYER_PLATFORM_EXPORT_PATH(cnteditviewitem.h)" + :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cntuiactionextension.h APP_LAYER_PLATFORM_EXPORT_PATH(cntuiactionextension.h)" + :BLD_INF_RULES.prj_exports += "../../contacts_plat/contacts_ui_extensions_api/inc/cnteditviewitemcallback.h APP_LAYER_PLATFORM_EXPORT_PATH(cnteditviewitemcallback.h)" } # Input @@ -71,6 +75,7 @@ inc/cntimageeditorview.h \ inc/cntfavoritesmemberview.h \ inc/cntfavoritesview.h \ + inc/cntfavourite.h \ inc/cntmainwindow.h \ inc/cntnamesview.h \ inc/cntnamesview_p.h \ @@ -122,7 +127,8 @@ inc/cntextensionmanager.h \ inc/cntimagelabel.h \ inc/cntfetchcontactsview.h \ - inc/cntimportsview.h + inc/cntimportsview.h \ + inc/cntsettingsview.h SOURCES += \ src/cntviewnavigator.cpp \ @@ -137,6 +143,7 @@ src/cntimageeditorview.cpp \ src/cntfavoritesmemberview.cpp \ src/cntfavoritesview.cpp \ + src/cntfavourite.cpp \ src/cntmainwindow.cpp \ src/cntnamesview.cpp \ src/cntnamesview_p.cpp \ @@ -186,7 +193,9 @@ src/cntextensionmanager.cpp \ src/cntimagelabel.cpp \ src/cntimportsview.cpp \ - src/cntfetchcontactsview.cpp + src/cntfetchcontactsview.cpp \ + src/cntsettingsview.cpp \ + src/cntsettingsmodel.cpp RESOURCES += resources\pbkcommonui.qrc diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_collections.docml --- a/phonebookui/pbkcommonui/resources/contacts_collections.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_collections.docml Thu May 27 12:45:19 2010 +0300 @@ -29,7 +29,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_contactcard.docml --- a/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Thu May 27 12:45:19 2010 +0300 @@ -41,9 +41,6 @@ - - - diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_ev.docml --- a/phonebookui/pbkcommonui/resources/contacts_ev.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_ev.docml Thu May 27 12:45:19 2010 +0300 @@ -28,7 +28,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_favmember.docml --- a/phonebookui/pbkcommonui/resources/contacts_favmember.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_favmember.docml Thu May 27 12:45:19 2010 +0300 @@ -12,7 +12,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_groupactions.docml --- a/phonebookui/pbkcommonui/resources/contacts_groupactions.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_groupactions.docml Thu May 27 12:45:19 2010 +0300 @@ -11,7 +11,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_if.docml --- a/phonebookui/pbkcommonui/resources/contacts_if.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_if.docml Thu May 27 12:45:19 2010 +0300 @@ -20,7 +20,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_namelist.docml --- a/phonebookui/pbkcommonui/resources/contacts_namelist.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_namelist.docml Thu May 27 12:45:19 2010 +0300 @@ -2,6 +2,7 @@ + @@ -13,28 +14,16 @@ - - + - - - - - - - - - - - - + @@ -57,7 +46,7 @@ - + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_settings.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/contacts_settings.docml Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/contacts_sim.docml --- a/phonebookui/pbkcommonui/resources/contacts_sim.docml Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/contacts_sim.docml Thu May 27 12:45:19 2010 +0300 @@ -4,21 +4,23 @@ - + - + + + + - + - + - diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/edit_button_pressed.fxml --- a/phonebookui/pbkcommonui/resources/edit_button_pressed.fxml Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - 0.2 - - 0.5 - 1.0 - - - \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/edit_button_released.fxml --- a/phonebookui/pbkcommonui/resources/edit_button_released.fxml Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - 0.2 - - 0.5 - 0.0 - - - \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/icons/pickerIcon.jpg Binary file phonebookui/pbkcommonui/resources/icons/pickerIcon.jpg has changed diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/icons/pin.png Binary file phonebookui/pbkcommonui/resources/icons/pin.png has changed diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/pbkcommonui.qrc --- a/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Thu May 27 12:45:19 2010 +0300 @@ -1,8 +1,6 @@ - edit_button_pressed.fxml - edit_button_released.fxml contacts_actions.docml contacts_contactcard.docml contacts_ev.docml @@ -19,10 +17,7 @@ contacts_collections.docml contacts_groupmembers.docml contacts_detail_editor.docml - - - icons/pickerIcon.jpg - icons/pin.png + contacts_settings.docml style/cnteditviewlistitem.hblistviewitem.widgetml @@ -32,8 +27,10 @@ style/cnteditviewdetailitem_color.css style/cntcontactcarddetailitem.widgetml style/cntcontactcarddetailitem.css + style/cntcontactcarddetailitem_color.css style/cntcontactcardheadingitem.widgetml style/cntcontactcardheadingitem.css + style/cntcontactcardheadingitem_color.css style/cnthistoryviewitem.widgetml style/cnthistoryviewitem.css style/cntlocationbutton.hbpushbutton.widgetml diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem_color.css Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,15 @@ +CntContactCardDetailItem[state = "normal"]::text{ + color: var(qtc_list_item_title_normal); +} + +CntContactCardDetailItem[state = "normal"]::valueText{ + color: var(qtc_list_item_content_normal); +} + +CntContactCardDetailItem[state = "pressed"]::text{ + color: var(qtc_list_item_pressed); +} + +CntContactCardDetailItem[state = "pressed"]::valueText{ + color: var(qtc_list_item_pressed); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem_color.css Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,19 @@ +CntContactCardHeadingItem::first_line_text{ + color: var(qtc_groupbox_normal); +} + +CntContactCardHeadingItem::primary_text{ + color: var(qtc_groupbox_normal); +} + +CntContactCardHeadingItem::second_line_text{ + color: var(qtc_groupbox_normal); +} + +CntContactCardHeadingItem::secondary_text{ + color: var(qtc_groupbox_normal); +} + +CntContactCardHeadingItem::marquee_item{ + color: var(qtc_groupbox_normal); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntactionmenubuilder.cpp --- a/phonebookui/pbkcommonui/src/cntactionmenubuilder.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntactionmenubuilder.cpp Thu May 27 12:45:19 2010 +0300 @@ -51,12 +51,12 @@ actions << d.actionName(); } - if ( actions.contains("call", Qt::CaseInsensitive) ) + if ( actions.contains("call", Qt::CaseInsensitive) && isSupportedDetails("call", aContact)) { createCallAction( *menu, aContact ); } - if ( actions.contains("message", Qt::CaseInsensitive) ) + if ( actions.contains("message", Qt::CaseInsensitive) && isSupportedDetails("message", aContact) ) { createMessageAction( *menu, aContact ); } @@ -80,8 +80,9 @@ return menu; } -HbMenu* CntActionMenuBuilder::actionMenu( QContact& aContact ) +HbMenu* CntActionMenuBuilder::actionMenu( QContact& aContact, QContactLocalId myCardId) { + iMyCardId = myCardId; mContact = new QContact( aContact ); return buildActionMenu( aContact ); } @@ -143,5 +144,29 @@ aMenu.addAction(hbTrId("txt_phob_menu_send_message"), this, SLOT(emitSmsContact())); } + +bool CntActionMenuBuilder::isSupportedDetails( const QString &actionName, const QContact &contact ) + { + QList actionDescriptors = QContactAction::actionDescriptors(actionName, "symbian"); + if (actionDescriptors.isEmpty()) + { + return false; + } + + QContactAction* contactAction = QContactAction::action(actionDescriptors.first()); + QList details = contactAction->supportedDetails(contact); + + delete contactAction; + + for (int i = 0; i < details.count(); i++) + { + if (contact.details().contains(details[i])) + { + return true; + } + } + + return false; + } // End of File diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntaddressmodel.cpp --- a/phonebookui/pbkcommonui/src/cntaddressmodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntaddressmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -27,9 +27,9 @@ mAddressWork(NULL), mIsLocationPickerEnabled( false ) { - HbDataFormModelItem* address = appendDataFormGroup(qtTrId("Address"), invisibleRootItem()); - HbDataFormModelItem* addressHome = appendDataFormGroup(qtTrId("Address (home)"), invisibleRootItem()); - HbDataFormModelItem* addressWork = appendDataFormGroup(qtTrId("Address (work)"), invisibleRootItem()); + HbDataFormModelItem* address = appendDataFormGroup(hbTrId("txt_phob_formlabel_address"), invisibleRootItem()); + HbDataFormModelItem* addressHome = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_home"), invisibleRootItem()); + HbDataFormModelItem* addressWork = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_work"), invisibleRootItem()); foreach ( QContactAddress a, mContact->details() ) { @@ -98,23 +98,23 @@ } // default items for rest of fields - HbDataFormModelItem* street = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Street")); + HbDataFormModelItem* street = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_street")); street->setContentWidgetData( "text", aAddress->street() ); street->setContentWidgetData( "maxLength", CNT_STREET_MAXLENGTH ); - HbDataFormModelItem* postal = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Post code")); + HbDataFormModelItem* postal = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_postal_codezip_code")); postal->setContentWidgetData( "text", aAddress->postcode() ); postal->setContentWidgetData( "maxLength", CNT_POSTCODE_MAXLENGTH ); - HbDataFormModelItem* city = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("City")); + HbDataFormModelItem* city = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_city")); city->setContentWidgetData( "text", aAddress->locality() ); city->setContentWidgetData( "maxLength", CNT_LOCALITY_MAXLENGTH ); - HbDataFormModelItem* region = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Province")); + HbDataFormModelItem* region = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_province")); region->setContentWidgetData( "text", aAddress->region() ); region->setContentWidgetData( "maxLength", CNT_REGION_MAXLENGTH ); - HbDataFormModelItem* country = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Country")); + HbDataFormModelItem* country = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_countryregion")); country->setContentWidgetData( "text", aAddress->country() ); country->setContentWidgetData( "maxLength", CNT_COUNTRY_MAXLENGTH ); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -17,6 +17,8 @@ #include "cntcollectionlistmodel.h" #include "cntextensionmanager.h" +#include "cntfavourite.h" + #include #include @@ -149,20 +151,10 @@ QVariantList dataList; QStringList displayList; displayList.append(hbTrId("txt_phob_dblist_favorites")); - if(!isFavoriteGroupCreated()) - { - displayList.append(hbTrId("txt_phob_dblist_favorites_val_no_favorites_selecte")); // as this isn't supported yet - - //Create Fav grp - QContact favoriteGroup; - favoriteGroup.setType(QContactType::TypeGroup); - QContactName favoriteGroupName; - favoriteGroupName.setCustomLabel("Favorites"); - favoriteGroup.saveDetail(&favoriteGroupName); - mContactManager->saveContact(&favoriteGroup); - mFavoriteGroupId = favoriteGroup.localId(); - } - else + + mFavoriteGroupId = CntFavourite::createFavouriteGroup( mContactManager ); + + if(mFavoriteGroupId != -1) { QContact favoriteGroup = mContactManager->contact(mFavoriteGroupId); QContactRelationshipFilter rFilter; @@ -208,8 +200,12 @@ { displayList.append(hbTrId("txt_phob_dblist_favorites_val_no_favorites_selecte")); } - } + else + { + displayList.append(hbTrId("txt_phob_dblist_favorites_val_no_favorites_selecte")); + } + dataList.append(displayList); dataList.append(QStringList("qtg_large_favourites")); dataList.append(mFavoriteGroupId); @@ -274,134 +270,100 @@ groupsOrder.append(sortOrderGroupName); QList groupContactIds = mContactManager->contactIds(groupFilter, groupsOrder); - if (!groupContactIds.isEmpty()) + + for(int i = 0;i < groupContactIds.count();i++) { - for(int i = 0;i < groupContactIds.count();i++) + QVariantList dataList; + + // group name + QStringList displayList; + + QContact contact = mContactManager->contact(groupContactIds.at(i)); + QContactName contactName = contact.detail(); + QString groupName = contactName.customLabel(); + if(groupContactIds.at(i) != mFavoriteGroupId ) { - QVariantList dataList; - - // group name - QStringList displayList; - - QContact contact = mContactManager->contact(groupContactIds.at(i)); - QContactName contactName = contact.detail(); - QString groupName = contactName.customLabel(); - if(groupContactIds.at(i) != mFavoriteGroupId ) + if (groupName.isNull()) { - if (groupName.isNull()) - { - QString unnamed(hbTrId("Unnamed")); - displayList.append(unnamed); - } - else - { - displayList.append(groupName); - } - - QContactRelationshipFilter rFilter; - rFilter.setRelationshipType(QContactRelationship::HasMember); - rFilter.setRelatedContactRole(QContactRelationship::First); - rFilter.setRelatedContactId(contact.id()); - - QContactSortOrder sortOrderFirstName; - sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldFirst); - sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); + QString unnamed(hbTrId("Unnamed")); + displayList.append(unnamed); + } + else + { + displayList.append(groupName); + } - QContactSortOrder sortOrderLastName; - sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldLast); - sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); + QContactRelationshipFilter rFilter; + rFilter.setRelationshipType(QContactRelationship::HasMember); + rFilter.setRelatedContactRole(QContactRelationship::First); + rFilter.setRelatedContactId(contact.id()); - QList sortOrders; - sortOrders.append(sortOrderFirstName); - sortOrders.append(sortOrderLastName); + QContactSortOrder sortOrderFirstName; + sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldFirst); + sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); + + QContactSortOrder sortOrderLastName; + sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldLast); + sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); - // group members and their count - QList groupMemberIds = mContactManager->contactIds(rFilter, sortOrders); - - if (!groupMemberIds.isEmpty()) + QList sortOrders; + sortOrders.append(sortOrderFirstName); + sortOrders.append(sortOrderLastName); + + // group members and their count + QList groupMemberIds = mContactManager->contactIds(rFilter, sortOrders); + + if (!groupMemberIds.isEmpty()) + { + QStringList nameList; + for(int i = 0;i < groupMemberIds.count();i++) { - QStringList nameList; - for(int i = 0;i < groupMemberIds.count();i++) + QContact contact = mContactManager->contact(groupMemberIds.at(i)); + QString memberName = contact.displayLabel(); + nameList << memberName; + if (nameList.join(", ").length() > 30) { - QContact contact = mContactManager->contact(groupMemberIds.at(i)); - QString memberName = contact.displayLabel(); - nameList << memberName; - if (nameList.join(", ").length() > 30) - { - break; - } - } - QString names = nameList.join(", "); - displayList.append(names); - displayList.append(hbTrId("(%1)").arg(groupMemberIds.count())); - } - else - { - displayList.append(hbTrId("No members selected")); - } - dataList.append(displayList); - - // Default if no image for group - bool icon = false; - QList details = contact.details(); - for (int i = 0;i < details.count();i++) - { - if (details.at(i).imageUrl().isValid()) - { - dataList.append(QStringList(details.at(i).imageUrl().toString())); - icon = true; break; } } - if(!icon) + QString names = nameList.join(", "); + displayList.append(names); + displayList.append(hbTrId("(%1)").arg(groupMemberIds.count())); + } + else + { + displayList.append(hbTrId("No members selected")); + } + dataList.append(displayList); + + // Default if no image for group + bool icon = false; + QList details = contact.details(); + for (int i = 0;i < details.count();i++) + { + if (details.at(i).imageUrl().isValid()) { - dataList.append(QStringList("qtg_large_custom")); + dataList.append(QStringList(details.at(i).imageUrl().toString())); + icon = true; + break; } - - // contact Id for identification - dataList.append(groupContactIds.at(i)); - - mDataPointer->mDataList.append(dataList); + } + if(!icon) + { + dataList.append(QStringList("qtg_large_custom")); } + + // contact Id for identification + dataList.append(groupContactIds.at(i)); + + mDataPointer->mDataList.append(dataList); } } } -bool CntCollectionListModel::isFavoriteGroupCreated() -{ - bool favoriteGroupCreated = false; - QContactDetailFilter groupFilter; - groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - groupFilter.setValue(QString(QLatin1String(QContactType::TypeGroup))); - - QList groupContactIds = mContactManager->contactIds(groupFilter); - - if (!groupContactIds.isEmpty()) - { - for(int i = 0;i < groupContactIds.count();i++) - { - QContact contact = mContactManager->contact(groupContactIds.at(i)); - QContactName contactName = contact.detail(); - QString groupName = contactName.customLabel(); - if(groupName.compare("Favorites") == 0) - { - favoriteGroupCreated = true; - mFavoriteGroupId = groupContactIds.at(i); - break; - } - } - } - return favoriteGroupCreated; -} - -int CntCollectionListModel::favoriteGroupId() -{ - return mFavoriteGroupId; -} - bool CntCollectionListModel::isExtensionGroup(const QModelIndex &index) { int row = index.row(); @@ -425,7 +387,7 @@ CntViewParameters params; for(int i = 0;i < mDataPointer->mExtensions.value(row)->groupCount();i++) { - const CntUiExtensionGroup& group = mDataPointer->mExtensions.value(row)->groupAt(i); + CntUiExtensionGroup& group = mDataPointer->mExtensions.value(row)->groupAt(i); if (group.serviceId() == mDataPointer->mDataList.at(row)[2].toInt()) { group.activated(params); @@ -435,18 +397,16 @@ return params; } -CntViewParameters CntCollectionListModel::extensionGroupLongPressed(int row, const QPointF& coords) +void CntCollectionListModel::extensionGroupLongPressed(int row, const QPointF& coords, CntExtensionGroupCallback* interface) { - CntViewParameters params; for(int i = 0;i < mDataPointer->mExtensions.value(row)->groupCount();i++) { - const CntUiExtensionGroup& group = mDataPointer->mExtensions.value(row)->groupAt(i); + CntUiExtensionGroup& group = mDataPointer->mExtensions.value(row)->groupAt(i); if (group.serviceId() == mDataPointer->mDataList.at(row)[2].toInt()) { - group.longPressed(coords, params); + group.longPressed(coords, interface); break; } } - return params; } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcollectionview.cpp --- a/phonebookui/pbkcommonui/src/cntcollectionview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcollectionview.cpp Thu May 27 12:45:19 2010 +0300 @@ -22,10 +22,11 @@ #include "cntcollectionlistmodel.h" #include "cntextensionmanager.h" #include "qtpbkglobal.h" +#include "cntfavourite.h" #include #include - +#include #include #include #include @@ -88,6 +89,7 @@ mNamesAction = static_cast(mDocumentLoader.findObject("cnt:names")); connect(mNamesAction, SIGNAL(triggered()), this, SLOT(showPreviousView())); mFindAction = static_cast(mDocumentLoader.findObject("cnt:find")); + mFindAction->setEnabled(false); mExtensionAction = static_cast (mDocumentLoader.findObject("cnt:activity")); } @@ -156,6 +158,14 @@ } /*! +Handle view switching request from an extension group item +*/ +void CntCollectionView::openView(CntViewParameters& viewParams) +{ + mViewManager->changeView(viewParams); +} + +/*! Go back to previous view */ void CntCollectionView::showPreviousView() @@ -180,7 +190,7 @@ else { int id = index.data(Qt::UserRole).toInt(); - int favoriteGrpId = mModel->favoriteGroupId(); + int favoriteGrpId = CntFavourite::favouriteGroupId(mViewManager->contactManager(SYMBIAN_BACKEND)); if (id == favoriteGrpId ) { @@ -198,7 +208,7 @@ viewParameters.insert(EViewId, collectionFavoritesView); QVariant var; var.setValue(favoriteGroup); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } else @@ -207,7 +217,7 @@ viewParameters.insert(EViewId, FavoritesMemberView); QVariant var; var.setValue(favoriteGroup); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } } @@ -219,7 +229,7 @@ viewParameters.insert(EViewId, groupMemberView); QVariant var; var.setValue(groupContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } } @@ -229,18 +239,14 @@ { if (mModel->isExtensionGroup(item->modelIndex())) { - CntViewParameters params = mModel->extensionGroupLongPressed(item->modelIndex().row(), coords); - if (params.count()) - { - mViewManager->changeView(params); - } + mModel->extensionGroupLongPressed(item->modelIndex().row(), coords, this); } else { int id = item->modelIndex().data(Qt::UserRole).toInt(); QVariant data( item->modelIndex().row() ); - - int favoriteGrpId = mModel->favoriteGroupId(); + + int favoriteGrpId = CntFavourite::favouriteGroupId(mViewManager->contactManager(SYMBIAN_BACKEND)); HbMenu *menu = new HbMenu(); menu->setAttribute(Qt::WA_DeleteOnClose); @@ -287,8 +293,13 @@ popup->setAttribute(Qt::WA_DeleteOnClose, true); popup->setPromptText(hbTrId("txt_phob_title_new_group_name")); - popup->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_create"), popup)); - popup->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), popup)); + popup->clearActions(); + HbAction* primaryAction = new HbAction(hbTrId("txt_phob_button_create")); + popup->addAction(primaryAction); + + HbAction* secondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); + popup->addAction(secondaryAction); + popup->setInputMode(HbInputDialog::TextInput); popup->open(this, SLOT(handleNewGroup(HbAction*))); @@ -318,7 +329,7 @@ // Select some contact(s) to add to the group QString groupNameCreated(mHandledContact->displayLabel()); mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_subtitle_1_group")).arg(groupNameCreated), - hbTrId("Save")); + hbTrId("txt_common_button_save")); mFetchView->displayContacts(CntFetchContacts::popup, HbAbstractItemView::MultiSelection, contactsSet); @@ -335,7 +346,7 @@ viewParameters.insert(EViewId, groupMemberView); QVariant var; var.setValue(*mHandledContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } @@ -364,8 +375,12 @@ mHandledContact = new QContact(group); QString name = mHandledContact->displayLabel(); - HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(name), this, SLOT(handleDeleteGroup(HbAction*)), - hbTrId("txt_phob_button_delete"), hbTrId("txt_common_button_cancel")); + 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_phob_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel); } void CntCollectionView::handleDeleteGroup(HbAction* action) diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcompanyeditormodel.cpp --- a/phonebookui/pbkcommonui/src/cntcompanyeditormodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcompanyeditormodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -30,22 +30,22 @@ mCompany = orgList.first(); HbDataFormModelItem* organization = new HbDataFormModelItem(HbDataFormModelItem::TextItem, - qtTrId("Company")); + hbTrId("txt_phob_formlabel_company")); organization->setContentWidgetData("text", mCompany.name()); organization->setContentWidgetData("maxLength", CNT_ORGANIZATION_MAXLENGTH); - HbDataFormModelItem* jobTitle = new HbDataFormModelItem(HbDataFormModelItem::TextItem, qtTrId( - "Job title")); + HbDataFormModelItem* jobTitle = new HbDataFormModelItem(HbDataFormModelItem::TextItem, + hbTrId("txt_phob_formlabel_job_title")); jobTitle->setContentWidgetData("text", mCompany.title()); jobTitle->setContentWidgetData("maxLength", CNT_JOBTITLE_MAXLENGTH); HbDataFormModelItem* department = new HbDataFormModelItem(HbDataFormModelItem::TextItem, - qtTrId("Department")); + hbTrId("txt_phob_formlabel_department")); department->setContentWidgetData("text", mCompany.department()); department->setContentWidgetData("maxLength", CNT_DEPARTMENT_MAXLENGTH); - HbDataFormModelItem* assistant = new HbDataFormModelItem(HbDataFormModelItem::TextItem, qtTrId( - "Assistant name")); + HbDataFormModelItem* assistant = new HbDataFormModelItem(HbDataFormModelItem::TextItem, + hbTrId("txt_phob_formlabel_assistant")); assistant->setContentWidgetData("text", mCompany.assistantName()); assistant->setContentWidgetData("maxLength", CNT_ASSISTANT_MAXLENGTH); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcarddatacontainer.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcarddatacontainer.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcarddatacontainer.cpp Thu May 27 12:45:19 2010 +0300 @@ -18,6 +18,7 @@ #include "cntcontactcarddatacontainer.h" #include "cntcontactcarddataitem.h" #include //For fetching maptile +#include "cntuiactionextension.h" #include #include @@ -41,7 +42,7 @@ /*! Constructor */ -CntContactCardDataContainer::CntContactCardDataContainer(QContact* contact, QObject *parent) : mContact(contact), mSeparatorIndex(-1) +CntContactCardDataContainer::CntContactCardDataContainer(QContact* contact, QObject *parent, bool myCard) : mContact(contact), mSeparatorIndex(-1) { Q_UNUSED(parent); if (contact->type() == QContactType::TypeGroup) @@ -50,9 +51,10 @@ } else { - initializeActionsData(); + initializeActionsData(myCard); initializeDetailsData(); - } + sortDataItems(); + } } /*! @@ -69,49 +71,63 @@ /*! Initialize contact details which include actions. */ -void CntContactCardDataContainer::initializeActionsData() +void CntContactCardDataContainer::initializeActionsData(bool myCard) { QList actionDescriptors = mContact->availableActions(); QStringList availableActions; + QStringList extendedActions; for (int i = 0;i < actionDescriptors.count();i++) { - availableActions << actionDescriptors.at(i).actionName(); + QString action = actionDescriptors.at(i).actionName(); + if(actionDescriptors.at(i).vendorName() == "symbian" && actionDescriptors.at(i).implementationVersion() == 1) + // String list for hardcoded actions, all actions falling in to this category must be hardcoded + // to show them on UI. + availableActions << action; + else if(!extendedActions.contains(action)) + // String list for dynamically extendable actions. Duplicate actions + // are handled later + extendedActions << action; } - QList details = mContact->details(); + QList details = mContact->details(); for (int i = 0; i < details.count(); i++) { - if (availableActions.contains("call", Qt::CaseInsensitive) && supportsDetail("call", details[i]) && details[i].definitionName() == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber number(details.at(i)); + //call + if (availableActions.contains("call", Qt::CaseInsensitive) && supportsDetail("call", details[i])) + { + QString context = details[i].contexts().isEmpty() ? QString() : details[i].contexts().first(); + QString subtype = details[i].subTypes().isEmpty() ? details[i].definitionName() : details[i].subTypes().first(); - QString context = number.contexts().isEmpty() ? QString() : number.contexts().first(); - QString subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first(); - - CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), itemCount(), true); + int position = getPosition(subtype, context); + + CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), position, true); dataItem->setAction("call"); - dataItem->setValueText(number.number()); + dataItem->setValueText(details[i].number()); dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(subtype, context))); - dataItem->setContactDetail(number); - mDataItemList.insert(itemCount(), dataItem); + dataItem->setContactDetail(details[i]); + mDataItemList.append(dataItem); } - - if (availableActions.contains("message", Qt::CaseInsensitive) && supportsDetail("message", details[i]) && details[i].definitionName() == QContactPhoneNumber::DefinitionName) - { - QContactPhoneNumber number(details.at(i)); - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_message"), itemCount(), true); + //message + if (availableActions.contains("message", Qt::CaseInsensitive) && supportsDetail("message", details[i])) + { + QString context = details[i].contexts().isEmpty() ? QString() : details[i].contexts().first(); + QString subtype = details[i].subTypes().isEmpty() ? details[i].definitionName() : details[i].subTypes().first(); + + int position = getPosition(subtype, context); + + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_message"), position, true); dataItem->setAction("message"); - dataItem->setValueText(number.number()); + dataItem->setValueText(details[i].number()); QString icon; - if (number.contexts().isEmpty()) + if (details[i].contexts().isEmpty()) { icon = "qtg_large_message"; } - else if (number.contexts().first() == QContactDetail::ContextHome) + else if (details[i].contexts().first() == QContactDetail::ContextHome) { icon = "qtg_large_message_home"; } - else if (number.contexts().first() == QContactDetail::ContextWork) + else if (details[i].contexts().first() == QContactDetail::ContextWork) { icon = "qtg_large_message_work"; } @@ -120,8 +136,8 @@ icon = "qtg_large_message"; } dataItem->setIcon(HbIcon(icon)); - dataItem->setContactDetail(number); - mDataItemList.insert(itemCount(), dataItem); + dataItem->setContactDetail(details[i]); + mDataItemList.append(dataItem); } } //email @@ -132,28 +148,139 @@ { QContactEmailAddress email(details.at(i)); QString context = email.contexts().isEmpty() ? QString() : email.contexts().first(); - - CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(email.definitionName(), context), itemCount(), true); + + int position = getPosition(email.definitionName(), context); + + CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(email.definitionName(), context), position, true); dataItem->setAction("email"); dataItem->setValueText(email.emailAddress(), Qt::ElideLeft); dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(email.definitionName(), context))); dataItem->setContactDetail(email); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } } //url - QList urlDetails = mContact->details(); - for (int i = 0; i < urlDetails.count(); i++) + if (availableActions.contains("url", Qt::CaseInsensitive)) + { + QList details = actionDetails("url", *mContact); + for (int i = 0; i < details.count(); i++) + { + QContactUrl url(details.at(i)); + QString context = url.contexts().isEmpty() ? QString() : url.contexts().first(); + + int position = getPosition(url.definitionName(), context); + + CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(url.definitionName(), context), position, true); + dataItem->setAction("url"); + dataItem->setValueText(url.url()); + dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(url.definitionName(), context))); + dataItem->setContactDetail(url); + mDataItemList.append(dataItem); + } + } + + if(!myCard && extendedActions.count()) { - QContactUrl url(urlDetails.at(i)); - QString context = url.contexts().isEmpty() ? QString() : url.contexts().first(); - - CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(url.definitionName(), context), itemCount(), true); - dataItem->setAction("url"); - dataItem->setValueText(url.url()); - dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(url.definitionName(), context))); - dataItem->setContactDetail(url); - mDataItemList.insert(itemCount(), dataItem); + // Do not create actions for details in my card + for (int i = 0; i < details.count(); i++) + { + for(int j = 0; j < extendedActions.count(); j++) + { + QList actionDescriptors = QContactAction::actionDescriptors(extendedActions[j]); + for(int l = 0; l < actionDescriptors.count(); l++) + { + // Different implementations(vendor, version) for same actions handled in loop + QContactAction* contactAction = QContactAction::action(actionDescriptors.at(l)); + if(contactAction->isDetailSupported(details[i], *mContact)) + { + const QContactDetail detail = details.at(i); + QVariantMap map = contactAction->metaData(); + if(map.contains(KCntUiActionMetaTitleText) || map.contains(KCntUiActionMetaTitleTextDetail)) + { + // Actions without title text and title text detail are considered to be non UI items + //action description + QString title = map.value(KCntUiActionMetaTitleText, "").toString(); + if(title.isEmpty()) + { + title = detail.value(map.value(KCntUiActionMetaTitleTextDetail).toString()); + } + else + { + //TODO: We shoud have localizations for "Home" and "Work" strings... +// if (!detail.contexts().isEmpty()) +// { +// title += " "; +// title += mStringMapper.getMappedDetail(detail.contexts().first()); +// } + } + if(title.count()) + { + QString context = detail.contexts().isEmpty() ? QString() : detail.contexts().first(); + int position = getPosition(detail.definitionName(), context, true); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, position, true); + //type + dataItem->setAction(extendedActions[j]); + //data + QString valueText = detail.value(map.value(KCntUiActionMetaValueTextDetail,"").toString()); + if(valueText.isEmpty()) + { + valueText = map.value(KCntUiActionMetaValueText," ").toString(); + } + dataItem->setValueText(valueText); + //icon + dataItem->setIcon(HbIcon(map.value(KCntUiActionMetaIcon, "").value())); + //detail + dataItem->setContactDetail(detail); + //save text for long press menu + dataItem->setLongPressText(map.value(KCntUiActionMetaValueTextLongPress,"...").toString()); + // We must save descriptor to be able to distinguish separate services for same action + dataItem->setActionDescriptor(actionDescriptors.at(l)); + mDataItemList.append(dataItem); + } + } + } + delete contactAction; + } + } + } + } + + // This is special action case. Here we query implementations that are generic + // to contact, so it's not linked to any detail(usually generic my card actions). + for(int j = 0; j < extendedActions.count(); j++) + { + QList actionDescriptors = QContactAction::actionDescriptors(extendedActions[j]); + for(int l = 0; l < actionDescriptors.count(); l++) + { + // Different implementations(vendor, version) for same actions handled in loop + QContactAction* contactAction = QContactAction::action(actionDescriptors.at(l)); + if(contactAction->isDetailSupported(QContactDetail(), *mContact)) + { + QVariantMap map = contactAction->metaData(); + if(map.contains(KCntUiActionMetaTitleText)) + { + // Actions without title text are considered to be non UI items + //action description + QString title = map.value(KCntUiActionMetaTitleText, "").toString(); + // Put as last action item on UI + CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, CntContactCardDataItem::EGenericDynamic, true); + //type + dataItem->setAction(extendedActions[j]); + //data + dataItem->setValueText(map.value(KCntUiActionMetaValueText, "").toString()); + //icon + dataItem->setIcon(HbIcon(map.value(KCntUiActionMetaIcon, "").value())); + //detail + dataItem->setContactDetail(QContactDetail()); + //save text for long press menu + dataItem->setLongPressText(map.value(KCntUiActionMetaValueTextLongPress,"...").toString()); + // We must save descriptor to be able to distinguish separate services for same action + dataItem->setActionDescriptor(actionDescriptors.at(l)); + mDataItemList.append(dataItem); + } + } + delete contactAction; + } } } @@ -173,7 +300,7 @@ dataItem->setValueText(confCallNumber.number()); dataItem->setIcon(HbIcon("qtg_large_call_group")); dataItem->setContactDetail(confCallNumber); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //message @@ -182,7 +309,7 @@ dataMessageItem->setValueText(confCallNumber.number()); dataMessageItem->setIcon(HbIcon("qtg_large_message")); dataMessageItem->setContactDetail(confCallNumber); - mDataItemList.insert(itemCount(), dataMessageItem); + mDataItemList.append(dataMessageItem); //email CntContactCardDataItem* dataEmailItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_email"), itemCount(), true); @@ -190,7 +317,7 @@ dataEmailItem->setValueText(confCallNumber.number()); dataEmailItem->setIcon(HbIcon("qtg_large_email")); dataEmailItem->setContactDetail(confCallNumber); - mDataItemList.insert(itemCount(), dataEmailItem); + mDataItemList.append(dataEmailItem); } /*! @@ -205,12 +332,14 @@ QContactOnlineAccount online(onlinedDetails.at(i)); QString context = online.contexts().isEmpty() ? QString() : online.contexts().first(); QString subtype = online.subTypes().isEmpty() ? online.definitionName() : online.subTypes().first(); + + int position = getPosition(subtype, context); - CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), position, false); dataItem->setValueText(online.accountUri()); dataItem->setContactDetail(online); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //address @@ -225,10 +354,12 @@ sourceAddressType = CntMapTileService::AddressPreference; QVariantList addressList; //no action + int position; QString title; if (addressDetails[i].contexts().isEmpty()) { title = hbTrId("txt_phob_formlabel_address"); + position = CntContactCardDataItem::EAddress; } else { @@ -236,14 +367,16 @@ { sourceAddressType = CntMapTileService::AddressHome; title = hbTrId("txt_phob_formlabel_address_home"); + position = CntContactCardDataItem::EAddressHome; } else if (addressDetails[i].contexts().at(0) == contextWork) { sourceAddressType = CntMapTileService::AddressWork; title = hbTrId("txt_phob_formlabel_address_work"); + position = CntContactCardDataItem::EAddressWork; } } - CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, position, false); QStringList address; if (!addressDetails[i].street().isEmpty()) @@ -260,7 +393,7 @@ dataItem->setValueText(address.join(" ")); dataItem->setContactDetail(addressDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); //Check whether location feature enabled if (mLocationFeatureEnabled) @@ -296,9 +429,9 @@ addSeparator(itemCount()); - CntContactCardDataItem* dataItem = new CntContactCardDataItem(QString(), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(QString(), position, false); dataItem->setIcon(HbIcon(mapTileIcon)); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } } } @@ -307,35 +440,35 @@ QList organizationDetails = mContact->details(); for (int i = 0; i < organizationDetails.count(); i++) { - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_company_details"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_company_details"), CntContactCardDataItem::ECompanyDetails, false); QStringList companyList; companyList << organizationDetails[i].title() << organizationDetails[i].name() << organizationDetails[i].department(); dataItem->setValueText(companyList.join(" ").trimmed()); dataItem->setContactDetail(organizationDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //birthday QList birthdayDetails = mContact->details(); for (int i = 0; i < birthdayDetails.count(); i++) { - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_birthday"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_birthday"), CntContactCardDataItem::EBirthday, false); dataItem->setValueText(birthdayDetails[i].date().toString("dd MMMM yyyy")); dataItem->setContactDetail(birthdayDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //anniversary QList anniversaryDetails = mContact->details(); for (int i = 0; i < anniversaryDetails.count(); i++) { - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_anniversary"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_anniversary"), CntContactCardDataItem::EAnniversary, false); dataItem->setValueText(anniversaryDetails[i].originalDate().toString("dd MMMM yyyy")); dataItem->setContactDetail(anniversaryDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //ringing tone @@ -344,11 +477,11 @@ { if (!ringtoneDetails.at(i).audioRingtoneUrl().isEmpty()) { - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_ringing_tone"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_ringing_tone"), CntContactCardDataItem::ERingtone, false); dataItem->setValueText(ringtoneDetails[i].audioRingtoneUrl().toString()); dataItem->setContactDetail(ringtoneDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); break; } } @@ -357,28 +490,34 @@ QList noteDetails = mContact->details(); for (int i = 0; i < noteDetails.count(); i++) { - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_note"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_note"), CntContactCardDataItem::ENote, false); dataItem->setValueText(noteDetails[i].note()); dataItem->setContactDetail(noteDetails[i]); addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataItem); + mDataItemList.append(dataItem); } //family details QList familyDetails = mContact->details(); for (int i = 0; i < familyDetails.count(); i++) { - CntContactCardDataItem* dataSpouseItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_spouse"), itemCount(), false); - dataSpouseItem->setValueText(familyDetails[i].spouse()); - dataSpouseItem->setContactDetail(familyDetails[i]); - addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataSpouseItem); + if (!familyDetails[i].spouse().isEmpty()) + { + CntContactCardDataItem* dataSpouseItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_spouse"), CntContactCardDataItem::EChildren, false); + dataSpouseItem->setValueText(familyDetails[i].spouse()); + dataSpouseItem->setContactDetail(familyDetails[i]); + addSeparator(itemCount()); + mDataItemList.append(dataSpouseItem); + } - CntContactCardDataItem* dataChildrenItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_children"), itemCount(), false); - dataChildrenItem->setValueText(familyDetails[i].children().join(", ")); - dataChildrenItem->setContactDetail(familyDetails[i]); - addSeparator(itemCount()); - mDataItemList.insert(itemCount(), dataChildrenItem); + if (!familyDetails[i].children().isEmpty()) + { + CntContactCardDataItem* dataChildrenItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_children"), CntContactCardDataItem::ESpouse, false); + dataChildrenItem->setValueText(familyDetails[i].children().join(", ")); + dataChildrenItem->setContactDetail(familyDetails[i]); + addSeparator(itemCount()); + mDataItemList.append(dataChildrenItem); + } } } @@ -443,7 +582,7 @@ if (mSeparatorIndex == -1) { mSeparatorIndex = index; - CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_subtitle_details"), itemCount(), false); + CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_subtitle_details"), CntContactCardDataItem::ESeparator, false); mDataItemList.insert(itemCount(), dataItem); } } @@ -464,5 +603,185 @@ qStableSort(mDataItemList.begin(), mDataItemList.end(), compareObjects); } +/*! +Returns position of specific item +*/ +int CntContactCardDataContainer::getPosition(const QString& aId, const QString& aContext, bool dynamicAction) +{ + int position = CntContactCardDataItem::EOther; + + if (aId == QContactPhoneNumber::SubTypeAssistant && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallAssistant; + } + else if (aId == QContactPhoneNumber::SubTypeCar && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallCar; + } + else if (aId == QContactPhoneNumber::SubTypeMobile && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallMobile; + } + else if (aId == QContactPhoneNumber::SubTypeMobile && aContext == QContactDetail::ContextHome && !dynamicAction) + { + position = CntContactCardDataItem::ECallMobileHome; + } + else if (aId == QContactPhoneNumber::SubTypeMobile && aContext == QContactDetail::ContextWork && !dynamicAction) + { + position = CntContactCardDataItem::ECallMobileWork; + } + else if (aId == QContactPhoneNumber::SubTypeLandline && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallPhone; + } + else if (aId == QContactPhoneNumber::SubTypeLandline && aContext == QContactDetail::ContextHome && !dynamicAction) + { + position = CntContactCardDataItem::ECallPhoneHome; + } + else if (aId == QContactPhoneNumber::SubTypeLandline && aContext == QContactDetail::ContextWork && !dynamicAction) + { + position = CntContactCardDataItem::ECallPhoneWork; + } + else if (aId == QContactPhoneNumber::SubTypeFacsimile && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallFax; + } + else if (aId == QContactPhoneNumber::SubTypeFacsimile && aContext == QContactDetail::ContextHome && !dynamicAction) + { + position = CntContactCardDataItem::ECallFaxHome; + } + else if (aId == QContactPhoneNumber::SubTypeFacsimile && aContext == QContactDetail::ContextWork && !dynamicAction) + { + position = CntContactCardDataItem::ECallFaxWork; + } + else if (aId == QContactPhoneNumber::SubTypePager && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ECallPager; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext == QContactDetail::ContextHome && dynamicAction) + { + position = CntContactCardDataItem::ECallDynamicHome; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext == QContactDetail::ContextWork && dynamicAction) + { + position = CntContactCardDataItem::ECallDynamicWork; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext.isEmpty() && dynamicAction) + { + position = CntContactCardDataItem::ECallDynamic; + } + else if (aId == QContactOnlineAccount::SubTypeSipVoip && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::EInternetTelephone; + } + else if (aId == QContactOnlineAccount::SubTypeSipVoip && aContext == QContactDetail::ContextHome && !dynamicAction) + { + position = CntContactCardDataItem::EInternetTelephoneHome; + } + else if (aId == QContactOnlineAccount::SubTypeSipVoip && aContext == QContactDetail::ContextWork && !dynamicAction) + { + position = CntContactCardDataItem::EInternetTelephoneWork; + } + else if (aId == QContactOnlineAccount::SubTypeSip && aContext.isEmpty() && !dynamicAction) + { + position = CntContactCardDataItem::ESip; + } + else if (aId == QContactOnlineAccount::DefinitionName && aContext == QContactDetail::ContextHome && dynamicAction) + { + position = CntContactCardDataItem::EInternetDynamicHome; + } + else if (aId == QContactOnlineAccount::DefinitionName && aContext == QContactDetail::ContextWork && dynamicAction) + { + position = CntContactCardDataItem::EInternetDynamicWork; + } + else if (aId == QContactOnlineAccount::DefinitionName && aContext.isEmpty() && dynamicAction) + { + position = CntContactCardDataItem::EInternetDynamic; + } + else if (aId == QContactEmailAddress::DefinitionName && aContext.isEmpty()) + { + if(!dynamicAction) + position = CntContactCardDataItem::EEmail; + else + position = CntContactCardDataItem::EEmailDynamic; + } + else if (aId == QContactEmailAddress::DefinitionName && aContext == QContactDetail::ContextHome) + { + if(!dynamicAction) + position = CntContactCardDataItem::EEmailHome; + else + position = CntContactCardDataItem::EEmailDynamicHome; + } + else if (aId == QContactEmailAddress::DefinitionName && aContext == QContactDetail::ContextWork) + { + if(!dynamicAction) + position = CntContactCardDataItem::EEmailWork; + else + position = CntContactCardDataItem::EEmailDynamicWork; + } + else if (aId == QContactAddress::DefinitionName && aContext.isEmpty()) + { + if(!dynamicAction) + position = CntContactCardDataItem::EAddress; + else + position = CntContactCardDataItem::EAddressDynamic; + } + else if (aId == QContactAddress::DefinitionName && aContext == QContactDetail::ContextHome) + { + if(!dynamicAction) + position = CntContactCardDataItem::EAddressHome; + else + position = CntContactCardDataItem::EAddressDynamicHome; + } + else if (aId == QContactAddress::DefinitionName && aContext == QContactDetail::ContextWork) + { + if(!dynamicAction) + position = CntContactCardDataItem::EAddressWork; + else + position = CntContactCardDataItem::EAddressDynamicWork; + } + else if (aId == QContactUrl::DefinitionName && aContext.isEmpty()) + { + if(!dynamicAction) + position = CntContactCardDataItem::EUrl; + else + position = CntContactCardDataItem::EUrlDynamic; + } + else if (aId == QContactUrl::DefinitionName && aContext == QContactDetail::ContextHome) + { + if(!dynamicAction) + position = CntContactCardDataItem::EUrlHome; + else + position = CntContactCardDataItem::EUrlDynamicHome; + } + else if (aId == QContactUrl::DefinitionName && aContext == QContactDetail::ContextWork) + { + if(!dynamicAction) + position = CntContactCardDataItem::EUrlWork; + else + position = CntContactCardDataItem::EUrlDynamicWork; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext.isEmpty()) + { + position = CntContactCardDataItem::ELastAction; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext == QContactDetail::ContextHome) + { + position = CntContactCardDataItem::ELastActionHome; + } + else if (aId == QContactPhoneNumber::DefinitionName && aContext == QContactDetail::ContextWork) + { + position = CntContactCardDataItem::ELastActionWork; + } + else if (!dynamicAction) + { + position = CntContactCardDataItem::EOther; + } + else + { + position = CntContactCardDataItem::EDynamic; + } + + return position; +} - diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcarddataitem.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcarddataitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcarddataitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -23,6 +23,7 @@ mTitle(aTitle), mValueText(QString("")), mAction(QString("")), + mActionDescriptor(QContactActionDescriptor()), mValueTextElideMode(Qt::ElideRight), mIsFocusable(aIsFocusable), mPosition(aPosition) @@ -66,3 +67,12 @@ mDetail = aDetail; } +void CntContactCardDataItem::setActionDescriptor(const QContactActionDescriptor& aActionDescriptor) +{ + mActionDescriptor = aActionDescriptor; +} + +void CntContactCardDataItem::setLongPressText(const QString& aLongPressText) +{ + mLongPressText = aLongPressText; +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcarddetailitem.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcarddetailitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcarddetailitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include CntContactCardDetailItem::CntContactCardDetailItem(int index, QGraphicsItem *parent, bool isFocusable) : @@ -51,10 +50,11 @@ { if (mIsFocusable) { - HbEffect::add(QString("frameitem"), QString(":/xml/edit_button_pressed.fxml"), QString("pressed")); - HbEffect::add(QString("frameitem"), QString(":/xml/edit_button_released.fxml"), QString("released")); + HbEffect::add("frameitem", "listviewitem_press", "pressed"); + HbEffect::add("frameitem", "listviewitem_release", "released"); initGesture(); } + setProperty("state", "normal"); } CntContactCardDetailItem::~CntContactCardDetailItem() @@ -148,7 +148,7 @@ style()->setItemName(mFocusItem, "highlight"); } - updatePrimitives(); + HbWidget::updatePrimitives(); updateGeometry(); repolish(); } @@ -162,72 +162,54 @@ void CntContactCardDetailItem::initGesture() { - grabGesture(Qt::TapAndHoldGesture, Qt::ReceivePartialGestures); - grabGesture(Qt::TapGesture, Qt::ReceivePartialGestures); + grabGesture(Qt::TapGesture); } void CntContactCardDetailItem::gestureEvent(QGestureEvent* event) { qDebug() << "CntContactCardDetailItem::gestureEvent - IN"; - event->accept( Qt::TapAndHoldGesture ); - - if (QGesture *tap = event->gesture(Qt::TapGesture)) + if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { - tapTriggered(static_cast(tap)); - event->accept( tap ); - } - - if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture)) + switch(tap->state()) + { + case Qt::GestureStarted: // + if (mIsFocusable) + { + HbInstantFeedback::play(HbFeedback::Basic); + } + mHasFocus = true; + updatePrimitives(); + break; + case Qt::GestureCanceled: // Reset state + mHasFocus = false; + updatePrimitives(); + break; + case Qt::GestureUpdated: + if(tap->tapStyleHint() == HbTapGesture::TapAndHold) + { + emit onLongPress(event->mapToGraphicsScene(tap->position())); + } + break; + case Qt::GestureFinished: // emit clicked + mHasFocus = false; + updatePrimitives(); + if (tap->tapStyleHint() == HbTapGesture::Tap) + { + emit clicked(); + } + break; + default: + break; + } + event->accept(); + } + else { - tapAndHoldTriggered(static_cast(tapAndHold)); - event->accept( tapAndHold ); + event->ignore(); } qDebug() << "CntContactCardDetailItem::gestureEvent - OUT"; } -void CntContactCardDetailItem::tapTriggered(QTapGesture *gesture) -{ - qDebug() << "CntContactdDetailItem::tagTriggered - IN"; - - Qt::GestureState state = gesture->state(); - qDebug() << "CntContactdDetailItem::tagTriggered, state: " << state; - switch ( state ) - { - case Qt::GestureStarted: - { - if (mIsFocusable) - { - HbInstantFeedback::play(HbFeedback::Basic); - } - mHasFocus = true; - updatePrimitives(); - break; - } - case Qt::GestureFinished: - case Qt::GestureCanceled: - { - mHasFocus = false; - updatePrimitives(); - emit clicked(); // also in GestureCancelled? - break; - } - default: - { - break; - } - } - qDebug() << "CntContactdDetailItem::tagTriggered - OUT"; -} - -void CntContactCardDetailItem::tapAndHoldTriggered(QTapAndHoldGesture *gesture) -{ - if (gesture->state() == Qt::GestureFinished) - { - onLongPress(gesture->position()); - } -} - - void CntContactCardDetailItem::onLongPress(const QPointF &point) { mHasFocus = false; @@ -237,54 +219,20 @@ void CntContactCardDetailItem::updatePrimitives() { - HbWidget::updatePrimitives(); if (mHasFocus && mIsFocusable) { mFocusItem->setVisible(true); - HbEffect::start(mFocusItem, QString("frameitem"), QString("pressed")); + setProperty("state", "pressed"); + HbEffect::start(mFocusItem, QString("frameitem"), QString("pressed")); } else { HbEffect::start(mFocusItem, QString("frameitem"), QString("released")); + mFocusItem->setVisible(false); + setProperty("state", "normal"); } -} - -/* -void CntContactCardDetailItem::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - if (mIsFocusable) - { - HbInstantFeedback::play(HbFeedback::Basic); - } - event->accept(); - mHasFocus = true; - updatePrimitives(); + HbWidget::updatePrimitives(); } -*/ -/* -void CntContactCardDetailItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - if (!rect().contains(event->pos()) && mHasFocus) - { - mHasFocus = false; - updatePrimitives(); - } - event->accept(); -} - - -void CntContactCardDetailItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - bool hadFocus = mHasFocus; - mHasFocus = false; - if (rect().contains(event->pos()) && hadFocus) - { - updatePrimitives(); - emit clicked(); - } - event->accept(); -} -*/ void CntContactCardDetailItem::setDetails(CntContactCardDataItem* aDataItem) { diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include CntContactCardHeadingItem::CntContactCardHeadingItem(QGraphicsItem *parent) : HbWidget(parent), @@ -324,18 +324,6 @@ { primaryText = hbTrId("txt_phob_list_unnamed"); } - - /* - // prefix, first and middle - QStringList firstNameList; - firstNameList << name.prefix() << name.first() << name.middle(); - firstLineText = firstNameList.join(" ").trimmed(); - - // last and suffix - QStringList lastNameList; - lastNameList << name.last() << name.suffix(); - mSecondLineText = lastNameList.join(" ").trimmed(); - */ } // nick label @@ -383,21 +371,48 @@ emit passLongPressed(point); } +void CntContactCardHeadingItem::processShortPress(const QPointF &point) +{ + emit passShortPressed(point); +} + void CntContactCardHeadingItem::gestureEvent(QGestureEvent* event) { - QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture); - if (tapAndHold && tapAndHold->state() == Qt::GestureFinished) { - processLongPress(static_cast(tapAndHold)->position()); + + if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) + { + switch (tap->state()) + { + case Qt::GestureFinished: + if (tap->tapStyleHint() == HbTapGesture::Tap && mIcon->rect().contains(mapFromScene(tap->position()))) + { + processShortPress(tap->position()); + } + break; + case Qt::GestureUpdated: + if (tap->tapStyleHint() == HbTapGesture::TapAndHold && mIcon->rect().contains(mapFromScene(tap->position()))) + { + processLongPress(tap->position()); + } + break; + default: + break; + } + event->accept(); + } + else + { + event->ignore(); } } void CntContactCardHeadingItem::initGesture() { - grabGesture(Qt::TapAndHoldGesture); + grabGesture(Qt::TapGesture); } QVariant CntContactCardHeadingItem::itemChange(GraphicsItemChange change, const QVariant &value) -{ +{ if (change == QGraphicsItem::ItemSceneHasChanged) { HbMainWindow *window = mainWindow(); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcardview.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview.cpp Thu May 27 12:45:19 2010 +0300 @@ -24,7 +24,8 @@ { Q_D(CntContactCardView); connect(d_ptr, SIGNAL(backPressed()), this, SIGNAL(backPressed())); - connect(d_ptr, SIGNAL(viewActivated(QContact, QContactDetail)), this, SIGNAL(viewActivated(QContact, QContactDetail))); + connect(d_ptr, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)), + this, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters))); } /*! @@ -56,13 +57,11 @@ bool CntContactCardView::isDefault() const { - Q_D(const CntContactCardView); return false; } int CntContactCardView::viewId() const { - Q_D(const CntContactCardView); return commLauncherView; } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,6 +19,8 @@ #include #include #include +#include + #include #include #include @@ -38,6 +40,7 @@ #include #include #include + #include "cntcontactcarddatacontainer.h" #include "cntcontactcarddetailitem.h" #include "cntcontactcardheadingitem.h" @@ -48,6 +51,7 @@ #include "cntdocumentloader.h" #include "cntimagelabel.h" #include "cntimageutility.h" +#include "cntfavourite.h" const char *CNT_CONTACTCARDVIEW_XML = ":/xml/contacts_contactcard.docml"; @@ -65,11 +69,8 @@ mDataContainer(NULL), mHeadingItem(NULL), mThumbnailManager(NULL), - mGroupContact(NULL), mAvatar(NULL), - mIsGroupMember(false), mIsHandlingMenu(false), - mIsPreviousImageEditorView(false), mFavoriteGroupId(-1), mLoader(NULL), mContactAction(NULL), @@ -111,9 +112,6 @@ delete mDataContainer; mDataContainer = NULL; - delete mGroupContact; - mGroupContact = NULL; - delete mAvatar; mAvatar = NULL; @@ -131,8 +129,9 @@ { emit backPressed(); - //save an avatar - if (mIsPreviousImageEditorView) + //save the contact if avatar has been changed. + QContact contact = contactManager()->contact(mContact->localId()); + if ( contact != *mContact ) { QList details = mContact->details(); for (int i = 0; i < details.count(); i++) @@ -145,14 +144,7 @@ } } - CntViewParameters viewParameters; - if (mIsGroupMember) - { - QVariant var; - var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); - } - mViewManager->back(viewParameters); + mViewManager->back( mArgs ); } /* @@ -160,24 +152,20 @@ */ void CntContactCardViewPrivate::activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) { - mView->installEventFilter(this); + mViewManager = aMgr; + mArgs = aArgs; - mViewManager = aMgr; + mView->installEventFilter(this); HbMainWindow* window = mView->mainWindow(); connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); setOrientation(window->orientation()); - if (aArgs.value(ECustomParam).toInt() == imageEditorView) - { - mIsPreviousImageEditorView = true; - } - QContact contact = aArgs.value(ESelectedContact).value(); - mContact = new QContact(contact); - + mContact = new QContact( contact ); //my card - if (mContact->localId() == contactManager()->selfContactId()) + bool myCard = mContact->localId() == contactManager()->selfContactId(); + if (myCard) { mView->menu()->clearActions(); mView->toolBar()->removeAction(static_cast(document()->findObject(QString("cnt:history")))); @@ -187,24 +175,18 @@ mView->toolBar()->removeAction(static_cast(document()->findObject(QString("cnt:sendMyCard")))); } - if (aArgs.value(ESelectedAction).toString() == "FromGroupMemberView") - { - mIsGroupMember = true; - QContact groupContact = aArgs.value(ESelectedGroupContact).value(); - mGroupContact = new QContact(groupContact); - } // add heading widget to the content QGraphicsWidget *c = document()->findWidget(QString("content")); QGraphicsLinearLayout* l = static_cast(c->layout()); mHeadingItem = static_cast(document()->findWidget(QString("cnt_contactcard_heading"))); mHeadingItem->setDetails(mContact); - mHeadingItem->setSecondaryIcon(isFavoriteGroupContact()); - 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")); connect(mImageLabel, SIGNAL(iconClicked()), this, SLOT(doChangeImage())); + connect(mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&))); // avatar QList details = mContact->details(); @@ -219,7 +201,7 @@ } // data - mDataContainer = new CntContactCardDataContainer(mContact); + mDataContainer = new CntContactCardDataContainer(mContact, NULL, myCard); // scroll area + container widget mScrollArea = static_cast(document()->findWidget(QString("scrollArea"))); @@ -296,38 +278,15 @@ } } - bool setAsFavorite = false; - if(isFavoriteGroupCreated()) + bool setAsFavorite( false ); + QContactLocalId favouriteGroupId = CntFavourite::favouriteGroupId( contactManager() ); + if( favouriteGroupId != 0 ) { - QContact favoriteGroup = contactManager()->contact(mFavoriteGroupId); - // Use relationship filter to get list of contacts in the relationship (if any) - QContactRelationshipFilter filter; - filter.setRelationshipType(QContactRelationship::HasMember); - filter.setRelatedContactRole(QContactRelationship::First); - filter.setRelatedContactId(favoriteGroup.id()); - - QList mContactsList = contactManager()->contactIds(filter); - int count = mContactsList.count(); - if (count) - { - for (int i = 0 ; i < count ; i++) - { - if (mContactsList.at(i) == mContact->localId()) - { - setAsFavorite = true; - } - } - } + setAsFavorite = CntFavourite::isMemberOfFavouriteGroup( contactManager(), mContact ); + mHeadingItem->setSecondaryIcon( setAsFavorite ); // if contact is part of favourites group } - - if (setAsFavorite) - { - qobject_cast(document()->findObject("cnt:setasfavorite"))->setVisible(false); - } - else - { - qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible(false); - } + qobject_cast(document()->findObject("cnt:setasfavorite"))->setVisible( !setAsFavorite ); + qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible( setAsFavorite ); // Menu items connect(qobject_cast(document()->findObject("cnt:sendbusinesscard")), SIGNAL(triggered()), @@ -349,7 +308,7 @@ connect(qobject_cast(document()->findObject("cnt:sendMyCard")), SIGNAL(triggered()), this, SLOT (sendBusinessCard())); - emit viewActivated(*mContact, aArgs.value(ESelectedDetail).value()); + emit viewActivated( mViewManager, aArgs ); } void CntContactCardViewPrivate::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) @@ -388,12 +347,13 @@ */ void CntContactCardViewPrivate::editContact() { - CntViewParameters viewParameters; - viewParameters.insert(EViewId, editView); QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); - mViewManager->changeView(viewParameters); + + mArgs.insert(ESelectedContact, var); + mArgs.insert(EViewId, editView); + + mViewManager->changeView( mArgs ); } void CntContactCardViewPrivate::addToGroup() @@ -402,43 +362,18 @@ void CntContactCardViewPrivate::setAsFavorite() { - QContact favoriteGroup; - if (!isFavoriteGroupCreated() ) - { - //Create Fav grp - favoriteGroup.setType(QContactType::TypeGroup); - QContactName favoriteGroupName; - favoriteGroupName.setCustomLabel("Favorites"); - favoriteGroup.saveDetail(&favoriteGroupName); - contactManager()->saveContact(&favoriteGroup); - mFavoriteGroupId = favoriteGroup.localId(); - } - else - { - favoriteGroup = contactManager()->contact(mFavoriteGroupId); - } + QContactId id = mContact->id(); + CntFavourite::addContactToFavouriteGroup( contactManager(), id ); - // new contact added to the favorite group - QContactRelationship relationship; - relationship.setRelationshipType(QContactRelationship::HasMember); - relationship.setFirst(favoriteGroup.id()); - relationship.setSecond(mContact->id()); - // save relationship - contactManager()->saveRelationship(&relationship); - + qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible(true); qobject_cast(document()->findObject("cnt:setasfavorite"))->setVisible(false); - qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible(true); mHeadingItem->setSecondaryIcon(true); } void CntContactCardViewPrivate::removeFromFavorite() { - QContact favoriteGroup = contactManager()->contact(mFavoriteGroupId); - QContactRelationship relationship; - relationship.setRelationshipType(QContactRelationship::HasMember); - relationship.setFirst(favoriteGroup.id()); - relationship.setSecond(mContact->id()); - contactManager()->removeRelationship(relationship); + QContactId id = mContact->id(); + CntFavourite::removeContactFromFavouriteGroup( contactManager(), id ); qobject_cast(document()->findObject("cnt:removefromfavorite"))->setVisible(false); qobject_cast(document()->findObject("cnt:setasfavorite"))->setVisible(true); @@ -466,9 +401,8 @@ if (note && action == note->actions().first()) { contactManager()->removeContact(mContact->localId()); - CntViewParameters viewParameters; - viewParameters.insert(EViewId, namesView); - mViewManager->changeView(viewParameters); + mArgs.insert(EViewId, namesView); + mViewManager->changeView( mArgs ); } } @@ -477,12 +411,12 @@ */ void CntContactCardViewPrivate::viewHistory() { - CntViewParameters viewParameters; - viewParameters.insert(EViewId, historyView); QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); - mViewManager->changeView(viewParameters); + mArgs.insert(ESelectedContact, var); + mArgs.insert(EViewId, historyView); + + mViewManager->changeView( mArgs ); } /*! @@ -498,6 +432,7 @@ */ void CntContactCardViewPrivate::sendBusinessCard() { + qDebug() << "CntContactCardViewPrivate::sendBusinessCard - IN"; // Check if the contact has an image. QList avatars = mContact->details(); bool imageExists( false ); @@ -529,8 +464,10 @@ if ( !imageExists ) { + qDebug() << "CntContactCardViewPrivate::sendBusinessCard without image"; handleSendBusinessCard( NULL ); // no image } + qDebug() << "CntContactCardViewPrivate::sendBusinessCard - OUT"; } /*! @@ -557,7 +494,19 @@ { CntContactCardDetailItem *item = qobject_cast(sender()); int index = item->index(); - launchAction(*mContact, mDataContainer->dataItem(index)->detail(), mDataContainer->dataItem(index)->action()); + QString action = mDataContainer->dataItem(index)->action(); + // Check if action is internal + QList actionDescriptors = QContactAction::actionDescriptors(action, "symbian", 1); + if(0 < actionDescriptors.count()) + { + // These actions are considered internal(vendor=symbian and version=1) + launchAction(*mContact, mDataContainer->dataItem(index)->detail(), action); + } + else + { + //Handle dynamic actions differently + launchDynamicAction(*mContact, mDataContainer->dataItem(index)->detail(), mDataContainer->dataItem(index)->actionDescriptor()); + } } /*! @@ -577,6 +526,18 @@ mContactAction->invokeAction(contact, detail); } +/*! +Launch dynamic action +*/ +void CntContactCardViewPrivate::launchDynamicAction(QContact contact, QContactDetail detail, QContactActionDescriptor actionDescriptor) +{ + // detail might be empty -> in that case engine uses the preferred detail for the selected action + mContactAction = QContactAction::action(actionDescriptor); + connect(mContactAction, SIGNAL(stateChanged(QContactAction::State)), + this, SLOT(progress(QContactAction::State))); + mContactAction->invokeAction(contact, detail); +} + void CntContactCardViewPrivate::progress(QContactAction::State status) { switch(status) @@ -584,7 +545,6 @@ case QContactAction::FinishedState: case QContactAction::FinishedWithErrorState: mContactAction->deleteLater(); - mContactAction = 0; break; default: break; @@ -610,6 +570,7 @@ CntContactCardContextMenu *menu = new CntContactCardContextMenu( item ); HbAction *communicationAction = 0; + HbAction *dynamicAction = 0; HbAction *videoCommunicationAction = 0; HbAction *preferredAction = 0; CntStringMapper stringMapper; @@ -629,7 +590,8 @@ communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(subtype, context)); // TODO : uncomment next line when videotelephony is released - //videoCommunicationAction = menu->addAction(QString("VideoCall")); + Q_UNUSED(videoCommunicationAction) + //videoCommunicationAction = menu->addAction(QString("txt_phob_menu_call_video_number")); } } else if (action.compare("message", Qt::CaseInsensitive) == 0) @@ -645,7 +607,25 @@ else { communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(detail.definitionName(), QString())); - } + } + } + else if (action.compare("url", Qt::CaseInsensitive) == 0) + { + if (!detail.contexts().isEmpty()) + { + communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(detail.definitionName(), detail.contexts().first())); + } + else + { + communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(detail.definitionName(), QString())); + } + } + else if (1 > QContactAction::actionDescriptors(action, "symbian", 1).count()) + { + // Do verification that action is not internal type(vendor=symbian and version=1) + // If hard coded action is not found, fetch localization from dynamic action + // and create dynamic action item. + dynamicAction = menu->addAction(mDataContainer->dataItem(index)->longPressText()); } if (action.compare("call", Qt::CaseInsensitive) == 0) @@ -670,6 +650,11 @@ { communicationAction->setObjectName( "communicationAction" ); } + + if ( dynamicAction ) + { + dynamicAction->setObjectName( "dynamicAction" ); + } if ( preferredAction ) { @@ -697,6 +682,11 @@ { launchAction( *mContact, detail, action ); } + + if ( name == "dynamicAction" ) + { + launchDynamicAction(*mContact, detail, mDataContainer->dataItem(index)->actionDescriptor()); + } if ( name == "preferredAction" ) { @@ -718,6 +708,7 @@ void CntContactCardViewPrivate::handleSendBusinessCard( HbAction* aAction ) { + qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - IN"; QList list; if ( aAction && aAction->objectName() == "cancel" ) { @@ -762,13 +753,14 @@ QVersitContactExporter exporter; // The vCard version needs to be 2.1 due to backward compatiblity when sending - if (!exporter.exportContacts(list, QVersitDocument::VCard21Type)) + if (exporter.exportContacts(list, QVersitDocument::VCard21Type)) { - + qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard, VCard21Type"; QList docs = exporter.documents(); QFile f(vCardPath); if ( f.open(QIODevice::WriteOnly) ) { + qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard write VCard"; // Start creating the vCard QVersitWriter writer; writer.setDevice(&f); @@ -783,6 +775,7 @@ s.send(l,false); } } + qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - OUT"; } /*! @@ -804,11 +797,6 @@ } return true; } - else if (event->type() == QEvent::LayoutRequest && mScrollArea) - { - mContainerWidget->resize(mScrollArea->size().width(), mScrollArea->size().height()); - return true; - } else { return QObject::eventFilter(obj,event); @@ -821,12 +809,13 @@ */ void CntContactCardViewPrivate::doChangeImage() { - CntViewParameters viewParameters; - viewParameters.insert(EViewId, imageEditorView); QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); - mViewManager->changeView(viewParameters); + + mArgs.insert(ESelectedContact, var); + mArgs.insert(EViewId, imageEditorView); + + mViewManager->changeView( mArgs ); } /*! @@ -871,75 +860,16 @@ HbMenu *menu = new HbMenu(); menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(doChangeImage()) ); - menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(doRemoveImage()) ); - + if (mAvatar) + { + menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(doRemoveImage()) ); + } menu->setAttribute( Qt::WA_DeleteOnClose ); menu->setPreferredPos( aCoords ); menu->open(); } /*! -Check if the favourite group created -*/ -bool CntContactCardViewPrivate::isFavoriteGroupCreated() -{ - bool favoriteGroupCreated = false; - QContactDetailFilter groupFilter; - groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - groupFilter.setValue(QString(QLatin1String(QContactType::TypeGroup))); - - QList groupContactIds = contactManager()->contactIds(groupFilter); - - if (!groupContactIds.isEmpty()) - { - for(int i = 0;i < groupContactIds.count();i++) - { - QContact contact = contactManager()->contact(groupContactIds.at(i)); - QContactName contactName = contact.detail(); - QString groupName = contactName.customLabel(); - if(groupName.compare("Favorites") == 0) - { - favoriteGroupCreated = true; - mFavoriteGroupId = groupContactIds.at(i); - break; - } - } - } - return favoriteGroupCreated; -} - -/*! -Check if the contact is the favourite group -*/ -bool CntContactCardViewPrivate::isFavoriteGroupContact() -{ - bool favoriteGroupContact = false; - - if (isFavoriteGroupCreated()) - { - QContact favoriteGroup = contactManager()->contact(mFavoriteGroupId); - QContactRelationshipFilter rFilter; - rFilter.setRelationshipType(QContactRelationship::HasMember); - rFilter.setRelatedContactRole(QContactRelationship::First); - rFilter.setRelatedContactId(favoriteGroup.id()); - - QList contactsLocalIdList = contactManager()->contactIds(rFilter); - if (!contactsLocalIdList.isEmpty()) - { - for(int i = 0;i < contactsLocalIdList.count();i++) - { - QContact favContact = contactManager()->contact(contactsLocalIdList.at(i)); - if (favContact.localId() == mContact->localId()) - { - favoriteGroupContact = true; - } - } - } - } - return favoriteGroupContact; -} - -/*! Return the pointer to the document loader */ CntDocumentLoader* CntContactCardViewPrivate::document() diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Thu May 27 12:45:19 2010 +0300 @@ -36,6 +36,7 @@ #include "cnteditview.h" #include "cntmycardselectionview.h" #include "cntimportsview.h" +#include "cntsettingsview.h" #include "cntextensionmanager.h" CntDefaultViewFactory::CntDefaultViewFactory(): @@ -56,18 +57,12 @@ { case namesView: return new CntNamesView(*mExtensionManager); - case noView: case commLauncherView: return new CntContactCardView(); - case serviceContactCardView: - case serviceAssignContactCardView: - break; case myCardView: return new CntMyCardView(); case myCardSelectionView: return new CntMyCardSelectionView(); - case serviceContactSelectionView: - break; case collectionView: return new CntCollectionView(*mExtensionManager); case collectionFavoritesView: @@ -77,8 +72,6 @@ case editView: return new CntEditView(); case onlineAccountEditorView: - case serviceEditView: - case serviceSubEditView: break; case emailEditorView: @@ -95,8 +88,6 @@ case imageEditorView: return new CntImageEditorView(); - case serviceContactFetchView: - break; case groupMemberView: return new CntGroupMemberView(); case groupActionsView: @@ -105,6 +96,8 @@ return new CntHistoryView(); case importsView: return new CntImportsView(); + case settingsView: + return new CntSettingsView(); default: return createPluginView(aId); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp --- a/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Thu May 27 12:45:19 2010 +0300 @@ -133,26 +133,33 @@ void CntDefaultViewManager::deleteOldView() { - if (mOldView && !mOldView->view()->isVisible()) + disconnect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deleteOldView())); + + if (mOldView) { - disconnect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deleteOldView())); mOldView->deactivate(); - mMainWindow->removeView(mOldView->view()); - if (!mOldView->isDefault()) + // 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 (!mOldView->view()->isVisible()) { - delete mOldView; - mOldView = NULL; + 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 ); + } } - // 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); - } + mMainWindow->setInteractive(true); } void CntDefaultViewManager::switchView(const CntViewParameters aArgs, QFlags flags) diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntdetaileditor.cpp --- a/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Thu May 27 12:45:19 2010 +0300 @@ -90,20 +90,26 @@ mView->setNavigationAction(mSoftkey); } - QContact selectedContact = aArgs.value(ESelectedContact).value(); + QContact selectedContact; + if ( mId == groupEditorView ) + { + selectedContact = aArgs.value(ESelectedGroupContact).value(); + connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) ); + + } + else + { + selectedContact = aArgs.value(ESelectedContact).value(); + } mEditorFactory->setupEditorView(*this, selectedContact); mDataForm->setItemRecycling(true); // add new field if required - if ( aArgs.value(ESelectedAction).toString() == "add" ) { + if ( aArgs.value(ESelectedAction).toString() == "add" ) + { mDataFormModel->insertDetailField(); } - - if ( mId == groupEditorView ) - { - connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) ); - } } void CntDetailEditor::deactivate() @@ -168,7 +174,15 @@ QContact selected( *mDataFormModel->contact() ); QVariant var; var.setValue(selected); - mArgs.insert(ESelectedContact, var); + if ( mId == groupEditorView ) + { + mArgs.insert(ESelectedGroupContact, var); + } + else + { + mArgs.insert(ESelectedContact, var); + } + mViewManager->back( mArgs ); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnteditview_p.cpp --- a/phonebookui/pbkcommonui/src/cnteditview_p.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditview_p.cpp Thu May 27 12:45:19 2010 +0300 @@ -34,6 +34,7 @@ #include #include #include +#include const char *CNT_EDIT_XML = ":/xml/contacts_ev.docml"; @@ -122,8 +123,8 @@ setOrientation(window->orientation()); } - QVariant selectedAction = mArgs.value( EMyCard ); - QString myCard = selectedAction.toString(); + QString myCard = mArgs.value( EMyCard ).toString(); + QString selectedAction = mArgs.value( ESelectedAction ).toString(); QVariant contact = aArgs.value( ESelectedContact ); mContact = new QContact( contact.value() ); @@ -182,6 +183,21 @@ void CntEditViewPrivate::deactivate() { } + +void CntEditViewPrivate::openView(CntViewParameters& viewParams) +{ + QList keys = viewParams.keys(); + for(int i = 0;i < keys.count();i++) + { + mArgs.insert(keys.at(i), viewParams.value(keys.at(i))); + } + mMgr->changeView( mArgs ); +} + +void CntEditViewPrivate::requestRefresh() +{ + mModel->refreshExtensionItems(); +} void CntEditViewPrivate::activated( const QModelIndex& aIndex ) { @@ -189,8 +205,7 @@ QVariant type = item->data( ERoleItemType ); if ( type == QVariant(ETypeUiExtension) ) { - item->activated(); - mModel->refreshExtensionItems( aIndex ); + item->activated(this); } else { @@ -214,8 +229,7 @@ // Ui extensions handle the long press by themselves. if ( type == QVariant(ETypeUiExtension) ) { - item->longPressed( aCoords ); - mModel->refreshExtensionItems( aItem->modelIndex() ); + item->longPressed( aCoords, this ); } // only detail items are able to show context specific menu else @@ -235,7 +249,7 @@ CntEditViewItem* item = mModel->itemAt( index ); if ( aAction ) { - switch ( aAction->commandRole() ) + switch ( aAction->property("menu").toInt() ) { case HbAction::EditRole: { @@ -382,12 +396,25 @@ { mgr->setSelfContactId( mContact->localId() ); } + + emit contactUpdated(success); + + QString name = mgr->synthesizedDisplayLabel( *mContact ); + + if ( success ) + { + HbNotificationDialog::launchDialog(HbParameterLengthLimiter("txt_phob_dpophead_contact_1_saved").arg(name)); + } + else + { + //TODO: localization is missing + HbNotificationDialog::launchDialog(qtTrId("SAVING FAILED!")); + } + QVariant var; var.setValue(*mContact); mArgs.insert(ESelectedContact, var); - mArgs.insert( ESelectedAction, success ? "save" : "failed" ); - emit contactUpdated(success); - } + } } else { @@ -400,24 +427,28 @@ bool success = mgr->removeContact( mContact->localId() ); emit contactRemoved(success); - if ( success ) - { - mArgs.insert( ESelectedAction, "delete" ); - QVariant contact; - contact.setValue( c ); - mArgs.insert( ESelectedContact, contact ); - } } else { bool success = mgr->saveContact(mContact); - mArgs.insert( ESelectedAction, success ? "save" : "failed"); + + emit contactUpdated( success ); + + QString name = mgr->synthesizedDisplayLabel( *mContact ); + + if ( success ) + { + HbNotificationDialog::launchDialog(HbParameterLengthLimiter("txt_phob_dpophead_contacts_1_updated").arg(name)); + } + else + { + //TODO: localization is missing + HbNotificationDialog::launchDialog(qtTrId("SAVING FAILED!")); + } QVariant var; var.setValue(*mContact); - mArgs.insert(ESelectedContact, var); - - emit contactUpdated( success ); + mArgs.insert(ESelectedContact, var); } } } @@ -502,9 +533,8 @@ def == QContactUrl::DefinitionName || def == QContactNote::DefinitionName ) { - HbAction* add = menu->addAction(HbParameterLengthLimiter( - map->getContactEditorAddLocString(detail.definitionName(), ""))); - add->setCommandRole( HbAction::NewRole ); + HbAction* add = menu->addAction(map->getContactEditorAddLocString(detail.definitionName(), "")); + add->setProperty( "menu", HbAction::NewRole ); add->setData( data ); } @@ -532,18 +562,19 @@ context = QString(); subtype = detail.definitionName(); } - HbAction* edit = menu->addAction(HbParameterLengthLimiter(map->getContactEditorEditLocString(subtype, context))); - HbAction* del = menu->addAction(HbParameterLengthLimiter(map->getContactEditorDelLocString(subtype, context))); - edit->setCommandRole( HbAction::EditRole ); - del->setCommandRole( HbAction::DeleteRole ); - edit->setData( data ); - del->setData( data ); + + HbAction* edit = menu->addAction(hbTrId("txt_common_menu_edit")); + HbAction* del = menu->addAction(map->getContactEditorDelLocString(subtype, context)); + edit->setProperty( "menu", HbAction::EditRole ); + del->setProperty( "menu" , HbAction::DeleteRole ); + edit->setData( data ); + del->setData( data ); } else { - HbAction* edit = menu->addAction(HbParameterLengthLimiter(map->getContactEditorEditLocString(detail.definitionName(), ""))); - edit->setCommandRole( HbAction::EditRole ); - edit->setData( data ); + HbAction* add = menu->addAction(map->getContactEditorAddLocString(detail.definitionName(), "")); + add->setProperty( "menu", HbAction::NewRole ); + add->setData( data ); } return menu; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnteditviewdetailitem.cpp --- a/phonebookui/pbkcommonui/src/cnteditviewdetailitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditviewdetailitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -92,12 +92,14 @@ } } -void CntEditViewDetailItem::activated() +void CntEditViewDetailItem::activated(CntEditViewItemCallback* interface) { + Q_UNUSED( interface ); } -void CntEditViewDetailItem::longPressed(const QPointF &coords) +void CntEditViewDetailItem::longPressed(const QPointF &coords, CntEditViewItemCallback* interface) { + Q_UNUSED( interface ); Q_UNUSED( coords ); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnteditviewitembuilder.cpp --- a/phonebookui/pbkcommonui/src/cnteditviewitembuilder.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditviewitembuilder.cpp Thu May 27 12:45:19 2010 +0300 @@ -95,11 +95,11 @@ else if ( subtype == QContactOnlineAccount::SubTypeSipVoip ) { if ( context == QContactOnlineAccount::ContextHome ) - detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_home") ); + detailItem->addText( hbTrId("txt_phob_formlabel_internet_telephone") ); else if ( context == QContactOnlineAccount::ContextWork ) - detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_work") ); + detailItem->addText( hbTrId("txt_phob_formlabel_internet_telephone_home") ); else - detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone") ); + detailItem->addText( hbTrId("txt_phob_formlabel_internet_telephone_work") ); detailItem->addText( number.accountUri() ); list.append( detailItem ); @@ -149,7 +149,7 @@ else if ( context == QContactEmailAddress::ContextWork ) detailItem->addText(hbTrId("txt_phob_formlabel_email_work")); else - detailItem->addText( hbTrId("txt_phob_list_email") ); + detailItem->addText( hbTrId("txt_phob_formlabel_email") ); detailItem->addText( address.emailAddress() ); list.append( detailItem ); @@ -211,11 +211,11 @@ detailItem->addIcon( mMap->getContactEditorIconString(QContactUrl::DefinitionName, context) ); if ( context == QContactUrl::ContextHome ) - detailItem->addText( hbTrId("txt_phob_formlabel_address_home") ); + detailItem->addText( hbTrId("txt_phob_dblist_url_home") ); else if ( context == QContactUrl::ContextWork ) - detailItem->addText( hbTrId("txt_phob_formlabel_address_work") ); + detailItem->addText( hbTrId("txt_phob_dblist_url_work") ); else - detailItem->addText( hbTrId("txt_phob_list_url") ); + detailItem->addText( hbTrId("txt_phob_dblist_url") ); detailItem->addText( url.url() ); list.append( detailItem ); @@ -254,7 +254,7 @@ else if ( context == QContactAddress::ContextWork ) detailItem->addText(hbTrId("txt_phob_formlabel_address_work")); else - detailItem->addText(hbTrId("txt_phob_list_address")); + detailItem->addText(hbTrId("txt_phob_formlabel_address")); detailItem->addText( address ); list.append( detailItem ); @@ -285,7 +285,7 @@ org, fields, companyEditorView); - detailItem->addText( hbTrId("txt_phob_list_company_details") ); + detailItem->addText( hbTrId("txt_phob_formlabel_company_details") ); detailItem->addText( company ); list.append( detailItem ); } @@ -349,7 +349,7 @@ note, QContactNote::FieldNote, noteEditorView); - detailItem->addText( hbTrId("txt_phob_list_note") ); + detailItem->addText( hbTrId("txt_phob_formlabel_note") ); detailItem->addText( text ); list.append( detailItem ); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnteditviewlistmodel.cpp --- a/phonebookui/pbkcommonui/src/cnteditviewlistmodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditviewlistmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -158,9 +158,8 @@ } } -void CntEditViewListModel::refreshExtensionItems( const QModelIndex& aIndex ) +void CntEditViewListModel::refreshExtensionItems() { - Q_UNUSED( aIndex ); beginResetModel(); // remove all extension items for( int i(mItemList.count()-1); i >= 0; i-- ) diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnteditviewseparator.cpp --- a/phonebookui/pbkcommonui/src/cnteditviewseparator.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnteditviewseparator.cpp Thu May 27 12:45:19 2010 +0300 @@ -32,16 +32,18 @@ case Hb::ItemTypeRole: return QVariant( Hb::SeparatorItem ); case Qt::DisplayRole: - return QVariant(qtTrId("Details")); + return QVariant(hbTrId("txt_phob_subtitle_details")); default: return QVariant(); } } -void CntEditViewSeparator::activated() +void CntEditViewSeparator::activated(CntEditViewItemCallback* interface) { + Q_UNUSED( interface ); } -void CntEditViewSeparator::longPressed(const QPointF &coords) +void CntEditViewSeparator::longPressed(const QPointF &coords, CntEditViewItemCallback* interface) { + Q_UNUSED( interface ); Q_UNUSED( coords ); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -130,20 +130,20 @@ QString fieldAddress = QContactEmailAddress::FieldEmailAddress; QStandardItem *noContext = new QStandardItem; - noContext->setText(qtTrId("Email")); + noContext->setText(hbTrId("txt_phob_formlabel_val_email")); noContext->setData(fieldAddress, DetailSubType); noContext->setData(CNT_EMAIL_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(noContext); QStandardItem *home = new QStandardItem; - home->setText(qtTrId("Email (home)")); + home->setText(hbTrId("txt_phob_formlabel_val_email_home")); home->setData(fieldAddress, DetailSubType); home->setData(contextHome, DetailContext); home->setData(CNT_EMAIL_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(home); QStandardItem *work = new QStandardItem; - work->setText(qtTrId("Email (work)")); + work->setText(hbTrId("txt_phob_formlabel_val_email_work")); work->setData(fieldAddress, DetailSubType); work->setData(contextWork, DetailContext); work->setData(CNT_EMAIL_EDITOR_MAXLENGTH, DetailMaxLength); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntextensionmanager.cpp --- a/phonebookui/pbkcommonui/src/cntextensionmanager.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntextensionmanager.cpp Thu May 27 12:45:19 2010 +0300 @@ -20,6 +20,8 @@ #include #include "cntextensionmanager.h" +const char *CNT_UI_EXTENSION_PLUGIN_DIRECTORY = "/resource/qt/plugins/contacts/extensions/"; + CntExtensionManager::CntExtensionManager( QObject* aParent ): mPluginsLoaded(false) { @@ -81,8 +83,8 @@ // installed in runtime while contacts is running => new plugin should // be loaded when it is added to file system (assuming that this // extension API will be open for 3rd party plugins) - - QDir pluginsDir(QLibraryInfo::location(QLibraryInfo::PluginsPath)); + + QDir pluginsDir(CNT_UI_EXTENSION_PLUGIN_DIRECTORY); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { // Create plugin loader diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntfamilyeditormodel.cpp --- a/phonebookui/pbkcommonui/src/cntfamilyeditormodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfamilyeditormodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -32,12 +32,12 @@ QStringList children = mFamily.children(); HbDataFormModelItem* spouseItem = new HbDataFormModelItem(HbDataFormModelItem::TextItem, - qtTrId("Spouse")); + hbTrId("txt_phob_formlabel_spouse")); spouseItem->setContentWidgetData("text", mFamily.spouse()); spouseItem->setContentWidgetData("maxLength", CNT_SPOUSE_MAXLENGTH); HbDataFormModelItem* childrenItem = new HbDataFormModelItem(HbDataFormModelItem::TextItem, - qtTrId("Children")); + hbTrId("txt_phob_formlabel_children")); childrenItem->setContentWidgetData("text", children.join(", ")); childrenItem->setContentWidgetData("maxLength", CNT_CHILDREN_MAXLENGTH); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Thu May 27 12:45:19 2010 +0300 @@ -31,6 +31,7 @@ #include #include #include +#include const char *CNT_FAVORITESMEMBERVIEW_XML = ":/xml/contacts_favmember.docml"; @@ -89,7 +90,7 @@ if (mView->navigationAction() != mSoftkey) mView->setNavigationAction(mSoftkey); - mContact = new QContact(aArgs.value(ESelectedContact).value()); + mContact = new QContact(aArgs.value(ESelectedGroupContact).value()); mViewManager = aMgr; mFavoriteListView = static_cast (mDocumentLoader.findWidget("listView")); @@ -107,32 +108,14 @@ HbFrameBackground frame; frame.setFrameGraphicsName("qtg_fr_list_normal"); frame.setFrameType(HbFrameDrawer::NinePieces); + mFavoriteListView->itemPrototypes().first()->setDefaultFrame(frame); - + mFavoriteListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape); mFavoriteListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail); if (!mModel) { - QContactRelationshipFilter rFilter; - rFilter.setRelationshipType(QContactRelationship::HasMember); - rFilter.setRelatedContactRole(QContactRelationship::First); - rFilter.setRelatedContactId(mContact->id()); - - QContactSortOrder sortOrderFirstName; - sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldFirst); - sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); - - QContactSortOrder sortOrderLastName; - sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldLast); - sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); - - QList sortOrders; - sortOrders.append(sortOrderFirstName); - sortOrders.append(sortOrderLastName); - - mModel = new MobCntModel(mViewManager->contactManager(SYMBIAN_BACKEND), rFilter, sortOrders, false); + createModel(); } mFavoriteListView->setModel(mModel); @@ -164,8 +147,35 @@ { groupSelectionPopup->saveOldGroup(); } + delete mModel; + mModel = 0; + createModel(); + mFavoriteListView->setModel(mModel); + } +void CntFavoritesMemberView::createModel() +{ + QContactRelationshipFilter rFilter; + rFilter.setRelationshipType(QContactRelationship::HasMember); + rFilter.setRelatedContactRole(QContactRelationship::First); + rFilter.setRelatedContactId(mContact->id()); + QContactSortOrder sortOrderFirstName; + sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldFirst); + sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); + + QContactSortOrder sortOrderLastName; + sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldLast); + sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); + + QList sortOrders; + sortOrders.append(sortOrderFirstName); + sortOrders.append(sortOrderLastName); + + mModel = new MobCntModel(mViewManager->contactManager(SYMBIAN_BACKEND), rFilter, sortOrders, false); +} /*! Called when a list item is longpressed @@ -192,7 +202,7 @@ openContactAction = menu->addAction(hbTrId("txt_common_menu_open")); editContactAction = menu->addAction(hbTrId("txt_common_menu_edit")); removeFromFavoritesAction = menu->addAction(hbTrId("txt_phob_menu_remove_from_favorites")); - sendToHsAction = menu->addAction(hbTrId("Send to HS")); + sendToHsAction = menu->addAction(hbTrId("txt_phob_menu_send_to_homescreen")); openContactAction->setData( data ); editContactAction->setData( data ); @@ -212,11 +222,11 @@ if ( action == menuItem->actions().first() ) { - openContact(index); + openContact(index); } else if (action == menuItem->actions().at(1)) { - editContact(index); + editContact(index); } else if (action == menuItem->actions().at(2)) { @@ -224,7 +234,7 @@ } else if (action == menuItem->actions().at(3)) { - // sendToHs(index); + sendToHs(index); } } @@ -240,7 +250,6 @@ QVariant varGroup; varGroup.setValue(*mContact); viewParameters.insert(ESelectedGroupContact, varGroup); - viewParameters.insert(ESelectedAction, "FromGroupMemberView"); mViewManager->changeView(viewParameters); } @@ -270,3 +279,19 @@ mViewManager->contactManager(SYMBIAN_BACKEND)->removeRelationship(relationship); } +/*! +Called after user clicked on the listview. +*/ +void CntFavoritesMemberView::sendToHs(const QModelIndex &index) +{ + QVariantHash preferences; + preferences["contactId"] = mModel->contact(index).id().localId(); + + XQServiceRequest snd("com.nokia.services.hsapplication.IHomeScreenClient", + "addWidget(QString,QVariantHash)" + ,false); + snd << QString("hscontactwidgetplugin"); + snd << preferences; + snd.send(); +} + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntfavoritesview.cpp --- a/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Thu May 27 12:45:19 2010 +0300 @@ -67,7 +67,7 @@ connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); setOrientation(window->orientation()); - mContact = new QContact(aArgs.value(ESelectedContact).value()); + mContact = new QContact(aArgs.value(ESelectedGroupContact).value()); mViewManager = aMgr; HbPushButton *addButton = static_cast(mDocumentLoader.findWidget(QString("cnt_button_add"))); @@ -101,7 +101,7 @@ viewParameters.insert(EViewId, FavoritesMemberView); QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } else diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntfavourite.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntfavourite.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,116 @@ +/* +* 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 "cntfavourite.h" + +QContactLocalId CntFavourite::createFavouriteGroup( QContactManager* aManager ) +{ + QContactLocalId favouriteId = CntFavourite::favouriteGroupId(aManager); + + if ( favouriteId == 0 ) + { + QContact favouriteGroup; + favouriteGroup.setType( QContactType::TypeGroup ); + + QContactName favouriteGroupName; + favouriteGroupName.setCustomLabel( QLatin1String(FavouriteGroupName) ); + + favouriteGroup.saveDetail( &favouriteGroupName ); + if ( aManager->saveContact( &favouriteGroup ) ) + { + favouriteId = favouriteGroup.localId(); + } + } + return favouriteId; +} + +QContactLocalId CntFavourite::favouriteGroupId( QContactManager* aManager ) +{ + QContactLocalId favouriteId( 0 ); + + QContactDetailFilter groupFilter; + groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); + groupFilter.setValue(QString(QLatin1String(QContactType::TypeGroup))); + + QList groupContactIds = aManager->contactIds( groupFilter ); + + for(int i = 0;i < groupContactIds.count();i++) + { + QContact contact = aManager->contact(groupContactIds.at(i)); + QContactName contactName = contact.detail(); + QString groupName = contactName.customLabel(); + if ( groupName.compare(QLatin1String(FavouriteGroupName)) == 0 ) + { + favouriteId = groupContactIds.at(i); + break; + } + } + + return favouriteId; +} + +bool CntFavourite::isMemberOfFavouriteGroup( QContactManager* aManager, QContact* aContact ) +{ + bool favouriteGroupContact( false ); + QContactLocalId favouriteId = CntFavourite::favouriteGroupId( aManager ); + if ( favouriteId != 0 ) + { + QContact favoriteGroup = aManager->contact( favouriteId ); + QContactRelationshipFilter rFilter; + rFilter.setRelationshipType( QContactRelationship::HasMember ); + rFilter.setRelatedContactRole( QContactRelationship::First ); + rFilter.setRelatedContactId( favoriteGroup.id() ); + + QList contactsLocalIdList = aManager->contactIds( rFilter ); + favouriteGroupContact = contactsLocalIdList.contains( aContact->localId() ); + } + return favouriteGroupContact; +} + +void CntFavourite::addContactToFavouriteGroup( QContactManager* aManager, QContactId& aId) +{ + QContactLocalId favouriteId = CntFavourite::favouriteGroupId( aManager ); + if ( favouriteId == 0 ) + { + favouriteId = CntFavourite::createFavouriteGroup( aManager ); + } + + QContact favoriteGroup = aManager->contact( favouriteId ); + + // new contact added to the favorite group + QContactRelationship relationship; + relationship.setRelationshipType(QContactRelationship::HasMember); + relationship.setFirst( favoriteGroup.id() ); + relationship.setSecond( aId ); + + // save relationship + aManager->saveRelationship( &relationship ); +} + +void CntFavourite::removeContactFromFavouriteGroup( QContactManager* aManager, QContactId& aId ) +{ + QContactLocalId favouriteId = CntFavourite::favouriteGroupId( aManager ); + if ( favouriteId != 0 ) + { + QContact favoriteGroup = aManager->contact( favouriteId ); + QContactRelationship relationship; + relationship.setRelationshipType( QContactRelationship::HasMember ); + relationship.setFirst( favoriteGroup.id() ); + relationship.setSecond( aId ); + aManager->removeRelationship(relationship); + } +} +// End of File diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp --- a/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp Thu May 27 12:45:19 2010 +0300 @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include "cntfetchcontactsview.h" @@ -53,7 +53,7 @@ { mSearchPanel = new HbSearchPanel(); mSearchPanel->setVisible(false); - connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(closeFind())); + mSearchPanel->setCancelEnabled(false); connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString))); mLayout = new QGraphicsLinearLayout(Qt::Vertical); @@ -145,18 +145,6 @@ return mCurrentlySelected; } -void CntFetchContacts::closeFind() -{ - if (mSearchPanel) { - QContactDetailFilter filter; - filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - QString typeContact = QContactType::TypeContact; - filter.setValue(typeContact); - - mSearchPanel->deleteLater(); - } -} - void CntFetchContacts::setFilter(const QString &filterString) { QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts); @@ -254,6 +242,12 @@ 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, @@ -264,38 +258,43 @@ mSearchPanel->setVisible(true); - mPopup = new HbDialog; - 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()) { - mListView->setVisible(false); - if (!mEmptyListLabel) { - mEmptyListLabel = new HbTextItem(hbTrId("(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); + if (!mPopup) { + mPopup = new HbDialog; } - mCntModel->showMyCard(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()) { + 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); + } } void CntFetchContacts::connectSignal() @@ -322,13 +321,15 @@ } mPopup->setHeadingWidget(mLabel); - if (!mButtonText.isEmpty()) { + if (!mButtonText.isEmpty() && !mPrimaryAction) { mPrimaryAction = new HbAction(hbTrId(mButtonText.toAscii())); mPopup->addAction(mPrimaryAction); } - mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); - mPopup->addAction(mSecondaryAction); + if (!mSecondaryAction) { + mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); + mPopup->addAction(mSecondaryAction); + } mPopup->open(this, SLOT(handleUserResponse(HbAction*))); } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntgroupactionsview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Thu May 27 12:45:19 2010 +0300 @@ -85,7 +85,7 @@ viewParameters.insert(EViewId, groupEditorView); QVariant var; var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } @@ -99,7 +99,7 @@ CntViewParameters viewParameters; QVariant var; var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->back(viewParameters); } @@ -116,7 +116,7 @@ if (mView->navigationAction() != mSoftkey) mView->setNavigationAction(mSoftkey); - mGroupContact = new QContact(aArgs.value(ESelectedContact).value()); + mGroupContact = new QContact(aArgs.value(ESelectedGroupContact).value()); mViewManager = aMgr; QContactName groupContactName = mGroupContact->detail( QContactName::DefinitionName ); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp --- a/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Thu May 27 12:45:19 2010 +0300 @@ -54,7 +54,7 @@ // set the listview to multiSelection mode, this will bring MarkAll functionality (from Orbit) mListView->setSelectionMode(HbAbstractItemView::MultiSelection); mListView->setFrictionEnabled(true); - mListView->setScrollingStyle(HbScrollArea::PanOrFlick); + mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); setContentWidget(mListView); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntgroupmemberview.cpp --- a/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Thu May 27 12:45:19 2010 +0300 @@ -64,7 +64,6 @@ mImageLabel(NULL), mListView(NULL), mFetchView(NULL), - mIsPreviousImageEditorView(false), mAvatar(NULL) { @@ -84,6 +83,7 @@ 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, @@ -92,6 +92,7 @@ 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 @@ -159,14 +160,9 @@ mView->setNavigationAction(mSoftkey); } - QVariant contact = aArgs.value( ESelectedContact ); + QVariant contact = aArgs.value( ESelectedGroupContact ); mGroupContact = new QContact( contact.value() ); - if (aArgs.value(ECustomParam).toInt() == imageEditorView) - { - mIsPreviousImageEditorView = true; - } - HbMainWindow* window = mView->mainWindow(); if ( window ) { @@ -203,27 +199,7 @@ frame.setFrameType(HbFrameDrawer::NinePieces); mListView->itemPrototypes().first()->setDefaultFrame(frame); - QContactRelationshipFilter rFilter; - rFilter.setRelationshipType(QContactRelationship::HasMember); - rFilter.setRelatedContactRole(QContactRelationship::First); - rFilter.setRelatedContactId(mGroupContact->id()); - - QContactSortOrder sortOrderFirstName; - sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldFirst); - sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); - - QContactSortOrder sortOrderLastName; - sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, - QContactName::FieldLast); - sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); - - QList sortOrders; - sortOrders.append(sortOrderFirstName); - sortOrders.append(sortOrderLastName); - - mModel = new MobCntModel(getContactManager(), rFilter, sortOrders, false); - mListView->setModel(mModel); + createModel(); if (aArgs.value(ESelectedAction).toString() == "save") { @@ -242,12 +218,18 @@ void CntGroupMemberView::showPreviousView() { - //save an avatar - if (mIsPreviousImageEditorView) + //save the contact if avatar has been changed. + QContact contact = mViewManager->contactManager( SYMBIAN_BACKEND )->contact(mGroupContact->localId()); + if ( contact != *mGroupContact ) { - if (!mAvatar->imageUrl().isEmpty()) + QList details = mGroupContact->details(); + for (int i = 0; i < details.count(); i++) { - mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact); + if (!details.at(i).imageUrl().isEmpty()) + { + getContactManager()->saveContact(mGroupContact); + break; + } } } @@ -261,7 +243,7 @@ viewParameters.insert(EViewId, groupActionsView); QVariant var; var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } @@ -269,15 +251,20 @@ { QContactRelationshipFilter membersFilter; membersFilter.setRelationshipType(QContactRelationship::HasMember); - membersFilter.setRelatedContactRole(QContactRelationshipFilter::First); + 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_subtitle_1_group")).arg(groupName), - hbTrId("Save")); + hbTrId("txt_common_button_save")); mFetchView->displayContacts(CntFetchContacts::popup, HbAbstractItemView::MultiSelection, contactsSet); @@ -285,6 +272,7 @@ void CntGroupMemberView::handleManageMembers() { + QSet selectedContacts = mFetchView->getSelectedContacts(); if (mFetchView->wasCanceled()) { @@ -321,14 +309,46 @@ membership.setSecond(contact.id()); addedMemberships.append(membership); } - + + QMap errors; if (!addedMemberships.isEmpty()) { - getContactManager()->saveRelationships(&addedMemberships); + getContactManager()->saveRelationships(&addedMemberships, &errors); } if (!removedMemberships.isEmpty()) { - getContactManager()->removeRelationships(removedMemberships); + getContactManager()->removeRelationships(removedMemberships, &errors); } + + // delete the model and recreate it with relationship changes + delete mModel; + mModel = 0; + + createModel(); +} + +void CntGroupMemberView::createModel() +{ + QContactRelationshipFilter rFilter; + rFilter.setRelationshipType(QContactRelationship::HasMember); + rFilter.setRelatedContactRole(QContactRelationship::First); + rFilter.setRelatedContactId(mGroupContact->id()); + + QContactSortOrder sortOrderFirstName; + sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldFirst); + sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive); + + QContactSortOrder sortOrderLastName; + sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, + QContactName::FieldLast); + sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive); + + QList sortOrders; + sortOrders.append(sortOrderFirstName); + sortOrders.append(sortOrderLastName); + + mModel = new MobCntModel(getContactManager(), rFilter, sortOrders, false); + mListView->setModel(mModel); } void CntGroupMemberView::editGroup() @@ -337,7 +357,7 @@ viewParameters.insert(EViewId, groupEditorView); QVariant var; var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); + viewParameters.insert(ESelectedGroupContact, var); mViewManager->changeView(viewParameters); } @@ -394,9 +414,7 @@ { int row = action->data().toInt(); HbMenu *menuItem = static_cast(sender()); - QModelIndex index = mModel->index(row, 0); - - int id = index.data(Qt::UserRole).toInt(); + QModelIndex index = mModel->index(row); if ( action == menuItem->actions().first() ) { @@ -426,7 +444,6 @@ QVariant varGroup; varGroup.setValue(*mGroupContact); viewParameters.insert(ESelectedGroupContact, varGroup); - viewParameters.insert(ESelectedAction, "FromGroupMemberView"); mViewManager->changeView(viewParameters); } @@ -440,6 +457,12 @@ relationship.setFirst(mGroupContact->id()); relationship.setSecond(selectedContact.id()); getContactManager()->removeRelationship(relationship); + + // delete the model and recreate it with relationship changes + delete mModel; + mModel = NULL; + + createModel(); } void CntGroupMemberView::editContact(const QModelIndex &index) @@ -474,7 +497,12 @@ var.setValue(*mGroupContact); CntViewParameters viewParameters; + // 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. + viewParameters.insert(ESelectedGroupContact, var); viewParameters.insert(ESelectedContact, var); + viewParameters.insert(EViewId, imageEditorView ); mViewManager->changeView( viewParameters ); @@ -482,8 +510,6 @@ QContactManager* CntGroupMemberView::getContactManager() { - if (!mViewManager) return NULL; - return mViewManager->contactManager(SYMBIAN_BACKEND); } @@ -493,50 +519,32 @@ void CntGroupMemberView::drawImageMenu(const QPointF &aCoords) { HbMenu *menu = new HbMenu(); - HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture")); - HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image")); + 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(this, SLOT(handleImageMenu(HbAction*))); + menu->open(); } -void CntGroupMemberView::handleImageMenu(HbAction* action) -{ - HbMenu *menuItem = static_cast(sender()); - if ( action == menuItem->actions().first() ) { - changeImage(); - } - else if (action == menuItem->actions().at(1)) { - removeImage(); - } -} - -void CntGroupMemberView::changeImage() -{ - CntViewParameters viewParameters; - viewParameters.insert(EViewId, imageEditorView); - QVariant var; - var.setValue(*mGroupContact); - viewParameters.insert(ESelectedContact, var); - mViewManager->changeView(viewParameters); -} void CntGroupMemberView::removeImage() { -if (mAvatar) + if (mAvatar) { - if (!mAvatar->imageUrl().isEmpty()) + if (!mAvatar->imageUrl().isEmpty()) + { + mGroupContact->removeDetail(mAvatar); + // Check if image removable. + CntImageUtility imageUtility; + if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString())) { - mGroupContact->removeDetail(mAvatar); - // Check if image removable. - CntImageUtility imageUtility; - if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString())) - { - imageUtility.removeImage(mAvatar->imageUrl().toString()); - } - mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact); - mHeadingItem->setIcon(HbIcon("qtg_large_avatar")); - + imageUtility.removeImage(mAvatar->imageUrl().toString()); } + mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact); + mHeadingItem->setIcon(HbIcon("qtg_large_avatar")); + } } } diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntgroupselectionpopup.cpp --- a/phonebookui/pbkcommonui/src/cntgroupselectionpopup.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntgroupselectionpopup.cpp Thu May 27 12:45:19 2010 +0300 @@ -151,7 +151,7 @@ setContentWidget(mContainerWidget); - HbAction *mPrimaryAction = new HbAction(hbTrId("Save"), this); + HbAction *mPrimaryAction = new HbAction(hbTrId("txt_common_button_save"), this); addAction(mPrimaryAction); HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), this); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnthistoryview.cpp --- a/phonebookui/pbkcommonui/src/cnthistoryview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnthistoryview.cpp Thu May 27 12:45:19 2010 +0300 @@ -97,7 +97,8 @@ void CntHistoryView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) { mViewMgr = aMgr; - mContact = new QContact(aArgs.value(ESelectedContact).value()); + mArgs = aArgs; + mContact = new QContact(mArgs.value(ESelectedContact).value()); // Set history view heading HbGroupBox* groupBox = static_cast(docLoader()->findWidget(QString("groupBox"))); @@ -192,7 +193,7 @@ if (!v.isValid()) return; - QString service("com.nokia.services.telephony"); + QString service("com.nokia.symbian.ICallDial"); QString type("dial(QString)"); XQServiceRequest snd(service, type, false); snd << v.toString(); @@ -217,11 +218,10 @@ */ void CntHistoryView::showPreviousView() { - CntViewParameters viewParameters; QVariant var; var.setValue(*mContact); - viewParameters.insert(ESelectedContact, var); - mViewMgr->back(viewParameters); + mArgs.insert(ESelectedContact, var); + mViewMgr->back( mArgs ); } /*! diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp --- a/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -22,6 +22,8 @@ #include #define NEW_EVENT_FRAME "qtg_fr_list_new_item" +#define INCOMING_FOCUS_FRAME "qtg_fr_convlist_received_pressed" +#define OUTGOING_FOCUS_FRAME "qtg_fr_convlist_sent_pressed" //--------------------------------------------------------------- // HbListViewItem::HbListViewItem @@ -31,7 +33,8 @@ : HbListViewItem(parent), mIncoming(false), mNewMessage(false), - mNewItem(NULL) + mNewItem(NULL), + mFocusItem(NULL) { } @@ -53,7 +56,7 @@ int flags = modelIndex().data(CntHistoryModel::FlagsRole).toInt(); mIncoming = flags & CntHistoryModel::Incoming ? true : false; mNewMessage = flags & CntHistoryModel::Unseen ? true : false; - + if (mNewMessage) { if (!mNewItem) @@ -70,7 +73,52 @@ mNewItem = NULL; } } - + HbListViewItem::updateChildItems(); } + +//--------------------------------------------------------------- +// HbAbstractViewItem::pressStateChanged +// This function is called whenever item press state changes. +//--------------------------------------------------------------- +void CntHistoryViewItem::pressStateChanged(bool pressed, bool animate) +{ + Q_UNUSED(animate); + if (pressed) + { + if (!mFocusItem) + { + // focus frame position can't be read from widgetml, we set it manually + QRectF frameRect = HbWidget::primitive("frame")->boundingRect(); + QPointF framePoint = HbWidget::primitive("frame")->pos(); + + // W12: + //QRectF frameRect = primitive(HbStyle::P_ItemViewItem_frame)->boundingRect(); + //QPointF framePoint = primitive(HbStyle::P_ItemViewItem_frame)->pos(); + + frameRect.moveTo(framePoint); + + if (mIncoming) + { + mFocusItem = new HbFrameItem(INCOMING_FOCUS_FRAME, HbFrameDrawer::NinePieces, this); + } + else + { + mFocusItem = new HbFrameItem(OUTGOING_FOCUS_FRAME, HbFrameDrawer::NinePieces, this); + } + + mFocusItem->setGeometry(frameRect); + mFocusItem->setZValue(-1.0); + style()->setItemName(mFocusItem, "focusframe"); + } + } + else + { + if (mFocusItem) + { + delete mFocusItem; + mFocusItem = NULL; + } + } +} // EOF diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntimageeditorview.cpp --- a/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Thu May 27 12:45:19 2010 +0300 @@ -32,9 +32,9 @@ const char *CNT_IMAGE_XML = ":/xml/contacts_if.docml"; -#define FETCHER_SERVICE "com.nokia.services.media" -#define FETCHER_INTERFACE "image" -#define FETCHER_OPERATION "fetch(QVariantMap,QVariant)" +#define FETCHER_SERVICE "photos" +#define FETCHER_INTERFACE "com.nokia.symbian.IImageFetch" +#define FETCHER_OPERATION "fetch()" /*! Constructor @@ -194,7 +194,7 @@ mRequest = 0; } - mRequest = mAppManager.create(FETCHER_SERVICE, FETCHER_INTERFACE, FETCHER_OPERATION, false); + mRequest = mAppManager.create(FETCHER_SERVICE, FETCHER_INTERFACE, FETCHER_OPERATION, true); if ( mRequest ) { connect(mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleImageChange(const QVariant&))); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntimagelabel.cpp --- a/phonebookui/pbkcommonui/src/cntimagelabel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimagelabel.cpp Thu May 27 12:45:19 2010 +0300 @@ -18,12 +18,13 @@ #include "cntimagelabel.h" #include +#include #include CntImageLabel::CntImageLabel(QGraphicsItem *parent) : HbLabel(parent) { - + grabGesture(Qt::TapGesture); } CntImageLabel::~CntImageLabel() @@ -31,17 +32,33 @@ } -void CntImageLabel::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - HbInstantFeedback::play(HbFeedback::Basic); - event->accept(); +void CntImageLabel::gestureEvent(QGestureEvent* event) +{ + if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) + { + switch (tap->state()) + { + case Qt::GestureFinished: + if (tap->tapStyleHint() == HbTapGesture::Tap) + { + HbInstantFeedback::play(HbFeedback::Basic); + emit iconClicked(); + } + break; + case Qt::GestureUpdated: + if (tap->tapStyleHint() == HbTapGesture::TapAndHold) + { + emit iconLongPressed(tap->position()); + } + break; + default: + break; + } + event->accept(); + } + else + { + event->ignore(); + } } -void CntImageLabel::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - if (rect().contains(event->pos())) - { - emit iconClicked(); - } - event->accept(); -} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntimportsview.cpp --- a/phonebookui/pbkcommonui/src/cntimportsview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntimportsview.cpp Thu May 27 12:45:19 2010 +0300 @@ -26,8 +26,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -93,8 +92,8 @@ */ void CntImportsView::showPreviousView() { - CntViewParameters args; - mViewManager->back(args); + CntViewParameters args; + mViewManager->back(args); } /* @@ -445,31 +444,31 @@ void CntImportsView::showWaitNote() { mImportSimPopup = new HbDialog(); - mImportSimPopup->setDismissPolicy(HbDialog::NoDismiss); - mImportSimPopup->setTimeout(0); + mImportSimPopup->setDismissPolicy(HbPopup::NoDismiss); + mImportSimPopup->setTimeout(HbPopup::NoTimeout); mImportSimPopup->setBackgroundFaded(true); mImportSimPopup->setAttribute(Qt::WA_DeleteOnClose, true); - HbGroupBox *groupBox = new HbGroupBox; - groupBox->setHeading(hbTrId("txt_phob_title_import_contacts")); - mImportSimPopup->setHeadingWidget(groupBox); + HbLabel *headingLabel = new HbLabel(mImportSimPopup); + headingLabel->setPlainText(hbTrId("txt_phob_title_import_contacts")); + mImportSimPopup->setHeadingWidget(headingLabel); QGraphicsLinearLayout *containerLayout = new QGraphicsLinearLayout(Qt::Vertical); containerLayout->setContentsMargins(0, 0, 0, 0); containerLayout->setSpacing(10); - HbLabel *icon = new HbLabel(); + HbLabel *icon = new HbLabel(mImportSimPopup); icon->setIcon(HbIcon("qtg_large_sim")); - HbLabel *simText= new HbLabel(); + HbLabel *simText= new HbLabel(mImportSimPopup); simText->setPlainText(hbTrId("txt_phob_info_importing_contacts_from_sim")); simText->setTextWrapping(Hb::TextWordWrap); simText->setElideMode(Qt::ElideNone); - HbProgressBar *progressBar = new HbProgressBar; + HbProgressBar *progressBar = new HbProgressBar(mImportSimPopup); progressBar->setRange(0,0); - HbPushButton *stopButton = new HbPushButton; + HbPushButton *stopButton = new HbPushButton(mImportSimPopup); stopButton->setText(hbTrId("txt_phob_button_cancel")); connect(stopButton, SIGNAL(clicked()), this, SLOT(stopSimImport())); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntmycardview.cpp --- a/phonebookui/pbkcommonui/src/cntmycardview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp Thu May 27 12:45:19 2010 +0300 @@ -74,8 +74,9 @@ { mViewManager = aMgr; - if (mView->navigationAction() != mSoftkey) + if (mView->navigationAction() != mSoftkey) { mView->setNavigationAction(mSoftkey); + } HbMainWindow* window = mView->mainWindow(); connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); @@ -97,13 +98,14 @@ chooseButton->setEnabled(false); } - mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection())); + if (!mFetchView) { + mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND )); + connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection())); + } } void CntMyCardView::deactivate() { - } void CntMyCardView::setOrientation(Qt::Orientation orientation) @@ -141,7 +143,7 @@ void CntMyCardView::openMyCardSelectionView() { // Display a list of contacts to choose a mycard from. - mFetchView->setDetails(hbTrId("txt_phob_subtitle_my_card"),hbTrId("Save")); + mFetchView->setDetails(hbTrId("txt_phob_title_select_contact"), ""); QSet emptyContactsSet; mFetchView->displayContacts(CntFetchContacts::popup, HbAbstractItemView::SingleSelection, @@ -157,11 +159,32 @@ if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) { QList selectedContactsList = selectedContacts.values(); manager->setSelfContactId(selectedContactsList.front()); + + QContact contact = mViewManager->contactManager(SYMBIAN_BACKEND)->contact(selectedContactsList.front()); + removeFromGroup(&contact); + + showPreviousView(); } - - CntViewParameters viewParameters; - viewParameters.insert(EViewId, namesView); - mViewManager->changeView(viewParameters); +} + +void CntMyCardView::removeFromGroup(const QContact* aContact) +{ + QContactDetailFilter groupFilter; + groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); + groupFilter.setValue(QLatin1String(QContactType::TypeGroup)); + + QContactManager* mgr = mViewManager->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); + } + } } // EOF diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntnameeditormodel.cpp --- a/phonebookui/pbkcommonui/src/cntnameeditormodel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnameeditormodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -39,12 +39,12 @@ iNick = nickList.first(); HbDataFormModelItem::DataItemType text = HbDataFormModelItem::TextItem; - HbDataFormModelItem* firstname = new HbDataFormModelItem(text, qtTrId("First name")); - HbDataFormModelItem* lastname = new HbDataFormModelItem(text, qtTrId("Last name")); - HbDataFormModelItem* middlename = new HbDataFormModelItem(text,qtTrId("Middle name")); - HbDataFormModelItem* nickname = new HbDataFormModelItem(text, qtTrId("Nick name")); - HbDataFormModelItem* prefix = new HbDataFormModelItem(text, qtTrId("Prefix")); - HbDataFormModelItem* suffix = new HbDataFormModelItem(text, qtTrId("Suffix")); + HbDataFormModelItem* firstname = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_first_name")); + HbDataFormModelItem* lastname = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_last_name")); + HbDataFormModelItem* middlename = new HbDataFormModelItem(text,hbTrId("txt_phob_formlabel_middle_name")); + HbDataFormModelItem* nickname = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_nick_name")); + HbDataFormModelItem* prefix = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_prefix")); + HbDataFormModelItem* suffix = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_sufix")); firstname->setContentWidgetData("text", iName.firstName()); firstname->setContentWidgetData("maxLength", CNT_FIRSTNAME_MAXLENGTH); @@ -94,6 +94,7 @@ { mContact->removeDetail( &iName ); } + if(iNick.nickname().isEmpty()) { mContact->removeDetail( &iNick ); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntnamesview_p.cpp --- a/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Thu May 27 12:45:19 2010 +0300 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -101,6 +100,9 @@ SLOT(showContextMenu(HbAbstractViewItem*,QPointF))); connect(list(), SIGNAL(activated (const QModelIndex&)), this, SLOT(showContactView(const QModelIndex&))); + + HbAction* settings = static_cast(document()->findObject("cnt:settings") ); + connect( settings, SIGNAL(triggered()), this, SLOT(showSettings()) ); } CntNamesViewPrivate::~CntNamesViewPrivate() @@ -134,6 +136,7 @@ void CntNamesViewPrivate::activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) { + Q_UNUSED( aArgs ) mViewManager = aMgr; if (!mListModel) { QContactSortOrder sortOrderFirstName; @@ -172,35 +175,31 @@ } QContactManager* contactManager = aMgr->contactManager( SYMBIAN_BACKEND ); - if ( aArgs.contains(ESelectedContact) ) - { - QContact selectedContact = aArgs.value(ESelectedContact).value(); - QString action = aArgs.value(ESelectedAction).toString(); - - if ( action == "save" ) - { - QString name = contactManager->synthesizedDisplayLabel( selectedContact ); - HbNotificationDialog::launchDialog(qtTrId("Contact \"%1\" saved").arg(name)); - } - - else if ( action == "delete" ) - { - QString name = contactManager->synthesizedDisplayLabel( selectedContact ); - HbNotificationDialog::launchDialog(qtTrId("%1 deleted").arg(name)); - } - else if ( action == "failed") - { - HbNotificationDialog::launchDialog(qtTrId("SAVING FAILED!")); - } - } + + disableDeleteAction(); + connect(contactManager, SIGNAL(contactsAdded(const QList&)), + this, SLOT(handleContactAddition(const QList&))); - bool multipleContacts = mListModel->rowCount() >= CNT_MIN_ROW_COUNT; - mMultipleDeleter->setEnabled(multipleContacts); + connect(contactManager, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(handleContactRemoval(const QList&))); + + connect(contactManager, SIGNAL(selfContactIdChanged(const QContactLocalId&, const QContactLocalId&)), + this, SLOT(handleSelfContactIdChange(const QContactLocalId&, const QContactLocalId&))); } void CntNamesViewPrivate::deactivate() { hideFinder(); + + QContactManager* contactManager = mViewManager->contactManager( SYMBIAN_BACKEND ); + disconnect(contactManager, SIGNAL(contactsAdded(const QList&)), + this, SLOT(handleContactAddition(const QList&))); + + disconnect(contactManager, SIGNAL(contactsRemoved(const QList&)), + this, SLOT(handleContactRemoval(const QList&))); + + disconnect(contactManager, SIGNAL(selfContactIdChanged(const QContactLocalId&, const QContactLocalId&)), + this, SLOT(handleSelfContactIdChange(const QContactLocalId&, const QContactLocalId&))); delete mMenuBuilder; mMenuBuilder = NULL; @@ -210,6 +209,12 @@ mSearchPanel = NULL; } +void CntNamesViewPrivate::disableDeleteAction() +{ + bool multipleContacts = mListModel->rowCount() >= CNT_MIN_ROW_COUNT; + mMultipleDeleter->setEnabled(multipleContacts); +} + void CntNamesViewPrivate::setFilter(const QString &filterString) { QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts); @@ -286,33 +291,41 @@ void CntNamesViewPrivate::hideFinder() { - layout()->removeItem(emptyLabel()); - layout()->removeItem(search()); - emptyLabel()->setVisible(false); - search()->setVisible(false); + if ( mSearchPanel ) + { + layout()->removeItem(emptyLabel()); + layout()->removeItem(search()); + emptyLabel()->setVisible(false); + search()->setVisible(false); - hideBanner(); + hideBanner(); - layout()->addItem(list()); - list()->setVisible(true); + layout()->addItem(list()); + list()->setVisible(true); - QContactDetailFilter filter; - filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); - QString typeContact = QContactType::TypeContact; - filter.setValue(typeContact); + QContactDetailFilter filter; + filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); + QString typeContact = QContactType::TypeContact; + filter.setValue(typeContact); - mListModel->setFilterAndSortOrder(filter); - mListModel->showMyCard(true); + mListModel->setFilterAndSortOrder(filter); + mListModel->showMyCard(true); - mNewContact->setVisible(true); - mImportSim->setVisible(true); - mMultipleDeleter->setVisible(true); - mView->toolBar()->show(); + mNewContact->setVisible(true); + mImportSim->setVisible(true); + mMultipleDeleter->setVisible(true); + mView->toolBar()->show(); + } } bool CntNamesViewPrivate::isFinderVisible() { - return search()->isVisible(); + bool isVisible = false; + if ( mSearchPanel ) + { + isVisible = mSearchPanel->isVisible(); + } + return isVisible; } void CntNamesViewPrivate::showPreviousView() @@ -368,7 +381,7 @@ connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleDeleteMultipleContacts())); } - mFetchView->setDetails(hbTrId("txt_phob_opt_delete_contact"),hbTrId("txt_phob_button_delete")); + mFetchView->setDetails(hbTrId("txt_phob_title_delete_contacts"),hbTrId("txt_phob_button_delete")); QSet emptyContactsSet; // Pop up a list of contacts for deletion @@ -383,18 +396,12 @@ QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND ); if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) { - QList selectedContactsList = selectedContacts.values(); - foreach (QContactLocalId id, selectedContactsList) { - QContact contact = manager->contact(id); - - manager->removeContact(contact.localId()); + foreach ( QContactLocalId id, selectedContacts.values() ) + { + manager->removeContact( id ); } } - if (mListModel->rowCount() < CNT_MIN_ROW_COUNT) { - mMultipleDeleter->setEnabled(false); - } - delete mFetchView; mFetchView = NULL; } @@ -423,10 +430,17 @@ void CntNamesViewPrivate::showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint) { QContact contact = mListModel->contact(aItem->modelIndex()); - HbMenu* menu = mMenuBuilder->actionMenu( contact ); - menu->setPreferredPos( aPoint ); - menu->setAttribute( Qt::WA_DeleteOnClose, true ); - menu->open(); + + // In case of an empty MyCard, do not show any ContextMenu + if (!(contact.localId() == mListModel->myCardId() && contact.details().count() <= 4)) + { + HbMenu* menu = mMenuBuilder->actionMenu( contact, mListModel->myCardId() ); + menu->setPreferredPos( aPoint ); + menu->setAttribute( Qt::WA_DeleteOnClose, true ); + menu->open(); + } + + } void CntNamesViewPrivate::executeAction( QContact& aContact, QString aAction ) @@ -479,6 +493,31 @@ mViewManager->changeView(args); } +void CntNamesViewPrivate::showSettings() +{ + CntViewParameters args; + args.insert( EViewId, settingsView ); + mViewManager->changeView( args ); +} + +void CntNamesViewPrivate::handleContactAddition(const QList& aAddedList) +{ + Q_UNUSED(aAddedList); + disableDeleteAction(); +} + +void CntNamesViewPrivate::handleContactRemoval(const QList& aRemovedList) +{ + Q_UNUSED(aRemovedList); + disableDeleteAction(); +} + +void CntNamesViewPrivate::handleSelfContactIdChange(const QContactLocalId& aOldId, const QContactLocalId& aNewId) +{ + Q_UNUSED(aOldId); + Q_UNUSED(aNewId); + disableDeleteAction(); +} //// lazy accessors HbListView* CntNamesViewPrivate::list() diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -22,7 +22,7 @@ #include #include #include -#include +#include CntNoteEditorViewItem::CntNoteEditorViewItem( QGraphicsItem* aParent ) : CntDetailViewItem(aParent), diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp --- a/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -245,121 +245,109 @@ QString subTypeVideoShare = QContactOnlineAccount::SubTypeVideoShare; QStandardItem *mobile = new QStandardItem; - mobile->setText(hbTrId("txt_phob_dblist_mobile")); + mobile->setText(hbTrId("txt_phob_formlabel_val_mobile")); mobile->setData(subTypeMobile, DetailSubType); mobile->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(mobile); QStandardItem *mobilehome = new QStandardItem; - mobilehome->setText(hbTrId("txt_phob_dblist_mobile_home")); + mobilehome->setText(hbTrId("txt_phob_formlabel_val_mobile_home")); mobilehome->setData(subTypeMobile, DetailSubType); mobilehome->setData(contextHome, DetailContext); mobilehome->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(mobilehome); QStandardItem *mobilework = new QStandardItem; - mobilework->setText(hbTrId("txt_phob_dblist_mobile_work")); + mobilework->setText(hbTrId("txt_phob_formlabel_val_mobile_work")); mobilework->setData(subTypeMobile, DetailSubType); mobilework->setData(contextWork, DetailContext); mobilework->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(mobilework); QStandardItem *land = new QStandardItem; - land->setText(hbTrId("txt_phob_dblist_phone")); + land->setText(hbTrId("txt_phob_formlabel_val_phone")); land->setData(subTypeLandline, DetailSubType); land->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(land); QStandardItem *landhome = new QStandardItem; - landhome->setText(hbTrId("txt_phob_dblist_phone_home")); + landhome->setText(hbTrId("txt_phob_formlabel_val_phone_home")); landhome->setData(subTypeLandline, DetailSubType); landhome->setData(contextHome, DetailContext); landhome->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(landhome); QStandardItem *landwork = new QStandardItem; - landwork->setText(hbTrId("txt_phob_dblist_phone_work")); + landwork->setText(hbTrId("txt_phob_formlabel_val_phone_work")); landwork->setData(subTypeLandline, DetailSubType); landwork->setData(contextWork, DetailContext); landwork->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(landwork); QStandardItem *fax = new QStandardItem; - fax->setText(hbTrId("txt_phob_dblist_fax")); + fax->setText(hbTrId("txt_phob_formlabel_val_fax")); fax->setData(subTypeFax, DetailSubType); fax->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(fax); QStandardItem *faxhome = new QStandardItem; - faxhome->setText(hbTrId("txt_phob_dblist_fax_home")); + faxhome->setText(hbTrId("txt_phob_formlabel_val_fax_home")); faxhome->setData(subTypeFax, DetailSubType); faxhome->setData(contextHome, DetailContext); faxhome->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(faxhome); QStandardItem *faxwork = new QStandardItem; - faxwork->setText(hbTrId("txt_phob_dblist_fax_work")); + faxwork->setText(hbTrId("txt_phob_formlabel_val_fax_work")); faxwork->setData(subTypeFax, DetailSubType); faxwork->setData(contextWork, DetailContext); faxwork->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(faxwork); QStandardItem *pager = new QStandardItem; - pager->setText(hbTrId("txt_phob_dblist_pager")); + pager->setText(hbTrId("txt_phob_formlabel_val_pager")); pager->setData(subTypePager, DetailSubType); pager->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(pager); QStandardItem *assistant = new QStandardItem; - assistant->setText(hbTrId("txt_phob_dblist_assistant")); + assistant->setText(hbTrId("txt_phob_formlabel_val_assistant")); assistant->setData(subTypeAssistant, DetailSubType); assistant->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(assistant); QStandardItem *carPhone = new QStandardItem; - carPhone->setText(hbTrId("txt_phob_dblist_car")); + carPhone->setText(hbTrId("txt_phob_formlabel_val_car")); carPhone->setData(subTypeCarPhone, DetailSubType); carPhone->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(carPhone); - -// QStandardItem *dtmf = new QStandardItem; -// dtmf->setText(hbTrId("DTMF")); -// dtmf->setData(subTypeDtmf, DetailSubType); -// dtmf->setData(CNT_DTMF_EDITOR_MAXLENGTH, DetailMaxLength); -// model->appendRow(dtmf); - + QStandardItem *internet = new QStandardItem; - internet->setText(qtTrId("Internet call")); + internet->setText(hbTrId("txt_phob_formlabel_val_internet_telephone")); internet->setData(subTypeInternet, DetailSubType); internet->setData(CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(internet); QStandardItem *internethome = new QStandardItem; - internethome->setText(hbTrId("Internet call (home)")); + internethome->setText(hbTrId("txt_phob_formlabel_val_internet_telephone_home")); internethome->setData(subTypeInternet, DetailSubType); internethome->setData(contextHome, DetailContext); internethome->setData(CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(internethome); QStandardItem *internetwork = new QStandardItem; - internetwork->setText(hbTrId("Internet call (work)")); + internetwork->setText(hbTrId("txt_phob_formlabel_val_internet_telephone_work")); internetwork->setData(subTypeInternet, DetailSubType); internetwork->setData(contextWork, DetailContext); internetwork->setData(CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(internetwork); QStandardItem *sip = new QStandardItem; - sip->setText(hbTrId("SIP")); + sip->setText(hbTrId("txt_phob_formlabel_val_sip")); sip->setData(subTypeSIP, DetailSubType); sip->setData(CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(sip); - -// QStandardItem *shareVideo = new QStandardItem; -// shareVideo->setText(qtTrId("Share Video")); -// shareVideo->setData(subTypeVideoShare, DetailSubType); -// shareVideo->setData(CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH, DetailMaxLength); -// model->appendRow(shareVideo); - + mBox->setModel( model ); // search the selected index to be set diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntsettingsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntsettingsmodel.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "cntsettingsview.h" +#include +#include + +CntDefaultSettingsModel::CntDefaultSettingsModel() +{ + QStringList orderList; + orderList.append( hbTrId("txt_phob_setlabel_name_display_order_val_last_name") ); + orderList.append( hbTrId("txt_phob_setlabel_name_display_order_val_last_name_separator") ); + orderList.append( hbTrId("txt_phob_setlabel_name_display_order_val_first_nam") ); + /* + QStringList showList; + showList.append(hbTrId("txt_phob_setlabel_show_val_status_update")); + showList.append(hbTrId("txt_phob_setlabel_show_val_name_and_phonenumber")); + showList.append(hbTrId("txt_phob_setlabel_show_val_name_only")); + */ + mOrder = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, hbTrId("txt_phob_setlabel_name_display_order")); + mOrder->setContentWidgetData( "items", orderList ); + + /* + HbDataFormModelItem* show = new HbDataFormModelItem( HbDataFormModelItem::ComboBoxItem, hbTrId("txt_phob_setlabel_show") ); + show->setContentWidgetData( "items", showList ); + */ + + appendDataFormItem( mOrder, invisibleRootItem() ); + /* appendDataFormItem( show, invisibleRootItem() ); + */ +} + +CntDefaultSettingsModel::~CntDefaultSettingsModel() +{ + +} + +void CntDefaultSettingsModel::saveSettings() +{ + QString selected = mOrder->contentWidgetData( "currentText" ).toString(); + +} + +void CntDefaultSettingsModel::loadSettings() +{ + mOrder->setContentWidgetData("currentText", hbTrId("txt_phob_setlabel_name_display_order_val_last_name_separator") ); +} +// End of File diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntsettingsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/src/cntsettingsview.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,100 @@ +/* +* 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 "cntsettingsview.h" + +const char *CNT_SETTINGS_XML = ":/xml/contacts_settings.docml"; + +CntSettingsView::CntSettingsView() : QObject(), +mView( NULL ), +mDoc( NULL ), +mForm( NULL ), +mViewMgr( NULL ), +mModel( NULL ) +{ + bool ok; + document()->load(CNT_SETTINGS_XML, &ok); + if (!ok) { + qFatal("Unable to read %S", CNT_SETTINGS_XML); + } + mModel = new CntDefaultSettingsModel(); // default implementation + + mView = static_cast (document()->findWidget(QString("view"))); + mForm = static_cast (document()->findWidget(QString("dataForm"))); + mForm->setItemRecycling(true); + mForm->setModel( mModel ); + + mBack = new HbAction(Hb::BackNaviAction, mView); + connect( mBack, SIGNAL(triggered()), this, SLOT(back()) ); +} + +CntSettingsView::~CntSettingsView() +{ + mView->deleteLater(); + delete mForm; + delete mModel; + delete mDoc; +} + +void CntSettingsView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) +{ + mViewMgr = aMgr; + mArgs = aArgs; + + if ( mView->navigationAction() != mBack) { + mView->setNavigationAction(mBack); + } + + mModel->loadSettings(); +} + +void CntSettingsView::deactivate() +{ +} + +bool CntSettingsView::isDefault() const +{ + return false; +} + +HbView* CntSettingsView::view() const +{ + return mView; +} + +int CntSettingsView::viewId() const +{ + return settingsView; +} + +void CntSettingsView::back() +{ + mModel->saveSettings(); + mViewMgr->back( mArgs ); +} +HbDocumentLoader* CntSettingsView::document() +{ + if ( !mDoc ) + { + mDoc = new HbDocumentLoader(); + } + return mDoc; +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp --- a/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -119,20 +119,20 @@ QString fieldAddress = QContactUrl::FieldUrl; QStandardItem *noContext = new QStandardItem; - noContext->setText(qtTrId("URL")); + noContext->setText(hbTrId("txt_phob_formlabel_val_url")); noContext->setData(fieldAddress, DetailSubType); noContext->setData(CNT_URL_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(noContext); QStandardItem *home = new QStandardItem; - home->setText(qtTrId("URL (home)")); + home->setText(hbTrId("txt_phob_formlabel_val_url_home")); home->setData(fieldAddress, DetailSubType); home->setData(contextHome, DetailContext); home->setData(CNT_URL_EDITOR_MAXLENGTH, DetailMaxLength); model->appendRow(home); QStandardItem *work = new QStandardItem; - work->setText(qtTrId("URL (work)")); + work->setText(hbTrId("txt_phob_formlabel_val_url_work")); work->setData(fieldAddress, DetailSubType); work->setData(contextWork, DetailContext); work->setData(CNT_URL_EDITOR_MAXLENGTH, DetailMaxLength); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobbaseaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobbaseaction.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,70 @@ +/* +* 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 MOBBASEACTION_H +#define MOBBASEACTION_H + +#include +#include + +#include +#include +#include + +QTM_USE_NAMESPACE + +class MobBaseAction : public QContactAction +{ + Q_OBJECT + +public: + MobBaseAction(const QString &actionName, const QString& vendorName); + virtual ~MobBaseAction(); + +public: + enum ErrorCodes { + GeneralError = 1, + DetailNotSupported + }; + + +public: //QContactAction + QContactActionDescriptor actionDescriptor() const; + bool invokeAction(const QContact& contact, const QContactDetail& detail = QContactDetail(), const QVariantMap& parameters = QVariantMap()); + QVariantMap results() const; + +public: + virtual void resetAction(); + virtual MobBaseAction* clone() const = 0; + +public: + //returns whether the actionDescription is supported by this action + bool actionDescriptionSupported(const QContactActionDescriptor& descriptor) const; + void emitResult(int errorCode, const QVariant &retValue); + + +protected: + QString m_actionName; + QString m_vendorName; + int m_implementationVersion; + + QVariantMap m_result; //result returned to client + QContact m_contact; //contact passed to invokeAction + QContactDetail m_detail; //detail passed to invokeAction +}; + +#endif //MOBBASEACTION_H diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexample2action.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexample2action.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,39 @@ +/* +* 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 QMOBEXAMPLE2ACTION_H +#define QMOBEXAMPLE2ACTION_H + +#include "mobbaseaction.h" + +class MobExample2Action : public MobBaseAction +{ + Q_OBJECT + +public: + MobExample2Action(const QString& actionName, const QString& vendorName); + ~MobExample2Action(); + + QVariantMap metaData() const; + QContactFilter contactFilter(const QVariant& value) const; + bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const; + QList supportedDetails(const QContact& contact) const; + State state() const; + MobExample2Action* clone() const; +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampleaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampleaction.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,39 @@ +/* +* 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 QMOBEXAMPLEACTION_H +#define QMOBEXAMPLEACTION_H + +#include "mobbaseaction.h" + +class MobExampleAction : public MobBaseAction +{ + Q_OBJECT + +public: + MobExampleAction(const QString& actionName, const QString& vendorName); + ~MobExampleAction(); + + QVariantMap metaData() const; + QContactFilter contactFilter(const QVariant& value) const; + bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const; + QList supportedDetails(const QContact& contact) const; + State state() const; + MobExampleAction* clone() const; +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampleactionfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampleactionfactory.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MOBEXAMPLEACTIONFACTORY_H +#define MOBEXAMPLEACTIONFACTORY_H + +#include +#include + +class MobBaseAction; + +QTM_USE_NAMESPACE + +class Q_DECL_EXPORT MobExampleActionFactory : public QContactActionFactory +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QContactActionFactory) + +public: + MobExampleActionFactory(); + ~MobExampleActionFactory(); + + QString name() const; + QList actionDescriptors() const; + QContactAction* instance(const QContactActionDescriptor& descriptor) const; + QVariantMap actionMetadata(const QContactActionDescriptor& descriptor) const; + +private: + QList actionList; +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampledynamicaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexampledynamicaction.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,59 @@ +/* +* 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 QMOBEXAMPLEDYNAMICACTION_H +#define QMOBEXAMPLEDYNAMICACTION_H + +#include "mobbaseaction.h" + +#include + +class MobExampleDynamicAction : public MobBaseAction +{ + Q_OBJECT + +public: + MobExampleDynamicAction(const QString& actionName, const QString& vendorName); + MobExampleDynamicAction(const QString& actionName, const QString& vendorName, const MobExampleDynamicAction& copy); + ~MobExampleDynamicAction(); + + QVariantMap metaData() const; + QContactFilter contactFilter(const QVariant& value) const; + bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const; + QList supportedDetails(const QContact& contact) const; + State state() const; + MobExampleDynamicAction* clone() const; + + void setDefinitionName(const QString& definitionName); + void setFilter(QContactFilter filter); + void setIcon(QIcon icon); + void setTitleField(QString titleField); + void setValueField(QString valueField); + void setTitleFieldDetail(QString titleField); + void setValueFieldDetail(QString valueField); + +private: + QString mTitleField; + QString mValueField; + QString mTitleFieldDetail; + QString mValueFieldDetail; + QIcon mIcon; + QContactFilter mFilter; + QString mDefinitionName; +}; + +#endif diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexamplenodetailaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/inc/mobexamplenodetailaction.h Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,39 @@ +/* +* 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 MOBEXAMPLENODETAILACTION_H_ +#define MOBEXAMPLENODETAILACTION_H_ + +#include "mobbaseaction.h" + +class MobExampleNoDetailAction : public MobBaseAction +{ + Q_OBJECT + +public: + MobExampleNoDetailAction(const QString& actionName, const QString& vendorName); + ~MobExampleNoDetailAction(); + + QVariantMap metaData() const; + QContactFilter contactFilter(const QVariant& value) const; + bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const; + QList supportedDetails(const QContact& contact) const; + State state() const; + MobExampleNoDetailAction* clone() const; +}; + +#endif /* MOBEXAMPLENODETAILACTION_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/mobactionextensionexample.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/mobactionextensionexample.pro Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,56 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin +CONFIG += hb +TARGET = $$qtLibraryTarget(mobexampleactionsplugin) +DEPENDPATH += . +INCLUDEPATH += . + +# Input +HEADERS += \ + inc/mobexampleactionfactory.h \ + inc/mobbaseaction.h \ + inc/mobexampleaction.h \ + inc/mobexample2action.h \ + inc/mobexamplenodetailaction.h \ + inc/mobexampledynamicaction.h + +SOURCES += \ + src/mobexampleactionfactory.cpp \ + src/mobbaseaction.cpp \ + src/mobexampleaction.cpp \ + src/mobexample2action.cpp \ + src/mobexamplenodetailaction.cpp \ + src/mobexampledynamicaction.cpp +MOC_DIR = moc + +symbian: + { + load(data_caging_paths) + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0xefa11113 + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + LIBS += -lQtContacts \ + -lxqservice + target.path = /sys/bin + INSTALLS += target + symbianplugin.sources = $${TARGET}.dll + symbianplugin.path = /resource/qt/plugins/contacts + DEPLOYMENT += symbianplugin +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobbaseaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobbaseaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mobbaseaction.h" + +#include +#include +#include +#include +#include + +MobBaseAction::MobBaseAction(const QString &actionName, const QString& vendorName) : + m_actionName(actionName), + m_vendorName(vendorName), + m_implementationVersion(1), + m_result(), + m_contact(), + m_detail() +{ +} + +MobBaseAction::~MobBaseAction() +{ +} + +QContactActionDescriptor MobBaseAction::actionDescriptor() const +{ + QContactActionDescriptor ret; + ret.setActionName(m_actionName); + ret.setVendorName(m_vendorName); + ret.setImplementationVersion(m_implementationVersion); + return ret; +} + +bool MobBaseAction::invokeAction(const QContact& contact, const QContactDetail& detail, const QVariantMap& parameters) +{ + m_contact = contact; + m_detail = detail; +} + +//Clears the action data, is called after the result has been emitted to contact (emitResult function) +void MobBaseAction::resetAction() +{ + m_contact = QContact(); + m_detail = QContactDetail(); +} + +//returns whether the actionDescription is supported by this action +bool MobBaseAction::actionDescriptionSupported(const QContactActionDescriptor& descriptor) const +{ + bool supported(false); + + if ((descriptor.actionName() == m_actionName) && (descriptor.vendorName() == m_vendorName) && (descriptor.implementationVersion() == m_implementationVersion)) + supported = true; + else + supported = false; + + return supported; +} + +//emit the result to the client +void MobBaseAction::emitResult(int errorCode, const QVariant &retValue) +{ +// m_result.clear(); +// m_result.insert("Error", QVariant(errorCode)); +// m_result.insert("ReturnValue", retValue); +// +// QContactAction::Status status; +// +// if (errorCode == 0){ +// status = QContactAction::Finished; +// } +// +// else{ +// status = QContactAction::FinishedWithError; +// } +// +// emit progress(status, m_result); + + resetAction(); //reset values in the action +} + +QVariantMap MobBaseAction::results() const +{ + return m_result; +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexample2action.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexample2action.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mobexample2action.h" +#include +#include +#include +#include +#include + +//Action class +MobExample2Action::MobExample2Action(const QString& actionName, const QString& vendorName) : + MobBaseAction(actionName, vendorName) +{ +} + +MobExample2Action::~MobExample2Action() +{ +} + +QVariantMap MobExample2Action::metaData() const +{ + QVariantMap variantMap; + QVariant localization("Test action 2"); + variantMap.insert(KCntUiActionMetaTitleText, localization); + const QString& string(QContactPhoneNumber::FieldNumber); + QVariant detailField(string); + variantMap.insert(KCntUiActionMetaValueTextDetail, detailField); + QString menuString("Do example action2"); + QVariant longPressMenu(menuString); + variantMap.insert(KCntUiActionMetaValueTextLongPress, longPressMenu); + return variantMap; +} + +QContactFilter MobExample2Action::contactFilter(const QVariant& value) const +{ + Q_UNUSED(value); + + QContactDetailFilter mobileFilter; + mobileFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldSubTypes); + mobileFilter.setValue(QLatin1String(QContactPhoneNumber::SubTypeMobile)); + + return mobileFilter; +} + +bool MobExample2Action::isDetailSupported(const QContactDetail &detail, const QContact &contact) const +{ + if(QContactPhoneNumber::DefinitionName == detail.definitionName()) + { + return true; + } + else + { + return false; + } +} + +QList MobExample2Action::supportedDetails(const QContact& contact) const +{ + +} + +QContactAction::State MobExample2Action::state() const +{ + +} + +MobExample2Action* MobExample2Action::clone() const +{ + return new MobExample2Action(m_actionName, m_vendorName); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampleaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampleaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mobexampleaction.h" +#include +#include +#include +#include +#include +#include +#include + +//Action class +MobExampleAction::MobExampleAction(const QString& actionName, const QString& vendorName) : + MobBaseAction(actionName, vendorName) +{ +} + +MobExampleAction::~MobExampleAction() +{ +} + +QVariantMap MobExampleAction::metaData() const +{ + QVariantMap variantMap; + const QString& string("Test action 1"); + QVariant localization(string); + variantMap.insert(KCntUiActionMetaTitleText, localization); + const QString& string2(QContactOnlineAccount::FieldAccountUri); + const QVariant detailField(string2); + variantMap.insert(KCntUiActionMetaValueTextDetail, detailField); + QString menuString("Do example action"); + QVariant longPressMenu(menuString); + variantMap.insert(KCntUiActionMetaValueTextLongPress, longPressMenu); + HbIcon hIcon("qtg_large_voip.svg"); + // Must be QIcon + QIcon icon(hIcon.qicon()); + QVariant iconVariant(icon); + variantMap.insert("icon", iconVariant); + return variantMap; +} + +QContactFilter MobExampleAction::contactFilter(const QVariant& value) const +{ + Q_UNUSED(value); + + QContactDetailFilter onlineFilter; + onlineFilter.setDetailDefinitionName(QContactOnlineAccount::DefinitionName, QContactOnlineAccount::FieldSubTypes); + onlineFilter.setValue(QLatin1String(QContactOnlineAccount::SubTypeImpp)); + + return onlineFilter; +} + +bool MobExampleAction::isDetailSupported(const QContactDetail &detail, const QContact &contact) const +{ + if(QContactOnlineAccount::DefinitionName == detail.definitionName()) + { + return true; + } + else + { + return false; + } +} + +QList MobExampleAction::supportedDetails(const QContact& contact) const +{ + +} + +QContactAction::State MobExampleAction::state() const +{ + +} + +MobExampleAction* MobExampleAction::clone() const +{ + return new MobExampleAction(m_actionName, m_vendorName); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampleactionfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampleactionfactory.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,129 @@ +/* +* 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 ACTIONFACTORYPLUGINTARGET +#define ACTIONFACTORYPLUGINTARGET mobexampleactionsplugin +#endif +#ifndef ACTIONFACTORYPLUGINNAME +#define ACTIONFACTORYPLUGINNAME SymbianActionFactory +#endif + +#include "mobexampleactionfactory.h" +#include "mobexampleaction.h" +#include "mobexample2action.h" +#include "mobexamplenodetailaction.h" +#include "mobexampledynamicaction.h" + +#include +#include + +#define makestr(x) (#x) +#define makename(x) makestr(x) + + +//Factory class +MobExampleActionFactory::MobExampleActionFactory() +{ + // Next two actions are different, but for same service. These actions can be used + // also for other services, by changing "Test service". In real plugin all these actions + // would have been created once for each service. In this example third action is created for + // different service for testing purposes. + actionList.append(new MobExampleAction("staticaction1", "Test service")); + actionList.append(new MobExample2Action("staticaction2", "Test service")); + // This action is for second service. + actionList.append(new MobExampleNoDetailAction("nodetailaction", "Test service 2")); + + // create several variants of one action and change it behaviour in run time + MobExampleDynamicAction* nonUiItem = new MobExampleDynamicAction("dynamicaction", "Test service 2"); + nonUiItem->setDefinitionName(QContactOnlineAccount::DefinitionName); + QContactDetailFilter filter; + filter.setDetailDefinitionName(QContactOnlineAccount::DefinitionName); + nonUiItem->setFilter(filter); + nonUiItem->setIcon(QIcon()); + nonUiItem->setTitleField(""); + nonUiItem->setTitleFieldDetail(""); + actionList.append(nonUiItem); + + MobExampleDynamicAction* emptyValueField = new MobExampleDynamicAction("dynamicaction2", "Test service 2"); + emptyValueField->setDefinitionName(QContactOnlineAccount::DefinitionName); + QContactDetailFilter filter2; + filter2.setDetailDefinitionName(QContactOnlineAccount::DefinitionName); + emptyValueField->setFilter(filter2); + emptyValueField->setIcon(QIcon()); + emptyValueField->setTitleFieldDetail(QContactOnlineAccount::FieldServiceProvider); + emptyValueField->setValueField(""); + actionList.append(emptyValueField); +} + +MobExampleActionFactory::~MobExampleActionFactory() +{ + while (!actionList.isEmpty()) + delete actionList.takeFirst(); +} + +QString MobExampleActionFactory::name() const +{ + return QString(makename(ACTIONFACTORYPLUGINNAME)); +} + + +QList MobExampleActionFactory::actionDescriptors() const +{ + QList descriptorList; + + //loop through all the actions and add the descriptor to the list + for (int i = 0; i < actionList.size(); i++) + { + descriptorList << actionList.at(i)->actionDescriptor(); + } + + return descriptorList; +} + +QContactAction* MobExampleActionFactory::instance(const QContactActionDescriptor& descriptor) const +{ + QContactAction *action(0); + + //loop through the actions and return the one that supports the descriptor + for (int i = 0; i < actionList.size() && action == 0; i++) + { + if (actionList.at(i)->actionDescriptionSupported(descriptor)){ + //create a new heap object of the action + action = actionList.at(i)->clone(); + } + } + + return action; +} + +QVariantMap MobExampleActionFactory::actionMetadata(const QContactActionDescriptor& descriptor) const +{ + QVariantMap map; + + //loop through the actions and return the one that supports the descriptor + for (int i = 0; i < actionList.size() && map.isEmpty(); i++) + { + if (actionList.at(i)->actionDescriptionSupported(descriptor)) + { + map = actionList.at(i)->metaData(); + } + } + + return map; + +} + +Q_EXPORT_PLUGIN2(ACTIONFACTORYPLUGINTARGET, MobExampleActionFactory); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampledynamicaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexampledynamicaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mobexampledynamicaction.h" +#include +#include +#include +#include +#include + +//Action class +MobExampleDynamicAction::MobExampleDynamicAction(const QString& actionName, const QString& vendorName) : + MobBaseAction(actionName, vendorName) +{ +} + +MobExampleDynamicAction::MobExampleDynamicAction(const QString& actionName, const QString& vendorName, const MobExampleDynamicAction& copy) : + MobBaseAction(actionName, vendorName) +{ + mTitleField = copy.mTitleField; + mValueField = copy.mValueField; + mTitleFieldDetail = copy.mTitleFieldDetail; + mValueFieldDetail = copy.mValueFieldDetail; + mIcon = copy.mIcon; + mFilter = copy.mFilter; + mDefinitionName = copy.mDefinitionName; +} + +MobExampleDynamicAction::~MobExampleDynamicAction() +{ +} + +QVariantMap MobExampleDynamicAction::metaData() const +{ + QVariantMap variantMap; + + variantMap.insert(KCntUiActionMetaTitleTextDetail, !mTitleField.isEmpty() ? mTitleField : mTitleFieldDetail); + + if(!mValueFieldDetail.isEmpty()) + variantMap.insert(KCntUiActionMetaValueTextDetail, mValueFieldDetail); + else if(!mValueField.isEmpty()) + variantMap.insert(KCntUiActionMetaValueText, mValueField); + // Must be QIcon + QIcon icon(mIcon); + QVariant iconVariant(icon); + variantMap.insert("icon", iconVariant); + return variantMap; +} + +QContactFilter MobExampleDynamicAction::contactFilter(const QVariant& value) const +{ + return mFilter; +} + +bool MobExampleDynamicAction::isDetailSupported(const QContactDetail &detail, const QContact &contact) const +{ + if(mDefinitionName == detail.definitionName()) + { + return true; + } + else + { + return false; + } +} + +QList MobExampleDynamicAction::supportedDetails(const QContact& contact) const +{ + +} + +QContactAction::State MobExampleDynamicAction::state() const +{ + +} + +MobExampleDynamicAction* MobExampleDynamicAction::clone() const +{ + return new MobExampleDynamicAction(m_actionName, m_vendorName, *this); +} + +void MobExampleDynamicAction::setDefinitionName(const QString& definitionName) +{ + mDefinitionName = definitionName; +} + +void MobExampleDynamicAction::setFilter(QContactFilter filter) +{ + mFilter = filter; +} + +void MobExampleDynamicAction::setIcon(QIcon icon) +{ + mIcon = icon; +} + +void MobExampleDynamicAction::setTitleField(QString titleField) +{ + mTitleField = titleField; +} + +void MobExampleDynamicAction::setValueField(QString valueField) +{ + mValueField = valueField; +} + +void MobExampleDynamicAction::setTitleFieldDetail(QString titleFieldDetail) +{ + mTitleFieldDetail = titleFieldDetail; +} + +void MobExampleDynamicAction::setValueFieldDetail(QString valueFieldDetail) +{ + mValueFieldDetail = valueFieldDetail; +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexamplenodetailaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/pbkcommonui/tsrc/mobactionextensionexample/src/mobexamplenodetailaction.cpp Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mobexamplenodetailaction.h" +#include + +//Action class +MobExampleNoDetailAction::MobExampleNoDetailAction(const QString& actionName, const QString& vendorName) : + MobBaseAction(actionName, vendorName) +{ +} + +MobExampleNoDetailAction::~MobExampleNoDetailAction() +{ +} + +QVariantMap MobExampleNoDetailAction::metaData() const +{ + QVariantMap variantMap; + QVariant localization("Test action 3"); + variantMap.insert(KCntUiActionMetaTitleText, localization); + QVariant detailField("Description"); + variantMap.insert(KCntUiActionMetaValueText, detailField); + QString menuString("Do action 3"); + QVariant longPressMenu(menuString); + variantMap.insert(KCntUiActionMetaValueTextLongPress, longPressMenu); + return variantMap; +} + +QContactFilter MobExampleNoDetailAction::contactFilter(const QVariant& value) const +{ + Q_UNUSED(value); + + QContactFilter all; + + return all; +} + +// If detail is empty plugin knows that this is special action query that +// is targetted to whole contact not to specific detail on contact. +// If you want to create action to my card only, check cntuiactionextension.h for details +bool MobExampleNoDetailAction::isDetailSupported(const QContactDetail &detail, const QContact &contact) const +{ + if(detail.isEmpty()) + { + return true; + } + else + { + return false; + } +} + +QList MobExampleNoDetailAction::supportedDetails(const QContact& contact) const +{ + +} + +QContactAction::State MobExampleNoDetailAction::state() const +{ + +} + +MobExampleNoDetailAction* MobExampleNoDetailAction::clone() const +{ + return new MobExampleNoDetailAction(m_actionName, m_vendorName); +} diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookapp/phonebookapp.pro --- a/phonebookui/phonebookapp/phonebookapp.pro Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookapp/phonebookapp.pro Thu May 27 12:45:19 2010 +0300 @@ -63,4 +63,8 @@ TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x1000 0xA00000 + :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 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookapp/resources/phonebook.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookapp/resources/phonebook.docml Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookapp/resources/phonebook.splashml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/phonebookapp/resources/phonebook.splashml Thu May 27 12:45:19 2010 +0300 @@ -0,0 +1,6 @@ + + phonebook.docml + view + 0x20022EF9 + contacts + diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h --- a/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h Thu May 27 12:45:19 2010 +0300 @@ -38,20 +38,20 @@ Q_OBJECT public slots: - void doCloseView(); void addActionsToToolBar(); void addToContacts(); void saveNew(); void updateExisting(); - void doViewActivated(QContact contact, QContactDetail detail); + + void doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs); public: CntServiceAssignContactCardView(CntServiceHandler *aServiceHandler); ~CntServiceAssignContactCardView(); int viewId() const { return serviceAssignContactCardView; } - + private: CntServiceHandler *mServiceHandler; CntAbstractViewManager *mViewManager; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookservices/inc/cntservicecontactselectionview.h --- a/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h Thu May 27 12:45:19 2010 +0300 @@ -37,7 +37,7 @@ public slots: void onListViewActivated(const QModelIndex &aIndex); - void aboutToOpenView(const CntViewParameters viewParameters); + void aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters); void aboutToCloseView(); private: diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp --- a/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp Thu May 27 12:45:19 2010 +0300 @@ -94,7 +94,7 @@ QVariant var; var.setValue(mContact); viewParameters.insert(ESelectedContact, var); - //viewManager()->changeView(viewParameters); + mViewManager->changeView(viewParameters); } /*! @@ -107,16 +107,17 @@ QVariant var; var.setValue(mDetail); viewParameters.insert(ESelectedDetail, var); - //viewManager()->changeView(viewParameters); + mViewManager->changeView(viewParameters); } /*! Called after the view has been activated */ -void CntServiceAssignContactCardView::doViewActivated(QContact contact, QContactDetail detail) +void CntServiceAssignContactCardView::doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) { - mContact = contact; - mDetail = detail; + mViewManager = aMgr; + mContact = aArgs.value(ESelectedContact).value(); + mDetail = aArgs.value(ESelectedDetail).value(); } /*! diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp --- a/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp Thu May 27 12:45:19 2010 +0300 @@ -56,8 +56,10 @@ mServiceHandler->completeEdit(0); } -void CntServiceContactSelectionView::aboutToOpenView(const CntViewParameters viewParameters) +void CntServiceContactSelectionView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters) { + mMgr = aMgr; + QContactDetailFilter filter; filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); QString typeContact = QContactType::TypeContact; diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/phonebookservices/src/cntserviceviewfactory.cpp --- a/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp Thu May 27 12:45:19 2010 +0300 @@ -21,6 +21,8 @@ #include "cntservicesubeditview.h" #include "cntservicecontactfetchview.h" #include "cntservicecontactselectionview.h" +#include "cntservicecontactcardview.h" +#include "cntserviceassigncontactcardview.h" CntServiceViewFactory::CntServiceViewFactory(CntServiceHandler* aHandler) : CntDefaultViewFactory(), @@ -51,10 +53,10 @@ return new CntServiceSubEditView( mService ); case serviceContactCardView: - return new CntServiceEditView( mService ); + return new CntServiceContactCardView( mService ); case serviceAssignContactCardView: - return new CntServiceSubEditView( mService ); + return new CntServiceAssignContactCardView( mService ); default: return CntDefaultViewFactory::createView( aViewId ); diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/rom/pbk.iby --- a/phonebookui/rom/pbk.iby Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/rom/pbk.iby Thu May 27 12:45:19 2010 +0300 @@ -47,5 +47,7 @@ data=DATAZ_\RESOURCE_FILES_DIR\qt\plugins\contacts\mobapicontactspluginsymbiansim.qtplugin RESOURCE_FILES_DIR\qt\plugins\contacts\mobapicontactspluginsymbiansim.qtplugin data=DATAZ_\CONTACTS_RESOURCE_DIR\cntmodel.rsc CONTACTS_RESOURCE_DIR\cntmodel.rsc +data=ZRESOURCE\hb\splashml\phonebook.splashml RESOURCE_FILES_DIR\hb\splashml\phonebook.splashml +data=ZRESOURCE\hb\splashml\phonebook.docml RESOURCE_FILES_DIR\hb\splashml\phonebook.docml #endif \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/rom/pbkresources.iby --- a/phonebookui/rom/pbkresources.iby Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/rom/pbkresources.iby Thu May 27 12:45:19 2010 +0300 @@ -24,5 +24,6 @@ data=DATAZ_\QT_TRANSLATIONS_DIR\contacts.qm QT_TRANSLATIONS_DIR\contacts.qm S60_APP_RESOURCE(phonebook) +data=DATAZ_/APP_RESOURCE_DIR/phonebook.mif APP_RESOURCE_DIR/phonebook.mif #endif \ No newline at end of file diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/cntdisplaylabel.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/cntdisplaylabel.h Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/inc/cntdisplaylabel.h Thu May 27 12:45:19 2010 +0300 @@ -49,7 +49,6 @@ #include #include - #include QTM_USE_NAMESPACE @@ -71,10 +70,12 @@ void setDisplayLabelDetails(); QString generateDisplayLabel( const QContact &contact, const QList > > detailList) const; QString delimiter() const; + QString comma() const; private: QList > > m_contactDisplayLabelDetails; QList > > m_groupDisplayLabelDetails; + int m_nameOrder; }; #endif /* CNTDISPLAYLABEL_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntdbinfo.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntdbinfo.h Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntdbinfo.h Thu May 27 12:45:19 2010 +0300 @@ -57,6 +57,7 @@ { Q_OBJECT +public: enum TCommAddrType { EPhoneNumber, diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilteraction.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilteraction.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CNTFILTERACTION_H_ -#define CNTFILTERACTION_H_ - -#include "cntabstractcontactfilter.h" -#include "cntsymbiansrvconnection.h" -#include "cntdbinfo.h" - -class CntFilterAction : public CntAbstractContactFilter -{ -public: - CntFilterAction(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); - ~CntFilterAction(); - QList contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupported, - QContactManager::Error* error); - bool filterSupported(const QContactFilter& filter); - - void createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error); -private: - -protected: - CContactDatabase& m_contactdatabase; - CntSymbianSrvConnection &m_srvConnection; - CntDbInfo& m_dbInfo; -}; - -#endif /* CNTFILTERACTION_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterchangelog.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterchangelog.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CNTFILTERCHANGELOG_H_ -#define CNTFILTERCHANGELOG_H_ - -#include "cntabstractcontactfilter.h" -#include "cntsymbiansrvconnection.h" -#include "cntdbinfo.h" - -class CntFilterChangeLog : public CntAbstractContactFilter -{ -public: - CntFilterChangeLog(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); - ~CntFilterChangeLog(); - QList contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupported, - QContactManager::Error* error); - bool filterSupported(const QContactFilter& filter); - - void createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error); -private: - -protected: - CContactDatabase& m_contactdatabase; - CntSymbianSrvConnection &m_srvConnection; - CntDbInfo& m_dbInfo; -}; - -#endif /* CNTFILTERCHANGELOG_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterdetail.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterdetail.h Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterdetail.h Thu May 27 12:45:19 2010 +0300 @@ -52,6 +52,23 @@ class CntFilterDetail : public CntAbstractContactFilter { +private: + class TMatch { + public: + TMatch(); + + static TInt32 createHash(const TDesC& phoneNumberString, + TInt matchLength, + TInt& numPhoneDigits); + static void stripOutNonDigitChars(TDes& text); + static TInt32 padOutPhoneMatchNumber(TInt32& phoneNumber, + TInt padOutLength); + public: + TInt32 iLowerSevenDigits; + TInt32 iUpperDigits; + TInt iNumLowerDigits; + TInt iNumUpperDigits; + }; public: CntFilterDetail(CContactDatabase& contactDatabase, CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); ~CntFilterDetail(); @@ -62,8 +79,6 @@ QContactManager::Error* error); bool filterSupported(const QContactFilter& filter) ; - //bool isFilterSupported(const QContactFilter& filter) const; - void getTableNameWhereClause( const QContactDetailFilter& filter, QString& tableName, QString& sqlWhereClause , @@ -71,21 +86,26 @@ void createSelectQuery(const QContactFilter& filter, QString& sqlQuery, QContactManager::Error* error); + void createMatchPhoneNumberQuery(const QContactFilter& filter, + QString& sqlQuery, + QContactManager::Error* error); private: - - void updateForMatchFlag( const QContactDetailFilter& filter, QString& fieldToUpdate , QContactManager::Error* error) const; - QList HandlePhonenumberDetailFilter(const QContactFilter& filter); QList HandlePredictiveSearchFilter(const QContactFilter& filter, QContactManager::Error* error); - TInt CntFilterDetail::searchPhoneNumbers( - CContactIdArray*& idArray, - const TDesC& phoneNumber, - const TInt matchLength); - void getMatchLengthL(TInt& matchLength); + CntFilterDetail::TMatch createPaddedPhoneDigits(const TDesC& number, + const TInt numLowerDigits, + const TInt numUpperDigits, + QContactManager::Error* error); + CntFilterDetail::TMatch createPhoneMatchNumber(const TDesC& text, + TInt lowerMatchLength, + TInt upperMatchLength, + QContactManager::Error* error); + bool getMatchLengthL(TInt& matchLength); + protected: CContactDatabase& m_contactdatabase; CntSymbianSrvConnection &m_srvConnection; diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterdetailrange.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterdetailrange.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CNTFILTERDETAILRANGE_H_ -#define CNTFILTERDETAILRANGE_H_ - -#include "cntabstractcontactfilter.h" -#include "cntsymbiansrvconnection.h" -#include "cntdbinfo.h" - -class CntFilterdetailrange : public CntAbstractContactFilter -{ -public: - CntFilterdetailrange(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); - ~CntFilterdetailrange(); - QList contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupported, - QContactManager::Error* error); - bool filterSupported(const QContactFilter& filter); - - void createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error); -private: - -protected: - CContactDatabase& m_contactdatabase; - CntSymbianSrvConnection &m_srvConnection; - CntDbInfo& m_dbInfo; -}; - -#endif /* CNTFILTERDETAILRANGE_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterinvalid.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterinvalid.h Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CNTFILTERINVALID_H_ -#define CNTFILTERINVALID_H_ - -#include "cntabstractcontactfilter.h" -#include "cntsymbiansrvconnection.h" -#include "cntdbinfo.h" - -class CntFilterInvalid : public CntAbstractContactFilter -{ -public: - CntFilterInvalid(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); - ~CntFilterInvalid(); - QList contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupported, - QContactManager::Error* error); - bool filterSupported(const QContactFilter& filter); - void createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error); -private: - -protected: - CContactDatabase& m_contactdatabase; - CntSymbianSrvConnection &m_srvConnection; - CntDbInfo& m_dbInfo; -}; - -#endif /* CNTFILTERINVALID_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterlocalid.h --- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntfilterlocalid.h Fri May 14 15:42:23 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. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CNTFILTERLOCALID_H_ -#define CNTFILTERLOCALID_H_ - -#include "cntabstractcontactfilter.h" -#include "cntsymbiansrvconnection.h" -#include "cntdbinfo.h" - - -class CntFilterLocalId : public CntAbstractContactFilter -{ -public: - CntFilterLocalId(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo); - ~CntFilterLocalId(); - QList contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupported, - QContactManager::Error* error); - bool filterSupported(const QContactFilter& filter); - - void createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error); -private: - -protected: - CContactDatabase& m_contactdatabase; - CntSymbianSrvConnection &m_srvConnection; - CntDbInfo& m_dbInfo; -}; - -#endif /* CNTFILTERLOCALID_H_ */ diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/rss/cntmodel.rss --- a/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodel.rss Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodel.rss Thu May 27 12:45:19 2010 +0300 @@ -937,13 +937,20 @@ }, FIELD // Anniversary { - fieldStorageType=KStorageTypeText; + fieldStorageType=KStorageTypeDateTime; contactFieldType=KUidContactFieldAnniversaryValue; vCardMapping=KIntContactFieldVCardMapAnniversary; category=EContactCategoryOther; - fieldName=STRING_r_cntui_new_field_defns66; - } - + fieldName=qtn_phob_lbl_anniversary; + }, + FIELD // Anniversary Event + { + fieldStorageType=KStorageTypeText; + contactFieldType=KUidContactFieldAnniversaryEventValue; + vCardMapping=KIntContactFieldVCardMapUnknown; + category=EContactCategoryOther; + fieldName=STRING_r_cntui_new_field_defns15; + } }; } diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.h --- a/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.h Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.h Thu May 27 12:45:19 2010 +0300 @@ -77,6 +77,12 @@ */ const TUid KUidContactFieldGender={KUidContactFieldGenderValue}; +/** + * Phonebook custom Field value. + * Anniversary event field type. + */ +const TUid KUidContactFieldAnniversaryEvent={KUidContactFieldAnniversaryEventValue}; + /* This is a workaround to avoid OS version specific checks.. */ #if defined(Q_HAD_TO_DECLARE_GEO_VALUE) const TUid KUidContactFieldGEO = {KUidContactFieldGEOValue}; diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.hrh --- a/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.hrh Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/rss/cntmodelextuids.hrh Thu May 27 12:45:19 2010 +0300 @@ -81,6 +81,12 @@ */ #define KUidContactFieldGenderValue 0x200100E7 +/** + * Phonebook custom Field value. + * Anniversary event field type. + */ +#define KUidContactFieldAnniversaryEventValue 0x200100E8 + // !! In case this is undefined on earlier platforms #ifndef KUidContactFieldGEOValue #define KUidContactFieldGEOValue 0x10274DB2 diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/rss/fieldnames.loc --- a/qtcontactsmobility/plugins/contacts/symbian/rss/fieldnames.loc Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/rss/fieldnames.loc Thu May 27 12:45:19 2010 +0300 @@ -52,6 +52,7 @@ #define STRING_r_cntui_new_field_defns12 "Video ringtone" #define STRING_r_cntui_new_field_defns13 "Sync target" #define STRING_r_cntui_new_field_defns14 "Gender" +#define STRING_r_cntui_new_field_defns15 "Anniversary event" //d:Label text for "first name" memory entry item //l:list_single_graphic_pane_t1_cp2 diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/cntdisplaylabel.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/cntdisplaylabel.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/cntdisplaylabel.cpp Thu May 27 12:45:19 2010 +0300 @@ -41,13 +41,30 @@ #include "cntdisplaylabel.h" #include +#include +#include + +const TUint32 KOrderLastFirst = 0x00000000; +const TUint32 KOrderLastCommaFirst = 0x00000001; +const TUint32 KOrderFirstLast = 0x00000002; /*! * Constructor */ -CntDisplayLabel::CntDisplayLabel() +CntDisplayLabel::CntDisplayLabel() : + m_nameOrder(KOrderFirstLast) { +#ifdef SYMBIAN_BACKEND_USE_SQLITE + CRepository* cenrep; + TRAPD(err, cenrep = CRepository::NewL(KCRUiContacts)); + if (err == KErrNone) { + TInt value(-1); + if (cenrep->Get(KNameOrdering, value) == KErrNone) { + m_nameOrder = static_cast(value); + } + } +#endif setDisplayLabelDetails(); } @@ -74,8 +91,16 @@ //Contact //Preferred details QList > contactPrefferedDisplayLabelDetails; - contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), QLatin1String(QContactName::FieldFirstName))); - contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), QLatin1String(QContactName::FieldLastName))); + QLatin1String firstLatin(QContactName::FieldFirstName); + QLatin1String secondLatin(QContactName::FieldLastName); + + if (m_nameOrder == KOrderLastFirst || m_nameOrder == KOrderLastCommaFirst) { + firstLatin = QLatin1String(QContactName::FieldLastName); + secondLatin = QLatin1String(QContactName::FieldFirstName); + } + + contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), firstLatin)); + contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), secondLatin)); m_contactDisplayLabelDetails.append(contactPrefferedDisplayLabelDetails); //if preferred details doesn't exist use these @@ -146,9 +171,12 @@ if(!label.isEmpty()) { - displayLabel.append(delimiter()); + // Inlcude a comma if needed in the display label + if (m_nameOrder == KOrderLastCommaFirst) + displayLabel.append(comma()); + displayLabel.append(delimiter()); displayLabel.append(label); - } + } } } } @@ -196,3 +224,12 @@ { return m_groupDisplayLabelDetails.at(0); } + +/*! + * Comma to be used in display label + * \return comma + */ +QString CntDisplayLabel::comma() const +{ + return ","; +} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilteraction.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilteraction.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "cntfilteraction.h" -#include "cnttransformcontact.h" -#include "cntfilterdetaildisplaylabel.h" //todo rename class to follow naming pattern CntFilterDetailDisplayLabel - -CntFilterAction::CntFilterAction(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo) - :m_contactdatabase(contactDatabase), - m_srvConnection(cntServer), - m_dbInfo(dbInfo) -{ - // m_detailFilters.append(new CntFilterDetailDisplayLabel(m_srvConnection)); -} - -CntFilterAction::~CntFilterAction() -{ - -} - -QList CntFilterAction::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) -{ - Q_UNUSED(sortOrders); - Q_UNUSED(filterSupportedflag); - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - return QList(); - } - QList idList; - - //Create the query - QString sqlQuery; - createSelectQuery( filter,sqlQuery,error); - - //fetch the contacts - if(*error != QContactManager::NotSupportedError) - { - idList = m_srvConnection.searchContacts(sqlQuery, error); - } - - return idList; - -} - - -bool CntFilterAction::filterSupported(const QContactFilter& /*filter*/) -{ - bool result = false; - //Not yet supported - /*if(QContactFilter::ActionFilter == filter.type()) - { - result = true; - } - */ - - return result; -} - - -void CntFilterAction::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) - -{ - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - } - //For default filter, just return the below query - sqlQuery = ""; - - -} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterchangelog.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterchangelog.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "cntfilterchangelog.h" -#include "cnttransformcontact.h" -#include "cntfilterdetaildisplaylabel.h" //todo rename class to follow naming pattern CntFilterDetailDisplayLabel - -CntFilterChangeLog::CntFilterChangeLog(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo) - :m_contactdatabase(contactDatabase), - m_srvConnection(cntServer), - m_dbInfo(dbInfo) -{ - -} - -CntFilterChangeLog::~CntFilterChangeLog() -{ - -} - -QList CntFilterChangeLog::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) -{ - Q_UNUSED(sortOrders); - Q_UNUSED(filterSupportedflag); - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - return QList(); - } - QList idList; - - //Create the query - QString sqlQuery; - createSelectQuery( filter,sqlQuery,error); - - //fetch the contacts - if(*error != QContactManager::NotSupportedError) - { - idList = m_srvConnection.searchContacts(sqlQuery, error); - } - - return idList; - -} - - -bool CntFilterChangeLog::filterSupported(const QContactFilter& /*filter*/) -{ - bool result = false; - //Not supported yet - /* - if(QContactFilter::ChangeLogFilter == filter.type()) - { - result = true; - } - */ - return result; -} - - -void CntFilterChangeLog::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) - -{ - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - } - //Not supported yet. - sqlQuery = ""; - - -} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetail.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetail.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetail.cpp Thu May 27 12:45:19 2010 +0300 @@ -60,12 +60,10 @@ m_srvConnection(cntServer), m_dbInfo(dbInfo) { - } CntFilterDetail::~CntFilterDetail() { - } @@ -77,174 +75,149 @@ { Q_UNUSED(filterSupportedflag); //Check if any invalid filter is passed - if(!filterSupported(filter) ) - { + if (!filterSupported(filter) ) { *error = QContactManager::NotSupportedError; return QList(); - } + } QList idList; QContactDetailFilter detailFilter(filter); QString sqlQuery; //Check for phonenumber. Special handling needed - if( (detailFilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) && - (detailFilter.detailFieldName() != QContactPhoneNumber::FieldSubTypes)) - { + if ( (detailFilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) && + (detailFilter.detailFieldName() != QContactPhoneNumber::FieldSubTypes)) { //Handle phonenumber ... - idList = HandlePhonenumberDetailFilter(filter); + createMatchPhoneNumberQuery(filter,sqlQuery,error); + if (*error == QContactManager::NoError) { + //fetch the contacts + idList = m_srvConnection.searchContacts(sqlQuery, error); + } } - else if (detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation) - { + else if (detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation) { //predictive search filter idList = HandlePredictiveSearchFilter(filter,error); } // handle other cases - else - { + else { createSelectQuery(filter,sqlQuery,error); QString sortQuery = m_dbInfo.getSortQuery(sortOrders, sqlQuery, error); - if(*error == QContactManager::NoError) - { + if (*error == QContactManager::NoError) { //fetch the contacts idList = m_srvConnection.searchContacts(sortQuery, error); - } + } } - return idList; - - - } - bool CntFilterDetail::filterSupported(const QContactFilter& filter) { bool result = false; - if(QContactFilter::ContactDetailFilter == filter.type()) - { + if (QContactFilter::ContactDetailFilter == filter.type()) { result = true; - } - + } return result; } void CntFilterDetail::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) + QString& sqlQuery, + QContactManager::Error* error) { - if(!filterSupported(filter) ) - { - *error = QContactManager::NotSupportedError; - return; - } - QContactDetailFilter detailFilter(filter); - //display label - if (detailFilter.detailDefinitionName() == QContactDisplayLabel::DefinitionName) - { - CntFilterDetailDisplayLabel displayLabelFilter; - displayLabelFilter.createSelectQuery(filter, sqlQuery, error); - } - - //type - else if(detailFilter.detailDefinitionName() == QContactType::DefinitionName) - { - if(detailFilter.value().toString() == QContactType::TypeContact) - sqlQuery = "SELECT contact_id FROM contact WHERE (type_flags>>24)=0"; - else if(detailFilter.value().toString() == QContactType::TypeGroup) - sqlQuery = "SELECT contact_id FROM contact WHERE (type_flags>>24)=3"; + if (!filterSupported(filter)) { + *error = QContactManager::NotSupportedError; + return; + } + QContactDetailFilter detailFilter(filter); + //display label + if (detailFilter.detailDefinitionName() == QContactDisplayLabel::DefinitionName) { + CntFilterDetailDisplayLabel displayLabelFilter; + displayLabelFilter.createSelectQuery(filter, sqlQuery, error); + } + //type + else if (detailFilter.detailDefinitionName() == QContactType::DefinitionName) { + if (detailFilter.value().toString() == QContactType::TypeContact) + sqlQuery = "SELECT contact_id FROM contact WHERE (type_flags>>24)=0"; + else if (detailFilter.value().toString() == QContactType::TypeGroup) + sqlQuery = "SELECT contact_id FROM contact WHERE (type_flags>>24)=3"; + } + else if (detailFilter.detailDefinitionName() == QContactGuid::DefinitionName) { + if (detailFilter.detailFieldName() == QContactGuid::FieldGuid) { + QStringList fullGuidValue = detailFilter.value().toString().split('-'); + if (fullGuidValue.count() == 3) { + QString localGuidValue = fullGuidValue.at(1); + sqlQuery = "SELECT contact_id FROM contact WHERE guid_string = '" + localGuidValue + '\''; + } } - else if(detailFilter.detailDefinitionName() == QContactGuid::DefinitionName) - { - if(detailFilter.detailFieldName() == QContactGuid::FieldGuid) - { - QStringList fullGuidValue = detailFilter.value().toString().split('-'); - if (fullGuidValue.count() == 3) { - QString localGuidValue = fullGuidValue.at(1); - sqlQuery = "SELECT contact_id FROM contact WHERE guid_string = '" + localGuidValue + '\''; - } - } - } - //everything else - else - { - QString tableName; - QString sqlWhereClause; - getTableNameWhereClause(detailFilter,tableName,sqlWhereClause,error); - //Create the sql query - sqlQuery += "SELECT DISTINCT contact_id FROM " + tableName + " WHERE " + sqlWhereClause; - } + } + //everything else + else { + QString tableName; + QString sqlWhereClause; + getTableNameWhereClause(detailFilter,tableName,sqlWhereClause,error); + //Create the sql query + sqlQuery += "SELECT DISTINCT contact_id FROM " + tableName + " WHERE " + sqlWhereClause; + } } - /*! - * Updates match flage for columns. + * Updates match flags for columns. */ -void CntFilterDetail::updateForMatchFlag( const QContactDetailFilter& filter, - QString& fieldToUpdate , - QContactManager::Error* error) const +void CntFilterDetail::updateForMatchFlag(const QContactDetailFilter& filter, + QString& fieldToUpdate , + QContactManager::Error* error) const { // Modify the filed depending on the query - switch(filter.matchFlags()) - { - case QContactFilter::MatchExactly: - { - // Pattern for MatchExactly: - // " ='xyz'" - fieldToUpdate = " ='" - + filter.value().toString() + '\''; - *error = QContactManager::NoError; - break; - } - case QContactFilter::MatchContains: - { - // Pattern for MatchContains: - // " LIKE '%xyz%'" - fieldToUpdate = " LIKE '%" + filter.value().toString() + "%'" ; - *error = QContactManager::NoError; - break; - } - case QContactFilter::MatchStartsWith: - { - // Pattern for MatchStartsWith: - // " LIKE 'xyz%'" - fieldToUpdate = " LIKE '" + filter.value().toString() + "%'" ; - *error = QContactManager::NoError; - break; - } - case QContactFilter::MatchEndsWith: - { - // Pattern for MatchEndsWith: - // " LIKE '%xyz'" - fieldToUpdate = " LIKE '%" + filter.value().toString() + '\'' ; - *error = QContactManager::NoError; - break; - } - case QContactFilter::MatchFixedString: - { - *error = QContactManager::NotSupportedError; - break; - } - case QContactFilter::MatchCaseSensitive: - { - *error = QContactManager::NotSupportedError; - break; - } - default: - { - *error = QContactManager::NotSupportedError; - break; - } + switch (filter.matchFlags()) { + case QContactFilter::MatchExactly: { + // Pattern for MatchExactly: + // " ='xyz'" + fieldToUpdate = " ='" + + filter.value().toString() + '\''; + *error = QContactManager::NoError; + break; + } + case QContactFilter::MatchContains: { + // Pattern for MatchContains: + // " LIKE '%xyz%'" + fieldToUpdate = " LIKE '%" + filter.value().toString() + "%'" ; + *error = QContactManager::NoError; + break; } - + case QContactFilter::MatchStartsWith: { + // Pattern for MatchStartsWith: + // " LIKE 'xyz%'" + fieldToUpdate = " LIKE '" + filter.value().toString() + "%'" ; + *error = QContactManager::NoError; + break; + } + case QContactFilter::MatchEndsWith: { + // Pattern for MatchEndsWith: + // " LIKE '%xyz'" + fieldToUpdate = " LIKE '%" + filter.value().toString() + '\'' ; + *error = QContactManager::NoError; + break; + } + case QContactFilter::MatchFixedString: { + *error = QContactManager::NotSupportedError; + break; + } + case QContactFilter::MatchCaseSensitive: { + *error = QContactManager::NotSupportedError; + break; + } + default: { + *error = QContactManager::NotSupportedError; + break; + } + } } -void CntFilterDetail::getTableNameWhereClause( const QContactDetailFilter& detailfilter, - QString& tableName, - QString& sqlWhereClause , - QContactManager::Error* error) const +void CntFilterDetail::getTableNameWhereClause(const QContactDetailFilter& detailfilter, + QString& tableName, + QString& sqlWhereClause , + QContactManager::Error* error) const { //Get the table name and the column name QString columnName; @@ -253,119 +226,282 @@ m_dbInfo.getDbTableAndColumnName(detailfilter.detailDefinitionName(), detailfilter.detailFieldName(), tableName, columnName, isSubType); // return if tableName is empty - if(tableName.isEmpty()) - { + if (tableName.isEmpty()) { *error = QContactManager::NotSupportedError; return; - } + } //check columnName - if(columnName.isEmpty()) - { + if (columnName.isEmpty()) { *error = QContactManager::NotSupportedError; return; - } - else if (isSubType) - { + } + else if (isSubType) { sqlWhereClause += columnName; sqlWhereClause += " NOT NULL "; - } - else - { + } + else { sqlWhereClause += ' ' + columnName + ' '; QString fieldToUpdate; //Update the value depending on the match flag updateForMatchFlag(detailfilter,fieldToUpdate,error); sqlWhereClause += fieldToUpdate; - } + } } -QList CntFilterDetail::HandlePredictiveSearchFilter(const QContactFilter& filter,QContactManager::Error* error) - { - +QList CntFilterDetail::HandlePredictiveSearchFilter(const QContactFilter& filter, + QContactManager::Error* error) +{ QString sqlQuery; - if(filter.type() == QContactFilter::ContactDetailFilter){ + if (filter.type() == QContactFilter::ContactDetailFilter) { const QContactDetailFilter detailFilter(filter); - if( detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation ){ - CntSqlSearch sqlSearch; - //convert string to numeric format + if (detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation) { + CntSqlSearch sqlSearch; + //convert string to numeric format QString pattern = detailFilter.value().toString(); sqlQuery = sqlSearch.CreatePredictiveSearch(pattern); return m_srvConnection.searchContacts(sqlQuery, error); - } - else - { + } + else { return QList(); - } - } - else - { + } + } + else { return QList(); - } } +} -QList CntFilterDetail::HandlePhonenumberDetailFilter(const QContactFilter& filter) - { - QList matches; - QContactDetailFilter detailFilter(filter); - // Phone numbers need separate handling +/* + * Creates an sql query to fetch contact item IDs for all the contact items + * which may contain the specified telephone number in a telephone, fax + * or SMS type field. + * + * The comparison method used is not exact. The number is compared starting from + * the right side of the number and the method returns an array of candidate + * matches. Punctuation (e.g. spaces) and other alphabetic characters are ignored + * when comparing. + */ +void CntFilterDetail::createMatchPhoneNumberQuery( + const QContactFilter& filter, + QString& sqlQuery, + QContactManager::Error* error) - QString number((detailFilter.value()).toString()); - TPtrC commPtr(reinterpret_cast(number.utf16())); +{ + if (!filterSupported(filter) ) { + *error = QContactManager::NotSupportedError; + return; + } + + QContactDetailFilter detailFilter(filter); + QString number((detailFilter.value()).toString()); + TPtrC numberPtr(reinterpret_cast(number.utf16())); - TInt matchLength(KDefaultMatchLength); - // no need to propagate error, we can use the default match length - TRAP_IGNORE(getMatchLengthL(matchLength)); - int actualLength = number.length(); + TInt matchLengthFromRight(KDefaultMatchLength); + // no need to propagate error, we can use the default match length + TRAP_IGNORE(getMatchLengthL(matchLengthFromRight)); + + TInt numLowerDigits = matchLengthFromRight; + TInt numUpperDigits = 0; + + if (numLowerDigits > KLowerSevenDigits) { + // New style matching. + numLowerDigits = KLowerSevenDigits; + numUpperDigits = matchLengthFromRight - KLowerSevenDigits; + } + + TMatch phoneDigits = createPaddedPhoneDigits( + numberPtr, numLowerDigits, numUpperDigits, error); - //call the search - CContactIdArray* idArray(0); - TInt err = searchPhoneNumbers(idArray, commPtr, matchLength); - if( idArray && (err == KErrNone)){ - // copy the matching contact ids - for(int i(0); i < idArray->Count(); i++) { - matches.append(QContactLocalId((*idArray)[i])); - } - delete idArray; - } - else{ - //CntSymbianTransformError::transformError(err, error); - } - - - - return matches; - - } + if (*error == QContactManager::NoError) { + // select fields for contacts that match phone lookup + // SELECT contact_id FROM comm_addr + // WHERE value = [value string] AND type = [type value]; + // + QString type = QString(" type = %1").arg(CntDbInfo::EPhoneNumber); + QString value = QString(" value = %1").arg(phoneDigits.iLowerSevenDigits); + QString extraValue = QString(" extra_value = %1").arg(phoneDigits.iUpperDigits); + QString whereClause = " WHERE" + value + " AND" + type; + if (matchLengthFromRight <= KLowerSevenDigits) { + // Matching 7 or less digits... + sqlQuery = "SELECT contact_id FROM comm_addr" + whereClause; + } + else { + // Checking the upper digits... + whereClause += " AND" + extraValue; + sqlQuery = "SELECT contact_id FROM comm_addr" + whereClause; + } + } +} /* * Get the match length setting. Digits to be used in matching (counted from * right). */ -void CntFilterDetail::getMatchLengthL(TInt& matchLength) +bool CntFilterDetail::getMatchLengthL(TInt& matchLength) { //Get number of digits used to match + bool result = false; CRepository* repository = CRepository::NewL(KCRUidTelConfiguration); - CleanupStack::PushL(repository); - User::LeaveIfError(repository->Get(KTelMatchDigits, matchLength)); - CleanupStack::PopAndDestroy(repository); + TInt err = repository->Get(KTelMatchDigits, matchLength); + delete repository; + + result = (err == KErrNone); + return result; +} + +/* + * Convert the supplied string to a matchable phone number. + * + * \param text Descriptor containing phone number. + * \param lowerMatchlength Number of least significant phone digits to use. + * \param upperMatchLength Number of most significant phone digits to use. + * \param error Qt error code. + * \return The hash code(s) to use when matching the supplied phone number. + */ +CntFilterDetail::TMatch CntFilterDetail::createPaddedPhoneDigits( + const TDesC& number, + const TInt numLowerDigits, + const TInt numUpperDigits, + QContactManager::Error* error) +{ + TMatch phoneNumber = createPhoneMatchNumber( + number, numLowerDigits, numUpperDigits, error); + if (*error == QContactManager::NoError) { + if (phoneNumber.iNumLowerDigits + phoneNumber.iUpperDigits == 0) { + // No digits, do nothing + } + else if (phoneNumber.iNumLowerDigits < KLowerSevenDigits) { + // Only the lower-digits hash is used, pad out the number to + // KLowerSevenDigits. + TInt pad = KLowerSevenDigits - phoneNumber.iNumLowerDigits; + phoneNumber.iLowerSevenDigits = TMatch::padOutPhoneMatchNumber(phoneNumber.iLowerSevenDigits,pad); + } + else if (phoneNumber.iNumUpperDigits < (KMaxPhoneMatchLength - KLowerSevenDigits) ) { + // The lower-digits hash is full, pad out the upper hash if less than 15 + // digits total. + TInt pad = KMaxPhoneMatchLength - KLowerSevenDigits - phoneNumber.iNumUpperDigits; + phoneNumber.iUpperDigits = TMatch::padOutPhoneMatchNumber(phoneNumber.iUpperDigits,pad); + } + } + return phoneNumber; } /* - * Find contacts based on a phone number. - * \a idArray On return contains the ids of the contacts that match the phonenumber. - * \a phoneNumber The phone number to match - * \a matchLength Match length; digits from right. + * Returns the hash code(s) to use when matching the supplied phone number. If the + * number supplied has more actual phone digits (i.e. not including spaces) than + * KLowerSevenDigits, a second hash is generated to hold the remaining most + * significant phone digits. Removes the non-digit characters. + + * \param text Descriptor containing contacts phone number field. + * \param lowerMatchlength Number of least significant phone digits to use. + * \param upperMatchLength Number of most significant phone digits to use. + * \param error Qt error code. + * \return The hash code(s) to use when matching the supplied phone number. */ -TInt CntFilterDetail::searchPhoneNumbers( - CContactIdArray*& idArray, - const TDesC& phoneNumber, - const TInt matchLength) +CntFilterDetail::TMatch CntFilterDetail::createPhoneMatchNumber( + const TDesC& text, + TInt lowerMatchLength, + TInt upperMatchLength, + QContactManager::Error* error) +{ + const TInt KBufLength = KCntMaxTextFieldLength+1; + TBuf buf; + + if (text.Length() <= KBufLength) { + buf = text; + } + else { + buf = text.Right(KBufLength); + } + TMatch::stripOutNonDigitChars(buf); + + TMatch phoneNumber; + if (buf.Length() == 0) { + *error = QContactManager::BadArgumentError; + return phoneNumber; + } + + // Generate a hash for the upper digits only if the phone number string is + // large enough and more than 7 digits are to be matched. + TInt phoneNumberlength = buf.Length(); + if ((phoneNumberlength > KLowerSevenDigits) && (upperMatchLength > 0)) { + TPtrC upperPart = buf.Left(phoneNumberlength - KLowerSevenDigits); + phoneNumber.iUpperDigits = TMatch::createHash(upperPart, + upperMatchLength, phoneNumber.iNumUpperDigits); + } + // Generate a hash of the lower digits. + phoneNumber.iLowerSevenDigits = TMatch::createHash(buf, + lowerMatchLength, phoneNumber.iNumLowerDigits); + + return phoneNumber; +} + +//CntFilterDetail::TMatch constructor. +CntFilterDetail::TMatch::TMatch() + : + iLowerSevenDigits(0), + iUpperDigits(0), + iNumLowerDigits(0), + iNumUpperDigits(0) { - CContactIdArray* idArrayTmp(0); - TRAPD( err, idArrayTmp = m_contactdatabase.MatchPhoneNumberL(phoneNumber, matchLength)); - if(err == KErrNone){ - idArray = idArrayTmp; +} + +/* + * Generates a hash value by reversing the matchLength least significant digits, + * ignoring non-digits and zeroes at the end of the number. Returns error if no phone + * digits are supplied. + + * \param phoneNumberString A descriptor containing a phone number. + * \param matchLength The number of digits from the right of the phone number to use. + * \param numPhoneDigits The number of digits found in the phone number string. + * \param error Qt error code.* + * \return An integer representation of the phone number string in reverse. + */ +TInt32 CntFilterDetail::TMatch::createHash( + const TDesC& phoneNumberString, + TInt matchLength, + TInt& numPhoneDigits) +{ + TInt phoneNumberLength = phoneNumberString.Length(); + TInt startIndex = 0; + if (phoneNumberLength > matchLength) { + startIndex = phoneNumberLength - matchLength; } - return 0; + + numPhoneDigits = 0; + TUint reversedDigits = 0; + TInt mult = 1; + + for (TInt chrIndex = startIndex; (numPhoneDigits < matchLength) && (chrIndex < phoneNumberLength); chrIndex++) { + TChar chr = phoneNumberString[chrIndex]; + if (chr.IsDigit()) { + reversedDigits += (chr.GetNumericValue()) * mult; + mult = mult * 10; + ++numPhoneDigits; + } + } + return reversedDigits ; } + +void CntFilterDetail::TMatch::stripOutNonDigitChars(TDes& text) +{ + for (TInt chrPos = 0; chrPos < text.Length(); ++chrPos) { + TChar chr = text[chrPos]; + if (!chr.IsDigit()) { + text.Delete(chrPos, 1); + --chrPos; + } + } +} + +TInt32 CntFilterDetail::TMatch::padOutPhoneMatchNumber(TInt32& phoneNumber, + TInt padOutLength) +{ + TInt32 result(phoneNumber); + const TInt KMult(10); + for (TInt i = 0; i < padOutLength; ++i) { + result *= KMult; + } + phoneNumber = result; + return result; +} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetailrange.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetailrange.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "cntfilterdetailrange.h" -#include "cnttransformcontact.h" -#include "cntfilterdetaildisplaylabel.h" //todo rename class to follow naming pattern CntFilterDetailDisplayLabel - -CntFilterdetailrange::CntFilterdetailrange(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo) - :m_contactdatabase(contactDatabase), - m_srvConnection(cntServer), - m_dbInfo(dbInfo) -{ - // m_detailFilters.append(new CntFilterDetailDisplayLabel(m_srvConnection)); -} - -CntFilterdetailrange::~CntFilterdetailrange() -{ - -} - - -QList CntFilterdetailrange::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) -{ - Q_UNUSED(sortOrders); - Q_UNUSED(filterSupportedflag); - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - return QList(); - } - QList idList; - - //Create the query - QString sqlQuery; - createSelectQuery( filter,sqlQuery,error); - - //fetch the contacts - if(*error != QContactManager::NotSupportedError) - { - idList = m_srvConnection.searchContacts(sqlQuery, error); - } - - return idList; - -} - - -bool CntFilterdetailrange::filterSupported(const QContactFilter& /*filter*/) -{ - bool result = false; - //Not yet supported - /*if(QContactFilter::ContactDetailRangeFilter == filter.type()) - { - result = true; - } - */ - return result; -} - - -void CntFilterdetailrange::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) - -{ - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - } - //Not yet supported - sqlQuery = ""; - - -} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterintersection.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterintersection.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterintersection.cpp Thu May 27 12:45:19 2010 +0300 @@ -51,38 +51,33 @@ m_srvConnection(cntServer), m_dbInfo(dbInfo) { - } CntFilterIntersection::~CntFilterIntersection() { - } -QList CntFilterIntersection::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) +QList CntFilterIntersection::contacts(const QContactFilter &filter, + const QList &sortOrders, + bool &filterSupportedflag, + QContactManager::Error* error) { Q_UNUSED(sortOrders); Q_UNUSED(filterSupportedflag); //Check if any invalid filter is passed - if(filterSupported(filter) == false) - { + if (filterSupported(filter) == false) { *error = QContactManager::NotSupportedError; return QList(); - } + } QList idList; QString sqlQuery; createSelectQuery(filter,sqlQuery,error); QString sortQuery = m_dbInfo.getSortQuery(sortOrders, sqlQuery, error); //fetch the contacts - if(*error == QContactManager::NoError ) - { + if (*error == QContactManager::NoError ) { idList = m_srvConnection.searchContacts(sortQuery, error); - } + } return idList; } @@ -90,98 +85,84 @@ bool CntFilterIntersection::filterSupported(const QContactFilter& filter) { bool result = false; - if(QContactFilter::IntersectionFilter == filter.type()) - { - result = true; - } - - return result; + if (QContactFilter::IntersectionFilter == filter.type()) { + result = true; + } + return result; } void CntFilterIntersection::createSelectQuery(const QContactFilter& filter, - QString& selectquery, - QContactManager::Error* error) + QString& selectquery, + QContactManager::Error* error) { const QContactIntersectionFilter& intersectionfilter = static_cast(filter); - if(!filterSupported(filter)) - { + if (!filterSupported(filter)) { *error = QContactManager::NotSupportedError; return; + } + QList individualFilters = intersectionfilter.filters(); + //QString selectquery; + int fltrcnt = individualFilters.count(); + if (fltrcnt) + getSelectQueryforFilter(individualFilters[0],selectquery,error); + + for (int i=1; i< fltrcnt ; i++) { + + QString query; + getSelectQueryforFilter(individualFilters[i],query,error); + if (*error == QContactManager::NoError ) { + selectquery.append(" INTERSECT "); + selectquery += query; } - QList individualFilters = intersectionfilter.filters(); - //QString selectquery; - int fltrcnt = individualFilters.count(); - if(fltrcnt) - getSelectQueryforFilter(individualFilters[0],selectquery,error); - - for(int i=1; i< fltrcnt ; i++) - { - - QString query; - getSelectQueryforFilter(individualFilters[i],query,error); - if(*error == QContactManager::NoError ) - { - selectquery.append(" INTERSECT "); - selectquery += query; - } - - } - - + } } -void CntFilterIntersection::getSelectQueryforFilter(const QContactFilter& filter,QString& sqlSelectQuery,QContactManager::Error* error) - { - switch(filter.type()) - { - case QContactFilter::DefaultFilter: - { - CntFilterDefault defaultfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - defaultfltr.createSelectQuery(filter,sqlSelectQuery,error); - break; - } - case QContactFilter::ContactDetailFilter: - { - QContactDetailFilter detailfilter(filter); - if(detailfilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) - { - *error=QContactManager::NotSupportedError; - } - else - { - CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - dtlfltr.createSelectQuery(filter,sqlSelectQuery,error); - } - break; - } - case QContactFilter::RelationshipFilter: - { - CntFilterRelationship relationfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - relationfltr.createSelectQuery(filter,sqlSelectQuery,error); - break; - } - case QContactFilter::IntersectionFilter: - { - sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; - CntFilterIntersection intersectionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - intersectionfltr.createSelectQuery(filter,sqlSelectQuery,error); - sqlSelectQuery += ')'; - break; - } - case QContactFilter::UnionFilter: - { - sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; - CntFilterUnion unionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - unionfltr.createSelectQuery(filter,sqlSelectQuery,error); - sqlSelectQuery += ')'; - break; - } - default: - { - *error = QContactManager::NotSupportedError; - break; - } +void CntFilterIntersection::getSelectQueryforFilter(const QContactFilter& filter, + QString& sqlSelectQuery, + QContactManager::Error* error) +{ + switch(filter.type()) { + case QContactFilter::DefaultFilter: { + CntFilterDefault defaultfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + defaultfltr.createSelectQuery(filter,sqlSelectQuery,error); + break; + } + case QContactFilter::ContactDetailFilter: { + QContactDetailFilter detailfilter(filter); + if (detailfilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) { + CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + dtlfltr.createMatchPhoneNumberQuery(filter,sqlSelectQuery,error); + } + else { + CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + dtlfltr.createSelectQuery(filter,sqlSelectQuery,error); } + break; + } + case QContactFilter::RelationshipFilter: { + CntFilterRelationship relationfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + relationfltr.createSelectQuery(filter,sqlSelectQuery,error); + break; + } + case QContactFilter::IntersectionFilter: { + sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; + CntFilterIntersection intersectionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + intersectionfltr.createSelectQuery(filter,sqlSelectQuery,error); + sqlSelectQuery += ')'; + break; + } + case QContactFilter::UnionFilter: { + sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; + CntFilterUnion unionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + unionfltr.createSelectQuery(filter,sqlSelectQuery,error); + sqlSelectQuery += ')'; + break; + } + default: { + *error = QContactManager::NotSupportedError; + break; + } } +} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterinvalid.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterinvalid.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "cntfilterinvalid.h" -#include "cnttransformcontact.h" -#include "cntfilterdetaildisplaylabel.h" //todo rename class to follow naming pattern CntFilterDetailDisplayLabel - -CntFilterInvalid::CntFilterInvalid(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo) - :m_contactdatabase(contactDatabase), - m_srvConnection(cntServer), - m_dbInfo(dbInfo) -{ - // m_detailFilters.append(new CntFilterDetailDisplayLabel(m_srvConnection)); -} - -CntFilterInvalid::~CntFilterInvalid() -{ - -} - -QList CntFilterInvalid::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) -{ - Q_UNUSED(filter); - Q_UNUSED(sortOrders); - Q_UNUSED(filterSupportedflag); - Q_UNUSED(error); - //In case of invalid filter, we return empty list - return QList(); - -} - - -bool CntFilterInvalid::filterSupported(const QContactFilter& filter) -{ - bool result = false; - if(QContactFilter::InvalidFilter == filter.type()) - { - result = true; - } - - return result; -} - -void CntFilterInvalid::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) - -{ - Q_UNUSED(sqlQuery); - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - } -} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterlocalid.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterlocalid.cpp Fri May 14 15:42:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "cntfilterlocalid.h" -#include "cnttransformcontact.h" - -CntFilterLocalId::CntFilterLocalId(CContactDatabase& contactDatabase,CntSymbianSrvConnection &cntServer,CntDbInfo& dbInfo) - :m_contactdatabase(contactDatabase), - m_srvConnection(cntServer), - m_dbInfo(dbInfo) -{ - -} - -CntFilterLocalId::~CntFilterLocalId() -{ - -} - -QList CntFilterLocalId::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) -{ - Q_UNUSED(sortOrders); - Q_UNUSED(filterSupportedflag); - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - return QList(); - } - QList idList; - - //Create the query - QString sqlQuery; - createSelectQuery( filter,sqlQuery,error); - - //fetch the contacts - if(*error != QContactManager::NotSupportedError) - { - idList = m_srvConnection.searchContacts(sqlQuery, error); - } - - return idList; - -} - - -bool CntFilterLocalId::filterSupported(const QContactFilter& /*filter*/) -{ - bool result = false; - //Not yet supported - /*if(QContactFilter::LocalIdFilter == filter.type()) - { - result = true; - } - */ - return result; -} - - -void CntFilterLocalId::createSelectQuery(const QContactFilter& filter, - QString& sqlQuery, - QContactManager::Error* error) - -{ - //Check if any invalid filter is passed - if(!filterSupported(filter)) - { - *error = QContactManager::NotSupportedError; - } - //Not yet supported - sqlQuery = ""; - - -} diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterunion.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterunion.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterunion.cpp Thu May 27 12:45:19 2010 +0300 @@ -51,139 +51,119 @@ m_srvConnection(cntServer), m_dbInfo(dbInfo) { - } CntFilterUnion::~CntFilterUnion() { - } -QList CntFilterUnion::contacts( - const QContactFilter &filter, - const QList &sortOrders, - bool &filterSupportedflag, - QContactManager::Error* error) +QList CntFilterUnion::contacts(const QContactFilter &filter, + const QList &sortOrders, + bool &filterSupportedflag, + QContactManager::Error* error) { Q_UNUSED(sortOrders); Q_UNUSED(filterSupportedflag); //Check if any invalid filter is passed - if(!filterSupported(filter)) - { + if (!filterSupported(filter)) { *error = QContactManager::NotSupportedError; return QList(); - } - QList idList; - QString sqlQuery; - createSelectQuery(filter,sqlQuery,error); - QString sortQuery = m_dbInfo.getSortQuery(sortOrders, sqlQuery, error); - //fetch the contacts - if(*error == QContactManager::NoError ) - { - idList = m_srvConnection.searchContacts(sortQuery, error); - } - return idList; + } + QList idList; + QString sqlQuery; + createSelectQuery(filter,sqlQuery,error); + QString sortQuery = m_dbInfo.getSortQuery(sortOrders, sqlQuery, error); + //fetch the contacts + if (*error == QContactManager::NoError) { + idList = m_srvConnection.searchContacts(sortQuery, error); + } + return idList; } bool CntFilterUnion::filterSupported(const QContactFilter& filter) { bool result = false; - if(QContactFilter::UnionFilter == filter.type()) - { - result = true; - } - - return result; + if (QContactFilter::UnionFilter == filter.type()) { + result = true; + } + return result; } void CntFilterUnion::createSelectQuery(const QContactFilter& filter, - QString& selectquery, - QContactManager::Error* error) + QString& selectquery, + QContactManager::Error* error) { const QContactUnionFilter& unionfilter = static_cast(filter); - if(!filterSupported(filter)) - { + if (!filterSupported(filter)) { *error = QContactManager::NotSupportedError; return; + } + QList individualFilters = unionfilter.filters(); + //QString selectquery; + int fltrcnt = individualFilters.count(); + if (fltrcnt) + getSelectQueryforFilter(individualFilters[0],selectquery,error); + + for (int i=1; i< fltrcnt ; i++) { + QString query; + getSelectQueryforFilter(individualFilters[i],query,error); + if (*error == QContactManager::NoError ) { + selectquery.append(" UNION "); + selectquery += query; } - QList individualFilters = unionfilter.filters(); - //QString selectquery; - int fltrcnt = individualFilters.count(); - if(fltrcnt) - getSelectQueryforFilter(individualFilters[0],selectquery,error); - - for(int i=1; i< fltrcnt ; i++) - { - - QString query; - getSelectQueryforFilter(individualFilters[i],query,error); - if(*error == QContactManager::NoError ) - { - selectquery.append(" UNION "); - selectquery += query; - } - - } - - + } } -void CntFilterUnion::getSelectQueryforFilter(const QContactFilter& filter,QString& sqlSelectQuery,QContactManager::Error* error) - { - switch(filter.type()) - { - case QContactFilter::DefaultFilter: - { - CntFilterDefault defaultfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - defaultfltr.createSelectQuery(filter,sqlSelectQuery,error); - break; - } - case QContactFilter::ContactDetailFilter: - { - QContactDetailFilter detailfilter(filter); - if(detailfilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) - { - *error=QContactManager::NotSupportedError; - } - else - { - CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - dtlfltr.createSelectQuery(filter,sqlSelectQuery,error); - } - break; - } - case QContactFilter::RelationshipFilter: - { - CntFilterRelationship relationfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - relationfltr.createSelectQuery(filter,sqlSelectQuery,error); - break; - } - case QContactFilter::IntersectionFilter: - { - sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; - CntFilterIntersection intersectionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - intersectionfltr.createSelectQuery(filter,sqlSelectQuery,error); - sqlSelectQuery += ')'; - break; - } - case QContactFilter::UnionFilter: - { - sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; - CntFilterUnion unionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); - unionfltr.createSelectQuery(filter,sqlSelectQuery,error); - sqlSelectQuery += ')'; - break; - } - default: - { - *error = QContactManager::NotSupportedError; - break; - } +void CntFilterUnion::getSelectQueryforFilter(const QContactFilter& filter, + QString& sqlSelectQuery, + QContactManager::Error* error) +{ + switch (filter.type()) { + case QContactFilter::DefaultFilter: { + CntFilterDefault defaultfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + defaultfltr.createSelectQuery(filter,sqlSelectQuery,error); + break; + } + case QContactFilter::ContactDetailFilter: { + QContactDetailFilter detailfilter(filter); + if (detailfilter.detailDefinitionName() == QContactPhoneNumber::DefinitionName ) { + CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + dtlfltr.createMatchPhoneNumberQuery(filter,sqlSelectQuery,error); + } + else { + CntFilterDetail dtlfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + dtlfltr.createSelectQuery(filter,sqlSelectQuery,error); } + break; + } + case QContactFilter::RelationshipFilter: { + CntFilterRelationship relationfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + relationfltr.createSelectQuery(filter,sqlSelectQuery,error); + break; + } + case QContactFilter::IntersectionFilter: { + sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; + CntFilterIntersection intersectionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + intersectionfltr.createSelectQuery(filter,sqlSelectQuery,error); + sqlSelectQuery += ')'; + break; + } + case QContactFilter::UnionFilter: { + sqlSelectQuery += "SELECT DISTINCT contact_id FROM ("; + CntFilterUnion unionfltr(m_contactdatabase,m_srvConnection,m_dbInfo); + unionfltr.createSelectQuery(filter,sqlSelectQuery,error); + sqlSelectQuery += ')'; + break; + } + default: { + *error = QContactManager::NotSupportedError; + break; + } } - +} + diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbianfiltersql.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbianfiltersql.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbianfiltersql.cpp Thu May 27 12:45:19 2010 +0300 @@ -51,11 +51,6 @@ #include "cntfilterintersection.h" #include "cntfilterunion.h" #include "cntfilterrelationship.h" -#include "cntfilterinvalid.h" -#include "cntfilterdetailrange.h" -#include "cntfilterchangelog.h" -#include "cntfilteraction.h" -#include "cntfilterlocalid.h" #include #include #include @@ -77,11 +72,6 @@ m_filterMap.insert(QContactFilter::IntersectionFilter, new CntFilterIntersection(m_contactDatabase,m_srvConnection,*m_dbInfo)); m_filterMap.insert(QContactFilter::UnionFilter, new CntFilterUnion(m_contactDatabase,m_srvConnection,*m_dbInfo)); m_filterMap.insert(QContactFilter::RelationshipFilter, new CntFilterRelationship(m_contactDatabase,m_srvConnection,*m_dbInfo)); - m_filterMap.insert(QContactFilter::InvalidFilter, new CntFilterInvalid(m_contactDatabase,m_srvConnection,*m_dbInfo)); - m_filterMap.insert(QContactFilter::ContactDetailRangeFilter, new CntFilterdetailrange(m_contactDatabase,m_srvConnection,*m_dbInfo)); - m_filterMap.insert(QContactFilter::ChangeLogFilter, new CntFilterChangeLog(m_contactDatabase,m_srvConnection,*m_dbInfo)); - m_filterMap.insert(QContactFilter::ActionFilter, new CntFilterAction(m_contactDatabase,m_srvConnection,*m_dbInfo)); - m_filterMap.insert(QContactFilter::LocalIdFilter, new CntFilterLocalId(m_contactDatabase,m_srvConnection,*m_dbInfo)); } CntSymbianFilter::~CntSymbianFilter() @@ -89,8 +79,7 @@ //delete the all filters from the map QMap::iterator itr; - for (itr = m_filterMap.begin(); itr != m_filterMap.end(); ++itr) - { + for (itr = m_filterMap.begin(); itr != m_filterMap.end(); ++itr) { CntAbstractContactFilter* value = itr.value(); delete value; value = 0; @@ -99,31 +88,24 @@ delete m_dbInfo; } -QList CntSymbianFilter::contacts( - const QContactFilter& filter, - const QList& sortOrders, - bool &filterSupported, - QContactManager::Error* error) +QList CntSymbianFilter::contacts(const QContactFilter& filter, + const QList& sortOrders, + bool &filterSupported, + QContactManager::Error* error) { QList ids; - if(m_filterMap.contains(filter.type())) - { - + if (m_filterMap.contains(filter.type())) { ids = ( m_filterMap.value(filter.type()))->contacts(filter,sortOrders,filterSupported,error); return ids; - - } + } *error = QContactManager::NotSupportedError; return ids; - } bool CntSymbianFilter::filterSupported(const QContactFilter& filter) { bool result = false; - - if(m_filterMap.contains(filter.type())) - { + if (m_filterMap.contains(filter.type())) { result = m_filterMap.value(filter.type())->filterSupported(filter); } return result; diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversary.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversary.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversary.cpp Thu May 27 12:45:19 2010 +0300 @@ -39,8 +39,7 @@ ** ****************************************************************************/ #include "cnttransformanniversary.h" - -const char separator = ','; +#include "cntmodelextuids.h" QList CntTransformAnniversary::transformDetailL(const QContactDetail &detail) { @@ -52,55 +51,38 @@ //cast to anniversary const QContactAnniversary &anniversary(static_cast(detail)); - //create new field - QString formattedAnniversary; - if (anniversary.originalDate().isValid()) { - formattedAnniversary = anniversary.originalDate().toString(Qt::ISODate); - } - if (formattedAnniversary.length() > 0) { - formattedAnniversary.append(separator); - } - formattedAnniversary.append(anniversary.event()); + //date field + TDateTime dateTime(anniversary.originalDate().year(), + TMonth(anniversary.originalDate().month() - 1), + anniversary.originalDate().day() - 1, 0, 0, 0, 0); + CContactItemField* dateField = CContactItemField::NewLC(KStorageTypeDateTime, KUidContactFieldAnniversary); + dateField->DateTimeStorage()->SetTime(dateTime); + dateField->SetMapping(KUidContactFieldVCardMapAnniversary); + fieldList.append(dateField); + CleanupStack::Pop(dateField); - TPtrC fieldText(reinterpret_cast(formattedAnniversary.utf16())); - CContactItemField* newField = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldAnniversary); - newField->TextStorage()->SetTextL(fieldText); - newField->SetMapping(KUidContactFieldVCardMapAnniversary); - - fieldList.append(newField); - CleanupStack::Pop(newField); - + //event field + transformToTextFieldL(anniversary, fieldList, anniversary.event(), KUidContactFieldAnniversaryEvent, KUidContactFieldVCardMapUnknown, false); + return fieldList; } QContactDetail *CntTransformAnniversary::transformItemField(const CContactItemField& field, const QContact &contact) { - Q_UNUSED(contact); - - QContactAnniversary *anniversary = new QContactAnniversary(); + QContactAnniversary *anniversaryDetail = new QContactAnniversary(contact.detail()); + if (field.StorageType() == KStorageTypeDateTime) { + CContactDateField* date = field.DateTimeStorage(); + TTime time(date->Time()); + QDate qDate(time.DateTime().Year(), time.DateTime().Month() + 1, time.DateTime().Day() + 1); + anniversaryDetail->setOriginalDate(qDate); + } + else if (field.StorageType() == KStorageTypeText) { + CContactTextField* event = field.TextStorage(); + QString eventString = QString::fromUtf16(event->Text().Ptr(), event->Text().Length()); + anniversaryDetail->setEvent(eventString); + } - CContactTextField* storage = field.TextStorage(); - QString unformattedAnniversary = QString::fromUtf16(storage->Text().Ptr(), storage->Text().Length()); - int separatorPos = unformattedAnniversary.indexOf(separator); - bool dateFound = false; - if (separatorPos != -1) { - // date is probably included - QDate date = QDate::fromString(unformattedAnniversary.left(separatorPos), Qt::ISODate); - if (date.isValid()) { - anniversary->setOriginalDate(date); - dateFound = true; - } - } - - if (dateFound) { - if (unformattedAnniversary.length()-separatorPos-1 > 0) { - anniversary->setEvent(unformattedAnniversary.right(unformattedAnniversary.length()-separatorPos-1)); - } - } - else { - anniversary->setEvent(unformattedAnniversary); - } - return anniversary; + return anniversaryDetail; } bool CntTransformAnniversary::supportsField(TUint32 fieldType) const diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversarysimple.cpp --- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversarysimple.cpp Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformanniversarysimple.cpp Thu May 27 12:45:19 2010 +0300 @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "CntTransformAnniversarySimple.h" +#include "cnttransformanniversarysimple.h" QList CntTransformAnniversarySimple::transformDetailL(const QContactDetail &detail) { diff -r 2a11b5b00470 -r fd64c38c277d qtcontactsmobility/plugins/contacts/symbian/symbian.pro --- a/qtcontactsmobility/plugins/contacts/symbian/symbian.pro Fri May 14 15:42:23 2010 +0300 +++ b/qtcontactsmobility/plugins/contacts/symbian/symbian.pro Thu May 27 12:45:19 2010 +0300 @@ -60,13 +60,8 @@ inc/filtering/cntdbinfo.h \ inc/filtering/cntfilterdefault.h \ inc/filtering/cntfilterintersection.h \ - inc/filtering/cntfilterunion.h \ - inc/filtering/cntfilterinvalid.h \ - inc/filtering/cntfilteraction.h \ - inc/filtering/cntfilterlocalid.h \ - inc/filtering/cntfilterchangelog.h \ - inc/filtering/cntfilterdetailrange.h \ - inc/filtering/cntabstractcontactsorter.h \ + inc/filtering/cntfilterunion.h \ + inc/filtering/cntabstractcontactsorter.h \ inc/filtering/cntabstractcontactfilter.h \ inc/filtering/cntsymbianfilterdbms.h \ inc/filtering/cntsymbianfiltersql.h \ @@ -107,11 +102,6 @@ src/filtering/cntfilterdefault.cpp \ src/filtering/cntfilterintersection.cpp \ src/filtering/cntfilterunion.cpp \ - src/filtering/cntfilterinvalid.cpp \ - src/filtering/cntfilteraction.cpp \ - src/filtering/cntfilterlocalid.cpp \ - src/filtering/cntfilterchangelog.cpp \ - src/filtering/cntfilterdetailrange.cpp \ src/filtering/cntsymbianfilterdbms.cpp \ src/filtering/cntsymbianfiltersql.cpp \ src/filtering/cntsymbiansorterdbms.cpp \