Revision: 201031
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:39:00 +0300
changeset 59 a642906a277a
parent 47 7cbcb2896f0e
child 65 ae724a111993
Revision: 201031 Kit: 201033
contacts_plat/contacts_services_api/contacts_services_api.metaxml
contacts_plat/contacts_services_api/inc/cntservicescontact.h
contacts_plat/contacts_ui_api/contacts_ui_api.metaxml
contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h
contacts_plat/contacts_ui_api/inc/cntviewparams.h
contacts_plat/contacts_ui_extensions_api/contacts_ui_extensions_api.metaxml
contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h
contacts_plat/qt_mobility_contacts_api/qt_mobility_contacts_api.metaxml
contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp
contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp
contactwidgethsplugin/contactwidgethsplugin.pro
contactwidgethsplugin/resource/contactwidgethsplugin.manifest
contactwidgethsplugin/rom/contactwidgeths.iby
contactwidgethsplugin/rom/contactwidgeths_resources.iby
inc/cntdebug.h
inc/cntglobal.h
phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp
phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp
phonebookengines/cntactions/inc/cntaction.h
phonebookengines/cntactions/inc/cntemailaction.h
phonebookengines/cntactions/src/cntaction.cpp
phonebookengines/cntactions/src/cntemailaction.cpp
phonebookengines/cntactions/src/cntmessageaction.cpp
phonebookengines/cntlistmodel/src/cntcache.cpp
phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro
phonebookengines_old/contactsmodel/groupsql/cntmodel.iby
phonebookengines_old/contactsmodel/tsrc/Integration/TestStartUp/data/StartUpData.ini
phonebookui/bwins/pbkcommonuiu.def
phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h
phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp
phonebookui/eabi/pbkcommonuiu.def
phonebookui/pbkcommonui/inc/cntactionlauncher.h
phonebookui/pbkcommonui/inc/cntactionpopup.h
phonebookui/pbkcommonui/inc/cntbaseselectionview.h
phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h
phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h
phonebookui/pbkcommonui/inc/cntcollectionview.h
phonebookui/pbkcommonui/inc/cntcontactcardview.h
phonebookui/pbkcommonui/inc/cntcontactcardview_p.h
phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h
phonebookui/pbkcommonui/inc/cntdetailconst.h
phonebookui/pbkcommonui/inc/cntdetaileditor.h
phonebookui/pbkcommonui/inc/cntdetailpopup.h
phonebookui/pbkcommonui/inc/cnteditview_p.h
phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h
phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h
phonebookui/pbkcommonui/inc/cntfavoritesview.h
phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h
phonebookui/pbkcommonui/inc/cntfetchcontactsview.h
phonebookui/pbkcommonui/inc/cntfetchmarkall.h
phonebookui/pbkcommonui/inc/cntgroupactionsview.h
phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h
phonebookui/pbkcommonui/inc/cntgroupmemberview.h
phonebookui/pbkcommonui/inc/cntgroupmemberview_p.h
phonebookui/pbkcommonui/inc/cnthistoryview.h
phonebookui/pbkcommonui/inc/cnthistoryviewitem.h
phonebookui/pbkcommonui/inc/cntimageeditorview.h
phonebookui/pbkcommonui/inc/cntimagelabel.h
phonebookui/pbkcommonui/inc/cntimportsview.h
phonebookui/pbkcommonui/inc/cntkeygrabber.h
phonebookui/pbkcommonui/inc/cntmainwindow.h
phonebookui/pbkcommonui/inc/cntmycardselectionview.h
phonebookui/pbkcommonui/inc/cntmycardview.h
phonebookui/pbkcommonui/inc/cntnamesview_p.h
phonebookui/pbkcommonui/inc/cntpresencelistener.h
phonebookui/pbkcommonui/inc/cntsavemanager.h
phonebookui/pbkcommonui/inc/cntvcarddetailhandler.h
phonebookui/pbkcommonui/inc/cntviewnavigator.h
phonebookui/pbkcommonui/pbkcommonui.pro
phonebookui/pbkcommonui/resources/contacts_actions.docml
phonebookui/pbkcommonui/resources/contacts_contactcard.docml
phonebookui/pbkcommonui/resources/contacts_ev.docml
phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml
phonebookui/pbkcommonui/resources/contacts_groupmembers.docml
phonebookui/pbkcommonui/resources/contacts_if.docml
phonebookui/pbkcommonui/resources/pbkcommonui.qrc
phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml
phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css
phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml
phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css
phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css
phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml
phonebookui/pbkcommonui/resources/style/cntfetchmarkall_color.css
phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml
phonebookui/pbkcommonui/resources/style/cntimagelabel.css
phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml
phonebookui/pbkcommonui/src/cntactionlauncher.cpp
phonebookui/pbkcommonui/src/cntactionpopup_p.cpp
phonebookui/pbkcommonui/src/cntaddressviewitem.cpp
phonebookui/pbkcommonui/src/cntbaseselectionview.cpp
phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp
phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp
phonebookui/pbkcommonui/src/cntcollectionview.cpp
phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp
phonebookui/pbkcommonui/src/cntcontactcardview.cpp
phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp
phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp
phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp
phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp
phonebookui/pbkcommonui/src/cntdetaileditor.cpp
phonebookui/pbkcommonui/src/cntdetailpopup.cpp
phonebookui/pbkcommonui/src/cntdocumentloader.cpp
phonebookui/pbkcommonui/src/cnteditview_p.cpp
phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp
phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp
phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp
phonebookui/pbkcommonui/src/cntfavoritesview.cpp
phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp
phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp
phonebookui/pbkcommonui/src/cntfetchmarkall.cpp
phonebookui/pbkcommonui/src/cntgroupactionsview.cpp
phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp
phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp
phonebookui/pbkcommonui/src/cntgroupmemberview.cpp
phonebookui/pbkcommonui/src/cntgroupmemberview_p.cpp
phonebookui/pbkcommonui/src/cnthistoryview.cpp
phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp
phonebookui/pbkcommonui/src/cntimageeditorview.cpp
phonebookui/pbkcommonui/src/cntimagelabel.cpp
phonebookui/pbkcommonui/src/cntimportsview.cpp
phonebookui/pbkcommonui/src/cntkeygrabber.cpp
phonebookui/pbkcommonui/src/cntmainwindow.cpp
phonebookui/pbkcommonui/src/cntmycardselectionview.cpp
phonebookui/pbkcommonui/src/cntmycardview.cpp
phonebookui/pbkcommonui/src/cntnamesview_p.cpp
phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp
phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp
phonebookui/pbkcommonui/src/cntpresencelistener.cpp
phonebookui/pbkcommonui/src/cntsavemanager.cpp
phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp
phonebookui/pbkcommonui/src/cntviewnavigator.cpp
phonebookui/phonebookapp/inc/cntapplication.h
phonebookui/phonebookapp/phonebookapp.pro
phonebookui/phonebookapp/src/main.cpp
phonebookui/phonebookservices/inc/cntabstractserviceprovider.h
phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h
phonebookui/phonebookservices/inc/cntservicecontactcardview.h
phonebookui/phonebookservices/inc/cntservicecontactfetchview.h
phonebookui/phonebookservices/inc/cntservicecontactselectionview.h
phonebookui/phonebookservices/inc/cntserviceeditview.h
phonebookui/phonebookservices/inc/cntservicegroupmemberview.h
phonebookui/phonebookservices/inc/cntservicehandler.h
phonebookui/phonebookservices/inc/cntservicemainwindow.h
phonebookui/phonebookservices/inc/cntserviceprovideredit.h
phonebookui/phonebookservices/inc/cntserviceproviderfetch.h
phonebookui/phonebookservices/inc/cntserviceproviderold.h
phonebookui/phonebookservices/inc/cntserviceproviderold2.h
phonebookui/phonebookservices/inc/cntserviceproviderviewing.h
phonebookui/phonebookservices/inc/cntservices.h
phonebookui/phonebookservices/inc/cntservicestrings.h
phonebookui/phonebookservices/inc/cntservicesubeditview.h
phonebookui/phonebookservices/inc/cntserviceviewfactory.h
phonebookui/phonebookservices/inc/cntserviceviewmanager.h
phonebookui/phonebookservices/inc/cntserviceviewparams.h
phonebookui/phonebookservices/phonebookservices.pro
phonebookui/phonebookservices/service_conf.xml
phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp
phonebookui/phonebookservices/src/cntservicecontactcardview.cpp
phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp
phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp
phonebookui/phonebookservices/src/cntserviceeditview.cpp
phonebookui/phonebookservices/src/cntservicegroupmemberview.cpp
phonebookui/phonebookservices/src/cntservicehandler.cpp
phonebookui/phonebookservices/src/cntservicemainwindow.cpp
phonebookui/phonebookservices/src/cntserviceprovideredit.cpp
phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp
phonebookui/phonebookservices/src/cntserviceproviderold.cpp
phonebookui/phonebookservices/src/cntserviceproviderold2.cpp
phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp
phonebookui/phonebookservices/src/cntservices.cpp
phonebookui/phonebookservices/src/cntservicesubeditview.cpp
phonebookui/phonebookservices/src/cntserviceviewfactory.cpp
phonebookui/phonebookservices/src/cntserviceviewmanager.cpp
phonebookui/phonebookservices/src/main.cpp
phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp
phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp
phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h
phonebookui/rom/phonebook.iby
pimprotocols/pbap/group/bld.inf
pimprotocols/phonebooksync/group/BLD.INF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts_plat/contacts_services_api/contacts_services_api.metaxml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="0ceeb483423b55b7ae987112142ea845" dataversion="2.0">
+  <name>Contacts services API</name>
+  <description>Qt Highway services offered by Contacts package.</description>
+  <type>c++</type>
+  <collection>phonebookui</collection>
+  <libs/>
+  <release category="platform" sinceversion=""/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/contacts_plat/contacts_services_api/inc/cntservicescontact.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/contacts_plat/contacts_services_api/inc/cntservicescontact.h	Wed Aug 18 09:39:00 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Data container & constants for "phonebookservices" Qt Highway services.
 *
 */
 
@@ -22,21 +22,27 @@
 #include <QString>
 #include <xqserviceipcmarshal.h>
 
-/*Supported actions*/
+//Action filter definitions:
+
+/// Action filter that DOES NOT filter away based on supported action.
 const QString KCntActionAll("all");
+/// Action filter for showing only contacts that support calling.
 const QString KCntActionCall("call");
+/// Action filter for showing only contacts that suppport SMS sending.
 const QString KCntActionSms("sms");
+// Action filter for showing only contacts that support emailing.
 const QString KCntActionEmail("email");
 
-/*Supported filters*/
-const QString KCntFilterDisplayAll("all");
-const QString KCntFilterDisplayFavorites("favorites");
 
-/*Supported Fetch Selection Modes*/
-const QString KCntNoSelectionMode("No Selection");
-const QString KCntSingleSelectionMode("SingleSelect");
-const QString KCntMultiSelectionMode("MultiSelect");
+/// Return values from editing service
+const int KCntServicesReturnValueContactSaved       = 1;
+const int KCntServicesReturnValueContactDeleted     = -1;
+const int KCntServicesReturnValueContactNotModified = 0;
+const int KCntServicesTerminated = -2;
 
+/**
+ * A data container class to be used with "phonebookservices" Qt Highway services.
+ */
 class CntServicesContact
 {
 public:
@@ -70,6 +76,23 @@
 
 typedef QList<CntServicesContact> CntServicesContactList;
 
+//-------------------------------------------------------------------
+// These are DEPRECATED and will be removed soon:
+
+/// @deprecated
+const QString KCntFilterDisplayAll("all");
+/// @deprecated
+const QString KCntFilterDisplayFavorites("favorites");
+
+/// @deprecated
+const QString KCntNoSelectionMode("No Selection");
+/// @deprecated
+const QString KCntSingleSelectionMode("SingleSelect");
+/// @deprecated
+const QString KCntMultiSelectionMode("MultiSelect");
+
+//-------------------------------------------------------------------
+
 Q_DECLARE_USER_METATYPE(CntServicesContact)
 Q_DECLARE_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts_plat/contacts_ui_api/contacts_ui_api.metaxml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="8fe604687acb630749f264e1dcd3d6ca" dataversion="2.0">
+  <name>Contacts UI API</name>
+  <description>Contacts UI related APIs.</description>
+  <type>c++</type>
+  <collection>phonebookui</collection>
+  <libs/>
+  <release category="platform" sinceversion=""/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/contacts_plat/contacts_ui_api/inc/cntabstractviewmanager.h	Wed Aug 18 09:39:00 2010 +0300
@@ -34,7 +34,7 @@
     
     /* New API */
     virtual void changeView( const CntViewParameters aArgs ) = 0;
-    virtual void back( const CntViewParameters aArgs ) = 0;
+    virtual void back( const CntViewParameters aArgs, bool toRoot = false ) = 0;
     
     virtual QContactManager* contactManager( const QString& aType ) = 0;
 };
--- a/contacts_plat/contacts_ui_api/inc/cntviewparams.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/contacts_plat/contacts_ui_api/inc/cntviewparams.h	Wed Aug 18 09:39:00 2010 +0300
@@ -38,6 +38,7 @@
     ESelectedDetail,
     ESelectionMode,
     EMyCard,
+    EExtraAction,
 	ECustomParam = 100
 };
 
@@ -45,7 +46,7 @@
 {
     noView=0, //exit
     namesView,
-    commLauncherView,
+    contactCardView,
     serviceContactCardView,
     serviceAssignContactCardView,
     myCardView,
@@ -53,7 +54,7 @@
     serviceContactSelectionView,
     collectionView,
     collectionFavoritesView,
-    FavoritesMemberView,
+    favoritesMemberView,
     editView,
     serviceEditView,
     serviceSubEditView,
@@ -76,6 +77,7 @@
     importsView,
     settingsView,
     ringToneFetcherView,
+    serviceGroupMemberView,
     customPhonebookView = 100, // reserved for internal view plugins, DO NOT USE THESE
     customView = 200 // for all other view plugins
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts_plat/contacts_ui_extensions_api/contacts_ui_extensions_api.metaxml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="7bca5023bc11289d3473faf7c2e0c529" dataversion="2.0">
+  <name>Contacts UI extensions API</name>
+  <description>Plugin APIs for extending phonebook application.</description>
+  <type>c++</type>
+  <collection>phonebookui</collection>
+  <libs/>
+  <release category="platform" sinceversion=""/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/contacts_plat/contacts_ui_extensions_api/inc/cntuigroupsupplier.h	Wed Aug 18 09:39:00 2010 +0300
@@ -24,9 +24,18 @@
 /**
  * UI extension class that supplies groups to phonebook groups UI.
  */
-class CntUiGroupSupplier
+class CntUiGroupSupplier : public QObject
 {
- public:
+public:
+    CntUiGroupSupplier() {}
+
+    /**
+     * Returns true if this supplier should be handled asynchronously and
+     * false otherwise.
+     *
+     * @return bool, asynchronity
+     */  
+    virtual bool isAsynch() const = 0;
 
     /**
      * Returns number of groups provided by the extension.
@@ -49,6 +58,14 @@
     {
         return NULL;
     }
+
+signals:
+    /**
+     * Asynchronous suppliers should re-implement this signal and emit it
+     * once group loading is ready.
+     */  
+    void groupsReady();
+
 protected:
     // prevent deleting by client
     virtual ~CntUiGroupSupplier() {}
--- a/contacts_plat/qt_mobility_contacts_api/qt_mobility_contacts_api.metaxml	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<api id="58ef187bb77e8e3bb353189b9b4a57aa" dataversion="2.0">
-  <name>Qt Mobility Contacts API</name>
-  <description>Qt Mobility Contacts API for managing contacts data.</description>
-  <type>c++</type>
-  <collection>phonebookengines</collection>
-  <libs>
-    <lib name="QtContacts.lib"/>
-  </libs>
-  <release category="platform" sinceversion="0.9"/>
-  <attributes>
-    <htmldocprovided>no</htmldocprovided>
-    <adaptation>no</adaptation>
-  </attributes>
-</api>
--- a/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -113,7 +113,11 @@
 CommLauncherWidget::~CommLauncherWidget()
 {
     // Deleting request cancels all pending requests 
-    delete mRequest;
+    if (mRequest) {
+        delete mRequest;
+        mRequest = NULL;
+    }
+
 }
 
 /*!
@@ -518,17 +522,14 @@
 */
 void CommLauncherWidget::keyPressEvent(QKeyEvent *event)
 {
+	qDebug() << "keyPressEvent event=" << event->key();
     if (event->key() == Qt::Key_Yes) {
         // Call key initializes a call
         makeCall();
         event->accept();
-    } else if (event->key() == Qt::Key_No || event->key() == Qt::Key_Select) {
-        // End key and Select key close the communication launcher and 
-        // forward the key event to HbPopup
-        close();
-        HbPopup::keyPressEvent(event);
     } else {
-        HbPopup::keyPressEvent(event);
+      close();
+      //HbPopup::keyPressEvent(event);
     } 
 }
 
@@ -549,3 +550,4 @@
     return width;
 }
 
+
--- a/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -41,6 +41,9 @@
 #include "commlauncherwidget.h"
 #include "ihswidgetpreferenceservice.h"
  
+const QString translationsPath = "/resource/qt/translations/";
+const QString translationsFile = "contactwidgethsplugin";
+
 const QString defaultAvatar = "qtg_large_avatar";
 const QString addContactAvatar = "qtg_small_add";
 const QString normalFrameName = "qtg_fr_hsshortcut_normal";
@@ -79,7 +82,7 @@
   mTranslator(0)
 {
     // Localization file loading   
-	mTranslator = new HbTranslator();
+	mTranslator = new HbTranslator(translationsPath, translationsFile);
 	mTranslator->loadCommon();    
     
     // UI creation done in onInitialize()
@@ -132,15 +135,37 @@
 */
 ContactWidgetHs::~ContactWidgetHs()
 {
-    delete mLauncher;
-    delete mContactManager;
-    delete mAppManager;
-    delete mAvatar;	
-    // Deleting request cancels all pending requests 
-    delete mContactSelectRequest;
-    //,,first cancel?
-    delete mThumbnailManager;
-    delete mTranslator;
+	if (mLauncher) 
+		{
+		delete mLauncher;
+		}
+    if (mContactManager)
+    	{
+    	delete mContactManager;
+    	}
+    if (mAppManager)
+    	{
+    	delete mAppManager;
+    	}
+    if (mAvatar)
+    	{
+    	delete mAvatar;
+    	}
+    
+    // Deleting request cancels all pending requests
+    if (mContactSelectRequest)
+    	{
+    	delete mContactSelectRequest;
+    	}
+    
+    if (mThumbnailManager)
+    	{
+    	delete mThumbnailManager;
+    	}
+    if (mTranslator)
+    	{
+    	delete mTranslator;
+    	}
 }
 
 /*!
@@ -237,17 +262,38 @@
     painter.end();
     qDebug() << "setContactImage av 2"; //,,             
 
+    int maxSize = (inputPixmap.width() > inputPixmap.height() ? inputPixmap.width():inputPixmap.height());
+    int minSize = (inputPixmap.width() < inputPixmap.height() ? inputPixmap.width():inputPixmap.height());
+    int sizeFrom = maxSize - minSize;
     // We may draw the icon when thumnail processing is still in progress, 
     // so can't show the thumbnail yet.
 	if (inputPixmap.width()>0) {
+		if (inputPixmap.width() < inputPixmap.height())
+		{
+  		QPixmap pm3 = inputPixmap.copy(0,sizeFrom/2,minSize,minSize);
+  		QPixmap pm2 = pm3.scaled( QSize(contactIconSize, contactIconSize), Qt::KeepAspectRatio );
+  		qDebug() << "pm2 " << pm2.width() << " " << pm2.height();
+  		avatarPixmap = pm2; 
+		}
+		else if (inputPixmap.width() > inputPixmap.height())
+		{
+  		QPixmap pm3 = inputPixmap.copy(sizeFrom/2,0,minSize,minSize);
+  		QPixmap pm2 = pm3.scaled( QSize(contactIconSize, contactIconSize), Qt::KeepAspectRatio );
+  		qDebug() << "pm2 " << pm2.width() << " " << pm2.height();
+  		avatarPixmap = pm2; 
+    }else
+    {
 		QPixmap pm2 = inputPixmap.scaled( QSize(contactIconSize, contactIconSize), Qt::IgnoreAspectRatio );
 		qDebug() << "pm2 " << pm2.width() << " " << pm2.height();
 		avatarPixmap = pm2; //
+    }
 	} 
     
     HbIcon *avatarIcon = new HbIcon(QIcon(avatarPixmap));
        
     mAvatarIconItem->setIcon(*avatarIcon);
+    mAvatarIconItem->setSize(QSize(contactIconSize, contactIconSize));
+    mAvatarIconItem->setAspectRatioMode(Qt::KeepAspectRatio);
         
     // Then display the new image
     update();
@@ -411,7 +457,21 @@
 */
 void ContactWidgetHs::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    if (event && event->type() == QEvent::GraphicsSceneMousePress) {
+	Q_UNUSED(event);
+}
+
+/*!
+    \fn void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+
+    Widget start is triggered from release \a event.
+    \sa 
+*/
+void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+{
+	qDebug() << "mouseReleaseEvent event->type() = " << (int)event->type();
+
+	//Q_UNUSED(event);
+    if (event && event->type() == QEvent::GraphicsSceneMouseRelease) {
         // If the widget doesn't have contact yet and
         // there are contacts, select one.    
         if (mContactLocalId == unUsedContactId) {
@@ -444,17 +504,6 @@
     }
 }
 
-/*!
-    \fn void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
-
-    Widget start is triggered from release \a event.
-    \sa 
-*/
-void ContactWidgetHs::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
-{
-    Q_UNUSED(event);
-}
-
 
 // Store contact data to member variables and to UI
 void ContactWidgetHs::getContactData()
@@ -579,7 +628,11 @@
 */
 void ContactWidgetHs::onHide()
 {
-    qDebug() << "ContactWidgetHs::onHide()";	
+    qDebug() << "ContactWidgetHs::onHide()";
+    // close the launcher if it's open
+    if (mLauncher->isVisible()) {
+        mLauncher->close();
+    }
 }
 
 
@@ -744,7 +797,17 @@
     for(i=0; i<contactIds.count(); i++) {
         if (contactIds.at(i) == mContactLocalId) {
             qDebug() << "-deleting widget with removed contact " << mContactLocalId;
-            // TODO this deletes the widget. Can we always delete the object immediately?
+
+            mAvatarIconItem->deleteLater();
+            mContactNameLabel->deleteLater();
+            mAppManager->deleteLater();
+            mLauncher->deleteLater();
+            mContactLocalId = unUsedContactId;
+            delete mAvatar;
+            mContactHasAvatarDetail = false;
+            mContactManager->deleteLater();
+            mThumbnailManager->deleteLater();
+            
             emit finished();
             break;
         }
--- a/contactwidgethsplugin/contactwidgethsplugin.pro	Tue Jul 06 14:05:47 2010 +0300
+++ b/contactwidgethsplugin/contactwidgethsplugin.pro	Wed Aug 18 09:39:00 2010 +0300
@@ -18,8 +18,7 @@
 CONFIG += plugin hb mobility
 MOBILITY = serviceframework contacts
 
-TRANSLATIONS = common.ts
-TRANSLATIONS += contactwidgethsplugin.ts
+TRANSLATIONS = contactwidgethsplugin.ts
 
 win32: PLUGIN_SUBDIR = /hsresources/import/widgetregistry/2002C353
 symbian: PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002C353
@@ -57,11 +56,10 @@
     BLD_INF_RULES.prj_exports += "./resource/contactwidgethsplugin.manifest z:$$PLUGIN_SUBDIR/contactwidgethsplugin.manifest"
     # xml files for emulator, sisx and hw rom
     BLD_INF_RULES.prj_exports += "./resource/contactwidgethsplugin.xml z:$$PLUGIN_SUBDIR/contactwidgethsplugin.xml"
-    # copy resources graphics png, svg
-    BLD_INF_RULES.prj_exports += "./resource/qtg_large_friend.svg z:$$PLUGIN_SUBDIR/qtg_large_friend.svg"
 
     # copy iby file
-    BLD_INF_RULES.prj_exports += "./rom/contactwidgeths.iby CORE_APP_LAYER_IBY_EXPORT_PATH( contactwidgeths.iby )"
+    BLD_INF_RULES.prj_exports += "./rom/contactwidgeths.iby CORE_APP_LAYER_IBY_EXPORT_PATH(contactwidgeths.iby)"
+    BLD_INF_RULES.prj_exports += "./rom/contactwidgeths_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(contactwidgeths_resources.iby)"
 }
 
 symbian {
--- a/contactwidgethsplugin/resource/contactwidgethsplugin.manifest	Tue Jul 06 14:05:47 2010 +0300
+++ b/contactwidgethsplugin/resource/contactwidgethsplugin.manifest	Wed Aug 18 09:39:00 2010 +0300
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <hswidgetmanifest>
     <uri>contactwidgethsplugin</uri>
-    <title>Contact</title>
-    <description>Contact widget.</description>
+    <title>txt_long_caption_friend</title>
+    <description>txt_friend_widget_dblist_friend_widget_val_quickly</description>
     <icon>qtg_large_friend</icon>
     <hidden>false</hidden>
     <servicexml>contactwidgethsplugin.xml</servicexml>
+    <translationfile>contactwidgethsplugin</translationfile>
 </hswidgetmanifest>
--- a/contactwidgethsplugin/rom/contactwidgeths.iby	Tue Jul 06 14:05:47 2010 +0300
+++ b/contactwidgethsplugin/rom/contactwidgeths.iby	Wed Aug 18 09:39:00 2010 +0300
@@ -17,6 +17,8 @@
 #ifndef __CONTACTWIDGETHSPLUGIN_IBY__
 #define __CONTACTWIDGETHSPLUGIN_IBY__
 
+#include <data_caging_paths_for_iby.hrh>
+
 // -------- contactwidgethsplugin
 file=ABI_DIR\BUILD_DIR\contactwidgethsplugin.dll                                        SHARED_LIB_DIR\contactwidgethsplugin.dll
 data=ZPRIVATE\20022f35\import\widgetregistry\2002C353\contactwidgethsplugin.qtplugin	private\20022f35\import\widgetregistry\2002C353\contactwidgethsplugin.qtplugin
@@ -25,4 +27,6 @@
 
 data=ZPRIVATE\20022f35\import\widgetregistry\2002C353\qtg_large_friend.svg              private\20022f35\import\widgetregistry\2002C353\qtg_large_friend.svg
 
+data=DATAZ_\APP_RESOURCE_DIR\contactwidgethsplugin.rsc                                  APP_RESOURCE_DIR\contactwidgethsplugin.rsc
+
 #endif //__CONTACTWIDGETHSPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contactwidgethsplugin/rom/contactwidgeths_resources.iby	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__
+#define __CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\contactwidgethsplugin.qm QT_TRANSLATIONS_DIR\contactwidgethsplugin.qm
+
+#endif //__CONTACTWIDGETHSPLUGIN_RESOURCES_IBY__
--- a/inc/cntdebug.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/inc/cntdebug.h	Wed Aug 18 09:39:00 2010 +0300
@@ -23,6 +23,8 @@
 #include <QtGlobal> // qDebug()
 
 // #define TRACK_MEMORY_LEAKS
+// #define TRACES
+// #define TRACE2FILE
 
 /*!
     \def CNT_UNUSED(name)
@@ -349,8 +351,13 @@
     by the streaming operator <<.
 */
 
+// traces for debug builds by default, or if
+// TRACES macro is defined
+#if defined (_DEBUG) && !defined (TRACES)
+#define TRACES
+#endif
 
-#ifdef _DEBUG
+#if defined (TRACES) || defined (TRACE2FILE)
     #define CNT_UNUSED(name)
     #define CNT_STATIC_ENTRY qDebug() << __PRETTY_FUNCTION__ << "entry";
     #define CNT_STATIC_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "entry," << args;
@@ -360,6 +367,9 @@
     #define CNT_EXIT_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "exit," << args;
     #define CNT_LOG qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this;
     #define CNT_LOG_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << args;
+    #define CNT_WARNING(args) qWarning() << __PRETTY_FUNCTION__ << args;
+    #define CNT_CRITICAL(args) qCritical() << __PRETTY_FUNCTION__ << args;
+    #define CNT_FATAL(args) qFatal() << __PRETTY_FUNCTION__ << args;
 #else
     #define CNT_UNUSED(name) Q_UNUSED(name)
     #define CNT_STATIC_ENTRY
@@ -370,8 +380,11 @@
     #define CNT_EXIT_ARGS(args)
     #define CNT_LOG
     #define CNT_LOG_ARGS(args)
-#endif // _DEBUG
-
+    #define CNT_WARNING(args)
+    #define CNT_CRITICAL(args)
+    #define CNT_FATAL(args)
+#endif // TRACES || TRACE2FILE
+    
 // for tracing memory leaks
 #ifdef TRACK_MEMORY_LEAKS
     #include <hbapplication.h>
@@ -406,4 +419,68 @@
     #define CNT_TRACK_QOBJECTLIVES(obj)
 #endif
 
+// filter phonebook app traces
+#ifdef TRACE2FILE
+    #include <QFile>
+    #include <QTextStream>
+    static void cntCustomLog2File(QtMsgType type, const char *msg)
+    {   
+        QFile logFile("c:/cnt_logs.log");
+        if (!logFile.open(QIODevice::Append | QIODevice::Text))
+        {
+            qFatal("error opening c:/cnt_logs.log file");
+            return;
+        }
+
+        QTextStream out(&logFile);
+        switch (type)
+        {
+            case QtDebugMsg:
+                out << "[CNT] Debug: " << msg;
+                break;
+            case QtWarningMsg:
+                out << "[CNT] Warning: " << msg;
+                break;
+            case QtCriticalMsg:
+                out << "[CNT] Critical: " << msg;
+                break;
+            case QtFatalMsg:
+                out << "[CNT] Fatal: " << msg;
+                abort();
+                break;
+            default:
+                out << "[CNT] No Log Selection Type: " << msg;
+                break;
+        }
+    }
+    #define MSG_HANDLER cntCustomLog2File
+#else
+    #ifdef Q_OS_SYMBIAN
+        #include <e32debug.h>
+        static void cntCustomLog(QtMsgType type, const char *msg)
+        {
+            switch (type) {
+                case QtDebugMsg:
+                    RDebug::Printf("[CNT] Debug: %s\n", msg);
+                    break;
+                case QtWarningMsg:
+                    RDebug::Printf("[CNT] Warning: %s\n", msg);
+                    break;
+                case QtCriticalMsg:
+                    RDebug::Printf("[CNT] Critical: %s\n", msg);
+                    break;
+                case QtFatalMsg:
+                    RDebug::Printf("[CNT] Fatal: %s\n", msg);
+                    abort();
+                    break;
+                default:
+                    break;
+            }
+        }
+        #define MSG_HANDLER cntCustomLog
+    #else
+        #define MSG_HANDLER 0
+    #endif  // Q_OS_SYMBIAN
+#endif  // TRACE2FILE
+
 #endif // CNTDEBUG_H
--- a/inc/cntglobal.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/inc/cntglobal.h	Wed Aug 18 09:39:00 2010 +0300
@@ -47,5 +47,7 @@
 #define CNT_ADD_ACTION          "add"
 #define CNT_FOCUS_ACTION        "focus"
 #define CNT_SAVE_ACTION         "save"
+#define CNT_FIND_ACTION         "find"
+#define CNT_ROOT_ACTION         "root"
 
 #endif // CNTGLOBAL_H
--- a/phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/CntFindPlugin/group/CntFindPlugin.mmp	Wed Aug 18 09:39:00 2010 +0300
@@ -33,8 +33,6 @@
 
 USERINCLUDE     ../group
 APP_LAYER_SYSTEMINCLUDE
-// Symbian uses #include <ecom.h> in cntviewfindconfig.h
-SYSTEMINCLUDE   /epoc32/include/ecom
 
 START RESOURCE  101f85f4.rss
 TARGET          cntfindplugin
--- a/phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/CntSortPlugin/group/CntSortPlugin.mmp	Wed Aug 18 09:39:00 2010 +0300
@@ -34,8 +34,6 @@
 
 USERINCLUDE     ../group
 APP_LAYER_SYSTEMINCLUDE
-// Symbian uses #include <ecom.h> in cntviewsortplugin.h
-SYSTEMINCLUDE   /epoc32/include/ecom
 
 START RESOURCE  101f85a9.rss
 TARGET          cntsortplugin
--- a/phonebookengines/cntactions/inc/cntaction.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntactions/inc/cntaction.h	Wed Aug 18 09:39:00 2010 +0300
@@ -79,6 +79,7 @@
 	QVariantMap m_result; 		//result returned to client
 	QContact m_contact;    		//contact passed to invokeAction
 	QContactDetail m_detail; 	//detail passed to invokeAction
+	QVariantMap m_data; 	//data passed to invokeAction
 	QContactAction::State m_state;
 	XQAiwRequest* m_request;
     XQApplicationManager    m_AppManager;
--- a/phonebookengines/cntactions/inc/cntemailaction.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntactions/inc/cntemailaction.h	Wed Aug 18 09:39:00 2010 +0300
@@ -35,8 +35,6 @@
     QList<QContactDetail> supportedDetails(const QContact& contact) const;
     CntEmailAction* clone() const;
     void performAction();
-private:
-    XQAiwRequest    *mRequest;
 };
 
 #endif
--- a/phonebookengines/cntactions/src/cntaction.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntactions/src/cntaction.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -116,10 +116,11 @@
 }
 
 
-bool CntAction::invokeAction(const QContact& contact, const QContactDetail& detail, const QVariantMap& /*parameters*/)
+bool CntAction::invokeAction(const QContact& contact, const QContactDetail& detail, const QVariantMap& data)
 {
 	m_contact = contact;
 	m_detail  = detail;
+	m_data = data;
 	
 	QTimer::singleShot(1, this, SLOT(performAction()));
 	m_state = QContactAction::ActiveState;
@@ -159,77 +160,60 @@
 //common code to perform a call, videocall and message action
 void CntAction::performNumberAction(const QString &interface, const QString &operation)
 {
-    XQApplicationManager appMng;
     QVariantList args;
     QVariant retValue;
     
     // TODO: Using XQApplicationManager is not working with calls
     // The factory method cannot create a request. Find out why
-    bool isCallAction = m_actionName == "call";
+    //bool isCallAction = (m_actionName == "call" || m_actionName == "videocall");
     XQServiceRequest snd(interface, operation, false);
 
-    delete m_request;
-    m_request = NULL;
-    m_request = appMng.create(interface, operation, false); // not embedded
-    if (!isCallAction) {
-        if (!m_request) {
-            emitResult(GeneralError, retValue);
-            return;
-        }
+    //QContactType == TypeGroup
+    if (QContactType::TypeGroup == m_contact.type()) {
+        QContactPhoneNumber conferenceCall = m_contact.detail<QContactPhoneNumber>();
+        args << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel();
+        
+        // TODO remove once call action works
+        snd << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel();
+        snd.send(retValue);
+        emitResult(snd.latestError(), retValue);
     }
-	
+    //QContactType == TypeContact
     //detail exist use it
-	if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName)
-	{
+    else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) {
 		const QContactPhoneNumber &phoneNumber = static_cast<const QContactPhoneNumber &>(m_detail);
 		
 		args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
 	    
-		// TODO remove once call action works
-		if (isCallAction) {
-            snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
-            emitResult(snd.send(retValue), retValue);
-	    } else {
-	       m_request->setArguments(args);
-	       m_request->setSynchronous(true);
-           emitResult(m_request->send(retValue), retValue);
-	    }
+        snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
+        snd.send(retValue);
+        emitResult(snd.latestError(), retValue);
 	}
-	
-	//if no detail, pick preferred
-	else if(m_detail.isEmpty())
+    //QContactType == TypeContact
+    //if no detail, pick preferred
+	else if (m_detail.isEmpty())
 	{
 		QContactDetail detail = m_contact.preferredDetail(m_actionName);
 		QContactPhoneNumber phoneNumber;
 	
 		//if preferred is empty pick first phonenumber
-		if(detail.isEmpty())
-		{
+		if (detail.isEmpty()) {
 			phoneNumber = m_contact.detail<QContactPhoneNumber>();
 		}
 		
 		//if not empty, cast detail to phonenumber
-		else
-		{
+		else {
 			phoneNumber = static_cast<QContactPhoneNumber>(detail);
 		}
 		
 		args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
 
-        // TODO remove once call action works
-        if (isCallAction) {
-            snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
-            emitResult(snd.send(retValue), retValue);
-        } else {
-            m_request->setArguments(args);
-            m_request->setSynchronous(true);
-            emitResult(m_request->send(retValue), retValue);
-        }
+        snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
+        snd.send(retValue);
+        emitResult(snd.latestError(), retValue);
 	}
-	
 	//else return an error
-	else
-	{
+	else {
 		emitResult(GeneralError, retValue);
 	}
 }
@@ -244,11 +228,11 @@
         m_result.insert("XQAiwRequest Error", m_request->lastError());
 	}
 	
-	if (errorCode == 0){
+	if (errorCode == 0) {
 		m_state = QContactAction::FinishedState;
 	}
 	
-	else{
+	else {
 		m_state = QContactAction::FinishedWithErrorState;
 	}
 	
--- a/phonebookengines/cntactions/src/cntemailaction.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntactions/src/cntemailaction.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -29,12 +29,10 @@
 CntEmailAction::CntEmailAction() : 
     CntAction("email")
 {
-    mRequest = m_AppManager.create(XQI_EMAIL_MESSAGE_SEND, "send(QVariant)", true);
 }
 
 CntEmailAction::~CntEmailAction()
 {
-    delete mRequest;
 }
 
 QContactFilter CntEmailAction::contactFilter(const QVariant& value) const
@@ -65,61 +63,58 @@
 void CntEmailAction::performAction()
 {
     QVariant retValue;
-
-    if (mRequest)
-    {
+    delete m_request;
+    m_request = NULL;
+    m_request = m_AppManager.create(XQI_EMAIL_MESSAGE_SEND, "send(QVariant)", true);
+    
+    if (m_request) {
         QMap<QString, QVariant> map;
         QStringList recipients;
         QList<QVariant> data;
 
+        //QContactType == TypeGroup
+        if (QContactType::TypeGroup == m_contact.type()) {
+            QStringList emails;
+            QVariant value = m_data.value("email");
+            if (value.canConvert<QStringList>()) {
+                emails = value.toStringList();
+            }
+            
+            if (!emails.isEmpty()) {
+                for (int i=0;i<emails.count();i++) {
+                    recipients.append(emails.at(i));
+                }
+                map.insert(EMAIL_SEND_TO_KEY, recipients);
+                data.append(map);
+
+                m_request->setArguments(data);
+                m_request->send(retValue);
+                emitResult(m_request->lastError(), retValue);
+            }
+            else {
+                emitResult(GeneralError, retValue);
+            }
+        }
+        //QContactType == TypeContact
         // If detail exists use it.
-        if (m_detail.definitionName() == QContactEmailAddress::DefinitionName)
-        {
+        else if (m_detail.definitionName() == QContactEmailAddress::DefinitionName) {
             const QContactEmailAddress &email = static_cast<const QContactEmailAddress &>(m_detail);
 
             recipients.append(email.emailAddress());
             map.insert(EMAIL_SEND_TO_KEY, recipients);
             data.append(map);
 
-            mRequest->setArguments(data);
-            mRequest->send(retValue);
-            emitResult(mRequest->lastError(), retValue);
+            m_request->setArguments(data);
+            m_request->send(retValue);
+            emitResult(m_request->lastError(), retValue);
         }
-
-        // If no detail, pick preferred.
-        // Todo : Temporary fix. Remove setting preferred when selection popup feature available.
-        else if (m_detail.isEmpty())
-        {
-            QContactDetail detail = m_contact.preferredDetail(m_actionName);
-            QContactEmailAddress email;
-
-            // If preferred is empty pick first email.
-            if(detail.isEmpty())
-            {
-                email = m_contact.detail<QContactEmailAddress>();
-            }
-            else
-            {
-                email = static_cast<QContactEmailAddress>(detail);
-            }
-
-            recipients.append(email.emailAddress());
-            map.insert(EMAIL_SEND_TO_KEY, recipients);
-            data.append(map);			
-
-            mRequest->setArguments(data);
-            mRequest->send(retValue);
-            emitResult(mRequest->lastError(), retValue);
-        }
-        else
-        {
+        else {
             emitResult(GeneralError, retValue);
         }
     }
 
     // Service not found.
-    else
-    {
+    else {
         emitResult(GeneralError, retValue);
     }
 }
--- a/phonebookengines/cntactions/src/cntmessageaction.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntactions/src/cntmessageaction.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -66,10 +66,60 @@
 
 void CntMessageAction::performAction()
 {
-    QString service("com.nokia.symbian.IMessageSend");
-    QString type("send(QString,qint32,QString)");
+    QList<QVariant> data;
+    QVariant retValue;
     
-    performNumberAction(service, type);
+    delete m_request;
+    m_request = NULL;
+        
+    //QContactType == TypeGroup
+    if (QContactType::TypeGroup == m_contact.type()) {
+        QString interface("com.nokia.symbian.IMessageSend");
+        QString operation("send(QVariantMap,QString)");
+        m_request = m_AppManager.create(interface, operation, false); // not embedded
+        if (m_request==NULL) {
+            emitResult(GeneralError, retValue);
+            return;
+        }
+        
+        QVariantMap recipientMap;
+        QVariant value = m_data.value("message");
+        if (value.canConvert<QVariantMap>()) {
+            recipientMap = value.toMap();
+        }
+        if (!recipientMap.isEmpty()) {
+            data.append(recipientMap); //recipients
+            data.append(QString()); //body text
+            
+            m_request->setArguments(data);
+            m_request->send(retValue);
+            emitResult(m_request->lastError(), retValue);
+        }
+        else {
+            emitResult(GeneralError, retValue);
+        }
+    }
+    //QContactType == TypeContact
+    //detail exist use it
+    else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) {
+        QString interface("com.nokia.symbian.IMessageSend");
+        QString operation("send(QString,qint32,QString)");
+        m_request = m_AppManager.create(interface, operation, false); // not embedded
+        if (m_request==NULL) {
+            emitResult(GeneralError, retValue);
+            return;
+        }
+        
+        const QContactPhoneNumber &phoneNumber = static_cast<const QContactPhoneNumber &>(m_detail);
+        data << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel();
+        
+        m_request->setArguments(data);
+        m_request->send(retValue);
+        emitResult(m_request->lastError(), retValue);
+    }
+    else {
+        emitResult(GeneralError, retValue);
+    }
 }
 
 
--- a/phonebookengines/cntlistmodel/src/cntcache.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntlistmodel/src/cntcache.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -439,9 +439,9 @@
     bool foundContact = false;
 
     QContactFetchHint nameOnlyFetchHint;
-    QStringList details;
+    /*QStringList details;
     details << QContactDisplayLabel::DefinitionName;
-    nameOnlyFetchHint.setDetailDefinitionsHint(details);
+    nameOnlyFetchHint.setDetailDefinitionsHint(details);*/
     nameOnlyFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships);
     QContact contact = mContactManager->contact(contactId, nameOnlyFetchHint);
     
@@ -648,7 +648,7 @@
 {
 	CNT_ENTRY
 
-    delete this;
+    deleteLater();
 
 	CNT_EXIT
 }
--- a/phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines/cntmaptileservice/tsrc/ut_cntmaptileservice/ut_cntmaptileservice.pro	Wed Aug 18 09:39:00 2010 +0300
@@ -40,7 +40,6 @@
     :BLD_INF_RULES.prj_exports += "data/preferredaddressmap.png /epoc32/winscw/c/maptiletest/preferredaddressmap.png"
     :BLD_INF_RULES.prj_exports += "data/workaddressmap.png /epoc32/winscw/c/maptiletest/workaddressmap.png"
     :BLD_INF_RULES.prj_exports += "data/homeaddressmap.png /epoc32/winscw/c/maptiletest/homeaddressmap.png"
-    SYSTEMINCLUDEPATH += \epoc32\include\stdapis
 }
 
 SOURCES += src/testrunner.cpp
--- a/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookengines_old/contactsmodel/groupsql/cntmodel.iby	Wed Aug 18 09:39:00 2010 +0300
@@ -23,7 +23,7 @@
 #include <versit.iby>
 #include <conarc.iby>
 #include <charconv.iby>
-#include <BackupRestoreNotification.iby>
+#include <backuprestorenotification.iby>
 #include <cntplsql.iby>
 REM Log Engine contact matching plug-in implementation
 #include <cntmatchlog.iby>
@@ -33,9 +33,9 @@
 #define CONTACT_SERVER_MAX_HEAPSIZE  0x100000
 #endif
 
-file=ABI_DIR\BUILD_DIR\cntsrv.exe		System\Programs\cntsrv.exe       heapmax=CONTACT_SERVER_MAX_HEAPSIZE
-file=ABI_DIR\BUILD_DIR\cntmodel.dll		System\Libs\cntmodel.dll
-file=ABI_DIR\BUILD_DIR\cntview.dll		System\Libs\cntview.dll
+file=ABI_DIR/BUILD_DIR/cntsrv.exe		System/Programs/cntsrv.exe       heapmax=CONTACT_SERVER_MAX_HEAPSIZE
+file=ABI_DIR/BUILD_DIR/cntmodel.dll		System/Libs/cntmodel.dll
+file=ABI_DIR/BUILD_DIR/cntview.dll		System/Libs/cntview.dll
 
 ECOM_PLUGIN(cntvcard.dll,102035f8.rsc)
 ECOM_PLUGIN(cntphone.dll,102035fb.rsc)
--- a/phonebookengines_old/contactsmodel/tsrc/Integration/TestStartUp/data/StartUpData.ini	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-[initial_view_settings_in_centralrep_ROM]
-ApiAction = GetDefaultViewSettings
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-NumberofViews = 1
-ViewName1 = KMainContactsAppView
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[set_initial_view_settings_in_centralrep]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 1
-ViewName1 = KMainContactsAppView
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[set_4_default_view_settings_in_centralrep]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 4
-ViewName1 = KMainContactsAppView1
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-ViewName2 = KMainContactsAppView2
-FirstViewSortOrder2 = 268440445
-SecondViewSortOrder2 = 268440444
-ThirdViewSortOrder2 =  268440333
-ViewPreferance2 = 0
-ViewType2 = 1
-SortPluginName2 =
-ViewName3 = KMainContactsAppView3
-FirstViewSortOrder3 = 268440445
-SecondViewSortOrder3 = 268440444
-ThirdViewSortOrder3 =  268440333
-ViewPreferance3 = 0
-ViewType3 = 1
-SortPluginName3 =
-ViewName4 = KMainContactsAppView4
-FirstViewSortOrder4 = 268440445
-SecondViewSortOrder4 = 268440444
-ThirdViewSortOrder4 =  268440333
-ViewPreferance4 = 0
-ViewType4 = 1
-SortPluginName4 =
-
-
-
-[set_invalid_view_type]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 1
-ViewName1 = invalid_view_type
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 99
-SortPluginName1 =
-
-
-
-[check_invalid_view_type]
-ApiAction = GetDefaultViewSettings
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-NumberofViews = 1
-ViewName1 = invalid_view_type
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 99
-SortPluginName1 =
-
-
-
-[set_invalid_preferance]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 1
-ViewName1 = invalid_pref
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 99
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[check_invalid_preferance]
-ApiAction = GetDefaultViewSettings
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-NumberofViews = 1
-ViewName1 = invalid_pref
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 99
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[store_invalid_sort_orders]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 1
-ViewName1 = invalid_sort_orders
-FirstViewSortOrder1 = 0
-SecondViewSortOrder1 = 0
-ThirdViewSortOrder1 =  0
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[store_invalid_plugin_name]
-ApiAction = SetNewDefaultViewSettings
-NumberofViews = 1
-ViewName1 = invalid_plugin_name
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 = xyz
-
-
-
-[invalid_rom_setting]
-ApiAction = GetDefaultViewSettings
-NumberofViews = 1
-ViewName1 = KMainContactsAppView
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 = abc
-
-
-
-[Append_View_Setting_To_View_Setting_List]
-ApiAction = AppendNewViewSetting
-
-
-
-[delete_named_view_setting]
-ApiAction = DeleteViewSettings
-ViewName = TempViewName
-
-
-
-[delete_default_view]
-ApiAction = DeleteViewSettings
-ViewName = KMainContactsAppView
-
-
-[launch_cnts_server]
-StartupAction = LaunchProcess
-StartupExeName = CNTSRV.EXE
-Mode = -nontransient
-
-
-[terminate_cnts_server]
-StartupAction = TerminateProcess
-
-
-
-[check_cnts_server_is_ok]
-StartupAction = CheckProcess
-StartUpExitType = 3    //EExitPending
-StartUpExitReason = 0  
-
-
-
-[check_cnts_server_has_terminated_ok]
-StartupAction = CheckProcess
-StartUpExitType = 1    //EExitTerminate
-StartUpExitReason = 0
-
-
-
-[create_default_cnts_db]
-ContactsDbAction = CreateDefCntsDb
-
-
-
-[add_20_contacts_to_default_db]
-ContactsDbAction = AddItemstoCntsDb
-NumberOfContacts = 20
-
-
-
-[delete_default_cnts_db]
-ContactsDbAction = DeleteDefCntsDb
-
-
-
-[open_default_cnts_db]
-ContactsDbAction = OpenDefCntsDb
-
-
-
-[replace_default_cnts_db]
-ContactsDbAction = ReplaceDefCntsDb
-
-
-[check_4_default_view_settings_in_centralrep]
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-ApiAction = GetDefaultViewSettings
-NumberofViews = 4
-ViewName1 = KMainContactsAppView1
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-ViewName2 = KMainContactsAppView2
-FirstViewSortOrder2 = 268440445
-SecondViewSortOrder2 = 268440444
-ThirdViewSortOrder2 =  268440333
-ViewPreferance2 = 0
-ViewType2 = 1
-SortPluginName2 =
-ViewName3 = KMainContactsAppView3
-FirstViewSortOrder3 = 268440445
-SecondViewSortOrder3 = 268440444
-ThirdViewSortOrder3 =  268440333
-ViewPreferance3 = 0
-ViewType3 = 1
-SortPluginName3 =
-ViewName4 = KMainContactsAppView4
-FirstViewSortOrder4 = 268440445
-SecondViewSortOrder4 = 268440444
-ThirdViewSortOrder4 =  268440333
-ViewPreferance4 = 0
-ViewType4 = 1
-SortPluginName4 =
-
-
-
-[check_invalid_sort_orders]
-ApiAction = GetDefaultViewSettings
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-NumberofViews = 1
-ViewName1 = invalid_sort_orders
-FirstViewSortOrder1 = 0
-SecondViewSortOrder1 = 0
-ThirdViewSortOrder1 =  0
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-
-
-
-[check_invalid_plugin_name]
-ApiAction = GetDefaultViewSettings
-NumberofViews = 1
-ViewName1 = invalid_plugin_name
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 = xyz
-
-
-
-[check_appended_view_Setting]
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-ApiAction = GetDefaultViewSettings
-NumberofViews = 2
-ViewName1 = KMainContactsAppView
-FirstViewSortOrder1 = 268440445
-SecondViewSortOrder1 = 268440444
-ThirdViewSortOrder1 =  268440333
-ViewPreferance1 = 0
-ViewType1 = 1
-SortPluginName1 =
-ViewName2 = TempViewName
-FirstViewSortOrder2 = 268440445
-SecondViewSortOrder2 = 268440445
-ThirdViewSortOrder2 =  268440445
-ViewPreferance2 = 0
-ViewType2 = 1
-SortPluginName2 =
-
-
-
-[OOM_Test_GetDefaultView]
-ApiAction = OutOfMemoryTestsForGetAPI
-
-
-
-[OOM_Test_SetDefaultView]
-ApiAction = OutOfMemoryTestsForSetAPI
-NumberofViews = 4
-
-
-
-[check_empty_view_defs]
-ContactsDbAction = CheckExistingViewDefsInCntsServer
-NumberofViews = 0
--- a/phonebookui/bwins/pbkcommonuiu.def	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/bwins/pbkcommonuiu.def	Wed Aug 18 09:39:00 2010 +0300
@@ -2,139 +2,172 @@
 	?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *)
 	?setViewNavigator@CntDefaultViewManager@@QAEXPAVCntViewNavigator@@@Z @ 2 NONAME ; void CntDefaultViewManager::setViewNavigator(class CntViewNavigator *)
 	?tr@CntActionPopup@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString CntActionPopup::tr(char const *, char const *)
-	?cleanup@CntDefaultViewManager@@AAEXXZ @ 4 NONAME ; void CntDefaultViewManager::cleanup(void)
-	??0CntDefaultViewFactory@@QAE@XZ @ 5 NONAME ; CntDefaultViewFactory::CntDefaultViewFactory(void)
-	??1CntMainWindow@@UAE@XZ @ 6 NONAME ; CntMainWindow::~CntMainWindow(void)
-	?viewActivated@CntContactCardView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 7 NONAME ; void CntContactCardView::viewActivated(class CntAbstractViewManager *, class QMap<int, class QVariant>)
-	?view@CntEditView@@UBEPAVHbView@@XZ @ 8 NONAME ; class HbView * CntEditView::view(void) const
-	?qt_metacall@CntBaseSelectionView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int CntBaseSelectionView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?closeView@CntBaseSelectionView@@AAEXXZ @ 10 NONAME ; void CntBaseSelectionView::closeView(void)
+	?currentViewId@CntDefaultViewManager@@QAEHXZ @ 4 NONAME ; int CntDefaultViewManager::currentViewId(void)
+	?cleanup@CntDefaultViewManager@@AAEXXZ @ 5 NONAME ; void CntDefaultViewManager::cleanup(void)
+	??0CntDefaultViewFactory@@QAE@XZ @ 6 NONAME ; CntDefaultViewFactory::CntDefaultViewFactory(void)
+	??1CntMainWindow@@UAE@XZ @ 7 NONAME ; CntMainWindow::~CntMainWindow(void)
+	?viewActivated@CntContactCardView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 8 NONAME ; void CntContactCardView::viewActivated(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	?view@CntEditView@@UBEPAVHbView@@XZ @ 9 NONAME ; class HbView * CntEditView::view(void) const
+	?qt_metacall@CntBaseSelectionView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int CntBaseSelectionView::qt_metacall(enum QMetaObject::Call, int, void * *)
 	?tr@CntMainWindow@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString CntMainWindow::tr(char const *, char const *)
 	?staticMetaObject@CntBaseSelectionView@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const CntBaseSelectionView::staticMetaObject
 	?d_func@CntEditView@@AAEPAVCntEditViewPrivate@@XZ @ 13 NONAME ; class CntEditViewPrivate * CntEditView::d_func(void)
 	?changesDiscarded@CntEditView@@IAEXXZ @ 14 NONAME ; void CntEditView::changesDiscarded(void)
-	?keyPressEvent@CntMainWindow@@UAEXPAVQKeyEvent@@@Z @ 15 NONAME ; void CntMainWindow::keyPressEvent(class QKeyEvent *)
-	??_ECntDefaultViewManager@@UAE@I@Z @ 16 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(unsigned int)
-	??_ECntBaseSelectionView@@UAE@I@Z @ 17 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(unsigned int)
-	?view@CntBaseSelectionView@@UBEPAVHbView@@XZ @ 18 NONAME ; class HbView * CntBaseSelectionView::view(void) const
-	??1CntDefaultViewFactory@@UAE@XZ @ 19 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(void)
-	??_ECntDefaultViewFactory@@UAE@I@Z @ 20 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(unsigned int)
-	?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *, int)
-	?qt_metacast@CntActionPopup@@UAEPAXPBD@Z @ 22 NONAME ; void * CntActionPopup::qt_metacast(char const *)
-	?deleteOldView@CntDefaultViewManager@@AAEXXZ @ 23 NONAME ; void CntDefaultViewManager::deleteOldView(void)
-	?trUtf8@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *, int)
-	?trUtf8@CntEditView@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString CntEditView::trUtf8(char const *, char const *, int)
-	??1CntEditView@@UAE@XZ @ 26 NONAME ; CntEditView::~CntEditView(void)
-	?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 27 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *)
-	?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const
-	?backPressed@CntContactCardView@@IAEXXZ @ 29 NONAME ; void CntContactCardView::backPressed(void)
-	?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 30 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 31 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
-	?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int)
-	?viewId@CntEditView@@UBEHXZ @ 33 NONAME ; int CntEditView::viewId(void) const
-	?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 34 NONAME ; void * CntContactCardView::qt_metacast(char const *)
-	?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 35 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
-	?viewClosed@CntBaseSelectionView@@IAEXXZ @ 36 NONAME ; void CntBaseSelectionView::viewClosed(void)
-	?showActionPopup@CntActionPopup@@QAE_NVQString@@@Z @ 37 NONAME ; bool CntActionPopup::showActionPopup(class QString)
-	?trUtf8@CntActionPopup@@SA?AVQString@@PBD0@Z @ 38 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *)
-	?keyPressed@CntMainWindow@@IAEXPAVQKeyEvent@@@Z @ 39 NONAME ; void CntMainWindow::keyPressed(class QKeyEvent *)
-	?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int)
-	?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 41 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const
-	??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 42 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *)
-	?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 43 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const
-	?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int)
-	?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 45 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void)
-	??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 46 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *)
-	?getStaticMetaObject@CntActionPopup@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & CntActionPopup::getStaticMetaObject(void)
-	?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 48 NONAME ; void CntViewNavigator::next(int const &, class QFlags<enum Hb::ViewSwitchFlag> &)
-	?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 49 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int)
-	?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 50 NONAME ; void * CntEditView::qt_metacast(char const *)
-	?contactRemoved@CntEditView@@IAEX_N@Z @ 51 NONAME ; void CntEditView::contactRemoved(bool)
-	?d_func@CntActionPopup@@ABEPBVCntActionPopupPrivate@@XZ @ 52 NONAME ; class CntActionPopupPrivate const * CntActionPopup::d_func(void) const
-	?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 53 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *)
-	?metaObject@CntActionPopup@@UBEPBUQMetaObject@@XZ @ 54 NONAME ; struct QMetaObject const * CntActionPopup::metaObject(void) const
-	?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 55 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject
-	?removeException@CntViewNavigator@@QAEXABH@Z @ 56 NONAME ; void CntViewNavigator::removeException(int const &)
-	?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *)
-	?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 58 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const
-	??_ECntMainWindow@@UAE@I@Z @ 59 NONAME ; CntMainWindow::~CntMainWindow(unsigned int)
-	?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 60 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const
-	?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 61 NONAME ; int const & CntViewNavigator::back(class QFlags<enum Hb::ViewSwitchFlag> &)
-	?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 62 NONAME ; void CntDefaultViewManager::changeView(class QMap<int, class QVariant>)
-	??_ECntContactCardView@@UAE@I@Z @ 63 NONAME ; CntContactCardView::~CntContactCardView(unsigned int)
-	?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 64 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject
-	?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 65 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 66 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 67 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *)
-	?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 68 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject
-	??1CntContactCardView@@UAE@XZ @ 69 NONAME ; CntContactCardView::~CntContactCardView(void)
-	?isDefault@CntContactCardView@@UBE_NXZ @ 70 NONAME ; bool CntContactCardView::isDefault(void) const
-	?qt_metacall@CntActionPopup@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 71 NONAME ; int CntActionPopup::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0CntBaseSelectionView@@QAE@XZ @ 72 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void)
-	??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 73 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int)
-	??1CntActionPopup@@UAE@XZ @ 74 NONAME ; CntActionPopup::~CntActionPopup(void)
-	?viewId@CntContactCardView@@UBEHXZ @ 75 NONAME ; int CntContactCardView::viewId(void) const
-	?removeEffect@CntViewNavigator@@QAEXABH@Z @ 76 NONAME ; void CntViewNavigator::removeEffect(int const &)
-	?getStaticMetaObject@CntContactCardView@@SAABUQMetaObject@@XZ @ 77 NONAME ; struct QMetaObject const & CntContactCardView::getStaticMetaObject(void)
-	?back@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 78 NONAME ; void CntDefaultViewManager::back(class QMap<int, class QVariant>)
-	?activate@CntContactCardView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 79 NONAME ; void CntContactCardView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
-	?staticMetaObject@CntActionPopup@@2UQMetaObject@@B @ 80 NONAME ; struct QMetaObject const CntActionPopup::staticMetaObject
-	?staticMetaObject@CntEditView@@2UQMetaObject@@B @ 81 NONAME ; struct QMetaObject const CntEditView::staticMetaObject
-	?viewOpened@CntBaseSelectionView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 82 NONAME ; void CntBaseSelectionView::viewOpened(class CntAbstractViewManager *, class QMap<int, class QVariant>)
-	?isDefault@CntEditView@@UBE_NXZ @ 83 NONAME ; bool CntEditView::isDefault(void) const
-	??_ECntViewNavigator@@UAE@I@Z @ 84 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int)
-	?trUtf8@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 85 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *, int)
-	?addException@CntViewNavigator@@QAEXABH0@Z @ 86 NONAME ; void CntViewNavigator::addException(int const &, int const &)
-	?closeApp@CntDefaultViewManager@@MAEXXZ @ 87 NONAME ; void CntDefaultViewManager::closeApp(void)
-	?deactivate@CntBaseSelectionView@@UAEXXZ @ 88 NONAME ; void CntBaseSelectionView::deactivate(void)
-	?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 89 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const
-	?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 90 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *)
-	?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void)
-	?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 92 NONAME ; class QString CntViewNavigator::tr(char const *, char const *)
-	?trUtf8@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *, int)
-	?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int)
-	?tr@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CntActionPopup::tr(char const *, char const *, int)
-	?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 96 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *)
-	?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 97 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0CntEditView@@QAE@XZ @ 98 NONAME ; CntEditView::CntEditView(void)
-	?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 99 NONAME ; void * CntViewNavigator::qt_metacast(char const *)
-	?view@CntContactCardView@@UBEPAVHbView@@XZ @ 100 NONAME ; class HbView * CntContactCardView::view(void) const
-	?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int)
-	?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString CntContactCardView::tr(char const *, char const *)
-	?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString CntEditView::tr(char const *, char const *)
-	?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 104 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void)
-	?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 105 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const
-	?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 106 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject
-	?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *)
-	?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *)
-	?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 109 NONAME ; void CntDefaultViewManager::switchView(class QMap<int, class QVariant>, class QFlags<enum Hb::ViewSwitchFlag>)
-	?deactivate@CntEditView@@UAEXXZ @ 110 NONAME ; void CntEditView::deactivate(void)
-	?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 111 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &)
-	?addEffect@CntViewNavigator@@QAEXABH0@Z @ 112 NONAME ; void CntViewNavigator::addEffect(int const &, int const &)
-	??_ECntActionPopup@@UAE@I@Z @ 113 NONAME ; CntActionPopup::~CntActionPopup(unsigned int)
-	?d_func@CntActionPopup@@AAEPAVCntActionPopupPrivate@@XZ @ 114 NONAME ; class CntActionPopupPrivate * CntActionPopup::d_func(void)
-	?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 115 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const
-	?contactUpdated@CntEditView@@IAEXH@Z @ 116 NONAME ; void CntEditView::contactUpdated(int)
-	??1CntDefaultViewManager@@UAE@XZ @ 117 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void)
-	??0CntContactCardView@@QAE@XZ @ 118 NONAME ; CntContactCardView::CntContactCardView(void)
-	?deactivate@CntContactCardView@@UAEXXZ @ 119 NONAME ; void CntContactCardView::deactivate(void)
-	?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 120 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void)
-	?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 121 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int)
-	?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 122 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 123 NONAME ; class QString CntEditView::tr(char const *, char const *, int)
-	?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void)
-	??1CntViewNavigator@@UAE@XZ @ 125 NONAME ; CntViewNavigator::~CntViewNavigator(void)
-	?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 126 NONAME ; void * CntMainWindow::qt_metacast(char const *)
-	?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 127 NONAME ; class QString CntEditView::trUtf8(char const *, char const *)
-	?isDefault@CntBaseSelectionView@@UBE_NXZ @ 128 NONAME ; bool CntBaseSelectionView::isDefault(void) const
-	??1CntBaseSelectionView@@UAE@XZ @ 129 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void)
-	?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 130 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int)
-	?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 131 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int)
-	??_ECntEditView@@UAE@I@Z @ 132 NONAME ; CntEditView::~CntEditView(unsigned int)
-	??0CntActionPopup@@QAE@PAVQContact@QtMobility@@@Z @ 133 NONAME ; CntActionPopup::CntActionPopup(class QtMobility::QContact *)
-	?executeContactAction@CntActionPopup@@IAEXAAVQContact@QtMobility@@VQContactDetail@3@VQString@@@Z @ 134 NONAME ; void CntActionPopup::executeContactAction(class QtMobility::QContact &, class QtMobility::QContactDetail, class QString)
-	?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void)
-	?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *)
-	?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 137 NONAME ; void CntDefaultViewManager::removeCurrentView(void)
-	?actionPopupCancelPressed@CntActionPopup@@IAEXXZ @ 138 NONAME ; void CntActionPopup::actionPopupCancelPressed(void)
+	??_ECntDefaultViewManager@@UAE@I@Z @ 15 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(unsigned int)
+	??_ECntBaseSelectionView@@UAE@I@Z @ 16 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(unsigned int)
+	?view@CntBaseSelectionView@@UBEPAVHbView@@XZ @ 17 NONAME ; class HbView * CntBaseSelectionView::view(void) const
+	??1CntDefaultViewFactory@@UAE@XZ @ 18 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(void)
+	??_ECntDefaultViewFactory@@UAE@I@Z @ 19 NONAME ; CntDefaultViewFactory::~CntDefaultViewFactory(unsigned int)
+	?trUtf8@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString CntDefaultViewManager::trUtf8(char const *, char const *, int)
+	?qt_metacast@CntActionPopup@@UAEPAXPBD@Z @ 21 NONAME ; void * CntActionPopup::qt_metacast(char const *)
+	?deleteOldView@CntDefaultViewManager@@AAEXXZ @ 22 NONAME ; void CntDefaultViewManager::deleteOldView(void)
+	?trUtf8@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *, int)
+	?trUtf8@CntEditView@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString CntEditView::trUtf8(char const *, char const *, int)
+	??1CntEditView@@UAE@XZ @ 25 NONAME ; CntEditView::~CntEditView(void)
+	?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 26 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *)
+	?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const
+	?back@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@_N@Z @ 28 NONAME ; void CntDefaultViewManager::back(class QMap<int, class QVariant>, bool)
+	??0CntKeyGrabber@@QAE@PAVHbMainWindow@@PAVQObject@@@Z @ 29 NONAME ; CntKeyGrabber::CntKeyGrabber(class HbMainWindow *, class QObject *)
+	?backPressed@CntContactCardView@@IAEXXZ @ 30 NONAME ; void CntContactCardView::backPressed(void)
+	?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 31 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 32 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	?tr@CntKeyGrabber@@SA?AVQString@@PBD0H@Z @ 33 NONAME ; class QString CntKeyGrabber::tr(char const *, char const *, int)
+	?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 34 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int)
+	?viewId@CntEditView@@UBEHXZ @ 35 NONAME ; int CntEditView::viewId(void) const
+	?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 36 NONAME ; void * CntContactCardView::qt_metacast(char const *)
+	?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 37 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	?viewClosed@CntBaseSelectionView@@IAEXXZ @ 38 NONAME ; void CntBaseSelectionView::viewClosed(void)
+	??1CntKeyGrabber@@UAE@XZ @ 39 NONAME ; CntKeyGrabber::~CntKeyGrabber(void)
+	?showActionPopup@CntActionPopup@@QAE_NVQString@@@Z @ 40 NONAME ; bool CntActionPopup::showActionPopup(class QString)
+	?trUtf8@CntActionPopup@@SA?AVQString@@PBD0@Z @ 41 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *)
+	?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 42 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int)
+	?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const
+	??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 44 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *)
+	?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 45 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const
+	?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int)
+	?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void)
+	??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 48 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *)
+	?actionPopupCancelPressed@CntActionPopup@@IAEXXZ @ 49 NONAME ; void CntActionPopup::actionPopupCancelPressed(void)
+	?getStaticMetaObject@CntActionPopup@@SAABUQMetaObject@@XZ @ 50 NONAME ; struct QMetaObject const & CntActionPopup::getStaticMetaObject(void)
+	?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 51 NONAME ; void CntViewNavigator::next(int const &, class QFlags<enum Hb::ViewSwitchFlag> &)
+	?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 52 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int)
+	?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 53 NONAME ; void * CntEditView::qt_metacast(char const *)
+	??0CntContactCardView@@QAE@_N@Z @ 54 NONAME ; CntContactCardView::CntContactCardView(bool)
+	?contactRemoved@CntEditView@@IAEX_N@Z @ 55 NONAME ; void CntEditView::contactRemoved(bool)
+	?d_func@CntActionPopup@@ABEPBVCntActionPopupPrivate@@XZ @ 56 NONAME ; class CntActionPopupPrivate const * CntActionPopup::d_func(void) const
+	?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *)
+	?metaObject@CntActionPopup@@UBEPBUQMetaObject@@XZ @ 58 NONAME ; struct QMetaObject const * CntActionPopup::metaObject(void) const
+	?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 59 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject
+	?removeException@CntViewNavigator@@QAEXABH@Z @ 60 NONAME ; void CntViewNavigator::removeException(int const &)
+	?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *)
+	?getStaticMetaObject@CntKeyGrabber@@SAABUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const & CntKeyGrabber::getStaticMetaObject(void)
+	?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const
+	??_ECntMainWindow@@UAE@I@Z @ 64 NONAME ; CntMainWindow::~CntMainWindow(unsigned int)
+	?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 65 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const
+	?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 66 NONAME ; void CntDefaultViewManager::changeView(class QMap<int, class QVariant>)
+	??_ECntContactCardView@@UAE@I@Z @ 67 NONAME ; CntContactCardView::~CntContactCardView(unsigned int)
+	?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 68 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject
+	?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 71 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *)
+	?trUtf8@CntKeyGrabber@@SA?AVQString@@PBD0H@Z @ 72 NONAME ; class QString CntKeyGrabber::trUtf8(char const *, char const *, int)
+	?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject
+	?isDefault@CntContactCardView@@UBE_NXZ @ 74 NONAME ; bool CntContactCardView::isDefault(void) const
+	??1CntContactCardView@@UAE@XZ @ 75 NONAME ; CntContactCardView::~CntContactCardView(void)
+	?qt_metacall@CntActionPopup@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 76 NONAME ; int CntActionPopup::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0CntBaseSelectionView@@QAE@XZ @ 77 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void)
+	?tr@CntKeyGrabber@@SA?AVQString@@PBD0@Z @ 78 NONAME ; class QString CntKeyGrabber::tr(char const *, char const *)
+	??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 79 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int)
+	??1CntActionPopup@@UAE@XZ @ 80 NONAME ; CntActionPopup::~CntActionPopup(void)
+	?viewId@CntContactCardView@@UBEHXZ @ 81 NONAME ; int CntContactCardView::viewId(void) const
+	?removeEffect@CntViewNavigator@@QAEXABH@Z @ 82 NONAME ; void CntViewNavigator::removeEffect(int const &)
+	?getStaticMetaObject@CntContactCardView@@SAABUQMetaObject@@XZ @ 83 NONAME ; struct QMetaObject const & CntContactCardView::getStaticMetaObject(void)
+	?activate@CntContactCardView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 84 NONAME ; void CntContactCardView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	?staticMetaObject@CntActionPopup@@2UQMetaObject@@B @ 85 NONAME ; struct QMetaObject const CntActionPopup::staticMetaObject
+	?staticMetaObject@CntEditView@@2UQMetaObject@@B @ 86 NONAME ; struct QMetaObject const CntEditView::staticMetaObject
+	?staticMetaObject@CntKeyGrabber@@2UQMetaObject@@B @ 87 NONAME ; struct QMetaObject const CntKeyGrabber::staticMetaObject
+	?viewOpened@CntBaseSelectionView@@IAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 88 NONAME ; void CntBaseSelectionView::viewOpened(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	?isDefault@CntEditView@@UBE_NXZ @ 89 NONAME ; bool CntEditView::isDefault(void) const
+	?qt_metacall@CntKeyGrabber@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 90 NONAME ; int CntKeyGrabber::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??_ECntViewNavigator@@UAE@I@Z @ 91 NONAME ; CntViewNavigator::~CntViewNavigator(unsigned int)
+	?trUtf8@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 92 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *, int)
+	?metaObject@CntKeyGrabber@@UBEPBUQMetaObject@@XZ @ 93 NONAME ; struct QMetaObject const * CntKeyGrabber::metaObject(void) const
+	?addException@CntViewNavigator@@QAEXABH0@Z @ 94 NONAME ; void CntViewNavigator::addException(int const &, int const &)
+	?closeApp@CntDefaultViewManager@@MAEXXZ @ 95 NONAME ; void CntDefaultViewManager::closeApp(void)
+	??_ECntKeyGrabber@@UAE@I@Z @ 96 NONAME ; CntKeyGrabber::~CntKeyGrabber(unsigned int)
+	?deactivate@CntBaseSelectionView@@UAEXXZ @ 97 NONAME ; void CntBaseSelectionView::deactivate(void)
+	?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 98 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const
+	?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 99 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *)
+	?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 100 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void)
+	?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString CntViewNavigator::tr(char const *, char const *)
+	?trUtf8@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 102 NONAME ; class QString CntActionPopup::trUtf8(char const *, char const *, int)
+	?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 103 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int)
+	?tr@CntActionPopup@@SA?AVQString@@PBD0H@Z @ 104 NONAME ; class QString CntActionPopup::tr(char const *, char const *, int)
+	?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 105 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *)
+	?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 106 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0CntEditView@@QAE@XZ @ 107 NONAME ; CntEditView::CntEditView(void)
+	?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 108 NONAME ; void * CntViewNavigator::qt_metacast(char const *)
+	?view@CntContactCardView@@UBEPAVHbView@@XZ @ 109 NONAME ; class HbView * CntContactCardView::view(void) const
+	?addToContacts@CntContactCardView@@IAEXXZ @ 110 NONAME ; void CntContactCardView::addToContacts(void)
+	?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 111 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int)
+	?addRoot@CntViewNavigator@@QAEXABH@Z @ 112 NONAME ; void CntViewNavigator::addRoot(int const &)
+	?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 113 NONAME ; class QString CntContactCardView::tr(char const *, char const *)
+	?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 114 NONAME ; class QString CntEditView::tr(char const *, char const *)
+	?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 115 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void)
+	?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const
+	?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 117 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject
+	?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 118 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *)
+	?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 119 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *)
+	?trUtf8@CntKeyGrabber@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString CntKeyGrabber::trUtf8(char const *, char const *)
+	?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 121 NONAME ; void CntDefaultViewManager::switchView(class QMap<int, class QVariant>, class QFlags<enum Hb::ViewSwitchFlag>)
+	?deactivate@CntEditView@@UAEXXZ @ 122 NONAME ; void CntEditView::deactivate(void)
+	?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 123 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &)
+	?addEffect@CntViewNavigator@@QAEXABH0@Z @ 124 NONAME ; void CntViewNavigator::addEffect(int const &, int const &)
+	??_ECntActionPopup@@UAE@I@Z @ 125 NONAME ; CntActionPopup::~CntActionPopup(unsigned int)
+	?d_func@CntActionPopup@@AAEPAVCntActionPopupPrivate@@XZ @ 126 NONAME ; class CntActionPopupPrivate * CntActionPopup::d_func(void)
+	?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 127 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const
+	?contactUpdated@CntEditView@@IAEXH@Z @ 128 NONAME ; void CntEditView::contactUpdated(int)
+	??1CntDefaultViewManager@@UAE@XZ @ 129 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void)
+	?deactivate@CntContactCardView@@UAEXXZ @ 130 NONAME ; void CntContactCardView::deactivate(void)
+	?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 131 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void)
+	?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int)
+	?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 133 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 134 NONAME ; class QString CntEditView::tr(char const *, char const *, int)
+	?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void)
+	?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString CntEditView::trUtf8(char const *, char const *)
+	??1CntViewNavigator@@UAE@XZ @ 137 NONAME ; CntViewNavigator::~CntViewNavigator(void)
+	?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 138 NONAME ; void * CntMainWindow::qt_metacast(char const *)
+	?isDefault@CntBaseSelectionView@@UBE_NXZ @ 139 NONAME ; bool CntBaseSelectionView::isDefault(void) const
+	?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@_N@Z @ 140 NONAME ; int const & CntViewNavigator::back(class QFlags<enum Hb::ViewSwitchFlag> &, bool)
+	??1CntBaseSelectionView@@UAE@XZ @ 141 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void)
+	?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 142 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int)
+	?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 143 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int)
+	??_ECntEditView@@UAE@I@Z @ 144 NONAME ; CntEditView::~CntEditView(unsigned int)
+	??0CntActionPopup@@QAE@PAVQContact@QtMobility@@@Z @ 145 NONAME ; CntActionPopup::CntActionPopup(class QtMobility::QContact *)
+	?executeContactAction@CntActionPopup@@IAEXAAVQContact@QtMobility@@VQContactDetail@3@VQString@@@Z @ 146 NONAME ; void CntActionPopup::executeContactAction(class QtMobility::QContact &, class QtMobility::QContactDetail, class QString)
+	?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 147 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void)
+	?eventFilter@CntKeyGrabber@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 148 NONAME ; bool CntKeyGrabber::eventFilter(class QObject *, class QEvent *)
+	?qt_metacast@CntKeyGrabber@@UAEPAXPBD@Z @ 149 NONAME ; void * CntKeyGrabber::qt_metacast(char const *)
+	?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 150 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *)
+	?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 151 NONAME ; void CntDefaultViewManager::removeCurrentView(void)
+	?trUtf8@CntGroupMemberView@@SA?AVQString@@PBD0H@Z @ 152 NONAME ; class QString CntGroupMemberView::trUtf8(char const *, char const *, int)
+	?d_func@CntGroupMemberView@@AAEPAVCntGroupMemberViewPrivate@@XZ @ 153 NONAME ; class CntGroupMemberViewPrivate * CntGroupMemberView::d_func(void)
+	?view@CntGroupMemberView@@UBEPAVHbView@@XZ @ 154 NONAME ; class HbView * CntGroupMemberView::view(void) const
+	?staticMetaObject@CntGroupMemberView@@2UQMetaObject@@B @ 155 NONAME ; struct QMetaObject const CntGroupMemberView::staticMetaObject
+	??1CntGroupMemberView@@UAE@XZ @ 156 NONAME ; CntGroupMemberView::~CntGroupMemberView(void)
+	?tr@CntGroupMemberView@@SA?AVQString@@PBD0H@Z @ 157 NONAME ; class QString CntGroupMemberView::tr(char const *, char const *, int)
+	?activate@CntGroupMemberView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 158 NONAME ; void CntGroupMemberView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+	??_ECntGroupMemberView@@UAE@I@Z @ 159 NONAME ; CntGroupMemberView::~CntGroupMemberView(unsigned int)
+	?viewId@CntGroupMemberView@@UBEHXZ @ 160 NONAME ; int CntGroupMemberView::viewId(void) const
+	?isDefault@CntGroupMemberView@@UBE_NXZ @ 161 NONAME ; bool CntGroupMemberView::isDefault(void) const
+	?qt_metacast@CntGroupMemberView@@UAEPAXPBD@Z @ 162 NONAME ; void * CntGroupMemberView::qt_metacast(char const *)
+	?trUtf8@CntGroupMemberView@@SA?AVQString@@PBD0@Z @ 163 NONAME ; class QString CntGroupMemberView::trUtf8(char const *, char const *)
+	?d_func@CntGroupMemberView@@ABEPBVCntGroupMemberViewPrivate@@XZ @ 164 NONAME ; class CntGroupMemberViewPrivate const * CntGroupMemberView::d_func(void) const
+	?getStaticMetaObject@CntGroupMemberView@@SAABUQMetaObject@@XZ @ 165 NONAME ; struct QMetaObject const & CntGroupMemberView::getStaticMetaObject(void)
+	??0CntGroupMemberView@@QAE@XZ @ 166 NONAME ; CntGroupMemberView::CntGroupMemberView(void)
+	?deactivate@CntGroupMemberView@@UAEXXZ @ 167 NONAME ; void CntGroupMemberView::deactivate(void)
+	?qt_metacall@CntGroupMemberView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 168 NONAME ; int CntGroupMemberView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?metaObject@CntGroupMemberView@@UBEPBUQMetaObject@@XZ @ 169 NONAME ; struct QMetaObject const * CntGroupMemberView::metaObject(void) const
+	?tr@CntGroupMemberView@@SA?AVQString@@PBD0@Z @ 170 NONAME ; class QString CntGroupMemberView::tr(char const *, char const *)
+	?backPressed@CntGroupMemberView@@IAEXXZ @ 171 NONAME ; void CntGroupMemberView::backPressed(void)
 
--- a/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/cnthistorymodel/inc/cnthistorymodelconsts.h	Wed Aug 18 09:39:00 2010 +0300
@@ -20,10 +20,8 @@
 enum Attributes
     {
     CntIncoming = 1,
-    CntOutgoing = 2,
-    CntUnseen = 4,
-    CntSeen = 8,
-    CntAttachment = 16
+    CntUnseen = 2,
+    CntAttachment = 4
     };
 
 enum ItemType
--- a/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/cnthistorymodel/src/cnthistorymodel_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -22,6 +22,7 @@
 #include <hbframebackground.h>
 
 #include "cnthistorymodel_p.h"
+#include "cntdebug.h"
 
 
 // Unnamed namespace for helper functions
@@ -36,6 +37,33 @@
     {
         return ((*t1).timeStamp < (*t2).timeStamp);
     }
+    
+#ifdef TRACES
+#define LOG_ITEM(i) logItem(i)
+#else
+#define LOG_ITEM(i)
+#endif
+    
+    void logItem(const HistoryItem& item)
+    {
+        QStringList l;
+        
+        l << item.message << item.number << item.timeStamp.toString() << item.title;
+        l << (item.flags & CntIncoming ? "incoming" : "outgoing");
+        l << (item.flags & CntUnseen ? "unseen" : "seen");
+        l << (item.flags & CntAttachment ? "attachment" : "");
+        l << (item.flags & CntCallLog ? "call" : "message");
+        if (item.flags & CntReceivedCall)
+            l << "recieved";
+        else if (item.flags & CntMissedCall)
+            l << "missed";
+        else if (item.flags & CntDialledCall)
+            l << "dialled";
+        
+        l.removeAll("");
+        
+        qDebug() << l;
+    }
 }
 
 Q_DECLARE_METATYPE(LogsEvent *)
@@ -382,16 +410,20 @@
         }
     }
 
-    if ( event->direction() == LogsEvent::DirOut )
-        item.flags |= CntOutgoing;
-    else
+    if ( event->direction() == LogsEvent::DirMissed
+        || event->direction() == LogsEvent::DirIn ) {
         item.flags |= CntIncoming;
+    } else {
+        item.flags &= ~CntIncoming;
+    }
     
     item.message = bodyText;
     item.title = title;
     item.timeStamp = event->time().toLocalTime();
     item.flags |= CntCallLog;
     item.number = QString(event->number());
+    
+    LOG_ITEM(item);
 }
 
 /*!
@@ -604,7 +636,7 @@
         else
             item.flags &= ~CntUnseen;
     } else if ( event.direction() == MsgItem::MsgDirectionOutgoing )
-        item.flags |= CntOutgoing;
+        item.flags &= ~CntIncoming;
     
     // Attachment
     if (event.isAttributeSet(MsgItem::MsgAttributeAttachment))
@@ -623,6 +655,8 @@
     }
     
     item.timeStamp = event.timeStamp().toLocalTime();
+    
+    LOG_ITEM(item);
 }
 
 /*!
--- a/phonebookui/eabi/pbkcommonuiu.def	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/eabi/pbkcommonuiu.def	Wed Aug 18 09:39:00 2010 +0300
@@ -13,152 +13,190 @@
 	_ZN11CntEditViewD0Ev @ 12 NONAME
 	_ZN11CntEditViewD1Ev @ 13 NONAME
 	_ZN11CntEditViewD2Ev @ 14 NONAME
-	_ZN13CntMainWindow10keyPressedEP9QKeyEvent @ 15 NONAME
-	_ZN13CntMainWindow11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME
-	_ZN13CntMainWindow11qt_metacastEPKc @ 17 NONAME
-	_ZN13CntMainWindow13keyPressEventEP9QKeyEvent @ 18 NONAME
-	_ZN13CntMainWindow16staticMetaObjectE @ 19 NONAME DATA 16
-	_ZN13CntMainWindow19getStaticMetaObjectEv @ 20 NONAME
-	_ZN13CntMainWindowC1EP7QWidgeti @ 21 NONAME
-	_ZN13CntMainWindowC2EP7QWidgeti @ 22 NONAME
-	_ZN13CntMainWindowD0Ev @ 23 NONAME
-	_ZN13CntMainWindowD1Ev @ 24 NONAME
-	_ZN13CntMainWindowD2Ev @ 25 NONAME
-	_ZN14CntActionPopup11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME
-	_ZN14CntActionPopup11qt_metacastEPKc @ 27 NONAME
-	_ZN14CntActionPopup15showActionPopupE7QString @ 28 NONAME
-	_ZN14CntActionPopup16staticMetaObjectE @ 29 NONAME DATA 16
-	_ZN14CntActionPopup19getStaticMetaObjectEv @ 30 NONAME
-	_ZN14CntActionPopup20executeContactActionERN10QtMobility8QContactENS0_14QContactDetailE7QString @ 31 NONAME
-	_ZN14CntActionPopupC1EPN10QtMobility8QContactE @ 32 NONAME
-	_ZN14CntActionPopupC2EPN10QtMobility8QContactE @ 33 NONAME
-	_ZN14CntActionPopupD0Ev @ 34 NONAME
-	_ZN14CntActionPopupD1Ev @ 35 NONAME
-	_ZN14CntActionPopupD2Ev @ 36 NONAME
-	_ZN16CntViewNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 37 NONAME
-	_ZN16CntViewNavigator11qt_metacastEPKc @ 38 NONAME
-	_ZN16CntViewNavigator12addExceptionERKiS1_ @ 39 NONAME
-	_ZN16CntViewNavigator12removeEffectERKi @ 40 NONAME
-	_ZN16CntViewNavigator15removeExceptionERKi @ 41 NONAME
-	_ZN16CntViewNavigator16staticMetaObjectE @ 42 NONAME DATA 16
-	_ZN16CntViewNavigator19getStaticMetaObjectEv @ 43 NONAME
-	_ZN16CntViewNavigator4backER6QFlagsIN2Hb14ViewSwitchFlagEE @ 44 NONAME
-	_ZN16CntViewNavigator4nextERKiR6QFlagsIN2Hb14ViewSwitchFlagEE @ 45 NONAME
-	_ZN16CntViewNavigator9addEffectERKiS1_ @ 46 NONAME
-	_ZN16CntViewNavigatorC1EP7QObject @ 47 NONAME
-	_ZN16CntViewNavigatorC2EP7QObject @ 48 NONAME
-	_ZN16CntViewNavigatorD0Ev @ 49 NONAME
-	_ZN16CntViewNavigatorD1Ev @ 50 NONAME
-	_ZN16CntViewNavigatorD2Ev @ 51 NONAME
-	_ZN18CntContactCardView10deactivateEv @ 52 NONAME
-	_ZN18CntContactCardView11backPressedEv @ 53 NONAME
-	_ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 54 NONAME
-	_ZN18CntContactCardView11qt_metacastEPKc @ 55 NONAME
-	_ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 56 NONAME
-	_ZN18CntContactCardView16staticMetaObjectE @ 57 NONAME DATA 16
-	_ZN18CntContactCardView19getStaticMetaObjectEv @ 58 NONAME
-	_ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 59 NONAME
-	_ZN18CntContactCardViewC1Ev @ 60 NONAME
-	_ZN18CntContactCardViewC2Ev @ 61 NONAME
-	_ZN18CntContactCardViewD0Ev @ 62 NONAME
-	_ZN18CntContactCardViewD1Ev @ 63 NONAME
-	_ZN18CntContactCardViewD2Ev @ 64 NONAME
-	_ZN20CntBaseSelectionView10deactivateEv @ 65 NONAME
-	_ZN20CntBaseSelectionView10viewClosedEv @ 66 NONAME
-	_ZN20CntBaseSelectionView10viewOpenedEP22CntAbstractViewManager4QMapIi8QVariantE @ 67 NONAME
-	_ZN20CntBaseSelectionView11qt_metacallEN11QMetaObject4CallEiPPv @ 68 NONAME
-	_ZN20CntBaseSelectionView11qt_metacastEPKc @ 69 NONAME
-	_ZN20CntBaseSelectionView16staticMetaObjectE @ 70 NONAME DATA 16
-	_ZN20CntBaseSelectionView19getStaticMetaObjectEv @ 71 NONAME
-	_ZN20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 72 NONAME
-	_ZN20CntBaseSelectionView9closeViewEv @ 73 NONAME
-	_ZN20CntBaseSelectionViewC2Ev @ 74 NONAME
-	_ZN20CntBaseSelectionViewD0Ev @ 75 NONAME
-	_ZN20CntBaseSelectionViewD1Ev @ 76 NONAME
-	_ZN20CntBaseSelectionViewD2Ev @ 77 NONAME
-	_ZN21CntDefaultViewFactory10createViewEi @ 78 NONAME
-	_ZN21CntDefaultViewFactory16createPluginViewEi @ 79 NONAME
-	_ZN21CntDefaultViewFactoryC1Ev @ 80 NONAME
-	_ZN21CntDefaultViewFactoryC2Ev @ 81 NONAME
-	_ZN21CntDefaultViewFactoryD0Ev @ 82 NONAME
-	_ZN21CntDefaultViewFactoryD1Ev @ 83 NONAME
-	_ZN21CntDefaultViewFactoryD2Ev @ 84 NONAME
-	_ZN21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 85 NONAME
-	_ZN21CntDefaultViewManager10switchViewE4QMapIi8QVariantE6QFlagsIN2Hb14ViewSwitchFlagEE @ 86 NONAME
-	_ZN21CntDefaultViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 87 NONAME
-	_ZN21CntDefaultViewManager11qt_metacastEPKc @ 88 NONAME
-	_ZN21CntDefaultViewManager13deleteOldViewEv @ 89 NONAME
-	_ZN21CntDefaultViewManager14contactManagerERK7QString @ 90 NONAME
-	_ZN21CntDefaultViewManager14setViewFactoryEP22CntAbstractViewFactory @ 91 NONAME
-	_ZN21CntDefaultViewManager16setViewNavigatorEP16CntViewNavigator @ 92 NONAME
-	_ZN21CntDefaultViewManager16staticMetaObjectE @ 93 NONAME DATA 16
-	_ZN21CntDefaultViewManager17removeCurrentViewEv @ 94 NONAME
-	_ZN21CntDefaultViewManager19getStaticMetaObjectEv @ 95 NONAME
-	_ZN21CntDefaultViewManager4backE4QMapIi8QVariantE @ 96 NONAME
-	_ZN21CntDefaultViewManager7cleanupEv @ 97 NONAME
-	_ZN21CntDefaultViewManager8closeAppEv @ 98 NONAME
-	_ZN21CntDefaultViewManagerC1EP12HbMainWindow @ 99 NONAME
-	_ZN21CntDefaultViewManagerC2EP12HbMainWindow @ 100 NONAME
-	_ZN21CntDefaultViewManagerD0Ev @ 101 NONAME
-	_ZN21CntDefaultViewManagerD1Ev @ 102 NONAME
-	_ZN21CntDefaultViewManagerD2Ev @ 103 NONAME
-	_ZNK11CntEditView10metaObjectEv @ 104 NONAME
-	_ZNK11CntEditView4viewEv @ 105 NONAME
-	_ZNK11CntEditView6viewIdEv @ 106 NONAME
-	_ZNK11CntEditView9isDefaultEv @ 107 NONAME
-	_ZNK13CntMainWindow10metaObjectEv @ 108 NONAME
-	_ZNK14CntActionPopup10metaObjectEv @ 109 NONAME
-	_ZNK16CntViewNavigator10metaObjectEv @ 110 NONAME
-	_ZNK18CntContactCardView10metaObjectEv @ 111 NONAME
-	_ZNK18CntContactCardView4viewEv @ 112 NONAME
-	_ZNK18CntContactCardView6viewIdEv @ 113 NONAME
-	_ZNK18CntContactCardView9isDefaultEv @ 114 NONAME
-	_ZNK20CntBaseSelectionView10metaObjectEv @ 115 NONAME
-	_ZNK20CntBaseSelectionView4viewEv @ 116 NONAME
-	_ZNK20CntBaseSelectionView9isDefaultEv @ 117 NONAME
-	_ZNK21CntDefaultViewManager10metaObjectEv @ 118 NONAME
-	_ZTI11CntEditView @ 119 NONAME
-	_ZTI13CntMainWindow @ 120 NONAME
-	_ZTI14CntActionPopup @ 121 NONAME
-	_ZTI16CntViewNavigator @ 122 NONAME
-	_ZTI18CntContactCardView @ 123 NONAME
-	_ZTI20CntBaseSelectionView @ 124 NONAME
-	_ZTI21CntDefaultViewFactory @ 125 NONAME
-	_ZTI21CntDefaultViewManager @ 126 NONAME
-	_ZTV11CntEditView @ 127 NONAME
-	_ZTV13CntMainWindow @ 128 NONAME
-	_ZTV14CntActionPopup @ 129 NONAME
-	_ZTV16CntViewNavigator @ 130 NONAME
-	_ZTV18CntContactCardView @ 131 NONAME
-	_ZTV20CntBaseSelectionView @ 132 NONAME
-	_ZTV21CntDefaultViewFactory @ 133 NONAME
-	_ZTV21CntDefaultViewManager @ 134 NONAME
-	_ZThn8_N11CntEditView10deactivateEv @ 135 NONAME
-	_ZThn8_N11CntEditView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 136 NONAME
-	_ZThn8_N11CntEditViewD0Ev @ 137 NONAME
-	_ZThn8_N11CntEditViewD1Ev @ 138 NONAME
-	_ZThn8_N13CntMainWindowD0Ev @ 139 NONAME
-	_ZThn8_N13CntMainWindowD1Ev @ 140 NONAME
-	_ZThn8_N18CntContactCardView10deactivateEv @ 141 NONAME
-	_ZThn8_N18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 142 NONAME
-	_ZThn8_N18CntContactCardViewD0Ev @ 143 NONAME
-	_ZThn8_N18CntContactCardViewD1Ev @ 144 NONAME
-	_ZThn8_N20CntBaseSelectionView10deactivateEv @ 145 NONAME
-	_ZThn8_N20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 146 NONAME
-	_ZThn8_N20CntBaseSelectionViewD0Ev @ 147 NONAME
-	_ZThn8_N20CntBaseSelectionViewD1Ev @ 148 NONAME
-	_ZThn8_N21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 149 NONAME
-	_ZThn8_N21CntDefaultViewManager14contactManagerERK7QString @ 150 NONAME
-	_ZThn8_N21CntDefaultViewManager4backE4QMapIi8QVariantE @ 151 NONAME
-	_ZThn8_N21CntDefaultViewManagerD0Ev @ 152 NONAME
-	_ZThn8_N21CntDefaultViewManagerD1Ev @ 153 NONAME
-	_ZThn8_NK11CntEditView4viewEv @ 154 NONAME
-	_ZThn8_NK11CntEditView6viewIdEv @ 155 NONAME
-	_ZThn8_NK11CntEditView9isDefaultEv @ 156 NONAME
-	_ZThn8_NK18CntContactCardView4viewEv @ 157 NONAME
-	_ZThn8_NK18CntContactCardView6viewIdEv @ 158 NONAME
-	_ZThn8_NK18CntContactCardView9isDefaultEv @ 159 NONAME
-	_ZThn8_NK20CntBaseSelectionView4viewEv @ 160 NONAME
-	_ZThn8_NK20CntBaseSelectionView9isDefaultEv @ 161 NONAME
-	_ZN14CntActionPopup24actionPopupCancelPressedEv @ 162 NONAME
+	_ZN13CntKeyGrabber11eventFilterEP7QObjectP6QEvent @ 15 NONAME
+	_ZN13CntKeyGrabber11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME
+	_ZN13CntKeyGrabber11qt_metacastEPKc @ 17 NONAME
+	_ZN13CntKeyGrabber16staticMetaObjectE @ 18 NONAME DATA 16
+	_ZN13CntKeyGrabber19getStaticMetaObjectEv @ 19 NONAME
+	_ZN13CntKeyGrabberC1EP12HbMainWindowP7QObject @ 20 NONAME
+	_ZN13CntKeyGrabberC2EP12HbMainWindowP7QObject @ 21 NONAME
+	_ZN13CntKeyGrabberD0Ev @ 22 NONAME
+	_ZN13CntKeyGrabberD1Ev @ 23 NONAME
+	_ZN13CntKeyGrabberD2Ev @ 24 NONAME
+	_ZN13CntMainWindow11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME
+	_ZN13CntMainWindow11qt_metacastEPKc @ 26 NONAME
+	_ZN13CntMainWindow16staticMetaObjectE @ 27 NONAME DATA 16
+	_ZN13CntMainWindow19getStaticMetaObjectEv @ 28 NONAME
+	_ZN13CntMainWindowC1EP7QWidgeti @ 29 NONAME
+	_ZN13CntMainWindowC2EP7QWidgeti @ 30 NONAME
+	_ZN13CntMainWindowD0Ev @ 31 NONAME
+	_ZN13CntMainWindowD1Ev @ 32 NONAME
+	_ZN13CntMainWindowD2Ev @ 33 NONAME
+	_ZN14CntActionPopup11qt_metacallEN11QMetaObject4CallEiPPv @ 34 NONAME
+	_ZN14CntActionPopup11qt_metacastEPKc @ 35 NONAME
+	_ZN14CntActionPopup15showActionPopupE7QString @ 36 NONAME
+	_ZN14CntActionPopup16staticMetaObjectE @ 37 NONAME DATA 16
+	_ZN14CntActionPopup19getStaticMetaObjectEv @ 38 NONAME
+	_ZN14CntActionPopup20executeContactActionERN10QtMobility8QContactENS0_14QContactDetailE7QString @ 39 NONAME
+	_ZN14CntActionPopup24actionPopupCancelPressedEv @ 40 NONAME
+	_ZN14CntActionPopupC1EPN10QtMobility8QContactE @ 41 NONAME
+	_ZN14CntActionPopupC2EPN10QtMobility8QContactE @ 42 NONAME
+	_ZN14CntActionPopupD0Ev @ 43 NONAME
+	_ZN14CntActionPopupD1Ev @ 44 NONAME
+	_ZN14CntActionPopupD2Ev @ 45 NONAME
+	_ZN16CntViewNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 46 NONAME
+	_ZN16CntViewNavigator11qt_metacastEPKc @ 47 NONAME
+	_ZN16CntViewNavigator12addExceptionERKiS1_ @ 48 NONAME
+	_ZN16CntViewNavigator12removeEffectERKi @ 49 NONAME
+	_ZN16CntViewNavigator15removeExceptionERKi @ 50 NONAME
+	_ZN16CntViewNavigator16staticMetaObjectE @ 51 NONAME DATA 16
+	_ZN16CntViewNavigator19getStaticMetaObjectEv @ 52 NONAME
+	_ZN16CntViewNavigator4backER6QFlagsIN2Hb14ViewSwitchFlagEEb @ 53 NONAME
+	_ZN16CntViewNavigator4nextERKiR6QFlagsIN2Hb14ViewSwitchFlagEE @ 54 NONAME
+	_ZN16CntViewNavigator7addRootERKi @ 55 NONAME
+	_ZN16CntViewNavigator9addEffectERKiS1_ @ 56 NONAME
+	_ZN16CntViewNavigatorC1EP7QObject @ 57 NONAME
+	_ZN16CntViewNavigatorC2EP7QObject @ 58 NONAME
+	_ZN16CntViewNavigatorD0Ev @ 59 NONAME
+	_ZN16CntViewNavigatorD1Ev @ 60 NONAME
+	_ZN16CntViewNavigatorD2Ev @ 61 NONAME
+	_ZN18CntContactCardView10deactivateEv @ 62 NONAME
+	_ZN18CntContactCardView11backPressedEv @ 63 NONAME
+	_ZN18CntContactCardView11qt_metacallEN11QMetaObject4CallEiPPv @ 64 NONAME
+	_ZN18CntContactCardView11qt_metacastEPKc @ 65 NONAME
+	_ZN18CntContactCardView13addToContactsEv @ 66 NONAME
+	_ZN18CntContactCardView13viewActivatedEP22CntAbstractViewManager4QMapIi8QVariantE @ 67 NONAME
+	_ZN18CntContactCardView16staticMetaObjectE @ 68 NONAME DATA 16
+	_ZN18CntContactCardView19getStaticMetaObjectEv @ 69 NONAME
+	_ZN18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 70 NONAME
+	_ZN18CntContactCardViewC1Eb @ 71 NONAME
+	_ZN18CntContactCardViewC2Eb @ 72 NONAME
+	_ZN18CntContactCardViewD0Ev @ 73 NONAME
+	_ZN18CntContactCardViewD1Ev @ 74 NONAME
+	_ZN18CntContactCardViewD2Ev @ 75 NONAME
+	_ZN20CntBaseSelectionView10deactivateEv @ 76 NONAME
+	_ZN20CntBaseSelectionView10viewClosedEv @ 77 NONAME
+	_ZN20CntBaseSelectionView10viewOpenedEP22CntAbstractViewManager4QMapIi8QVariantE @ 78 NONAME
+	_ZN20CntBaseSelectionView11qt_metacallEN11QMetaObject4CallEiPPv @ 79 NONAME
+	_ZN20CntBaseSelectionView11qt_metacastEPKc @ 80 NONAME
+	_ZN20CntBaseSelectionView16staticMetaObjectE @ 81 NONAME DATA 16
+	_ZN20CntBaseSelectionView19getStaticMetaObjectEv @ 82 NONAME
+	_ZN20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 83 NONAME
+	_ZN20CntBaseSelectionViewC2Ev @ 84 NONAME
+	_ZN20CntBaseSelectionViewD0Ev @ 85 NONAME
+	_ZN20CntBaseSelectionViewD1Ev @ 86 NONAME
+	_ZN20CntBaseSelectionViewD2Ev @ 87 NONAME
+	_ZN21CntDefaultViewFactory10createViewEi @ 88 NONAME
+	_ZN21CntDefaultViewFactory16createPluginViewEi @ 89 NONAME
+	_ZN21CntDefaultViewFactoryC1Ev @ 90 NONAME
+	_ZN21CntDefaultViewFactoryC2Ev @ 91 NONAME
+	_ZN21CntDefaultViewFactoryD0Ev @ 92 NONAME
+	_ZN21CntDefaultViewFactoryD1Ev @ 93 NONAME
+	_ZN21CntDefaultViewFactoryD2Ev @ 94 NONAME
+	_ZN21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 95 NONAME
+	_ZN21CntDefaultViewManager10switchViewE4QMapIi8QVariantE6QFlagsIN2Hb14ViewSwitchFlagEE @ 96 NONAME
+	_ZN21CntDefaultViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 97 NONAME
+	_ZN21CntDefaultViewManager11qt_metacastEPKc @ 98 NONAME
+	_ZN21CntDefaultViewManager13currentViewIdEv @ 99 NONAME
+	_ZN21CntDefaultViewManager13deleteOldViewEv @ 100 NONAME
+	_ZN21CntDefaultViewManager14contactManagerERK7QString @ 101 NONAME
+	_ZN21CntDefaultViewManager14setViewFactoryEP22CntAbstractViewFactory @ 102 NONAME
+	_ZN21CntDefaultViewManager16setViewNavigatorEP16CntViewNavigator @ 103 NONAME
+	_ZN21CntDefaultViewManager16staticMetaObjectE @ 104 NONAME DATA 16
+	_ZN21CntDefaultViewManager17removeCurrentViewEv @ 105 NONAME
+	_ZN21CntDefaultViewManager19getStaticMetaObjectEv @ 106 NONAME
+	_ZN21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 107 NONAME
+	_ZN21CntDefaultViewManager7cleanupEv @ 108 NONAME
+	_ZN21CntDefaultViewManager8closeAppEv @ 109 NONAME
+	_ZN21CntDefaultViewManagerC1EP12HbMainWindow @ 110 NONAME
+	_ZN21CntDefaultViewManagerC2EP12HbMainWindow @ 111 NONAME
+	_ZN21CntDefaultViewManagerD0Ev @ 112 NONAME
+	_ZN21CntDefaultViewManagerD1Ev @ 113 NONAME
+	_ZN21CntDefaultViewManagerD2Ev @ 114 NONAME
+	_ZNK11CntEditView10metaObjectEv @ 115 NONAME
+	_ZNK11CntEditView4viewEv @ 116 NONAME
+	_ZNK11CntEditView6viewIdEv @ 117 NONAME
+	_ZNK11CntEditView9isDefaultEv @ 118 NONAME
+	_ZNK13CntKeyGrabber10metaObjectEv @ 119 NONAME
+	_ZNK13CntMainWindow10metaObjectEv @ 120 NONAME
+	_ZNK14CntActionPopup10metaObjectEv @ 121 NONAME
+	_ZNK16CntViewNavigator10metaObjectEv @ 122 NONAME
+	_ZNK18CntContactCardView10metaObjectEv @ 123 NONAME
+	_ZNK18CntContactCardView4viewEv @ 124 NONAME
+	_ZNK18CntContactCardView6viewIdEv @ 125 NONAME
+	_ZNK18CntContactCardView9isDefaultEv @ 126 NONAME
+	_ZNK20CntBaseSelectionView10metaObjectEv @ 127 NONAME
+	_ZNK20CntBaseSelectionView4viewEv @ 128 NONAME
+	_ZNK20CntBaseSelectionView9isDefaultEv @ 129 NONAME
+	_ZNK21CntDefaultViewManager10metaObjectEv @ 130 NONAME
+	_ZTI11CntEditView @ 131 NONAME
+	_ZTI13CntKeyGrabber @ 132 NONAME
+	_ZTI13CntMainWindow @ 133 NONAME
+	_ZTI14CntActionPopup @ 134 NONAME
+	_ZTI16CntViewNavigator @ 135 NONAME
+	_ZTI18CntContactCardView @ 136 NONAME
+	_ZTI20CntBaseSelectionView @ 137 NONAME
+	_ZTI21CntDefaultViewFactory @ 138 NONAME
+	_ZTI21CntDefaultViewManager @ 139 NONAME
+	_ZTV11CntEditView @ 140 NONAME
+	_ZTV13CntKeyGrabber @ 141 NONAME
+	_ZTV13CntMainWindow @ 142 NONAME
+	_ZTV14CntActionPopup @ 143 NONAME
+	_ZTV16CntViewNavigator @ 144 NONAME
+	_ZTV18CntContactCardView @ 145 NONAME
+	_ZTV20CntBaseSelectionView @ 146 NONAME
+	_ZTV21CntDefaultViewFactory @ 147 NONAME
+	_ZTV21CntDefaultViewManager @ 148 NONAME
+	_ZThn8_N11CntEditView10deactivateEv @ 149 NONAME
+	_ZThn8_N11CntEditView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 150 NONAME
+	_ZThn8_N11CntEditViewD0Ev @ 151 NONAME
+	_ZThn8_N11CntEditViewD1Ev @ 152 NONAME
+	_ZThn8_N13CntMainWindowD0Ev @ 153 NONAME
+	_ZThn8_N13CntMainWindowD1Ev @ 154 NONAME
+	_ZThn8_N18CntContactCardView10deactivateEv @ 155 NONAME
+	_ZThn8_N18CntContactCardView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 156 NONAME
+	_ZThn8_N18CntContactCardViewD0Ev @ 157 NONAME
+	_ZThn8_N18CntContactCardViewD1Ev @ 158 NONAME
+	_ZThn8_N20CntBaseSelectionView10deactivateEv @ 159 NONAME
+	_ZThn8_N20CntBaseSelectionView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 160 NONAME
+	_ZThn8_N20CntBaseSelectionViewD0Ev @ 161 NONAME
+	_ZThn8_N20CntBaseSelectionViewD1Ev @ 162 NONAME
+	_ZThn8_N21CntDefaultViewManager10changeViewE4QMapIi8QVariantE @ 163 NONAME
+	_ZThn8_N21CntDefaultViewManager14contactManagerERK7QString @ 164 NONAME
+	_ZThn8_N21CntDefaultViewManager4backE4QMapIi8QVariantEb @ 165 NONAME
+	_ZThn8_N21CntDefaultViewManagerD0Ev @ 166 NONAME
+	_ZThn8_N21CntDefaultViewManagerD1Ev @ 167 NONAME
+	_ZThn8_NK11CntEditView4viewEv @ 168 NONAME
+	_ZThn8_NK11CntEditView6viewIdEv @ 169 NONAME
+	_ZThn8_NK11CntEditView9isDefaultEv @ 170 NONAME
+	_ZThn8_NK18CntContactCardView4viewEv @ 171 NONAME
+	_ZThn8_NK18CntContactCardView6viewIdEv @ 172 NONAME
+	_ZThn8_NK18CntContactCardView9isDefaultEv @ 173 NONAME
+	_ZThn8_NK20CntBaseSelectionView4viewEv @ 174 NONAME
+	_ZThn8_NK20CntBaseSelectionView9isDefaultEv @ 175 NONAME
+	_ZN18CntGroupMemberView10deactivateEv @ 176 NONAME
+	_ZN18CntGroupMemberView11backPressedEv @ 177 NONAME
+	_ZN18CntGroupMemberView11qt_metacallEN11QMetaObject4CallEiPPv @ 178 NONAME
+	_ZN18CntGroupMemberView11qt_metacastEPKc @ 179 NONAME
+	_ZN18CntGroupMemberView16staticMetaObjectE @ 180 NONAME DATA 16
+	_ZN18CntGroupMemberView19getStaticMetaObjectEv @ 181 NONAME
+	_ZN18CntGroupMemberView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 182 NONAME
+	_ZN18CntGroupMemberViewC1Ev @ 183 NONAME
+	_ZN18CntGroupMemberViewC2Ev @ 184 NONAME
+	_ZN18CntGroupMemberViewD0Ev @ 185 NONAME
+	_ZN18CntGroupMemberViewD1Ev @ 186 NONAME
+	_ZN18CntGroupMemberViewD2Ev @ 187 NONAME
+	_ZNK18CntGroupMemberView10metaObjectEv @ 188 NONAME
+	_ZNK18CntGroupMemberView4viewEv @ 189 NONAME
+	_ZNK18CntGroupMemberView6viewIdEv @ 190 NONAME
+	_ZNK18CntGroupMemberView9isDefaultEv @ 191 NONAME
+	_ZTI18CntGroupMemberView @ 192 NONAME
+	_ZTV18CntGroupMemberView @ 193 NONAME
+	_ZThn8_N18CntGroupMemberView10deactivateEv @ 194 NONAME
+	_ZThn8_N18CntGroupMemberView8activateEP22CntAbstractViewManager4QMapIi8QVariantE @ 195 NONAME
+	_ZThn8_N18CntGroupMemberViewD0Ev @ 196 NONAME
+	_ZThn8_N18CntGroupMemberViewD1Ev @ 197 NONAME
+	_ZThn8_NK18CntGroupMemberView4viewEv @ 198 NONAME
+	_ZThn8_NK18CntGroupMemberView6viewIdEv @ 199 NONAME
+	_ZThn8_NK18CntGroupMemberView9isDefaultEv @ 200 NONAME
 
--- a/phonebookui/pbkcommonui/inc/cntactionlauncher.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntactionlauncher.h	Wed Aug 18 09:39:00 2010 +0300
@@ -34,6 +34,7 @@
     
 public:
     bool execute( QContact aContact, QContactDetail aDetail );
+    bool execute( QContact aContact, QContactDetail aDetail, QVariantMap aParameters );
     bool execute( QContact aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor );
     
 signals:
--- a/phonebookui/pbkcommonui/inc/cntactionpopup.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntactionpopup.h	Wed Aug 18 09:39:00 2010 +0300
@@ -36,7 +36,7 @@
 /*
 * Class for showing popup for Call, Message and Email actions if preffered number is not set
 */
-class Q_DECL_EXPORT CntActionPopup : public QObject
+class QTPBK_EXPORT CntActionPopup : public QObject
 {
     Q_OBJECT
     
--- a/phonebookui/pbkcommonui/inc/cntbaseselectionview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntbaseselectionview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -48,10 +48,7 @@
     HbView* view() const;
     
     virtual int viewId() const = 0;
-    
-private slots:
-    void closeView();
-    
+
 protected:
     HbDocumentLoader* mDocument;
     HbListView* mListView;
--- a/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcollectionlistmodel.h	Wed Aug 18 09:39:00 2010 +0300
@@ -46,17 +46,25 @@
     CntCollectionListModel(QContactManager *manager, CntExtensionManager &extensionManager, QObject *parent = 0);
     ~CntCollectionListModel();
     
-public: // from QAbstractItemModel
+public:
+    // from QAbstractItemModel
     QVariant data(const QModelIndex& index, int role) const;
     int rowCount(const QModelIndex& parent = QModelIndex()) const;
     bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
+    bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
     
 public:
+    // removing and adding groups
     void removeGroup(int localId);
+    void addGroup(int localId);
+    
+    // extension (plugin) group handling
     bool isExtensionGroup(const QModelIndex &index);
     CntViewParameters extensionGroupActivated(int row);
     void extensionGroupLongPressed(int row, const QPointF& coords, CntExtensionGroupCallback* interface);
     
+    QModelIndex indexOfGroup(int localId);
+    
 private:
     void doConstruct();
     void initializeStaticGroups();
@@ -69,8 +77,9 @@
     bool validateRowIndex(const int index) const;
     
 private slots:
-    void informationUpdated(int row, const QString& secondRowText, int memberCount);
+    void informationUpdated(int id, const QString& secondRowText, int memberCount);
     void onIconReady(const QPixmap& pixmap, void *data, int id, int error);
+    void extensionGroupsReady();
     
 private:
     QSharedDataPointer<CntCollectionListModelData>  d;
--- a/phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcollectionlistmodelworker.h	Wed Aug 18 09:39:00 2010 +0300
@@ -33,6 +33,7 @@
 class CntCollectionListModelWorker : public QThread
 {
     Q_OBJECT
+    friend class TestCntCollectionListModelWorker;
     
 public:
     CntCollectionListModelWorker(QString unnamed, QString noFavs, QString noMembers, int sortOrder);
@@ -41,14 +42,14 @@
     void run();
     bool event(QEvent *event);
     
-    void scheduleJob(int row, int id);
+    void scheduleJob(int id);
 
 private:
     void processJobs();
-    void fetchInformation(int row, int id);
+    void fetchInformation(int id);
     
 signals:
-    void fetchDone(int row, const QString& secondRowText, int memberCount);
+    void fetchDone(int id, const QString& secondRowText, int memberCount);
     
 private:
     bool                        mStarted;
@@ -56,7 +57,7 @@
     bool                        mStopped;
     QMutex                      mMutex;
     
-    QList< QPair<int,int> >     mJobs;
+    QList<int>                  mJobs;
 
     QContactManager            *mManager;
     
--- a/phonebookui/pbkcommonui/inc/cntcollectionview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcollectionview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -29,7 +29,6 @@
 class HbView;
 class HbListView;
 class CntCollectionListModel;
-class CntFetchContacts;
 class QModelIndex;
 class QActionGroup;
 class HbAbstractViewItem;
@@ -58,6 +57,7 @@
 
 private slots:
     void showPreviousView();
+    void showNamesViewWithFinder();
     void openGroup(const QModelIndex &index);
     
     void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
@@ -65,12 +65,14 @@
     
     void newGroup();
     void handleNewGroup(HbAction* action);
-    void handleNewGroupMembers();
+    void handleNewGroupMembers( QSet<QContactLocalId> aMembers );
+    void handleCancelGroupMembers();
+    void notifyNewGroup();
     
     void refreshDataModel();
     
     void deleteGroup(QContact group);
-    void handleDeleteGroup(HbAction* action);
+    void handleDeleteGroup(int action);
     
     void deleteGroups();
     void handleDeleteGroups(HbAction* action);
@@ -95,7 +97,6 @@
     HbAction*               mDeleteGroupsAction; // owned by view
     
     QContact*               mHandledContact; // own, needed for asynchronous popups
-    CntFetchContacts*       mFetchView;
     QSet<QContactLocalId>   mSelectedContactsSet;
     
     QActionGroup*           mActionGroup;
--- a/phonebookui/pbkcommonui/inc/cntcontactcardview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcardview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -38,12 +38,13 @@
     Q_OBJECT
     
 public:
-    CntContactCardView();
+    CntContactCardView(bool isTemporary = false);
     ~CntContactCardView();
   
 signals:
     void backPressed();  
     void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs);
+    void addToContacts();
     
 public: // From CntAbstractView
     void activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs);
--- a/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h	Wed Aug 18 09:39:00 2010 +0300
@@ -79,8 +79,11 @@
     Q_DECLARE_PUBLIC(CntContactCardView)
 
 public:
-    CntContactCardViewPrivate();
-    virtual ~CntContactCardViewPrivate();    
+    CntContactCardViewPrivate(bool isTemporary);
+    virtual ~CntContactCardViewPrivate();
+    
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
 
 public slots:
     void onItemActivated();
@@ -91,14 +94,14 @@
     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
     void drawMenu(const QPointF &aCoords);
     void sendToHs();
+    void onAddedToContacts();
     void mapTileStatusReceived(int contactid, int addressType, int status);
-    void keyPressed(QKeyEvent *event);
 
 private slots:
     void sendBusinessCard();
     void addToGroup();
     void deleteContact();
-    void handleDeleteContact(HbAction *action);
+    void handleDeleteContact(int action);
     void setAsFavorite();
     void removeFromFavorite();
     void actionExecuted(CntActionLauncher* aAction);
@@ -106,11 +109,13 @@
     void showPreviousView();
     void doChangeImage();
     void doRemoveImage();
+    void showRootView();
     
     void handleMenuAction(HbAction* aAction);
     void handleSendBusinessCard( HbAction* aAction );
     void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction);
     void sendKeyCancelSlot();
+    void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds);
     
 #ifdef PBK_UNIT_TEST
 public slots:
@@ -123,7 +128,9 @@
 	void setMaptileLabel( HbLabel*& mapLabel, const HbIcon& icon );
 	void updateMaptileImage();
 	HbLabel* loadMaptileLabel( int addressType );
-    
+	
+	// Presence related function
+	void updateItemPresence(const QString& accountUri, bool online);
 	    
 public:
     CntContactCardView* q_ptr;    
@@ -136,7 +143,7 @@
     void preferredUpdated();
     void backPressed();
     void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs);
-
+    void addToContacts();
     
 #ifdef PBK_UNIT_TEST
 public:
@@ -147,7 +154,7 @@
     void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction, CntContactCardDetailItem* aItem);
     void executeDynamicAction(QContact& aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor);
     
-    void sendKeyPressed();
+    bool sendKeyPressed();
 #ifdef PBK_UNIT_TEST
 public:
 #else
@@ -166,12 +173,14 @@
     QContactAvatar              *mAvatar;
     bool                        mIsHandlingMenu;
     QMap<QString, CntContactCardDetailItem*> mPreferredItems;
+    /// maps a QContactOnlineAccount (for example "sip:sip@sip.com") to a detail item
+    QMap<QString, CntContactCardDetailItem*> mPresenceItems;
     int                         mFavoriteGroupId;
     CntDocumentLoader           *mLoader;
     QContactAction              *mContactAction;
     HbAction                    *mBackKey;
     CntImageLabel               *mImageLabel;
-	XQServiceRequest            *mHighwayService;
+    XQServiceRequest            *mHighwayService;
     HbIcon                      *mVCardIcon;
     CntViewParameters           mArgs;
     ShareUi                     *mShareUi;
@@ -183,6 +192,8 @@
     QTimer                      *mProgressTimer;
     QList <CntContactCardMapTileDetail*> mAddressList;
     QMap <int, HbLabel*>        mMaptileLabelList;
+    bool                        mIsTemporary;
+    bool                        mIsExecutingAction;
 };
 
 #endif // CNTCOMMLAUNCHERVIEW_H
--- a/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h	Wed Aug 18 09:39:00 2010 +0300
@@ -47,8 +47,11 @@
     
 public: // From CntAbstractViewManager
     void changeView( const CntViewParameters aArgs );
-    void back( const CntViewParameters aArgs );
+    void back( const CntViewParameters aArgs, bool toRoot = false );
     QContactManager* contactManager( const QString& aType );
+
+public:
+    int currentViewId();
     
 private slots:
     void removeCurrentView();
--- a/phonebookui/pbkcommonui/inc/cntdetailconst.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdetailconst.h	Wed Aug 18 09:39:00 2010 +0300
@@ -52,6 +52,8 @@
 const int CNT_SPOUSE_MAXLENGTH = 50;
 const int CNT_CHILDREN_MAXLENGTH = 250;
 
+const int CNT_GROUPNAME_MAXLENGTH = 50;
+
 const QDate CNT_DATEPICKER_FROM(1900,0,0);
 const QDate CNT_DATEPICKER_TO(2050,0,0);
 
--- a/phonebookui/pbkcommonui/inc/cntdetaileditor.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdetaileditor.h	Wed Aug 18 09:39:00 2010 +0300
@@ -31,6 +31,7 @@
 class HbView;
 class HbAction;
 class CntEditorFactory;
+class CntSaveManager;
 
 class CntDetailEditor : public QObject,
                         public CntAbstractView
@@ -47,6 +48,10 @@
     void insertField();
     void handleItemShown(const QModelIndex& aIndex );
     
+    void saveContact();
+    void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds);
+    void showRootView();
+    
 public:
     void setViewId( int aId );
     void setHeader( QString aHeader );
@@ -79,6 +84,7 @@
     HbAction                       *mSoftkey;
     HbAction                       *mCancel;
     CntViewParameters               mArgs;
+    CntSaveManager                 *mSaveManager; // own
     
     friend class TestCntDetailEditor;
     };
--- a/phonebookui/pbkcommonui/inc/cntdetailpopup.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdetailpopup.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,46 +19,29 @@
 #define CNTDETAILPOPUP_H
 
 #include <QObject>
-#include <hbdialog.h>
+#include <hbselectiondialog.h>
 #include <cntviewparams.h>
 
 class QStandardItemModel;
-class HbListView;
 
 typedef QList<int> CntViewIdList;
 
-class CntDetailPopup : public HbDialog
+class CntDetailPopup : public HbSelectionDialog
 {
+    friend class TestCntDetailPopup;
     Q_OBJECT
+    
 public:
     static void selectDetail( CntViewIdList aList, QObject *receiver = 0, const char *member = 0 );
-    int selectedDetail();
 
-#ifdef PBK_UNIT_TEST
-public slots:
-#else
-private slots:
-#endif
-    void listItemSelected(QModelIndex index);
-
-#ifdef PBK_UNIT_TEST
-public:
-#else
 private:
-#endif
     CntDetailPopup(QGraphicsItem *parent,  CntViewIdList aList );
     ~CntDetailPopup();
 
     void addListItem(QString aIcon, QString label, int aId);
 
-#ifdef PBK_UNIT_TEST
-public:
-#else
 private:
-#endif
     QStandardItemModel  *mListModel;
-    HbListView          *mListView;
-    int                  mSelectedDetail;
     CntViewIdList        mViewIdList;
 };
 
--- a/phonebookui/pbkcommonui/inc/cnteditview_p.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnteditview_p.h	Wed Aug 18 09:39:00 2010 +0300
@@ -43,6 +43,7 @@
 class QAction;
 class HbMenu;
 class XQAiwRequest;
+class CntSaveManager;
 
 QTM_BEGIN_NAMESPACE
 class QContact;
@@ -76,9 +77,10 @@
     void addDetailItem();
     void handleAddDetailItem(HbAction *aAction);
     void deleteContact();
-    void handleDeleteContact(HbAction *action);
+    void handleDeleteContact(int action);
     void discardChanges();
     void saveChanges();
+    void showRootView();
     
     void openNameEditor();
     void openImageEditor();
@@ -88,8 +90,8 @@
     void setScrollPosition();
     void ringToneFetchHandleError(int errorCode, const QString& errorMessage);
     void ringToneFetchHandleOk(const QVariant &result);
+    void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds);
 
-    
 private:
     void loadAvatar();
     HbMenu* createPopup( const QModelIndex aIndex, CntEditViewItem* aDetail );
@@ -97,7 +99,6 @@
     void editDetail( CntEditViewItem* aDetail );
     void removeDetail( CntEditViewItem* aDetail, const QModelIndex& aIndex );
     void setSelectedContact( QContact aContact );
-    void setPreferredDetails( QContact* aContact );
     void fetchTone();
     void changeEditorView();
     
@@ -128,6 +129,7 @@
     XQAiwRequest* mReq;
     XQApplicationManager mAppMgr;
     HbMenu *mMenu;
+    CntSaveManager* mSaveManager; // own
 
 };
 #endif /* CNTEDITVIEW_P_H_ */
--- a/phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnteditviewheadingitem.h	Wed Aug 18 09:39:00 2010 +0300
@@ -76,6 +76,7 @@
     HbTextItem              *mLabel;
     HbTextItem              *mSecondLabel;
     HbFrameItem             *mFrameItem;
+    HbFrameItem             *mFocusItem;
     HbTouchArea             *mIconTouchArea;
 
     bool                     mIconFocused;
--- a/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -44,7 +44,7 @@
     void deactivate();
     bool isDefault() const { return false; }
     HbView* view() const { return mView; }
-    int viewId() const { return FavoritesMemberView; }
+    int viewId() const { return favoritesMemberView; }
     void createModel();
     
 public:
@@ -58,7 +58,7 @@
 #endif
 
     void manageFavorites();
-    void handleManageFavorites();
+    void handleManageFavorites(QSet<QContactLocalId> aIds);
     
     void onLongPressed (HbAbstractViewItem *item, const QPointF &coords);
     void handleMenu(HbAction* action);
--- a/phonebookui/pbkcommonui/inc/cntfavoritesview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntfavoritesview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -21,10 +21,10 @@
 #include <QObject>
 #include <hbdocumentloader.h>
 #include <cntabstractview.h>
+#include <QSet>
 
 class HbAction;
 class HbView;
-class CntFetchContacts;
 
 QTM_BEGIN_NAMESPACE
 class QContact;
@@ -52,7 +52,7 @@
 private slots:
     void showPreviousView();
     void openSelectionPopup();
-    void handleMemberSelection();
+    void handleMemberSelection( QSet<QContactLocalId> aIds );
     void setOrientation(Qt::Orientation orientation);
 
 private:
@@ -68,7 +68,6 @@
     HbAction* mSoftkey;
     CntAbstractViewManager* mViewManager;
     HbDocumentLoader mDocumentLoader;
-    CntFetchContacts* mFetchView;
 };
 
 #endif // CNTFAVORITESVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#ifndef CNTFETCHCONTACTPOPUP_H_
+#define CNTFETCHCONTACTPOPUP_H_
+
+#include <qtcontacts.h>
+#include <hbabstractitemview.h>
+#include <QSet>
+
+class HbDialog;
+class HbListView;
+class HbTextItem;
+class HbLabel;
+class HbAction;
+class HbSearchPanel;
+class HbStaticVkbHost;
+
+class QGraphicsLinearLayout;
+class QItemSelectionModel;
+
+class CntListModel;
+class CntFetchMarkAll;
+class CntDocumentLoader;
+
+QTM_BEGIN_NAMESPACE
+class QContactManager;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+/*!
+  CntFetchContactPopup is simple to use popup for fetching (selecting) number
+  of contacts.
+  
+  \code
+  \endcode
+  
+  Note that by default, CntFetchContactPopup deletes itself when closing the popup.
+*/
+class CntFetchContactPopup : public QObject
+{
+    Q_OBJECT
+    
+public:
+    ~CntFetchContactPopup();
+    
+    static CntFetchContactPopup* createMultiSelectionPopup(  QString aTitle, QString aAction, QContactManager& aContactMgr );
+    static CntFetchContactPopup* createSingleSelectionPopup( QString aTitle, QContactManager& aContactMgr );
+
+    void setSelectedContacts( QSet<QContactLocalId> aIds );
+    void showPopup();
+    
+signals:
+    void fetchReady( QSet<QContactLocalId> aIds );
+    void fetchCancelled();
+
+private slots:
+    void setFilter( const QString& aFilter );
+    void contactSelected( const QModelIndex& aIndex );
+    void contactsSelected( const QItemSelection & selected, const QItemSelection & deselected );
+    void selectAll( int aState );
+    void dialogDismissed( HbAction* aAction );
+    void loadLayout( Qt::Orientation aOrientation );
+    void handleKeypadOpen();
+    void handleKeypadClosed();
+    void closePopup();
+    
+private:
+    CntFetchContactPopup( QContactManager& aManager );
+    void constructPopupDialog( QString aTitle, QString aAction, HbAbstractItemView::SelectionMode aMode );
+    
+private:
+    QContactManager& mManager;
+    QList<QContactLocalId> mIdList;
+    
+    HbDialog* mPopup; // own
+    HbListView* mListView; // own
+    HbTextItem* mEmptyView; // own
+    HbLabel* mHeading; // own
+    HbAction* mPrimaryAction; // own
+    HbSearchPanel* mSearch; //own
+    CntListModel* mModel; // own
+    HbStaticVkbHost* mVirtualKeyboard; // own
+    CntFetchMarkAll* mMarkAll; // own
+    QItemSelectionModel* mSelectionModel; // own
+    CntDocumentLoader* mDoc; // own
+    QString mTitle;
+};
+
+#endif /* CNTFETCHCONTACTPOPUP_H_ */
--- a/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CntFetchContacts_H_
-#define CntFetchContacts_H_
-
-#include <hbabstractitemview.h>
-#include <hbwidget.h>
-#include <hbtextitem.h>
-#include <cntviewparams.h>
-#include <QSet>
-
-class HbDialog;
-class HbSearchPanel;
-class HbAction;
-class HbListView;
-class HbLabel;
-class HbStaticVkbHost;
-class HbIndexFeedback;
-
-class CntListModel;
-class QGraphicsLinearLayout;
-
-QTM_BEGIN_NAMESPACE
-class QContact;
-QTM_END_NAMESPACE
-
-QTM_USE_NAMESPACE
-
-class CntFetchContacts : public QObject
-    {
-    Q_OBJECT
-
-public:
-    CntFetchContacts(QContactManager &aManager);
-    ~CntFetchContacts();
-    
-private slots:
-    void memberSelectionChanged(const QModelIndex &index);
-    
-    void setFilter(const QString &filterString);
-    
-    void handleKeypadOpen();
-    void handleKeypadClose();
-    
-    void handleUserResponse(HbAction* action);
-    
-public:
-    void displayContacts(HbAbstractItemView::SelectionMode aMode,
-                                     QSet<QContactLocalId> aContacts);
-    
-    QSet<QContactLocalId> getSelectedContacts() const;
-    bool wasCanceled() const;
-    void setDetails(QString aTitle, QString aButtonText);
-
-private:
-    void doInitialize(HbAbstractItemView::SelectionMode aMode,
-                                  QSet<QContactLocalId> aContacts);
-    void showPopup();
-    void markMembersInView();
-    
-signals:
-    void clicked();
-    
-private:
-    HbDialog*                          mPopup;
-    HbSearchPanel*                     mSearchPanel;
-    CntListModel*                      mCntModel;
-    HbListView*                        mListView;
-    QGraphicsLinearLayout*             mLayout;
-    HbTextItem*                        mEmptyListLabel;
-    HbWidget*                          mContainerWidget;
-    HbAbstractItemView::SelectionMode  mSelectionMode;
-    QSet<QContactLocalId>              mCurrentlySelected;
-    QContactManager*                   mManager;
-    bool                               mWasCanceled;
-    HbLabel*                           mLabel;
-    HbStaticVkbHost*                   mVirtualKeyboard;
-    QString                            mButtonText;
-    HbAction*                          mPrimaryAction;
-    HbAction*                          mSecondaryAction;
-    HbIndexFeedback*                   mIndexFeedback;
-    
-    friend class TestCntFetchUtility;
-    friend class TestCntMyCardView;
-    };
-
-#endif /* CntFetchContacts_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntfetchmarkall.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CNTFETCHSELECTIONITEM_H
+#define CNTFETCHSELECTIONITEM_H
+
+#include <QObject>
+#include <hbwidget.h>
+
+class HbCheckBox;
+class HbTextItem;
+class HbFrameItem;
+
+class CntFetchMarkAll : public HbWidget
+{
+    Q_OBJECT
+    
+public:
+    CntFetchMarkAll(QGraphicsItem *aParent = 0);
+    ~CntFetchMarkAll();
+
+    void setMaxContactCount( int aContactCount );
+    void setSelectedContactCount( int aSelectedCount );
+    
+signals:
+    void markAll(int aState);
+    
+private:    
+    friend class TestCntFetchSelectionItems;
+    
+    HbCheckBox* mCheckBox; // not own
+    HbTextItem* mCounterLabel; // not own
+    HbFrameItem* mFrame;
+    
+    int mContactCount;
+    int mSelectionCount;
+};
+
+#endif // CNTFETCHSELECTIONITEM_H
--- a/phonebookui/pbkcommonui/inc/cntgroupactionsview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupactionsview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -30,10 +30,12 @@
 class HbAbstractViewItem;
 class QModelIndex;
 class QStandardItemModel;
+class CntActionLauncher;
 
 
 QTM_BEGIN_NAMESPACE
 class QContact;
+class QContactAction;
 QTM_END_NAMESPACE
 
 QTM_USE_NAMESPACE
@@ -49,6 +51,9 @@
     HbView* view() const { return mView; }
     int viewId() const { return groupActionsView; }
     
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
+    
 public:
     CntGroupActionsView();
     ~CntGroupActionsView();
@@ -61,13 +66,19 @@
     
     void showPreviousView();
     void editGroup();
+    void listItemSelected(const QModelIndex &index);
+    void executeAction(QContact&, QContactDetail, QString);
+    void actionExecuted(CntActionLauncher* aAction);
+    void actionCancelled();
+    void executeConferenceCallAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction);
 
 #ifdef PBK_UNIT_TEST
 public:
 #else
 private:
 #endif      
-    void populatelist(QString label,HbIcon icon, QString secondaryText);
+    void populatelist(QString label,HbIcon icon, QString secondaryText, QString action);
+    bool sendKeyPressed();
    
 #ifdef PBK_UNIT_TEST
 public:
@@ -84,7 +95,10 @@
 
     HbAction*                   mSoftkey; // owned by view
     HbListView*                 mListView; // owned by layout
-
+    int                         mPopupCount;
+    QStringList                 mEmailActionParams;
+    QVariantMap                 mMessageActionParams;
+    bool                        mIsExecutingAction;
 };
 
 #endif // CNTGROUPACTIONSVIEW_H
--- a/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h	Wed Aug 18 09:39:00 2010 +0300
@@ -35,6 +35,7 @@
 class CntGroupDeletePopup : public HbSelectionDialog
 {
     Q_OBJECT
+    friend class TestCntGroupDeletePopup;
 
 public:
     CntGroupDeletePopup(QContactManager *manager, QGraphicsItem *parent = 0);
@@ -43,12 +44,7 @@
     void populateListOfGroup();
     QList<QContactLocalId> deleteGroup() const;
 
-#ifdef PBK_UNIT_TEST
-public:
-#else
 private:
-#endif
-    HbListView               *mListView;
     QContactManager          *mContactManager;
     CntGroupDeletePopupModel *mModel;  
 };
--- a/phonebookui/pbkcommonui/inc/cntgroupmemberview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,33 +19,14 @@
 #define CNTGROUPMEMBERVIEW_H
 
 #include <QObject>
-#include <QList>
-#include <hbdocumentloader.h>
-
 #include <cntabstractview.h>
+#include "cntglobal.h"
 
-class CntListModel;
-class CntAbstractViewManager;
-class CntContactCardHeadingItem;
-class CntFetchContacts;
+class CntGroupMemberViewPrivate;
 class HbView;
-class HbAction;
-class HbListView;
-class HbAbstractViewItem;
-class ThumbnailManager;
-class QModelIndex;
-class CntImageLabel;
-class HbDocumentLoader;
 
-QTM_BEGIN_NAMESPACE
-class QContact;
-QTM_END_NAMESPACE
-
-QTM_USE_NAMESPACE
-
-class CntGroupMemberView : public QObject, public CntAbstractView
+class QTPBK_EXPORT CntGroupMemberView : public QObject, public CntAbstractView
 {
-    friend class TestCntGroupMemberView;
     Q_OBJECT
 
 public:
@@ -55,62 +36,17 @@
 public: // From CntAbstractView
     void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs );
     void deactivate();
-    bool isDefault() const { return false; }
-    HbView* view() const { return mView; }
-    int viewId() const { return groupMemberView; }
-
-public slots:
-    void setOrientation(Qt::Orientation orientation);
-
-
-private slots:
-    void showPreviousView();
-    void openGroupActions();
-    void manageMembers();
-    void handleManageMembers();
-    void editGroup();
-    void deleteGroup();
-    void handleDeleteGroup(HbAction *action);
-    
-    void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
-    void handleMenu(HbAction* action);
+    bool isDefault() const;
+    HbView* view() const;
+    int viewId() const;
 
-    void showContactView(const QModelIndex &index);
-    void removeFromGroup(const QModelIndex &index);
-    void editContact(const QModelIndex &index);
-    void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
-    void openImageEditor();
-    
-    void drawImageMenu(const QPointF &aCoords);
-    void createModel();
-  
-    void removeImage();
-    
-private:
-    QContactManager* getContactManager();
-    void setRelationship(QSet<QContactLocalId>        &aLocalId,
-                         QList<QContactRelationship>  &aRelationshipList);
-    
+signals:
+    void backPressed();
+        
 private:
-    QContact*                   mGroupContact; // own
-    CntAbstractViewManager*     mViewManager;
-    HbDocumentLoader            mDocumentLoader;
-    HbView*                     mView; // own
-    HbAction*                   mSoftkey; // owned by view
-    CntContactCardHeadingItem*  mHeadingItem; // owned by layout
-    ThumbnailManager*           mThumbnailManager; // own
-    HbAction*                   mManageAction; // owned by view
-    HbAction*                   mDeleteAction; // owned by view
-    HbAction*                   mShowActionsAction; // owned by view
-    HbAction*                   mEditGroupAction; // owned by view
-    CntListModel*               mModel; // own
-    CntImageLabel*              mImageLabel;
-    HbListView*                 mListView; // owned by layout
-    HbDocumentLoader*           mDocument;
-    CntFetchContacts*           mFetchView;
-    QList<QContactLocalId>      mOriginalGroupMembers;
-    QContactAvatar*             mAvatar;
-    CntViewParameters           mArgs;
+    CntGroupMemberViewPrivate* const d_ptr;
+    Q_DECLARE_PRIVATE_D(d_ptr, CntGroupMemberView)
+    Q_DISABLE_COPY(CntGroupMemberView)
 };
 
 #endif // CNTGROUPMEMBERVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview_p.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CNTGROUPMEMBERVIEW_P_H
+#define CNTGROUPMEMBERVIEW_P_H
+
+#include "cntgroupmemberview.h"
+#include "cntglobal.h"
+
+#include <QObject>
+#include <QList>
+#include <hbdocumentloader.h>
+#include <QSet>
+#include <cntabstractview.h>
+
+class CntListModel;
+class CntAbstractViewManager;
+class CntContactCardHeadingItem;
+class HbView;
+class HbAction;
+class HbListView;
+class HbAbstractViewItem;
+class ThumbnailManager;
+class QModelIndex;
+class CntImageLabel;
+class HbDocumentLoader;
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+QTM_END_NAMESPACE
+
+QTM_USE_NAMESPACE
+
+class CntGroupMemberViewPrivate : public QObject
+{
+    Q_OBJECT
+
+public:
+    CntGroupMemberViewPrivate();
+    ~CntGroupMemberViewPrivate();
+    
+    void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs );
+    void deactivate();
+    
+public:
+    CntGroupMemberView* q_ptr;
+    
+private slots:
+    void showPreviousView();
+    void openGroupActions();
+    void manageMembers();
+    void handleManageMembers(QSet<QContactLocalId> aIds);
+    void editGroup();
+    void deleteGroup();
+    void handleDeleteGroup(int action); // Delete action
+    
+    void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); // item owned by HbListView
+    void handleMenu(HbAction* action);
+
+    void showContactView(const QModelIndex &index);
+    void removeFromGroup(const QModelIndex &index);
+    void editContact(const QModelIndex &index);
+    void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
+    void openImageEditor();
+    void setOrientation(Qt::Orientation orientation);
+    
+    void drawImageMenu(const QPointF &aCoords);
+    void createModel();
+  
+    void removeImage();
+    void sendToHs(const QModelIndex &index);
+   
+private:
+    QContactManager* getContactManager();
+    void setRelationship(QSet<QContactLocalId>        &aLocalId,
+                         QList<QContactRelationship>  &aRelationshipList);
+    
+private:
+    Q_DECLARE_PUBLIC(CntGroupMemberView)
+    friend class TestCntGroupMemberView;
+    
+private:
+    QContact*                   mGroupContact; // own
+    CntAbstractViewManager*     mViewManager;
+    HbDocumentLoader            mDocumentLoader;
+    HbView*                     mView; // own
+    HbAction*                   mSoftkey; // owned by view
+    CntContactCardHeadingItem*  mHeadingItem; // owned by layout
+    ThumbnailManager*           mThumbnailManager; // own
+    HbAction*                   mManageAction; // owned by view
+    HbAction*                   mDeleteAction; // owned by view
+    HbAction*                   mShowActionsAction; // owned by view
+    HbAction*                   mEditGroupAction; // owned by view
+    CntListModel*               mModel; // own
+    CntImageLabel*              mImageLabel;
+    HbListView*                 mListView; // owned by layout
+    HbDocumentLoader*           mDocument;
+    QList<QContactLocalId>      mOriginalGroupMembers;
+    QContactAvatar*             mAvatar;
+    CntViewParameters           mArgs;
+};
+
+#endif // CNTGROUPMEMBERVIEW_P_H
+
+// EOF
--- a/phonebookui/pbkcommonui/inc/cnthistoryview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnthistoryview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -20,6 +20,7 @@
 
 #include <QObject>
 #include <cntabstractview.h>
+#include <qcontactid.h>
 
 class HbListView;
 class CntHistoryModel;
@@ -51,10 +52,12 @@
 public slots:
     void updateScrollingPosition();
     void clearHistory();
-    void handleClearHistory(HbAction *action);
+    void handleClearHistory(int action);
     void itemActivated(const QModelIndex &index);
     void showPreviousView();
     void showClearHistoryMenu();
+    void showRootView();
+    void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds);
     
     
     
--- a/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h	Wed Aug 18 09:39:00 2010 +0300
@@ -50,6 +50,7 @@
      * Overriden method to draw the custom item in the list view
      */
     void updateChildItems();
+    bool event(QEvent* e);
     
     bool getIncoming() const { return mIncoming; }
     bool isNewMessage() const { return mNewMessage; }
--- a/phonebookui/pbkcommonui/inc/cntimageeditorview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntimageeditorview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,18 +19,19 @@
 #define CNTIMAGEEDITORVIEW_H
 
 #include <QObject>
-#include <hbdocumentloader.h>
+#include <cntdocumentloader.h>
 #include <xqappmgr.h>
 
 #include <cntabstractview.h>
 
-class HbLabel;
+class CntImageLabel;
 class HbListView;
 class XQAiwRequest;
 class ThumbnailManager;
 class HbAction;
 class QStandardItemModel;
 class QModelIndex;
+class CntSaveManager;
 
 QTM_BEGIN_NAMESPACE
 class QContact;
@@ -75,6 +76,7 @@
     void setOrientation(Qt::Orientation orientation);
     void listViewActivated(const QModelIndex &index);
     void handleError(int errorCode, const QString& errorMessage);
+    void saveContact();
 
 
 #ifdef PBK_UNIT_TEST
@@ -84,7 +86,7 @@
 #endif
     QContact                *mContact; // own
     QContactAvatar          *mAvatar; // own
-    HbLabel                 *mImageLabel; // owned by layout
+    CntImageLabel           *mImageLabel; // owned by layout
     XQAiwRequest            *mRequest; // own
     XQApplicationManager     mAppManager;
     ThumbnailManager        *mThumbnailManager; // own
@@ -92,9 +94,10 @@
     HbAction                *mSoftkey; // owned by view
     HbAction                *mRemoveImage; // own
     CntAbstractViewManager  *mViewManager;
-    HbDocumentLoader         mDocumentLoader;
+    CntDocumentLoader        mDocumentLoader;
     HbListView              *mListView; // owned by layout
     QStandardItemModel      *mModel; // own
+    CntSaveManager          *mSaveManager; // own
     
     CntViewParameters       mArgs;
 };
--- a/phonebookui/pbkcommonui/inc/cntimagelabel.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntimagelabel.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,24 +19,41 @@
 #define CNTIMAGELABEL_H
 
 #include <QObject>
-#include <hblabel.h>
+#include <hbwidget.h>
 
 class QGesture;
+class QPixmap;
+class HbIconItem;
+class HbIcon;
 
-class CntImageLabel : public HbLabel
+class CntImageLabel : public HbWidget
 {
     Q_OBJECT
+    Q_PROPERTY(HbIcon icon READ avatarIcon WRITE setAvatarIcon)
 
 public:
     CntImageLabel(QGraphicsItem *parent = 0);
     ~CntImageLabel();
 
+    void setAvatarIcon(const HbIcon &icon);
+    HbIcon avatarIcon() const;
+    
+    void setIcon(const QPixmap &pixmap);
+    void clear();
+
 protected:
     void gestureEvent(QGestureEvent* event);
+    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
     
 signals:
     void iconClicked();
     void iconLongPressed(const QPointF&);
+    
+private:
+    HbIconItem*  mDefaultAvatar;
+    HbIcon       mIcon;
+    QPixmap      mPixmap;
+    
 };
 
 #endif // CNTEDITVIEWHEADINGITEM_H
--- a/phonebookui/pbkcommonui/inc/cntimportsview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntimportsview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -53,6 +53,7 @@
     void importFetchResultReceivedADN();
     void importFetchResultReceivedSDN();
     void adnCacheStatusReady(CntSimUtility::CacheStatus& cacheStatus, int error);
+    void endKeyPressed();
      
 public:
 CntImportsView();
@@ -117,6 +118,7 @@
     int mSdnStoreEntries;
     bool mSimError;
     bool mWaitingForAdnCache;
+    bool mImportInProgress;
 };
 
 #endif /* CNTIMPORTSVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntkeygrabber.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CNTKEYGRABBER_H
+#define CNTKEYGRABBER_H
+
+#include <QObject>
+
+#include "cntglobal.h"
+
+class HbMainWindow;
+class XQAiwRequest;
+
+class QTPBK_EXPORT CntKeyGrabber : public QObject
+{
+    Q_OBJECT
+    friend class TestCntKeyGrabber;
+
+public:
+    CntKeyGrabber(HbMainWindow *window, QObject *parent = NULL);
+    ~CntKeyGrabber();
+
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
+    
+private:
+    HbMainWindow    *mMainWindow;
+    XQAiwRequest    *mRequest;
+
+};
+
+#endif // CNTKEYGRABBER_H
--- a/phonebookui/pbkcommonui/inc/cntmainwindow.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntmainwindow.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,7 +19,6 @@
 #define CNTMAINWINDOW_H
 
 #include <hbmainwindow.h>
-#include <QKeyEvent>
 
 #include "cntglobal.h"
 #include <cntviewparams.h>
@@ -29,27 +28,15 @@
 class QTPBK_EXPORT CntMainWindow : public HbMainWindow
 {
     Q_OBJECT
+    friend class TestCntMainWindow;
 
 public:
     CntMainWindow(QWidget *parent=0, int defaultView = namesView);
     virtual ~CntMainWindow();
 
-    void keyPressEvent(QKeyEvent *event);
-
-signals:
-
-    void keyPressed(QKeyEvent *event);
-
-public slots:
-
-private slots:
-
-#ifdef PBK_UNIT_TEST
-public:
-#else
-protected:
-#endif
+private:
     CntDefaultViewManager        *mViewManager;
+    int                           mDefaultView;
 
 };
 
--- a/phonebookui/pbkcommonui/inc/cntmycardselectionview.h	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef CNTMYCARDSELECTIONVIEW_H
-#define CNTMYCARDSELECTIONVIEW_H
-
-#include "cntbaseselectionview.h"
-
-class QModelIndex;
-
-class CntMyCardSelectionView : public CntBaseSelectionView
-{
-    Q_OBJECT
-public:
-    CntMyCardSelectionView();
-    ~CntMyCardSelectionView();
-
-public:
-    int viewId() const { return myCardSelectionView; }
-    
-private slots:
-    void onListViewActivated(const QModelIndex& index);
-    
-#ifdef PBK_UNIT_TEST
-public:
-#else
-private:
-#endif
-    void removeFromGroup(const QContact* contact);
-};
-
-#endif /* CNTMYCARDSELECTIONVIEW_H */
--- a/phonebookui/pbkcommonui/inc/cntmycardview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntmycardview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -19,12 +19,11 @@
 #define CNTMYCARDVIEW_H_
 
 #include <QObject>
+#include <QSet>
 #include <hbdocumentloader.h>
-
 #include <cntabstractview.h>
 
 class CntAbstractViewManager;
-class CntFetchContacts;
 class HbView;
 class HbAction;
 
@@ -55,7 +54,7 @@
     void showPreviousView();
     void openNameEditor();
     void openMyCardSelectionView(); 
-    void handleMultiCardSelection();
+    void handleMultiCardSelection(QSet<QContactLocalId> aIds);
     void setOrientation(Qt::Orientation orientation);
 
 private: 
@@ -68,7 +67,6 @@
     HbDocumentLoader          mDocumentLoader;
     HbView*                   mView; // own
     HbAction*                 mSoftkey;
-    CntFetchContacts*         mFetchView;
     
     friend class TestCntMyCardView;
 };
--- a/phonebookui/pbkcommonui/inc/cntnamesview_p.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntnamesview_p.h	Wed Aug 18 09:39:00 2010 +0300
@@ -60,7 +60,7 @@
     void deleteContact( QContact& aContact );
     void deleteMultipleContacts();
     
-    void handleDeleteMultipleContacts();
+    void handleDeleteMultipleContacts( QSet<QContactLocalId> aIds );
 
     void showPreviousView();
     void showCollectionView();
@@ -70,15 +70,18 @@
     void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint);
     void showSettings();
     
-     void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction );
+    void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction );
     void actionExecuted( CntActionLauncher* aAction );
-    void handleDeleteContact( HbAction* aAction );
+    void handleDeleteContact( int aAction );
     void importSim();
     
     void handleContactAddition(const QList<QContactLocalId> & aAddedList);
     void handleContactRemoval(const QList<QContactLocalId> & aRemovedList);
     void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId);
     
+private slots:
+    void switchOrientation();
+    
 public:
     bool isFinderVisible();
     void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs );
@@ -114,7 +117,6 @@
     HbAction*                   mNewContact;
     QContactLocalId             mHandledContactId;
     HbAction*                   mMultipleDeleter;
-    CntFetchContacts*           mFetchView;
     bool                        mIsDefault;
     int                         mId;
     QActionGroup*               mActionGroup;
--- a/phonebookui/pbkcommonui/inc/cntpresencelistener.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntpresencelistener.h	Wed Aug 18 09:39:00 2010 +0300
@@ -31,6 +31,11 @@
 
 QTM_USE_NAMESPACE
 
+/**
+    Presence listener for contact card. It provides aggregated
+    presence information for a contact and separately for each
+    valid QContactOnlineAccount.
+*/
 class CntPresenceListener : public QObject
 {
     friend class TestCntPresenceListener;
@@ -50,7 +55,9 @@
     bool parsePresence(QList<PrcPresenceBuddyInfoQt*> buddyList);
     
 signals:
-    void accountPresenceUpdated(QString accountUri, bool online);
+    /// account-specific presence status
+    void accountPresenceUpdated(const QString& accountUri, bool online);
+    /// aggregated presence status for this contact
     void fullPresenceUpdated(bool online);
     
 private:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntsavemanager.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CNTSAVEMANAGER_H
+#define CNTSAVEMANAGER_H
+
+#include <QObject>
+#include <qtcontacts.h>
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+class QContactAvatar;
+QTM_END_NAMESPACE
+
+QTM_USE_NAMESPACE
+
+/*!
+    Contact saving helper class. Used mainly in edit view for contact saving,
+    but should also be used in other (special) cases a contact needs to be saved.
+    For example "forcing" phonebook to shut down (end key, from task swapper etc..)
+    in detail editors.
+*/
+class CntSaveManager : public QObject
+{
+    friend class TestCntSaveManager;
+    Q_OBJECT
+    
+public:
+    enum CntSaveResult
+    {
+        ESaved = 0,
+        EUpdated,
+        EDeleted,
+        EFailed,
+        ENothingDone
+    };
+    
+    enum CntContactType
+    {
+        EContact = 0,
+        EMyCard,
+        EGroup
+    };
+    
+public:
+    CntSaveManager(CntContactType type = EContact, QObject* parent = NULL);
+    ~CntSaveManager();
+    
+    CntSaveResult saveContact(QContact* aContact, QContactManager* aManager);
+    
+private:
+    void setPreferredDetails(QContact* aContact);
+    
+private:
+    CntContactType   mContactType;
+    
+};
+
+#endif // CNTIMAGEEDITORVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntvcarddetailhandler.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <qversitcontactexporter.h>
+#include <qtcontacts.h>
+#include <qversitproperty.h>
+
+#ifndef CNTVCARDDETAILHANDLER_H
+#define CNTVCARDDETAILHANDLER_H
+
+class CntVCardDetailHandler : public QVersitContactExporterDetailHandlerV2 
+{
+public:
+    inline CntVCardDetailHandler(){}
+    inline void detailProcessed(const QContact& contact,
+                                 const QContactDetail& detail,
+                                 const QSet<QString>& processedFields,
+                                 const QVersitDocument& document,
+                                 QList<QVersitProperty>* toBeRemoved,
+                                 QList<QVersitProperty>* toBeAdded) 
+    {
+        Q_UNUSED(contact)
+        Q_UNUSED(detail)
+        Q_UNUSED(processedFields)
+        Q_UNUSED(document)
+        Q_UNUSED(toBeRemoved)
+        Q_UNUSED(toBeAdded)
+    }
+    
+    inline void contactProcessed(const QContact& contact,
+                                  QVersitDocument* document)
+    {
+        Q_UNUSED(contact)
+        // If there is not a FN or N value use an empty FN value. This ensures
+        // that the vCard created is valid. vCard standard requires a vCard to
+        // have atlease a name (N) of formatted name (FN) field to be valid.
+        bool vCardValid(false);
+        foreach (const QVersitProperty& property, document->properties()) {
+            const QString& name = property.name();
+            if (name == QLatin1String("FN") || name == QLatin1String("N")) {
+                vCardValid = true;
+                break;
+            }
+        }
+        
+        if (!vCardValid) {
+            QVersitProperty fnProperty;
+            fnProperty.setName(QLatin1String("FN"));
+            fnProperty.setValue(QString());
+            document->addProperty(fnProperty);
+        }
+    }
+};
+
+#endif
--- a/phonebookui/pbkcommonui/inc/cntviewnavigator.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntviewnavigator.h	Wed Aug 18 09:39:00 2010 +0300
@@ -50,7 +50,7 @@
     /*!
      * Back view returns the previous view
      */
-    const int& back( QFlags<Hb::ViewSwitchFlag> &flags );
+    const int& back( QFlags<Hb::ViewSwitchFlag> &flags, bool toRoot );
     
     /*!
      * Add exceptions to next/back mechanism. Function will use the aBack argument
@@ -65,10 +65,16 @@
     void addEffect( const int& aCurrent, const int& aBack );
     void removeEffect( const int& aCurrent );
     
+    /*!
+     * Set a view as a root view.
+     */
+    void addRoot( const int& aCurrent );
+    
 private:
     QStack<int> iViewStack;
     QMap< int, int > iExceptions;
     QMap< int, int > iEffects;
+    QList<int> iRoots;
     int iTop;
 };
 #endif /* CNTVIEWNAVIGATOR_H_ */
--- a/phonebookui/pbkcommonui/pbkcommonui.pro	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/pbkcommonui.pro	Wed Aug 18 09:39:00 2010 +0300
@@ -29,6 +29,7 @@
 INCLUDEPATH += ../../inc
 INCLUDEPATH += ../../phonebookengines/cntimageutility/inc
 INCLUDEPATH += ../../phonebookengines/cntsimutility/inc
+INCLUDEPATH += ../phonebookapp/inc
 INCLUDEPATH += ../cnthistorymodel/inc
 
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
@@ -96,9 +97,9 @@
     inc/cnteditviewdetailitem.h \
     inc/cnteditviewheadingitem.h \
     inc/cntstringmapper.h \
-    inc/cntmycardselectionview.h \
     inc/cntmycardview.h \
     inc/cntgroupmemberview.h \
+    inc/cntgroupmemberview_p.h \
     inc/cntgroupactionsview.h \
     inc/cntgroupeditormodel.h \
     inc/cnthistoryview.h \
@@ -128,7 +129,8 @@
     inc/cntgroupdeletepopup.h \
     inc/cntextensionmanager.h \
     inc/cntimagelabel.h \
-    inc/cntfetchcontactsview.h \
+    inc/cntfetchcontactpopup.h \
+    inc/cntfetchmarkall.h \
     inc/cntimportsview.h \
     inc/cntsettingsview.h \
     inc/cntpresencelistener.h \
@@ -137,8 +139,9 @@
     inc/cntcommondetailviewitem.h \
     ../../inc/cntdebug.h \
     inc/cntactionpopup_p.h \
-    inc/cntactionpopup.h
-    
+    inc/cntactionpopup.h \
+    inc/cntsavemanager.h \
+    inc/cntkeygrabber.h
     
     
 SOURCES += \
@@ -174,9 +177,9 @@
     src/cnteditviewdetailitem.cpp \
     src/cnteditviewheadingitem.cpp \
     src/cnteditviewseparator.cpp \
-    src/cntmycardselectionview.cpp \
     src/cntmycardview.cpp \
     src/cntgroupmemberview.cpp\
+    src/cntgroupmemberview_p.cpp\
     src/cntgroupactionsview.cpp \
     src/cntgroupeditormodel.cpp \
     src/cnthistoryview.cpp \
@@ -204,16 +207,37 @@
     src/cntextensionmanager.cpp \
     src/cntimagelabel.cpp \
     src/cntimportsview.cpp \
-    src/cntfetchcontactsview.cpp \
+    src/cntfetchcontactpopup.cpp \
+    src/cntfetchmarkall.cpp \
     src/cntsettingsview.cpp \
     src/cntpresencelistener.cpp \
     src/cntdetailorderinghelper.cpp \
     src/cntsettingsmodel.cpp \
     src/cntcommondetailviewitem.cpp \
     src/cntactionpopup_p.cpp \
-    src/cntactionpopup.cpp
+    src/cntactionpopup.cpp \
+    src/cntsavemanager.cpp \
+    src/cntkeygrabber.cpp
+
+DOCML += resources/contacts_contactcard.docml \
+         resources/contacts_ev.docml \
+         resources/contacts_mc.docml \
+         resources/contacts_if.docml \
+         resources/contacts_list.docml \
+         resources/contacts_namelist.docml \
+         resources/contacts_groupactions.docml \
+         resources/contacts_history.docml \
+         resources/contacts_editor.docml \
+         resources/contacts_sim.docml \
+         resources/contacts_favorite.docml \
+         resources/contacts_favmember.docml \
+         resources/contacts_collections.docml \
+         resources/contacts_groupmembers.docml \
+         resources/contacts_detail_editor.docml \
+         resources/contacts_fetchdialog.docml \
+         resources/contacts_settings.docml
     
-RESOURCES += resources\pbkcommonui.qrc
+RESOURCES += resources/pbkcommonui.qrc
 
 LIBS+= -lhbcore \
        -lxqservice \
--- a/phonebookui/pbkcommonui/resources/contacts_actions.docml	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.8">
-    <object name="cnt:nameslist" type="HbAction">
-      <icon iconName="qtg_mono_contact_all" name="icon"/>
-    </object>
-
-    <object name="cnt:collections" type="HbAction">
-      <icon iconName="qtg_mono_group" name="icon"/>
-    </object>
-    
-    <object name="cnt:addfavorites" type="HbAction">
-      <string name="text" value="Add favorites"/>
-    </object>
-    
-    <object name="cnt:savemycard" type="HbAction">
-      <string name="text" locid="txt_phob_opt_save_my_card"/>
-    </object>
-    
-    <object name="cnt:find" type="HbAction">
-      <icon iconName="qtg_mono_search" name="icon"/>
-    </object>
-    
-    <object name="cnt:newcontact" type="HbAction">
-      <string name="text" locid="txt_phob_opt_new_contact"/>
-    </object>
-    
-    <object name="cnt:import" type="HbAction">
-      <string name="text" locid="txt_phob_opt_import_contacts"/>
-    </object>
-    
-    <object name="cnt:newgroup" type="HbAction">
-      <icon iconName="qtg_mono_add_group" name="icon"/>
-    </object>
-    
-    <object name="cnt:discardchanges" type="HbAction">
-      <string name="text" locid="txt_phob_opt_discard_changes"/>
-    </object>
-
-    <object name="cnt:discardallchanges" type="HbAction">
-      <string name="text" value="Discard all changes"/>
-    </object>
-    
-    <object name="cnt:deletecontact" type="HbAction">
-      <string name="text" locid="txt_phob_opt_delete_contact"/>
-    </object>
-	
-    <object name="cnt:edit" type="HbAction">
-      <icon iconName="qtg_mono_add_field" name="icon"/>
-    </object>
-
-    <object name="cnt:save" type="HbAction">
-      <string name="text" locid="txt_phob_opt_save_contact_card"/>
-    </object>
-    
-    <object name="cnt:cancel" type="HbAction">
-      <string name="text" locid="txt_common_button_cancel"/>
-    </object>
-    
-    <object name="cnt:markall" type="HbAction">
-      <string name="text" locid="txt_phob_subtitle_mark_all"/>
-    </object>
-    
-    <object name="cnt:history" type="HbAction">
-      <icon iconName="qtg_mono_person_history" name="icon"/>
-    </object>
-    
-    <object name="cnt:activitystream" type="HbAction">
-      <icon iconName="qtg_mono_activitystream" name="icon"/>
-    </object>
-    
-    <object name="cnt:ccactivitystream" type="HbAction">
-      <icon iconName="qtg_mono_person_activitystream" name="icon"/>
-    </object>
-
-    <object name="cnt:addfield" type="HbAction">
-      <icon iconName="qtg_mono_plus" name="icon"/>
-      <string name="text" locid="txt_phob_button_add_field"/>
-    </object>
-	
-    <object name="cnt:addtocontacts" type="HbAction">
-      <string name="text" value="Add to Contacts"/>
-    </object>
-
-    <object name="cnt:editgroup" type="HbAction">
-      <icon iconName="qtg_mono_add_field" name="icon"/>
-    </object>
-     
-    <object name="cnt:managecontacts" type="HbAction">
-      <string name="text" locid="txt_phob_subtitle_manage_contacts"/>
-    </object>
-
-    <object name="cnt:addconferencenumber" type="HbAction">
-      <string name="text" value="Add Conference Number"/>
-    </object>
-
-    <object name="cnt:placegrouptohs" type="HbAction">
-      <string name="text" value="Place as a widget in HS"/>
-    </object>
-    
-    <object name="cnt:placecontacttohs" type="HbAction">
-      <string name="text" locid="txt_phob_opt_send_to_homescreen_as_widget"/>
-    </object>
-
-    <object name="cnt:deletegroupmenu" type="HbAction">
-      <string name="text" locid="txt_phob_menu_delete_group"/>
-    </object>
-    
-    <object name="cnt:deletegroup" type="HbAction">
-      <string name="text" locid="txt_phob_opt_delete_group"/>
-    </object>
-
-    <object name="cnt:groupactions" type="HbAction">
-      <icon iconName="qtg_mono_communication" name="icon"/>
-    </object>
-
-    <object name="cnt:groupmembers" type="HbAction">
-      <icon iconName="qtg_mono_details" name="icon"/>
-    </object>
-    
-    <object name="cnt:refresh" type="HbAction">
-      <icon iconName="qtg_mono_refresh" name="icon"/>
-    </object>
-
-    <object name="cnt:markUnmarkAll" type="HbAction">
-      <string name="text" value="Mark all / Unmark all"/>
-    </object>
-
-    <object name="cnt:managemembers" type="HbAction">
-      <icon iconName="qtg_mono_add_field" name="icon"/>
-    </object>
-    
-    <object name="cnt:managemembersmenu" type="HbAction">
-      <string name="text" value="Manage members"/>
-    </object>
-	
-    <object name="cnt:editgroupdetails" type="HbAction">
-      <string name="text" locid="txt_phob_opt_edit_group_details"/>
-    </object>
-    
-    <object name="cnt:editmembers" type="HbAction">
-      <icon iconName="qtg_mono_add_field" name="icon"/>
-    </object>
-    
-    <object name="cnt:reordergroups" type="HbAction">
-      <string name="text" locid="txt_phob_opt_reorder_groups"/>
-    </object>
-    
-    <object name="cnt:deletegroups" type="HbAction">
-      <string name="text" locid="txt_phob_opt_delete_groups"/>
-    </object>
-    
-    <object name="cnt:disconnectall" type="HbAction">
-      <string name="text" locid="txt_phob_opt_disconnect_all"/>
-    </object>
-    
-    <object name="cnt:sendbusinesscard" type="HbAction">
-      <string name="text" value="Send as a business card"/>
-    </object>
-    
-    <object name="cnt:editcontact" type="HbAction">
-      <string name="text" value="Edit"/>
-    </object>
-    
-    <object name="cnt:addtogroup" type="HbAction">
-      <string name="text" value="Add to group"/>
-    </object>
-    
-    <object name="cnt:clearhistory" type="HbAction">
-      <string name="text" locid="txt_phob_opt_clear_history"/>
-    </object>
-        
-    <object name="cnt:setasfavorite" type="HbAction">
-     <string name="text" locid="txt_phob_opt_set_as_favorite"/>
-    </object>    
-    
-    <object name="cnt:removefromfavorite" type="HbAction">
-     <string name="text" locid="txt_phob_menu_remove_from_favorites"/>
-    </object>   
-        
-</hbdocument>
\ No newline at end of file
--- a/phonebookui/pbkcommonui/resources/contacts_contactcard.docml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/contacts_contactcard.docml	Wed Aug 18 09:39:00 2010 +0300
@@ -12,6 +12,9 @@
     <object name="cnt:activityStream" type="HbAction">
         <icon iconName="qtg_mono_person_activitystream" name="icon"/>
     </object>
+    <object name="cnt:addtocontact" type="HbAction">
+        <icon iconName="qtg_mono_add_to_contact" name="icon"/>
+    </object>
     <object name="cnt:sendbusinesscard" type="HbAction">
         <string locid="txt_phob_opt_send_as_a_business_card" name="text"/>
     </object>
@@ -33,10 +36,7 @@
             <widget name="cnt_contactcard_image" type="CntImageLabel">
                 <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
                 <sizehint height="30.5un" type="FIXED" width="30.5un"/>
-                <contentsmargins bottom="2un" left="2un" right="2un" top="2un"/>
                 <bool name="visible" value="FALSE"/>
-                <string name="alignment" value="AlignCenter"/>
-                <string name="aspectRatioMode" value="KeepAspectRatio"/>
                 <icon iconName="qtg_large_add_contact_picture" name="icon"/>
             </widget>
             <widget name="scrollArea" type="HbScrollArea">
@@ -94,9 +94,9 @@
                 <bool name="visible" value="TRUE"/>
             </widget>
             <layout type="anchor">
-                <anchoritem dst="" dstEdge="LEFT" spacing="0un" src="cnt_contactcard_image" srcEdge="LEFT"/>
-                <anchoritem dst="" dstEdge="TOP" spacing="0un" src="cnt_contactcard_image" srcEdge="TOP"/>
-                <anchoritem dst="cnt_contactcard_heading" dstEdge="LEFT" spacing="0un" src="cnt_contactcard_image" srcEdge="RIGHT"/>
+                <anchoritem dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" src="cnt_contactcard_image" srcEdge="LEFT"/>
+                <anchoritem dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)" src="cnt_contactcard_image" srcEdge="TOP"/>
+                <anchoritem dst="cnt_contactcard_heading" dstEdge="LEFT" spacing="var(hb-param-margin-gene-right)" src="cnt_contactcard_image" srcEdge="RIGHT"/>
                 <anchoritem dst="" dstEdge="TOP" spacing="0un" src="cnt_contactcard_heading" srcEdge="TOP"/>
                 <anchoritem dst="scrollArea" dstEdge="TOP" spacing="0un" src="cnt_contactcard_heading" srcEdge="BOTTOM"/>
                 <anchoritem dst="" dstEdge="RIGHT" spacing="0un" src="cnt_contactcard_heading" srcEdge="RIGHT"/>
--- a/phonebookui/pbkcommonui/resources/contacts_ev.docml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/contacts_ev.docml	Wed Aug 18 09:39:00 2010 +0300
@@ -34,9 +34,6 @@
            
             <widget name="editViewImage" type="CntImageLabel">
                 <bool name="visible" value="FALSE"/>
-                <contentsmargins bottom="2.0un" left="2.0un" right="2.0un" top="2.0un"/>
-                <string name="alignment" value="AlignCenter"/>
-                <string name="aspectRatioMode" value="KeepAspectRatio"/>
                 <sizehint height="30.5un" type="FIXED" width="30.5un"/>
                 <icon iconName="qtg_large_add_contact_picture" name="icon"/>
                 <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
@@ -72,9 +69,9 @@
             	<anchoritem src="groupBox" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
             	<anchoritem src="groupBox" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
             	<anchoritem src="groupBox" srcEdge="TOP" spacing="0.0un" dst="" dstEdge="TOP"/>
-                <anchoritem src="editViewImage" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
-                <anchoritem src="editViewImage" srcEdge="TOP" spacing="0.0un" dst="groupBox" dstEdge="BOTTOM"/>
-                <anchoritem src="editViewImage" srcEdge="RIGHT" spacing="0.0un" dst="editViewHeading" dstEdge="LEFT"/>
+                <anchoritem src="editViewImage" srcEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" dst="" dstEdge="LEFT"/>
+                <anchoritem src="editViewImage" srcEdge="TOP" spacing="-var(hb-param-margin-gene-top)" dst="groupBox" dstEdge="BOTTOM"/>
+                <anchoritem src="editViewImage" srcEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" dst="editViewHeading" dstEdge="LEFT"/>
                 <anchoritem src="editViewHeading" srcEdge="TOP" spacing="0.0un" dst="groupBox" dstEdge="BOTTOM"/>
                 <anchoritem src="editViewHeading" srcEdge="BOTTOM" spacing="0.0un" dst="listView" dstEdge="TOP"/>
                 <anchoritem src="editViewHeading" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_fetchdialog.docml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="dialog" type="HbDialog">
+        <widget name="heading" role="HbDialog:headingWidget" type="HbLabel">
+            <string locid="txt_phob_title_contacts" name="plainText"/>
+        </widget>
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+        	<widget name="markAll" type="CntFetchMarkAll">
+        		<bool name="visible" value="TRUE"/>
+        	</widget>
+            <widget name="emptyLabel" type="HbLabel">
+                <fontspec name="fontSpec" role="Primary"/>
+                <string name="alignment" value="AlignCenter"/>
+                <string locid="txt_phob_info_no_matching_contacts" name="plainText"/>
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="listView" type="HbListView">
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="visible" value="FALSE"/>
+            </widget>			
+        </widget>        
+        <enums name="dismissPolicy" value="NoDismiss"/>
+        <bool name="modal" value="TRUE"/>
+    </widget>
+
+    <section name="find_list">
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+			<widget name="markAll" type="CntFetchMarkAll">
+				<bool name="visible" value="TRUE"/>
+			</widget>
+            <widget name="emptyLabel" type="HbLabel">
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="listView" type="HbListView">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="markAll"/>
+                <linearitem itemname="listView"/>
+                <linearitem itemname="searchPanel"/>
+            </layout>
+            <sizehint height="expr(var(hb-param-screen-long-edge) -2*var(hb-param-margin-gene-screen) )" type="PREFERRED" width="expr(var(hb-param-screen-short-edge) - 2*var(hb-param-margin-gene-screen) )"/>
+            <!-- 
+            <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+            
+            <sizehint height="expr(var(hb-param-screen-height) -2*var(hb-param-margin-gene-screen) )" type="PREFERRED" width="expr(var(hb-param-screen-width) - 2*var(hb-param-margin-gene-screen) )"/>
+            <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/> -->
+        </widget>
+    </section>
+	
+	<section name="find_list_single">
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+		    <widget name="emptyLabel" type="HbLabel">
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="listView" type="HbListView">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="listView"/>
+                <linearitem itemname="searchPanel"/>
+            </layout>
+            
+		<sizehint height="expr(var(hb-param-screen-long-edge) -2*var(hb-param-margin-gene-screen) )" type="PREFERRED" width="expr(var(hb-param-screen-short-edge) - 2*var(hb-param-margin-gene-screen) )"/>
+        </widget>
+    </section>
+	
+	<section name="find_list_landscape">
+		<widget name="dialog" type="HbDialog">
+            <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+				<widget name="markAll" type="CntFetchMarkAll">
+					<bool name="visible" value="FALSE"/>
+				</widget>
+				<widget name="emptyLabel" type="HbLabel">
+					<bool name="visible" value="FALSE"/>
+				</widget>
+				<widget name="listView" type="HbListView">
+					<bool name="visible" value="TRUE"/>
+				</widget>
+				<widget name="searchPanel" type="HbSearchPanel">
+					<bool name="visible" value="TRUE"/>
+				</widget>
+				<layout orientation="Vertical" spacing="0un" type="linear">
+					<contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+					<linearitem itemname="listView"/>
+					<linearitem itemname="searchPanel"/>
+				</layout>
+			</widget>
+			<sizehint height="expr(var(hb-param-screen-short-edge) - 2* var(hb-param-margin-gene-screen))" type="PREFERRED" width="expr(var(hb-param-screen-long-edge) - 2* var(hb-param-margin-gene-screen))"/>
+			<!-- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/> -->
+		</widget>
+    </section>
+
+    <section name="find_empty">
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+			<widget name="markAll" type="CntFetchMarkAll">
+				<bool name="visible" value="TRUE"/>
+			</widget>
+            <widget name="emptyLabel" type="HbLabel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <widget name="listView" type="HbListView">
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="markAll"/>
+                <linearitem itemname="emptyLabel"/>
+                <linearitem itemname="searchPanel"/>
+            </layout>
+            <sizehint height="expr(var(hb-param-screen-short-edge) - 2* var(hb-param-margin-gene-screen))" type="PREFERRED" width="expr(var(hb-param-screen-long-edge) - 2* var(hb-param-margin-gene-screen))"/>
+        </widget>
+    </section>
+
+	<section name="find_empty_single">
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+            <widget name="emptyLabel" type="HbLabel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <widget name="listView" type="HbListView">
+                <bool name="visible" value="FALSE"/>
+            </widget>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="emptyLabel"/>
+                <linearitem itemname="searchPanel"/>
+            </layout>
+            <sizehint height="expr(var(hb-param-screen-short-edge) - 2* var(hb-param-margin-gene-screen))" type="PREFERRED" width="expr(var(hb-param-screen-long-edge) - 2* var(hb-param-margin-gene-screen))"/>
+        </widget>
+    </section>
+	
+	<section name="find_empty_landscape">
+		<widget name="dialog" type="HbDialog">
+            <sizehint height="expr(var(hb-param-screen-short-edge) - 2* var(hb-param-margin-gene-screen))" type="PREFERRED" width="expr(var(hb-param-screen-long-edge) - 2* var(hb-param-margin-gene-screen))"/>
+
+			<widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+				<widget name="markAll" type="CntFetchMarkAll">
+					<bool name="visible" value="FALSE"/>
+				</widget>
+				<widget name="emptyLabel" type="HbLabel">
+					<bool name="visible" value="TRUE"/>
+				</widget>
+				<widget name="listView" type="HbListView">
+					<bool name="visible" value="FALSE"/>
+				</widget>
+				<widget name="searchPanel" type="HbSearchPanel">
+					<bool name="visible" value="TRUE"/>
+				</widget>
+				<layout orientation="Vertical" spacing="0un" type="linear">
+					<contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+					<linearitem itemname="emptyLabel"/>
+					<linearitem itemname="searchPanel"/>
+				</layout>
+			</widget>
+		</widget>
+    </section>
+	
+    <section name="size_section">
+        <widget name="dialog" type="HbDialog">
+            <sizehint height="expr(var(hb-param-screen-height) - 2* var(hb-param-margin-gene-screen))" type="PREFERRED" width="expr(var(hb-param-screen-width) - 2* var(hb-param-margin-gene-screen))"/>
+	    </widget>
+    </section>
+	
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="find_list" sections="#common find_list"/>
+        <uistate name="find_empty" sections="#common find_empty"/>
+        <uistate name="size_section" sections="#common size_section"/>
+    </metadata>
+</hbdocument>
--- a/phonebookui/pbkcommonui/resources/contacts_groupmembers.docml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/contacts_groupmembers.docml	Wed Aug 18 09:39:00 2010 +0300
@@ -30,7 +30,7 @@
                 <string name="alignment" value="AlignCenter"/>
                 <string name="aspectRatioMode" value="KeepAspectRatio"/>
                 <sizehint height="30.5un" type="FIXED" width="30.5un"/>
-                <icon iconName="qtg_large_add_contact_picture" name="icon"/>
+                <icon iconName="qtg_large_add_group_picture" name="icon"/>
                 <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
             </widget>
             
--- a/phonebookui/pbkcommonui/resources/contacts_if.docml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/contacts_if.docml	Wed Aug 18 09:39:00 2010 +0300
@@ -1,41 +1,38 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
+<hbdocument version="1.1">
     <object name="cnt:removeimage" type="HbAction">
         <string locid="txt_phob_menu_remove_image" name="text"/>
     </object>
     <widget name="view" type="HbView">
         <widget name="content" role="HbView:widget" type="HbWidget">
             <widget name="cnt_groupBox" type="HbGroupBox">
-                <string name="heading" locid="txt_phob_subtitle_change_image"/>
                 <bool name="collapsable" value="FALSE"/>
+                <string locid="txt_phob_subtitle_change_image" name="heading"/>
             </widget>
-            <widget name="cnt_image_label" type="HbLabel">
-                <contentsmargins bottom="2.0un" left="2.0un" right="2.0un" top="2.0un"/>
-                <string name="alignment" value="AlignCenter"/>
-                <string name="aspectRatioMode" value="KeepAspectRatio"/>
+            <widget name="cnt_image_label" type="CntImageLabel">
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
                 <sizehint height="30.5un" type="FIXED" width="30.5un"/>
                 <icon iconName="qtg_large_add_contact_picture" name="icon"/>
-                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
             </widget>
             <widget name="cnt_listview" type="HbListView">
-                <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+                <enums name="scrollingStyle" value="PanWithFollowOn"/>
                 <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
-                <string name="scrollingStyle" value="PanWithFollowOn"/>
-                <string name="clampingStyle" value="BounceBackClamping"/>
+                <sizehint height="1un" type="PREFERRED" width="1un"/>
+                <enums name="clampingStyle" value="BounceBackClamping"/>
             </widget>
         </widget>
         <widget name="viewMenu" role="HbView:menu" type="HbMenu">
-            <ref object="cnt:removeimage" role="HbMenu:addAction"/>
+            <ref object="cnt:removeimage" role="HbWidget:addAction"/>
         </widget>
         <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
     </widget>
     <section name="portrait">
         <widget name="content" role="HbView:widget" type="HbWidget">
-            <layout orientation="Vertical" type="linear" spacing="0.0un">
-                <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
-                <linearitem itemname="cnt_groupBox" />
-                <linearitem itemname="cnt_image_label" alignment="AlignCenter"/>
-                <linearitem itemname="cnt_listview" />
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="cnt_groupBox" spacing="2un"/>
+                <linearitem itemname="cnt_image_label" spacing="2un" alignment="AlignCenter"/>
+                <linearitem itemname="cnt_listview"/>
             </layout>
         </widget>
     </section>
@@ -45,9 +42,9 @@
                 <anchoritem src="cnt_groupBox" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
                 <anchoritem src="cnt_groupBox" srcEdge="TOP" spacing="0.0un" dst="" dstEdge="TOP"/>
                 <anchoritem src="cnt_groupBox" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
-                <anchoritem src="cnt_image_label" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
-                <anchoritem src="cnt_image_label" srcEdge="TOP" spacing="0.0un" dst="cnt_groupBox" dstEdge="BOTTOM"/>
-                <anchoritem src="cnt_image_label" srcEdge="RIGHT" spacing="0.0un" dst="cnt_listview" dstEdge="LEFT"/>
+                <anchoritem src="cnt_image_label" srcEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" dst="" dstEdge="LEFT"/>
+                <anchoritem src="cnt_image_label" srcEdge="TOP" spacing="-var(hb-param-margin-gene-top)" dst="cnt_groupBox" dstEdge="BOTTOM"/>
+                <anchoritem src="cnt_image_label" srcEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" dst="cnt_listview" dstEdge="LEFT"/>
                 <anchoritem src="cnt_listview" srcEdge="TOP" spacing="0.0un" dst="cnt_groupBox" dstEdge="BOTTOM"/>
                 <anchoritem src="cnt_listview" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
                 <anchoritem src="cnt_listview" srcEdge="BOTTOM" spacing="0.0un" dst="" dstEdge="BOTTOM"/>
--- a/phonebookui/pbkcommonui/resources/pbkcommonui.qrc	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/pbkcommonui.qrc	Wed Aug 18 09:39:00 2010 +0300
@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <RCC>
     <qresource prefix="/xml" >
-        <file alias="contacts_actions.docml" >contacts_actions.docml</file>
-        <file alias="contacts_contactcard.docml" >contacts_contactcard.docml</file>
-        <file alias="contacts_ev.docml" >contacts_ev.docml</file>
-        <file alias="contacts_mc.docml" >contacts_mc.docml</file>
-        <file alias="contacts_if.docml" >contacts_if.docml</file>
-        <file alias="contacts_list.docml" >contacts_list.docml</file>
-        <file alias="contacts_namelist.docml" >contacts_namelist.docml</file>
-        <file alias="contacts_groupactions.docml" >contacts_groupactions.docml</file>
-        <file alias="contacts_history.docml" >contacts_history.docml</file>
-        <file alias="contacts_editor.docml" >contacts_editor.docml</file>
-        <file alias="contacts_sim.docml">contacts_sim.docml</file>
-        <file alias="contacts_favorite.docml" >contacts_favorite.docml</file>
-        <file alias="contacts_favmember.docml" >contacts_favmember.docml</file>
-        <file alias="contacts_collections.docml" >contacts_collections.docml</file>
-        <file alias="contacts_groupmembers.docml" >contacts_groupmembers.docml</file>
-        <file alias="contacts_detail_editor.docml" >contacts_detail_editor.docml</file>
-		<file alias="contacts_settings.docml" >contacts_settings.docml</file>
+        <file alias="contacts_contactcard.docml" >contacts_contactcard.docml.bin</file>
+        <file alias="contacts_ev.docml" >contacts_ev.docml.bin</file>
+        <file alias="contacts_mc.docml" >contacts_mc.docml.bin</file>
+        <file alias="contacts_if.docml" >contacts_if.docml.bin</file>
+        <file alias="contacts_list.docml" >contacts_list.docml.bin</file>
+        <file alias="contacts_namelist.docml" >contacts_namelist.docml.bin</file>
+        <file alias="contacts_groupactions.docml" >contacts_groupactions.docml.bin</file>
+        <file alias="contacts_history.docml" >contacts_history.docml.bin</file>
+        <file alias="contacts_editor.docml" >contacts_editor.docml.bin</file>
+        <file alias="contacts_sim.docml">contacts_sim.docml.bin</file>
+        <file alias="contacts_favorite.docml" >contacts_favorite.docml.bin</file>
+        <file alias="contacts_favmember.docml" >contacts_favmember.docml.bin</file>
+        <file alias="contacts_collections.docml" >contacts_collections.docml.bin</file>
+        <file alias="contacts_groupmembers.docml" >contacts_groupmembers.docml.bin</file>
+        <file alias="contacts_detail_editor.docml" >contacts_detail_editor.docml.bin</file>
+        <file alias="contacts_fetchdialog.docml" >contacts_fetchdialog.docml.bin</file>
+        <file alias="contacts_settings.docml" >contacts_settings.docml.bin</file>
     </qresource>
     <qresource prefix="/style">
         <file alias="cnteditviewlistitem.hblistviewitem.widgetml">style/cnteditviewlistitem.hblistviewitem.widgetml</file>
@@ -34,9 +34,12 @@
         <file alias="cntcontactcardheadingitem_color.css">style/cntcontactcardheadingitem_color.css</file>
         <file alias="cnthistoryviewitem.widgetml">style/cnthistoryviewitem.widgetml</file>
         <file alias="cnthistoryviewitem.css">style/cnthistoryviewitem.css</file>
-        <file alias="cntlocationbutton.hbpushbutton.widgetml">style/cntlocationbutton.hbpushbutton.widgetml</file>
-        <file alias="cntlocationbutton.css">style/cntlocationbutton.css</file>
         <file alias="cntcommondetailviewitem.widgetml">style/cntcommondetailviewitem.widgetml</file>
         <file alias="cntcommondetailviewitem.css">style/cntcommondetailviewitem.css</file>
+        <file alias="cntimagelabel.widgetml">style/cntimagelabel.widgetml</file>
+        <file alias="cntimagelabel.css">style/cntimagelabel.css</file>
+        <file alias="cntfetchmarkall.widgetml">style/cntfetchmarkall.widgetml</file>
+        <file alias="cntfetchmarkall.css">style/cntfetchmarkall.css</file>
+        <file alias="cntfetchmarkall_color.css">style/cntfetchmarkall_color.css</file>
     </qresource>
 </RCC>
--- a/phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cntcontactcardheadingitem.widgetml	Wed Aug 18 09:39:00 2010 +0300
@@ -5,9 +5,9 @@
     <meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1un" />
     <meshitem src="icon" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="1un" />
 
-		<meshitem src="primary_text" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" />
-		<meshitem src="primary_text" srcEdge="CENTERV" dst="" dstEdge="CENTERV" />
-		<meshitem src="primary_text" srcEdge="RIGHT" dst="secondary_icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+	 <meshitem src="primary_text" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" />
+	 <meshitem src="primary_text" srcEdge="CENTERV" dst="" dstEdge="CENTERV" />
+	 <meshitem src="primary_text" srcEdge="RIGHT" dst="secondary_icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
      
     <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
     <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
@@ -19,14 +19,14 @@
     <meshitem src="pictureArea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="pictureArea" srcEdge="RIGHT" dst="icon" dstEdge="RIGHT" />
 
-		<meshitem src="secondary_icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+	 <meshitem src="secondary_icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
     <meshitem src="secondary_icon" srcEdge="CENTERV" dst="primary_text" dstEdge="CENTERV" />
   </layout>
   
   <layout name="layout_one_row-landscape" type="mesh">
 	<meshitem src="primary_text" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
-	<meshitem src="primary_text" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1un" />
-	<meshitem src="primary_text" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="1un" />
+	<meshitem src="primary_text" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)" />
+	<meshitem src="primary_text" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)" />
 	<meshitem src="primary_text" srcEdge="RIGHT" dst="secondary_icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-right)" />
     
     <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
@@ -34,7 +34,7 @@
     <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
 
-	<meshitem src="secondary_icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+	 <meshitem src="secondary_icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
     <meshitem src="secondary_icon" srcEdge="CENTERV" dst="primary_text" dstEdge="CENTERV" />
   </layout>
   
--- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.css	Wed Aug 18 09:39:00 2010 +0300
@@ -46,6 +46,13 @@
     bottom:0.0un;
 }
 
+CntEditViewHeadingItem::highlight{
+    left:0.0un;
+    right:0.0un;
+    top:0.0un;
+    bottom:0.0un;
+}
+
 CntEditViewHeadingItem::iconArea{
     left:0.0un;
     right:0.0un;
--- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem.widgetml	Wed Aug 18 09:39:00 2010 +0300
@@ -22,6 +22,11 @@
     <meshitem src="iconArea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="iconArea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="iconArea" srcEdge="RIGHT" dst="icon" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
   
   <layout name="customLayoutNoSecondText" type="mesh">
@@ -42,6 +47,11 @@
     <meshitem src="iconArea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="iconArea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="iconArea" srcEdge="RIGHT" dst="icon" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
   
   <layout name="customLayoutNoText" type="mesh">
@@ -62,6 +72,11 @@
     <meshitem src="iconArea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="iconArea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="iconArea" srcEdge="RIGHT" dst="icon" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
 
   <layout name="customLayout-landscape" type="mesh">
@@ -78,6 +93,11 @@
     <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
 
   <layout name="customLayoutNoSecondText-landscape" type="mesh">
@@ -90,6 +110,11 @@
     <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
   
   <layout name="customLayoutNoText-landscape" type="mesh">
@@ -102,6 +127,11 @@
     <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
     <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+    <meshitem src="highlight" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="highlight" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="highlight" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="highlight" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
 
 </hbwidget>
--- a/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cnteditviewheadingitem_color.css	Wed Aug 18 09:39:00 2010 +0300
@@ -1,8 +1,16 @@
-CntEditViewHeadingItem::text{
+CntEditViewHeadingItem[state = "normal"]::text{
+    color: var(qtc_groupbox_normal);
+}
+
+CntEditViewHeadingItem[state = "normal"]::second_text{
     color: var(qtc_groupbox_normal);
 }
 
-CntEditViewHeadingItem::second_text{
-    color: var(qtc_groupbox_normal);
+CntEditViewHeadingItem[state = "pressed"]::text{
+    color: var(qtc_groupbox_pressed);
 }
 
+CntEditViewHeadingItem[state = "pressed"]::second_text{
+    color: var(qtc_groupbox_pressed);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.css	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,13 @@
+CntFetchMarkAll{
+	layout:default;
+}
+
+CntFetchMarkAll::counter
+{
+	text-align: right;
+	text-height: var(hb-param-text-height-tiny);
+    text-line-count-max: 1;
+    text-line-count-min: 1;
+	font-variant:secondary;
+	right:var(hb-param-margin-gene-popup);	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall.widgetml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,21 @@
+<hbwidget version="0.1" type="CntFetchMarkAll">
+
+  <layout name="default" type="mesh">
+    
+    <meshitem src="checkbox" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="checkbox" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="checkbox" srcEdge="RIGHT" dst="counter" dstEdge="LEFT" />
+    <meshitem src="checkbox" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="counter" srcEdge="CENTERV" dst="checkbox" dstEdge="CENTERV" />
+    <meshitem src="counter" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+    <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+  </layout>
+
+</hbwidget>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cntfetchmarkall_color.css	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,6 @@
+CntFetchMarkAll::counter
+{
+    color: var(qtc_viewtitle_normal);
+}
+
+
--- a/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml	Wed Aug 18 09:39:00 2010 +0300
@@ -11,6 +11,7 @@
 
     <meshitem src="text-3" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
     <meshitem src="text-3" srcEdge="LEFT" dst="text-2" dstEdge="LEFT"/>
+    <meshitem src="text-3" srcEdge="RIGHT" dst="text-2" dstEdge="RIGHT" />
 
     <meshitem src="icon-1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
     <meshitem src="icon-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
@@ -38,6 +39,7 @@
 
     <meshitem src="text-3" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
     <meshitem src="text-3" srcEdge="LEFT" dst="text-2" dstEdge="LEFT"/>
+    <meshitem src="text-3" srcEdge="RIGHT" dst="text-2" dstEdge="RIGHT" />
 
     <meshitem src="icon-1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
     <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-right)"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.css	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,4 @@
+CntImageLabel
+{
+   layout: avatar_layout;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cntimagelabel.widgetml	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,10 @@
+<hbwidget version="0.1" type="bi">  
+
+  <layout name="avatar_layout" type="mesh">
+     <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+     <meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP"/>
+     <meshitem src="icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+     <meshitem src="icon" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+   </layout>
+  
+</hbwidget>
--- a/phonebookui/pbkcommonui/src/cntactionlauncher.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntactionlauncher.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -49,6 +49,36 @@
                 this, SLOT(progress(QContactAction::State)));
         executed = mContactAction->invokeAction( aContact, aDetail );
         }
+    else
+        {
+        progress(QContactAction::FinishedWithErrorState);
+        }
+    
+    return executed;
+    }
+
+bool CntActionLauncher::execute( QContact aContact, QContactDetail aDetail, QVariantMap aParameters )
+    {
+    bool executed = false;
+    QList<QContactActionDescriptor> all = QContactAction::actionDescriptors(mAction, "symbian");
+    mContactAction = QContactAction::action( all.first() );
+    if ( mContactAction )
+        {
+        if (aContact.preferredDetail(mAction).isEmpty() && (mAction == "call" || mAction == "message" || mAction == "email"))
+            {
+            aContact.setPreferredDetail(mAction, aDetail);
+            //return value will be ignored because we cannot do anything if it fails.
+            mContactManager->saveContact(&aContact);
+            }
+        
+        connect(mContactAction, SIGNAL(stateChanged(QContactAction::State)),
+                this, SLOT(progress(QContactAction::State)));
+        executed = mContactAction->invokeAction( aContact, aDetail, aParameters );
+        }
+    else
+        {
+        progress(QContactAction::FinishedWithErrorState);
+        }
     
     return executed;
     }
@@ -67,6 +97,10 @@
                 this, SLOT(progress(QContactAction::State)));
         executed = mContactAction->invokeAction( aContact, aDetail );
     }
+    else
+    {
+        progress(QContactAction::FinishedWithErrorState);
+    }
     return executed;
 }
 
--- a/phonebookui/pbkcommonui/src/cntactionpopup_p.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntactionpopup_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -40,6 +40,7 @@
     mListView = new HbListView(this);
     mListModel = new QStandardItemModel(this);
     setAttribute(Qt::WA_DeleteOnClose, true);
+    mDataItemList.clear();
 }
 
 CntActionPopupPrivate::~CntActionPopupPrivate()
@@ -169,12 +170,13 @@
     {
         buildEmailActionPopup();
     }
-    else
+    
+    if(mDataItemList.count())
     {
-        return false;
+        showPopup();
+        return true;
     }
-    showPopup();
-    return true; 
+    return false; 
     
 }
 
@@ -194,6 +196,10 @@
     mListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum );
     
     QString contactName = mContact->displayLabel();
+    if (contactName.isEmpty())
+    {
+        contactName = hbTrId("txt_phob_list_unnamed");
+    }
     HbLabel *label = new HbLabel();
     label->setPlainText(contactName);
     
--- a/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -70,25 +70,21 @@
     HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>( 
               modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
     
-    HbWidget* widget = new HbWidget();
+    HbWidget* widget = NULL;
+    
     if( itemType ==  HbDataFormModelItem::CustomItemBase )
     {
-        QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Horizontal);
-        widget->setLayout(layout);
-    
-        HbStyleLoader::registerFilePath(":/style/cntlocationbutton.css");
-        HbStyleLoader::registerFilePath(":/style/cntlocationbutton.hbpushbutton.widgetml");
-        HbDataForm* form = static_cast<HbDataForm*> (itemView());
-        HbDataFormModel* model = static_cast<HbDataFormModel*> (form->model());
+        HbPushButton* locationButton = new HbPushButton(this);
+        
+        // Naming UI components for automation testability
+        locationButton->setObjectName("Select location button");
+        locationButton->setText( hbTrId("txt_phob_button_select_location") );
+        locationButton->setTextAlignment( Qt::AlignCenter );
+        locationButton->setContentsMargins(0,0,0,0);
     
-        HbPushButton* mLocationButton = new HbPushButton(this);
-        mLocationButton->setObjectName("cntlocationbutton");
-        mLocationButton->setText( hbTrId("txt_phob_button_select_location") );
-        mLocationButton->setTextAlignment( Qt::AlignCenter );
+        connect(locationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
     
-        connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
-    
-        layout->addItem(mLocationButton);
+        widget = locationButton;
         
     }
     return widget;
@@ -151,6 +147,6 @@
    
 }
 
- Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
+Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
 
 // End of File
--- a/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -52,7 +52,7 @@
     indexFeedback->setItemView(mListView);
     
     mSoftkey = new HbAction(Hb::BackNaviAction, mView);
-    connect( mSoftkey, SIGNAL(triggered()), this, SLOT(closeView()) );
+    connect( mSoftkey, SIGNAL(triggered()), this, SIGNAL(viewClosed()) );
 }
 
 CntBaseSelectionView::~CntBaseSelectionView()
@@ -105,12 +105,4 @@
     return mView;
 }
 
-void CntBaseSelectionView::closeView()
-{
-    emit viewClosed();
-    
-    CntViewParameters args;
-    mMgr->back( args );
-}
-
 // EOF
--- a/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -108,7 +108,7 @@
     
     if (!p->fetched)
     {
-        mThread->scheduleJob(row, p->id);
+        mThread->scheduleJob(p->id);
         p->fetched = true;
     }
     
@@ -163,6 +163,32 @@
 }
 
 /*!
+    Adds a row to the model. This is called from addGroup(int localId), so no
+    real logic in here.
+
+    \param row the first row which is added
+    \param count amount of rows to be added (not supported)
+    \param parent not used as all items share the same parent
+    \return success of the operation
+*/
+bool CntCollectionListModel::insertRows(int row, int count, const QModelIndex &parent)
+{
+    Q_UNUSED(count);
+    Q_UNUSED(parent);
+    
+    if ( !validateRowIndex(row) )
+    {
+        return false;
+    }
+    
+    beginInsertRows(parent, row, row);
+
+    endInsertRows();
+
+    return true;
+}
+
+/*!
     Remove given group from the model. Ignore plugin groups.
 
     \param localId QContactLocalId of the group that should be removed
@@ -184,6 +210,87 @@
 }
 
 /*!
+    Add a new group to the model. This also takes care of putting it in the
+    correct row.
+
+    \param localId QContactLocalId of the group that should be added
+*/
+void CntCollectionListModel::addGroup(int localId)
+{
+    CNT_ENTRY
+    
+    QContactDetailFilter groupFilter;
+    groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
+    groupFilter.setValue(QString(QLatin1String(QContactType::TypeGroup)));
+
+    QContactSortOrder sortOrderGroupName;
+    sortOrderGroupName.setDetailDefinitionName(QContactName::DefinitionName,
+        QContactName::FieldCustomLabel);
+    sortOrderGroupName.setCaseSensitivity(Qt::CaseInsensitive);
+
+    QList<QContactSortOrder> groupsOrder;
+    groupsOrder.append(sortOrderGroupName);
+
+    QList<QContactLocalId> groupContactIds = d->mContactManager->contactIds(groupFilter, groupsOrder);
+    
+    int row = 1;
+    
+    for (int i = 0;i < groupContactIds.count();i++)
+    {
+        if (groupContactIds.at(i) == localId)
+        {
+            row += d->mExtensions.count();
+            
+            CollectionItemPointer item(new CntCollectionItem());
+            
+            QContactFetchHint noRelationshipsFetchHint;
+            noRelationshipsFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships);
+            
+            QContact contact = d->mContactManager->contact(groupContactIds.at(i), noRelationshipsFetchHint);
+            QContactName contactName = contact.detail<QContactName>();
+            QString groupName = contactName.customLabel();
+            
+            if (groupName.isNull())
+            {
+                item->groupName = hbTrId("txt_phob_dblist_unnamed");
+            }
+            else
+            {
+                item->groupName = groupName;
+            }
+
+            item->icon = HbIcon("qtg_large_custom");
+            
+            QList<QContactAvatar> details = contact.details<QContactAvatar>();
+            for (int k = 0;k < details.count();k++)
+            {
+                if (details.at(k).imageUrl().isValid())
+                {
+                    int id = d->mThumbnailManager->getThumbnail(details.at(k).imageUrl().toString());
+                    d->mIconRequests.insert(id, groupContactIds.at(i));
+                    break;
+                }
+            }
+            
+            // contact Id for identification
+            item->id = groupContactIds.at(i);
+            item->secondLineText = " ";
+            item->memberCount = -1;
+
+            d->mList.insert(row, item);
+            insertRow(row);
+            break;
+        }
+        else if (groupContactIds.at(i) != d->mFavoriteGroupId)
+        {
+            row++;
+        }
+    }
+    
+    CNT_EXIT
+}
+
+/*!
     Check if list item at given index is coming from an extension plugin or not.
 
     \param index the QModelIndex of the list item
@@ -247,6 +354,25 @@
 }
 
 /*!
+    Get the index for a given group id.
+
+    \param localId the id of the group
+    \return QModelIndex of the group
+*/
+QModelIndex CntCollectionListModel::indexOfGroup(int localId)
+{
+    for (int i = 0;i < d->mList.count();i++)
+    {
+        if (d->mList.at(i)->id == localId && !d->mList.at(i)->isPlugin)
+        {
+            return index(i);
+        }
+    }
+    
+    return QModelIndex();
+}
+
+/*!
     Initialize different groups.
 */
 void CntCollectionListModel::doConstruct()
@@ -295,24 +421,31 @@
         CntUiGroupSupplier* groupSupplier = d->mExtensionManager.pluginAt(i)->groupSupplier();
         if (groupSupplier)
         {
-            for(int j = 0;j < groupSupplier->groupCount();j++)
+            if (groupSupplier->isAsynch())
+            {
+                connect(groupSupplier, SIGNAL(groupsReady()), this, SLOT(extensionGroupsReady()));
+            }
+            else
             {
-                const CntUiExtensionGroup& group = groupSupplier->groupAt(j);
-                
-                CollectionItemPointer item(new CntCollectionItem());
-                
-                item->groupName = group.name();
-                item->secondLineText = group.extraText();
-                item->memberCount = group.memberCount();
-                item->icon = HbIcon(group.groupIcon());
-                item->secondaryIcon = HbIcon(group.extraIcon());
-                
-                item->id = group.serviceId();
-                item->isPlugin = true;
-                item->fetched = true;
-                
-                d->mExtensions.insert(rowCount(), groupSupplier);
-                d->mList.append(item);
+                for (int j = 0;j < groupSupplier->groupCount();j++)
+                {
+                    const CntUiExtensionGroup& group = groupSupplier->groupAt(j);
+                    
+                    CollectionItemPointer item(new CntCollectionItem());
+                    
+                    item->groupName = group.name();
+                    item->secondLineText = group.extraText();
+                    item->memberCount = group.memberCount();
+                    item->icon = HbIcon(group.groupIcon());
+                    item->secondaryIcon = HbIcon(group.extraIcon());
+                    
+                    item->id = group.serviceId();
+                    item->isPlugin = true;
+                    item->fetched = true;
+                    
+                    d->mExtensions.insert(rowCount(), groupSupplier);
+                    d->mList.append(item);
+                }
             }
         }
     }
@@ -371,7 +504,7 @@
                 if (details.at(k).imageUrl().isValid())
                 {
                     int id = d->mThumbnailManager->getThumbnail(details.at(k).imageUrl().toString());
-                    d->mIconRequests.insert(id, rowCount());
+                    d->mIconRequests.insert(id, groupContactIds.at(i));
                     break;
                 }
             }
@@ -450,17 +583,25 @@
     \param secondRowText text to be shown in the second row
     \param memberCount the amount of members the group has (shown in text-3 in HbListViewItem)
 */
-void CntCollectionListModel::informationUpdated(int row, const QString& secondRowText, int memberCount)
+void CntCollectionListModel::informationUpdated(int id, const QString& secondRowText, int memberCount)
 {
     CNT_ENTRY
     
-    CollectionItemPointer item = d->mList.at(row);
-    
-    item->secondLineText = secondRowText;
-    item->memberCount = memberCount;
-    
-    int idx = d->mList.indexOf(item);
-    emit dataChanged(index(idx, 0), index(idx, 0));
+    for (int i = 0;i < d->mList.count();i++)
+    {
+        if (d->mList.at(i)->id == id && !d->mList.at(i)->isPlugin)
+        {
+            CollectionItemPointer item = d->mList.at(i);
+            
+            item->secondLineText = secondRowText;
+            item->memberCount = memberCount;
+            
+            int idx = d->mList.indexOf(item);
+            emit dataChanged(index(idx, 0), index(idx, 0));
+            
+            break;
+        }
+    }
     
     CNT_EXIT
 }
@@ -482,15 +623,77 @@
     
     if (error == 0)
     {
-        int row = d->mIconRequests.take(id);
-        
-        CollectionItemPointer item = d->mList.at(row);
+        int localId = d->mIconRequests.take(id);
         
-        item->icon = HbIcon(pixmap);
-        
-        int idx = d->mList.indexOf(item);
-        emit dataChanged(index(idx, 0), index(idx, 0));
+        for (int i = 0;i < d->mList.count();i++)
+        {
+            if (d->mList.at(i)->id == localId && !d->mList.at(i)->isPlugin)
+            {
+                CollectionItemPointer item = d->mList.at(i);
+                
+                item->icon = HbIcon(pixmap);
+                
+                int idx = d->mList.indexOf(item);
+                emit dataChanged(index(idx, 0), index(idx, 0));
+                
+                break;
+            }
+        }
     }
 
     CNT_EXIT
 }
+
+/*!
+    Slot to handle asynchronously initiated extension groups. As
+    these are added right after the static favorites group, this takes
+    also care of updating the mapping between row and CntUiGroupSuppliers
+    in case there was already some synchronously loaded extension groups.
+*/
+void CntCollectionListModel::extensionGroupsReady()
+{
+    CntUiGroupSupplier* groupSupplier = static_cast<CntUiGroupSupplier*>(sender());
+    
+    int addedCount = groupSupplier->groupCount();
+    
+    if (addedCount > 0)
+    {
+        QList<int> rowList = d->mExtensions.keys();
+        QList<CntUiGroupSupplier*> supplierList = d->mExtensions.values();
+        
+        d->mExtensions.clear();
+        
+        for (int i = 0;i < rowList.count();i++)
+        {
+            int row = rowList.at(i) + addedCount;
+            CntUiGroupSupplier* supplier = supplierList.at(i);
+            
+            d->mExtensions.insert(row, supplier);
+        }
+        
+        
+        beginInsertRows(QModelIndex(), 1, groupSupplier->groupCount());
+        
+        for (int j = 0;j < groupSupplier->groupCount();j++)
+        {
+            const CntUiExtensionGroup& group = groupSupplier->groupAt(j);
+            
+            CollectionItemPointer item(new CntCollectionItem());
+            
+            item->groupName = group.name();
+            item->secondLineText = group.extraText();
+            item->memberCount = group.memberCount();
+            item->icon = HbIcon(group.groupIcon());
+            item->secondaryIcon = HbIcon(group.extraIcon());
+            
+            item->id = group.serviceId();
+            item->isPlugin = true;
+            item->fetched = true;
+            
+            d->mExtensions.insert(1 + j, groupSupplier);
+            d->mList.insert(1 + j, item);
+        }
+        
+        endInsertRows();
+    }
+}
--- a/phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodelworker.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -109,12 +109,11 @@
 }
 
 /*!
-    Schedule an asynch job for the given row (model) and contact id.
+    Schedule an asynch job for the given contact id.
 
-    \param row the row in the model
-    \param id the QContactLocalId of the group in the given row
+    \param id the QContactLocalId of the group
 */
-void CntCollectionListModelWorker::scheduleJob(int row, int id)
+void CntCollectionListModelWorker::scheduleJob(int id)
 {
     CNT_ENTRY
     
@@ -134,7 +133,7 @@
         HbApplication::instance()->postEvent(this, new QEvent(QEvent::User));
     }
 
-    mJobs.append(QPair<int,int>(row, id));
+    mJobs.append(id);
     
     mMutex.unlock();
     
@@ -163,12 +162,10 @@
         else
         {
             // get next job
-            QPair<int,int> pair = mJobs.takeFirst();
-            int row = pair.first;
-            int id = pair.second;
+            int id = mJobs.takeFirst();
 
             mMutex.unlock();
-            fetchInformation(row, id);
+            fetchInformation(id);
         }
 
         HbApplication::processEvents();
@@ -182,10 +179,9 @@
     and the amount of contacts in the group. Emits the result as a signal for
     CntCollectionListModel to handle.
 
-    \param row the row in the model
     \param id the QContactLocalId of the group in the given row
 */
-void CntCollectionListModelWorker::fetchInformation(int row, int id)
+void CntCollectionListModelWorker::fetchInformation(int id)
 {
     CNT_ENTRY
     
@@ -238,9 +234,9 @@
         for(int i = 0;i < groupMemberIds.count();i++)
         {
             QContactFetchHint nameOnlyFetchHint;
-            QStringList details;
+            /*QStringList details;
             details << QContactDisplayLabel::DefinitionName;
-            nameOnlyFetchHint.setDetailDefinitionsHint(details);
+            nameOnlyFetchHint.setDetailDefinitionsHint(details);*/
             nameOnlyFetchHint.setOptimizationHints(QContactFetchHint::NoRelationships);
 
             QContact contact = mManager->contact(groupMemberIds.at(i), nameOnlyFetchHint);
@@ -275,7 +271,7 @@
         }
     }
 
-    emit fetchDone(row, secondLineText, memberCount);
+    emit fetchDone(id, secondLineText, memberCount);
     
     CNT_EXIT
 }
--- a/phonebookui/pbkcommonui/src/cntcollectionview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcollectionview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,12 +16,13 @@
 */
 
 #include "cntcollectionview.h"
-#include "cntfetchcontactsview.h"
+#include "cntfetchcontactpopup.h"
 #include "cntgroupdeletepopup.h"
 #include "cntcollectionlistmodel.h"
 #include "cntextensionmanager.h"
 #include "cntglobal.h"
 #include "cntfavourite.h"
+#include "cntdetailconst.h"
 #include "cntdebug.h"
 
 #include <cntuiextensionfactory.h>
@@ -30,7 +31,7 @@
 #include <hblistview.h>
 #include <hblistviewitem.h>
 #include <hbmenu.h>
-#include <hbnotificationdialog.h>
+#include <hbdevicenotificationdialog.h>
 #include <hbinputdialog.h>
 #include <hbdialog.h>
 #include <hbaction.h>
@@ -41,6 +42,7 @@
 #include <hbparameterlengthlimiter.h>
 
 #include <QActionGroup>
+#include <QApplication>
 #include <QList>
 
 const char *CNT_COLLECTIONVIEW_XML = ":/xml/contacts_collections.docml";
@@ -61,7 +63,6 @@
     mNewGroupAction(NULL),
     mDeleteGroupsAction(NULL),
     mHandledContact(NULL),
-    mFetchView(NULL),
     mActionGroup(NULL)
 {
     bool ok = false;
@@ -98,8 +99,10 @@
     groups->setChecked(true);
     
     mFindAction = static_cast<HbAction*>(mDocumentLoader.findObject("cnt:find"));
-    mFindAction->setEnabled(false);
+    connect(mFindAction, SIGNAL(triggered()), this, SLOT(showNamesViewWithFinder()));
     mExtensionAction = static_cast<HbAction*> (mDocumentLoader.findObject("cnt:activity"));
+    
+    connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(notifyNewGroup()));
 }
 
 /*!
@@ -111,9 +114,6 @@
     
     delete mHandledContact;
     mHandledContact = NULL;
-    
-    delete mFetchView;
-    mFetchView = NULL;
 }
 
 /*!
@@ -159,9 +159,6 @@
     mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this);
     mListView->setModel(mModel);
     
-    mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND ));
-    connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleNewGroupMembers()));
-    
     CNT_EXIT
 }
 
@@ -188,6 +185,16 @@
 }
 
 /*!
+Go back to previous view
+*/
+void CntCollectionView::showNamesViewWithFinder()
+{
+    CntViewParameters viewParameters;
+    viewParameters.insert(EExtraAction, CNT_FIND_ACTION);
+    mViewManager->back(viewParameters);
+}
+
+/*!
 Called after user clicked on the listview.
 */
 void CntCollectionView::openGroup(const QModelIndex &index)
@@ -227,7 +234,7 @@
             else
             {
                 CntViewParameters viewParameters;
-                viewParameters.insert(EViewId, FavoritesMemberView);
+                viewParameters.insert(EViewId, favoritesMemberView);
                 QVariant var;
                 var.setValue(favoriteGroup);
                 viewParameters.insert(ESelectedGroupContact, var);
@@ -257,7 +264,7 @@
     else
     {
         int id = item->modelIndex().data(Qt::UserRole).toInt();
-        QVariant data( item->modelIndex().row() );
+        QVariant data( id );
 
         int favoriteGrpId = CntFavourite::favouriteGroupId(mViewManager->contactManager(SYMBIAN_BACKEND));
         
@@ -280,22 +287,20 @@
 
 void CntCollectionView::handleMenu(HbAction* action)
 {
-    int row = action->data().toInt();
     HbMenu *menuItem = static_cast<HbMenu*>(sender());
-    QModelIndex index = mModel->index(row, 0);
-    
-    int id = index.data(Qt::UserRole).toInt();
     
     if ( action == menuItem->actions().first() )
-        {
+    {
+        int id = action->data().toInt();
+        QModelIndex index = mModel->indexOfGroup(id);
         openGroup(index);
-        }
+    }
     else if (action == menuItem->actions().at(1))
-        {
-        
+    {
+        int id = action->data().toInt();
         QContact groupContact = getContactManager()->contact(id);
         deleteGroup(groupContact);
-        }
+    }
 }
 
 
@@ -307,6 +312,7 @@
     
     HbLineEdit *lineEdit = popup->lineEdit();
     lineEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
+    lineEdit->setMaxLength( CNT_GROUPNAME_MAXLENGTH );
     
     popup->setPromptText(hbTrId("txt_phob_title_new_group_name"));
     popup->clearActions();
@@ -343,43 +349,81 @@
         QSet<QContactLocalId> contactsSet = contactsList.toSet();
 
         // Select some contact(s) to add to the group
-        QString groupNameCreated(mHandledContact->displayLabel());
-        mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupNameCreated),
-                               hbTrId("txt_common_button_save"));
-        mFetchView->displayContacts(HbAbstractItemView::MultiSelection, contactsSet);
+        QString groupNameCreated = mHandledContact->displayLabel();
+        if (groupNameCreated.isEmpty())
+        {
+            groupNameCreated = hbTrId("txt_phob_list_unnamed");
+        }
+        
+        CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup(
+                HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupNameCreated),
+                hbTrId("txt_common_button_save"),
+                *mViewManager->contactManager(SYMBIAN_BACKEND));
+        connect( popup, SIGNAL(fetchReady(QSet<QContactLocalId>)), this, SLOT(handleNewGroupMembers(QSet<QContactLocalId>)) );
+        connect( popup, SIGNAL(fetchCancelled()), this, SLOT(handleCancelGroupMembers()) );
+        
+        popup->setSelectedContacts( contactsSet );
+        popup->showPopup();
     }
 }
 
-void CntCollectionView::handleNewGroupMembers()
+void CntCollectionView::handleNewGroupMembers( QSet<QContactLocalId> aIds )
 {
-    mSelectedContactsSet = mFetchView->getSelectedContacts();
-    if ( !mFetchView->wasCanceled() && mSelectedContactsSet.size() ) {
+    mSelectedContactsSet = aIds;
+
+    if ( aIds.size() > 0 )
+    {
         saveNewGroup(mHandledContact);
-
+        
         CntViewParameters viewParameters;
         viewParameters.insert(EViewId, groupMemberView);
+        
         QVariant var;
         var.setValue(*mHandledContact);
         viewParameters.insert(ESelectedGroupContact, var);
         mViewManager->changeView(viewParameters);
     }
-    
-    QString groupNameCreated(mHandledContact->displayLabel());
-    HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created")).arg(groupNameCreated));
+    else
+    {
+        mModel->addGroup(mHandledContact->localId());
+        mDeleteGroupsAction->setEnabled(true);
+    }
+    notifyNewGroup();
+}
 
-    // Refresh the page 
-    refreshDataModel();
+void CntCollectionView::handleCancelGroupMembers()
+{
+    mSelectedContactsSet.clear();
+    mModel->addGroup(mHandledContact->localId());
     mDeleteGroupsAction->setEnabled(true);
+    
+    notifyNewGroup();
+}
 
-    delete mHandledContact;
-    mHandledContact = NULL;
+void CntCollectionView::notifyNewGroup()
+{
+    if (mHandledContact != NULL)
+    {
+        QString groupNameCreated = mHandledContact->displayLabel();
+        if (groupNameCreated.isEmpty())
+        {
+            groupNameCreated = hbTrId("txt_phob_list_unnamed");
+        }
+        HbDeviceNotificationDialog::notification(QString(), 
+                HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created")).arg(groupNameCreated));
+
+        delete mHandledContact;
+        mHandledContact = NULL;
+    }
 }
 
 void CntCollectionView::refreshDataModel()
 {
     mListView->setModel(0);
+    
     delete mModel;
-    mModel = 0;
+    mModel = NULL;
+    
     mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this);
     mListView->setModel(mModel);
 }
@@ -388,20 +432,22 @@
 {
     mHandledContact = new QContact(group);
     QString name = mHandledContact->displayLabel();
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
 
     HbLabel *headingLabel = new HbLabel();
     headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(name));
           
     HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac")
-            , this, SLOT(handleDeleteGroup(HbAction*)),
-                hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel);
+            , this, SLOT(handleDeleteGroup(int)), HbMessageBox::Delete | HbMessageBox::Cancel,
+                headingLabel);
 }
 
-void CntCollectionView::handleDeleteGroup(HbAction* action)
+void CntCollectionView::handleDeleteGroup(int action)
 {
-    HbMessageBox *note = static_cast<HbMessageBox*>(sender());
-    
-    if (note && action == note->actions().first())
+    if (action == HbMessageBox::Delete)
     {
         getContactManager()->removeContact(mHandledContact->localId());
         mModel->removeGroup(mHandledContact->localId());
--- a/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,6 +16,7 @@
 */
 
 #include "cntcontactcardheadingitem.h"
+#include "cntdebug.h"
 
 #include <qtcontacts.h>
 #include <QGraphicsSceneMouseEvent>
@@ -30,6 +31,8 @@
 #include <hbaction.h>
 #include <hbmainwindow.h>
 #include <hbtapgesture.h>
+#include <hbeffect.h>
+#include <hbinstantfeedback.h>
 #include <cntuids.h>
 #include <xqsettingsmanager.h>
 #include <xqsettingskey.h>
@@ -48,6 +51,7 @@
     mIsFavorite(false),
     mIsOnline(false)
 {
+    HbEffect::add("icon", "groupbox_icon_click", "iconclick");
 }
 
 CntContactCardHeadingItem::~CntContactCardHeadingItem()
@@ -198,7 +202,7 @@
     if (!mFrameItem)
     {
         mFrameItem = new HbFrameItem(this);
-        mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox");
+        mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal");
         mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
         mFrameItem->setZValue(-2);
         style()->setItemName(mFrameItem, "background");
@@ -214,6 +218,10 @@
     {
         initGesture();
     }
+    else
+    {
+        ungrabGesture(Qt::TapGesture);
+    }
 }
 
 void CntContactCardHeadingItem::setIcon(const HbIcon newIcon)
@@ -354,16 +362,18 @@
     int setting = settingsMng.readItemValue(nameOrderKey, XQSettingsManager::TypeInt).toInt();
     
     QStringList nameList;
-    QString last;
+    QString last_first;
     
     switch( setting ) {
         case CntOrderLastFirst:
             nameList << name.prefix() << name.lastName() << name.firstName() << name.middleName() << name.suffix();
             break;
         case CntOrderLastCommaFirst:
-            if (!name.lastName().isEmpty())
-                last = name.lastName() + ",";
-            nameList << name.prefix() << last << name.firstName() << name.middleName() << name.suffix();
+            if (!name.firstName().isEmpty() && !name.lastName().isEmpty())
+                last_first = name.lastName() + ", " + name.firstName();
+            else
+                last_first = !name.firstName().isEmpty() ? name.firstName() : name.lastName();
+            nameList << name.prefix() << last_first << name.middleName() << name.suffix();
             break;
         default:    // Default to first name last name
             nameList << name.prefix() << name.firstName() << name.middleName() << name.lastName() << name.suffix();
@@ -432,9 +442,17 @@
             case Qt::GestureUpdated:
                 if (tap->tapStyleHint() == HbTapGesture::TapAndHold && mIcon->rect().contains(mapFromScene(tap->position()))) 
                 {
+                    HbEffect::cancel(mIcon, QString("iconclick"));
                     processLongPress(tap->position());
                 }
                 break;
+            case Qt::GestureStarted:
+                if (tap->tapStyleHint() == HbTapGesture::Tap && mIcon->rect().contains(mapFromScene(tap->position())))
+                {
+                    HbInstantFeedback::play(HbFeedback::Basic);
+                    HbEffect::start(mIcon, QString("icon"), QString("iconclick"));
+                }
+                
             default:
                 break;
         }
--- a/phonebookui/pbkcommonui/src/cntcontactcardview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcardview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -20,12 +20,13 @@
 
 #include <hbview.h>
 
-CntContactCardView::CntContactCardView() : d_ptr(new CntContactCardViewPrivate())
+CntContactCardView::CntContactCardView(bool isTemporary) : d_ptr(new CntContactCardViewPrivate(isTemporary))
 {
     Q_D(CntContactCardView);
     connect(d_ptr, SIGNAL(backPressed()), this, SIGNAL(backPressed()));
     connect(d_ptr, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)), 
             this, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)));
+    connect(d_ptr, SIGNAL(addToContacts()), this, SIGNAL(addToContacts()));
 }
 
 /*!
@@ -62,7 +63,7 @@
 
 int CntContactCardView::viewId() const 
 { 
-    return commLauncherView; 
+    return contactCardView; 
 }
 
 // end of file
--- a/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -63,6 +63,7 @@
 #include "cntactionlauncher.h"
 #include "cntpresencelistener.h"
 #include "cntactionpopup.h"
+#include "cntvcarddetailhandler.h"
 
 #define CNT_MAPTILE_PROGRESS_TIMER  100 //100 msec
 #define CNT_UNKNOWN_MAPTILE_STATUS  -1
@@ -74,7 +75,7 @@
 Constructor, initialize member variables.
 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
 */
-CntContactCardViewPrivate::CntContactCardViewPrivate() :
+CntContactCardViewPrivate::CntContactCardViewPrivate(bool isTemporary) :
     QObject(), 
     mScrollArea(NULL),
     mContainerWidget(NULL),
@@ -96,7 +97,9 @@
     mSendKeyListModel(NULL),
     mPresenceListener(NULL),
     mMaptile(NULL),
-	mProgressTimer(NULL)
+	mProgressTimer(NULL),
+	mIsTemporary(isTemporary),
+	mIsExecutingAction(false)
 {
     bool ok;
     document()->load(CNT_CONTACTCARDVIEW_XML, &ok);
@@ -119,7 +122,7 @@
     mBackKey = new HbAction(Hb::BackNaviAction, mView);
     mView->setNavigationAction(mBackKey);  
     connect(mBackKey, SIGNAL(triggered()), this, SLOT(showPreviousView()));
-	
+    
     mProgressTimer = new QTimer(this);
     mProgressTimer->setSingleShot(true);
     connect(mProgressTimer, SIGNAL(timeout()),this, SLOT(updateSpinningIndicator())); 
@@ -169,7 +172,8 @@
     
     delete mPresenceListener;
     mPresenceListener = NULL;
-	delete mMaptile;
+    
+    delete mMaptile;
     mMaptile = NULL;
     
     delete mProgressTimer;
@@ -195,14 +199,22 @@
     
     //save the contact if avatar has been changed.
     QContact contact = contactManager()->contact(mContact->localId());
-    if ( contact != *mContact )
+    if ( contact != *mContact && contactManager()->error() == QContactManager::NoError)
     {
         contactManager()->saveContact(mContact);
     }
-       
+    
     mViewManager->back( mArgs );
 }
 
+/*!
+Activates the root view
+*/
+void CntContactCardViewPrivate::showRootView()
+{
+    mViewManager->back( mArgs, true );
+}
+
 /*
 Activates a default view and setup name label texts
 */
@@ -213,13 +225,14 @@
     mViewManager = aMgr;
     mArgs = aArgs;
     
-    mView->installEventFilter(this);
-    
     HbMainWindow* window = mView->mainWindow();
-    connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
-    connect(window, SIGNAL(keyPressed(QKeyEvent*)), this, SLOT(keyPressed(QKeyEvent*)));
-    
-    setOrientation(window->orientation());
+    if (window)
+    {
+        connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
+        window->installEventFilter(this);
+        
+        setOrientation(window->orientation());
+    }
         
     QContact contact = aArgs.value(ESelectedContact).value<QContact>();
     mContact = new QContact( contact );
@@ -234,6 +247,12 @@
     {
         mView->toolBar()->removeAction(static_cast<HbAction*>(document()->findObject(QString("cnt:sendMyCard"))));
     }
+    if (mIsTemporary)
+    {
+        mView->menu()->clearActions();
+        mView->toolBar()->clearActions();
+        mView->toolBar()->addAction(static_cast<HbAction*>(document()->findObject(QString("cnt:addtocontact"))));
+    }
     
     // add heading widget to the content
     QGraphicsWidget *c = document()->findWidget(QString("content"));
@@ -241,19 +260,32 @@
 
     mHeadingItem = static_cast<CntContactCardHeadingItem*>(document()->findWidget(QString("cnt_contactcard_heading")));
     mHeadingItem->setDetails(mContact);
-    connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&)));
-    connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(doChangeImage()));
+    
+    mImageLabel = static_cast<CntImageLabel*>(document()->findWidget("cnt_contactcard_image"));
+         
+    if (!mIsTemporary)
+    {
+        connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&)));
+        connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(doChangeImage())); 
+        connect(mImageLabel, SIGNAL(iconClicked()), this, SLOT(doChangeImage()));
+        connect(mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&)));
+    }
+    else
+    {
+        mHeadingItem->ungrabGesture(Qt::TapGesture);
+        mImageLabel->ungrabGesture(Qt::TapGesture);
+    }
     
     // presence listener
     mPresenceListener = new CntPresenceListener(*mContact);
     connect(mPresenceListener, SIGNAL(fullPresenceUpdated(bool)), mHeadingItem, SLOT(setOnlineStatus(bool)));
+    connect(mPresenceListener, SIGNAL(accountPresenceUpdated(const QString&, bool)), 
+            this, SLOT(updateItemPresence(const QString&, bool)));
     bool online;
-    mPresenceListener->initialPresences(online);
+    QMap<QString, bool> presences = mPresenceListener->initialPresences(online);
     mHeadingItem->setOnlineStatus(online);
 
-    mImageLabel = static_cast<CntImageLabel*>(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<QContactAvatar> details = mContact->details<QContactAvatar>();
@@ -295,13 +327,36 @@
             CntContactCardDetailItem* item = new CntContactCardDetailItem(index, mContainerWidget);
 
             connect(item, SIGNAL(clicked()), this, SLOT(onItemActivated()));
-            connect(item, SIGNAL(longPressed(const QPointF&)), this, SLOT(onLongPressed(const QPointF&)));
-   
+            
+            if (!mIsTemporary)
+            {
+                connect(item, SIGNAL(longPressed(const QPointF&)), this, SLOT(onLongPressed(const QPointF&)));
+            }
+            
             if (mContact->isPreferredDetail(dataItem->action(), dataItem->detail()))
             {
                 dataItem->setSecondaryIcon(HbIcon("qtg_mono_favourites"));
                 mPreferredItems.insert(dataItem->action(), item);
             }
+            
+            if (dataItem->detail().definitionName() == QContactOnlineAccount::DefinitionName)
+            {
+                for (int i = 0;i < presences.keys().count();i++)
+                {
+                    QString fullAccount = presences.keys().at(i);
+                    QContactOnlineAccount account = dataItem->detail();
+                    QString currentFullAccount = account.serviceProvider() + ':' + account.accountUri();
+                    if (fullAccount == currentFullAccount)
+                    {
+                        if (presences.values().at(i))
+                        {
+                            dataItem->setSecondaryIcon(HbIcon("qtg_small_online"));
+                        }
+                        mPresenceItems.insert(fullAccount, item);
+                        break;
+                    }
+                }
+            }
          
             item->setDetails(dataItem);
             mContainerLayout->addItem(item);
@@ -355,7 +410,7 @@
                     CntContactCardMapTileDetail* detail = new CntContactCardMapTileDetail;
                     if( detail )
                     {
-                        detail->mContactId = mContact->id().localId();
+                        detail->mContactId = mContact->localId();
                             
                         if( dataItem->titleText() == hbTrId("txt_phob_formlabel_address") )
                         {
@@ -395,8 +450,8 @@
             setAsFavorite = CntFavourite::isMemberOfFavouriteGroup( contactManager(), mContact );
             mHeadingItem->setFavoriteStatus( setAsFavorite ); // if contact is part of favourites group
         }
-        qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite"))->setVisible( !setAsFavorite );
-        qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite"))->setVisible( setAsFavorite );
+        static_cast<HbAction *>(document()->findObject("cnt:setasfavorite"))->setVisible( !setAsFavorite );
+        static_cast<HbAction *>(document()->findObject("cnt:removefromfavorite"))->setVisible( setAsFavorite );
     }
     document()->findWidget("viewToolbar")->setParent(mView);
     document()->findWidget("viewMenu")->setParent(mView);
@@ -410,8 +465,15 @@
     connectAction("cnt:edit", SLOT(editContact()));
     connectAction("cnt:history", SLOT(viewHistory()));
     connectAction("cnt:sendMyCard", SLOT(sendBusinessCard()));
+    connectAction("cnt:addtocontact", SLOT(onAddedToContacts()));
     connectAction("cnt:activityStream", NULL);      // placeholder until this action is implemented (needed to avoid memory leak)
     
+    // disabled until this action is implemented 
+    static_cast<HbAction *>(document()->findObject("cnt:activityStream"))->setEnabled(false);
+        
+    connect(contactManager(), SIGNAL(contactsRemoved(const QList<QContactLocalId>&)), 
+        this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
+    
     emit viewActivated( mViewManager, aArgs );
 
     CNT_EXIT
@@ -458,7 +520,7 @@
             CntMapTileService::ContactAddressType sourceAddressType =
                     static_cast <CntMapTileService::ContactAddressType>( mAddressList[index]->mAddressType );
              
-            QContactLocalId contactId = mContact->id().localId();
+            QContactLocalId contactId = mContact->localId();
              
             if( mAddressList[index]->mDetailItem != NULL )
             {
@@ -557,7 +619,7 @@
     //If there is no maptile displayed, return immediately
     if( mMaptileLabelList.count() > 0 )
     {
-        QContactLocalId contactId = mContact->id().localId();
+        QContactLocalId contactId = mContact->localId();
         
         QList<QContactAddress> addressDetails = mContact->details<QContactAddress>();
         
@@ -644,6 +706,27 @@
     return maptileLabel;
 }
 
+/*
+* Update the presence status icon of action item with the given accountUri
+*/
+void CntContactCardViewPrivate::updateItemPresence(const QString& accountUri, bool online)
+{
+    CntContactCardDetailItem* item = mPresenceItems.value(accountUri);
+    
+    if (item)
+    {
+        if (online)
+        {
+            mDataContainer->dataItem(item->index())->setSecondaryIcon(HbIcon("qtg_small_online"));
+        }
+        else
+        {
+            mDataContainer->dataItem(item->index())->setSecondaryIcon(HbIcon());
+        }
+        item->setDetails(mDataContainer->dataItem(item->index()));
+    }
+}
+
 void CntContactCardViewPrivate::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error)
 {
     CNT_ENTRY
@@ -656,7 +739,7 @@
         mHeadingItem->setIcon(icon);
         mVCardIcon = new HbIcon(pixmap);
         mImageLabel->clear();
-        mImageLabel->setIcon(icon);
+        mImageLabel->setIcon(pixmap);
     }
     
     CNT_EXIT
@@ -668,14 +751,35 @@
 void CntContactCardViewPrivate::sendToHs()
 {
     QVariantHash preferences;
-    preferences["contactId"] = mContact->id().localId();
+    preferences["contactId"] = mContact->localId();
     
-    XQServiceRequest snd("com.nokia.services.hsapplication.IHomeScreenClient",
+    XQServiceRequest snd("com.nokia.symbian.IHomeScreenClient",
                          "addWidget(QString,QVariantHash)"
                          ,false);
     snd << QString("contactwidgethsplugin");
     snd << preferences;
     snd.send();
+
+    /* 
+    if (mRequest)
+    {
+        delete mRequest;
+        mRequest = 0;
+    }
+         
+    mRequest = mAppManager.create("com.nokia.symbian.IHomeScreenClient", "addWidget(QString,QVariantHash)", false);
+    
+    if (mRequest)
+    {
+        QList<QVariant> args;
+        QVariantHash preferences;
+        preferences["contactId"] = mContact->localId();
+        args << preferences;
+        args << QString("contactwidgethsplugin");
+        mRequest->setArguments(args);
+        mRequest->send();
+    }
+    */
 }
 
 /*!
@@ -721,23 +825,29 @@
 */
 void CntContactCardViewPrivate::deleteContact()
 {    
-    QString name = contactManager()->synthesizedDisplayLabel(*mContact);
+    QString name = contactManager()->synthesizedContactDisplayLabel(*mContact);
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
     
-    HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)),
-            hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"));
+    HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)),
+            HbMessageBox::Delete | HbMessageBox::Cancel);
 }
 
 /*!
 Handle action for deleting a contact
 */
-void CntContactCardViewPrivate::handleDeleteContact(HbAction *action)
+void CntContactCardViewPrivate::handleDeleteContact(int action)
 {
-    HbMessageBox *note = static_cast<HbMessageBox*>(sender());
-    
-    if (note && action == note->actions().first())
+    if (action == HbMessageBox::Delete)
     {
-        contactManager()->removeContact(mContact->localId());
-        mViewManager->back( mArgs );
+        disconnect(contactManager(), SIGNAL(contactsRemoved(const QList<QContactLocalId>&)),
+                this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
+        
+        contactManager()->removeContact(mContact->localId());  
+        emit backPressed();  
+        mViewManager->back( mArgs, true );
     }
 }
 
@@ -759,7 +869,7 @@
 */
 void CntContactCardViewPrivate::deactivate()
 {
-    mView->removeEventFilter(this);    
+    
 }
 
 /*!
@@ -767,7 +877,8 @@
 */
 void CntContactCardViewPrivate::sendBusinessCard()
 {
-    qDebug() << "CntContactCardViewPrivate::sendBusinessCard - IN";
+    CNT_ENTRY
+    
     // Check if the contact has an image.
     QList<QContactAvatar> avatars = mContact->details<QContactAvatar>();
     bool imageExists( false );
@@ -800,10 +911,11 @@
     
     if ( !imageExists )
     {
-        qDebug() << "CntContactCardViewPrivate::sendBusinessCard without image";
+        CNT_LOG_ARGS("snd vCard without image")
         handleSendBusinessCard( NULL ); // no image
     }
-    qDebug() << "CntContactCardViewPrivate::sendBusinessCard - OUT";
+    
+    CNT_EXIT
 }
 
 /*!
@@ -852,6 +964,15 @@
 */
 void CntContactCardViewPrivate::executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction, CntContactCardDetailItem* aItem)
 {
+    if (mIsExecutingAction)
+    {
+        return;
+    }
+    else
+    {
+        mIsExecutingAction = true;
+    }
+    
     CntActionLauncher* other = new CntActionLauncher(*contactManager(), aAction);
     connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
     if (aItem && aContact.preferredDetail(aAction).isEmpty())
@@ -876,6 +997,7 @@
         if (detail == aDetail && action == aAction)
         {
             detailItem = static_cast<CntContactCardDetailItem*>(mContainerLayout->itemAt(index));
+            break;
         }
     }
     executeAction(aContact, aDetail, aAction, detailItem);
@@ -887,6 +1009,15 @@
 */
 void CntContactCardViewPrivate::executeDynamicAction(QContact& aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor)
 {
+    if (mIsExecutingAction)
+    {
+        return;
+    }
+    else
+    {
+        mIsExecutingAction = true;
+    }
+    
     CntActionLauncher* other = new CntActionLauncher(*contactManager());
     connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
     other->execute(aContact, aDetail, aActionDescriptor);
@@ -895,6 +1026,7 @@
 void CntContactCardViewPrivate::actionExecuted(CntActionLauncher* aAction)
 {
     aAction->deleteLater();
+    mIsExecutingAction = false;
 }
 
 /*!
@@ -1063,8 +1195,9 @@
 
 void CntContactCardViewPrivate::handleSendBusinessCard( HbAction* aAction )
 {
+    CNT_ENTRY
     Q_UNUSED(aAction);
-    qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - IN";
+    
     QList<QContact> list;
     /*if ( aAction && aAction->objectName() == "cancel" )
     {
@@ -1111,21 +1244,28 @@
         }   
     }
            
-    QString vCardName = QString(mContact->displayLabel().append(".vcf"));
+    QString vCardName;
+    if ( mContact->displayLabel().isEmpty() ) {
+        vCardName = hbTrId("txt_phob_list_unnamed").append(".vcf");
+    } else
+        vCardName = mContact->displayLabel().append(".vcf");
+    
     QString vCardPath = dir.absolutePath().append(QDir::separator());
     vCardPath.append(vCardName);
     vCardPath = QDir::toNativeSeparators(vCardPath);
-        
+    
     QVersitContactExporter exporter;
+    CntVCardDetailHandler hanlder;
+    exporter.setDetailHandler(&hanlder);
     // The vCard version needs to be 2.1 due to backward compatiblity when sending 
     if (exporter.exportContacts(list, QVersitDocument::VCard21Type))
     {
-        qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard, VCard21Type";
+        CNT_LOG_ARGS("VCard21Type");
         QList<QVersitDocument> docs = exporter.documents();
         QFile f(vCardPath);
         if ( f.open(QIODevice::WriteOnly) ) 
         {
-            qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard write VCard";
+            CNT_LOG_ARGS("write VCard");
             // Start creating the vCard
             QVersitWriter writer;
             writer.setDevice(&f);
@@ -1142,7 +1282,8 @@
             mShareUi->send(l,false);
         }
     }
-    qDebug() << "CntContactCardViewPrivate::handleSendBusinessCard - OUT";
+    
+    CNT_EXIT
 }
 
 
@@ -1186,7 +1327,7 @@
             }
             mAvatar->setImageUrl(QUrl());
             mImageLabel->clear();
-            mImageLabel->setIcon(HbIcon("qtg_large_add_contact_picture"));
+            mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_contact_picture"));
             mHeadingItem->setIcon(HbIcon("qtg_large_add_contact_picture"));
             contactManager()->saveContact(mContact);
         }
@@ -1200,7 +1341,7 @@
 {
     HbMenu *menu = new HbMenu();
     menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(doChangeImage()) );
-    if (mAvatar)
+    if (mAvatar && !mAvatar->imageUrl().isEmpty())
     {
         menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(doRemoveImage()) );
     }
@@ -1229,17 +1370,24 @@
     return mViewManager->contactManager(SYMBIAN_BACKEND);
 }
 
-void CntContactCardViewPrivate::keyPressed(QKeyEvent *event)
+bool CntContactCardViewPrivate::eventFilter(QObject *obj, QEvent *event)
 {
-    if (event->key() == Qt::Key_Yes )
+    if (event->type() == QEvent::KeyPress && obj == mView->mainWindow())
     {
-        sendKeyPressed();
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        if (keyEvent->key() == Qt::Key_Yes)
+        {
+            return sendKeyPressed();
+        }
     }
+    return false;
 }
 
-void CntContactCardViewPrivate::sendKeyPressed()
+bool CntContactCardViewPrivate::sendKeyPressed()
 {   
     int count = 0;
+    bool keyConsumed = false;
+    
     for (int index = 0; index < mDataContainer->itemCount(); index++)
     {
         CntContactCardDataItem* dataItem = mDataContainer->dataItem(index);
@@ -1248,41 +1396,58 @@
             count++;
         }
     }
-    if (!count)
-    {
-        XQServiceRequest snd("com.nokia.services.logsservices.starter", "start(int,bool)", false);
-        snd << 0; // all calls
-        snd << true; // show dialpad
-        snd.send();
-    }
-    else
+
+    if (count)
     {
         QContactDetail preferredDetail = mContact->preferredDetail("call");
         if (!preferredDetail.isEmpty())
         {
-            executeAction(*mContact, preferredDetail, "call", NULL); 
+            keyConsumed = true;
+            executeAction(*mContact, preferredDetail, "call");
         }
         else if (count == 1 )
         {
-           mContact->setPreferredDetail("call", mContact->details<QContactPhoneNumber>().first());
-           executeAction( *mContact, mContact->details<QContactPhoneNumber>().first(), "call", NULL); 
+            keyConsumed = true;
+            executeAction( *mContact, mContact->details<QContactPhoneNumber>().first(), "call"); 
         }
         else if(count >= 2 && mAcceptSendKey)
-        {   
+        {
+            keyConsumed = true;
             mAcceptSendKey = false;
             CntActionPopup *actionPopup = new CntActionPopup(mContact);
             actionPopup->showActionPopup("call");
             connect( actionPopup, SIGNAL(executeContactAction(QContact&, QContactDetail, QString)), this, 
                     SLOT(executeAction(QContact&, QContactDetail, QString)));   
             connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, 
-                                SLOT(sendKeyCancelSlot()));   
-            
+                    SLOT(sendKeyCancelSlot()));
+        }
+        else
+        {
+            //ignore
         }
     }
+    
+    return keyConsumed;
 }
 
 void CntContactCardViewPrivate::sendKeyCancelSlot()
 {
     mAcceptSendKey = true;
 }
+
+void CntContactCardViewPrivate::onAddedToContacts()
+{
+    emit addToContacts();
+}
+
+void CntContactCardViewPrivate::contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds)
+{
+    if ( contactIds.contains(mContact->localId()) )
+    {
+        // Do not switch to the previous view immediately. List views are
+        // not updated properly if this is not done in the event loop
+        QTimer::singleShot(0, this, SLOT(showRootView()));
+    }
+}
+
 // end of file
--- a/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -58,13 +58,27 @@
     if ( detail.definitionName() == QContactBirthday::DefinitionName )
     {
         QContactBirthday bd = detail;
-        editDate( bd.date(), hbTrId("txt_phob_formlabel_birthday") );
+        if (bd.date().isNull())
+        {
+            editDate( QDate::currentDate(), hbTrId("txt_phob_formlabel_birthday") );
+        }
+        else
+        {
+            editDate( bd.date(), hbTrId("txt_phob_formlabel_birthday") );
+        }
     }
 
     if ( detail.definitionName() == QContactAnniversary::DefinitionName )
     {
         QContactAnniversary anniversary = detail;
-        editDate( anniversary.originalDate(), hbTrId("txt_phob_formlabel_anniversary") );
+        if (anniversary.originalDate().isNull())
+        {
+            editDate( QDate::currentDate(), hbTrId("txt_phob_formlabel_anniversary") );
+        }
+        else
+        {
+            editDate( anniversary.originalDate(), hbTrId("txt_phob_formlabel_anniversary") );
+        }
     }
 }
 
@@ -78,9 +92,11 @@
 
     QContactDetail detail = item->detail();
     QString text(hbTrId("txt_phob_formlabel_val_formlabel_val_no_date_set"));
+    QString buttonObjName;
 
     if ( detail.definitionName() == QContactBirthday::DefinitionName )
     {
+        buttonObjName = detail.definitionName() + " button";
         QContactBirthday birthday = detail;
         if ( !birthday.isEmpty() )
         {
@@ -90,6 +106,7 @@
 
     if ( detail.definitionName() == QContactAnniversary::DefinitionName )
     {
+        buttonObjName = detail.definitionName() + " button";
         QContactAnniversary anniversary = detail;
         if ( !anniversary.isEmpty() )
         {
@@ -97,6 +114,8 @@
         }
     }
     mButton->setText( text );
+    // Naming UI components for automation testability
+    mButton->setObjectName(buttonObjName);
     return mButton;
 }
 
--- a/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -34,7 +34,6 @@
 #include "cntgroupactionsview.h"
 #include "cnthistoryview.h"
 #include "cnteditview.h"
-#include "cntmycardselectionview.h"
 #include "cntimportsview.h"
 #include "cntsettingsview.h"
 #include "cntextensionmanager.h"
@@ -57,17 +56,15 @@
     {
     case namesView:
         return new CntNamesView(*mExtensionManager);
-    case commLauncherView:
+    case contactCardView:
         return new CntContactCardView();
     case myCardView:
         return new CntMyCardView();
-    case myCardSelectionView:
-        return new CntMyCardSelectionView();
     case collectionView:
         return new CntCollectionView(*mExtensionManager);
     case collectionFavoritesView:
         return new CntFavoritesView();
-    case FavoritesMemberView:
+    case favoritesMemberView:
         return new CntFavoritesMemberView();
     case editView:
 		return new CntEditView();
--- a/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -113,14 +113,14 @@
     CNT_EXIT
 }
 
-void CntDefaultViewManager::back(const CntViewParameters aArgs)
+void CntDefaultViewManager::back(const CntViewParameters aArgs, bool toRoot)
 {
     CNT_ENTRY
     
     mArgs.clear();
     
     QFlags<Hb::ViewSwitchFlag> flags;
-    int back = mNavigator->back( flags );
+    int back = mNavigator->back( flags, toRoot );
 
     foreach( int k, aArgs.keys() )
     {
@@ -132,7 +132,8 @@
     {
         switchView( mArgs, flags );
     }
-    else {
+    else 
+    {
         // exiting application
         cleanup();
         closeApp();
@@ -192,10 +193,6 @@
     {
         connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deleteOldView()));
     }
-    else
-    {
-        mMainWindow->setInteractive( true );
-    }
     
     CNT_EXIT
 }
@@ -209,28 +206,22 @@
     if (mOldView)
     {
         mOldView->deactivate();
-        
-        // Due to something strange in wk16, this check will fail occationally and cause
-        // a memory leak... most likely when opening edit view for the first time
-        if (mCurrent == NULL || !mOldView->view()->isVisible())
+
+        HbView* oldView = mOldView->view();
+        mMainWindow->removeView( oldView );
+
+        if (!mOldView->isDefault())
         {
-            mMainWindow->removeView(mOldView->view());
-            
-            if (!mOldView->isDefault())
-            {
-                delete mOldView;
-                mOldView = NULL;
-            }
-            // If view id is not in defaults list, it means that view has changed
-            // its opinnion about preserving state to true.
-            else if ( !mDefaults.contains(mOldView->viewId()) ) 
-            {
-                mDefaults.insert( mOldView->viewId(), mOldView );
-            }
+            delete mOldView;
+            mOldView = NULL;
+        }
+        // If view id is not in defaults list, it means that view has changed
+        // its opinnion about preserving state to true.
+        else if ( !mDefaults.contains(mOldView->viewId()) ) 
+        {
+            mDefaults.insert( mOldView->viewId(), mOldView );
         }
     }
-
-    mMainWindow->setInteractive(true);
     
     CNT_EXIT
 }
@@ -238,8 +229,7 @@
 void CntDefaultViewManager::switchView(const CntViewParameters aArgs, QFlags<Hb::ViewSwitchFlag> flags)
 {
     CNT_ENTRY
-    
-    mMainWindow->setInteractive(false);
+
     int id = aArgs.value(EViewId).toInt();
     if ( id != noView )
     {
@@ -268,4 +258,10 @@
     
     CNT_EXIT
 }
+
+int CntDefaultViewManager::currentViewId()
+{
+    return mCurrent->viewId();
+}
+
 // End of File
--- a/phonebookui/pbkcommonui/src/cntdetaileditor.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdetaileditor.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,7 +17,9 @@
 #include "cntdetaileditor.h"
 #include "cnteditorfactory.h"
 #include "cntgroupeditormodel.h"
+#include "cntsavemanager.h"
 #include "cntglobal.h"
+
 #include <cntviewparams.h>
 #include <hbmenu.h>
 #include <hbaction.h>
@@ -29,6 +31,13 @@
 #include <hbinputeditorinterface.h>
 #include <hbinputstandardfilters.h>
 #include <cntdebug.h>
+#include <hbscrollarea.h>
+#include <hbscrollbar.h>
+#include <hbdevicenotificationdialog.h>
+#include <hbparameterlengthlimiter.h>
+
+#include <QApplication>
+#include <QTimer>
 
 const char *CNT_DETAILEDITOR_XML = ":/xml/contacts_detail_editor.docml";
 
@@ -41,7 +50,8 @@
     mLoader(NULL),   
     mViewManager(NULL),
     mEditorFactory(NULL),
-    mCancel(NULL)
+    mCancel(NULL),
+    mSaveManager(NULL)
 {
     bool ok;
     document()->load(CNT_DETAILEDITOR_XML, &ok);
@@ -57,16 +67,27 @@
     
     mSoftkey = new HbAction(Hb::BackNaviAction, mView);
     connect( mSoftkey, SIGNAL(triggered()), this, SLOT(saveChanges()) );
+    
+    // closing the application from task swapper or end key will cause the contact to be saved
+    connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveContact()));
 }
 
 CntDetailEditor::~CntDetailEditor()
 {
     mView->deleteLater();
+    
     delete mDataForm;
+    mDataForm = NULL;
     delete mDataFormModel;
+    mDataFormModel = NULL;
     delete mHeader;
+    mHeader = NULL;
     delete mLoader;
+    mLoader = NULL;
     delete mEditorFactory;
+    mEditorFactory = NULL;
+    delete mSaveManager;
+    mSaveManager = NULL;
 }
 
 void CntDetailEditor::setViewId( int aId )
@@ -106,8 +127,31 @@
         selectedContact = aArgs.value(ESelectedContact).value<QContact>();
         connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) );
     }
+    
+    QContactManager* cm = mViewManager->contactManager(SYMBIAN_BACKEND);
+    connect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)), 
+        this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
+    
     mEditorFactory->setupEditorView(*this, selectedContact);
     
+    QString myCard = mArgs.value( EMyCard ).toString();
+    QContactLocalId localId = selectedContact.localId();
+    QContactLocalId selfContactId = mViewManager->contactManager(SYMBIAN_BACKEND)->selfContactId();
+    bool isMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty();
+    
+    if (isMyCard)
+    {
+        mSaveManager = new CntSaveManager(CntSaveManager::EMyCard);
+    }
+    else if ( mId == groupEditorView )
+    {
+        mSaveManager = new CntSaveManager(CntSaveManager::EGroup);
+    }
+    else
+    {
+        mSaveManager = new CntSaveManager();
+    }
+    
     mDataForm->setItemRecycling(true);
 
     // add new field if required
@@ -115,6 +159,9 @@
     {
         mDataFormModel->insertDetailField();
     }
+    mDataForm->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded); 
+    mDataForm->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+    mDataForm->verticalScrollBar()->setInteractive(true);
 }
 
 void CntDetailEditor::deactivate()
@@ -123,6 +170,10 @@
         QContactManager* mgr = mViewManager->contactManager(SYMBIAN_BACKEND);
         mgr->saveContact( mDataFormModel->contact() );
     }
+    
+    QContactManager *cm = mViewManager->contactManager(SYMBIAN_BACKEND);
+    disconnect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)),
+            this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
 }
     
 bool CntDetailEditor::isDefault() const
@@ -151,27 +202,42 @@
 
 void CntDetailEditor::handleItemShown(const QModelIndex& aIndex )
 {
-    if ( mId == groupEditorView )
-    {
-        CntGroupEditorModel* groupModel = static_cast<CntGroupEditorModel*>( mDataFormModel );    
-        if ( groupModel->isConferenceNumber(aIndex) )
-        {
-            HbDataFormViewItem* viewItem = static_cast<HbDataFormViewItem*>(mDataForm->itemByIndex( aIndex ));
-            HbLineEdit* edit = static_cast<HbLineEdit*>( viewItem->dataItemContentWidget() );
-            edit->setInputMethodHints( Qt::ImhDialableCharactersOnly );
-        }
-    }
-    else
+    HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex );
+    
+    if ( modelItem->type() == HbDataFormModelItem::TextItem ) 
     {
         HbDataFormViewItem* viewItem = static_cast<HbDataFormViewItem*>(mDataForm->itemByIndex( aIndex ));
         HbLineEdit* edit = static_cast<HbLineEdit*>( viewItem->dataItemContentWidget() );
-        edit->setInputMethodHints( Qt::ImhNoPredictiveText );
+        QString objName;
         
-        HbDataFormModelItem* modelItem = mDataFormModel->itemFromIndex( aIndex );
-        if (modelItem->contentWidgetData( "preferDigits" ).toBool())
+        if ( mId == groupEditorView )
         {
-            edit->setInputMethodHints( Qt::ImhPreferNumbers );
+            CntGroupEditorModel* groupModel = static_cast<CntGroupEditorModel*>( mDataFormModel );    
+            if ( groupModel->isConferenceNumber(aIndex) )
+            {
+                edit->setInputMethodHints( Qt::ImhDialableCharactersOnly );
+                objName = "Conference number line edit %1";
+            }
+            else
+            {
+                edit->setInputMethodHints( Qt::ImhNoPredictiveText );
+                objName = "Group name line edit %1";
+            }
         }
+        else
+        {
+            edit->setInputMethodHints( Qt::ImhNoPredictiveText );
+            
+            if (modelItem->contentWidgetData( "preferDigits" ).toBool())
+            {
+                edit->setInputMethodHints( Qt::ImhPreferNumbers );
+            }
+            
+            objName = mDataFormModel->detail().definitionName() + " line edit %1";
+        }
+        
+        // Naming UI components for automation testability
+        edit->setObjectName(objName.arg(aIndex.row()));
     }
 }
 
@@ -184,6 +250,10 @@
     mViewManager->back( mArgs );
 }
 
+/*!
+    Saves all changes made to details (type of details depends on
+    in which editor we are) of a contact. Doesn't save the contact.
+*/
 void CntDetailEditor::saveChanges()
 {
     mDataFormModel->saveContactDetails();
@@ -208,6 +278,46 @@
     mViewManager->back( mArgs );
 }
 
+/*!
+    First saves all changes made to details (type of details depends on
+    in which editor we are) of a contact and then saves the contact. This
+    is only called when phonebook is being closed either from task swapper
+    or by end key.
+*/
+void CntDetailEditor::saveContact()
+{
+    mDataFormModel->saveContactDetails();
+    
+    QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mDataFormModel->contact());
+    
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
+    
+    CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mDataFormModel->contact(), mViewManager->contactManager(SYMBIAN_BACKEND));
+    
+    if (mId != groupEditorView)
+    {
+        switch (result)
+        {
+        case CntSaveManager::ESaved:
+            HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name));
+            break;
+        case CntSaveManager::EUpdated:
+            HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name));
+            break;
+        case CntSaveManager::EFailed:
+            HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!"));
+            break;
+        case CntSaveManager::EDeleted:
+        case CntSaveManager::ENothingDone:
+        default:
+            break;
+        }
+    }
+}
+
 void CntDetailEditor::setHeader(QString aHeader)
 {
     if (!mHeader) {
@@ -236,4 +346,28 @@
     return mId;
 }
 
+/*!
+Go back to the root view
+*/
+void CntDetailEditor::showRootView()
+{   
+    mViewManager->back( mArgs, true );
+}
+
+
+void CntDetailEditor::contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds)
+{
+    CNT_ENTRY
+    
+    QContact normalContact = mArgs.value(ESelectedContact).value<QContact>();
+    QContact groupContact = mArgs.value(ESelectedGroupContact).value<QContact>();
+    if ( contactIds.contains(normalContact.localId()) || contactIds.contains(groupContact.localId()) )
+    {
+        // Do not switch to the previous view immediately. List views are
+        // not updated properly if this is not done in the event loop
+        QTimer::singleShot(0, this, SLOT(showRootView()));
+    }
+    CNT_EXIT
+}
+
 // End of File
--- a/phonebookui/pbkcommonui/src/cntdetailpopup.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdetailpopup.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -18,23 +18,13 @@
 #include "cntdetailpopup.h"
 
 #include <hblabel.h>
-#include <hbgroupbox.h>
-#include <hbaction.h>
-#include <qtcontacts.h>
-#include <hblistview.h>
-#include <hblistviewitem.h>
 #include <QStandardItemModel>
 
-QTM_USE_NAMESPACE
-
 CntDetailPopup::CntDetailPopup(QGraphicsItem *parent,  CntViewIdList aList ):
-    HbDialog(parent),
+    HbSelectionDialog(parent),
     mListModel(NULL),
-    mListView(NULL),
-    mSelectedDetail(0),
     mViewIdList( aList )
 {
-    mListView = new HbListView(this);
     mListModel = new QStandardItemModel(this);
 
     addListItem("qtg_small_mobile", hbTrId("txt_phob_list_number"), phoneNumberEditorView );
@@ -47,41 +37,21 @@
     addListItem("qtg_small_company_details", hbTrId("txt_phob_list_company_details"), companyEditorView);
     addListItem("qtg_small_family", hbTrId("txt_phob_list_family"), familyDetailEditorView);
     
-    mListView->setModel(mListModel);
-    mListView->setSelectionMode(HbAbstractItemView::NoSelection);
-    // ownership of prototype is not transferred
-    HbListViewItem* prototype = mListView->listItemPrototype();
-    prototype->setGraphicsSize( HbListViewItem::SmallIcon );
-    
     HbLabel *label = new HbLabel(this);    
     label->setPlainText(hbTrId("txt_phob_title_add_field"));
 
     setHeadingWidget(label);
-    setContentWidget(mListView);
-
-    HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"), this);
-    addAction(cancelAction);
     setTimeout(HbDialog::NoTimeout);
     setDismissPolicy(HbDialog::NoDismiss);
     setAttribute(Qt::WA_DeleteOnClose, true);
     setModal(true);
-
-    connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(listItemSelected(QModelIndex)));
+    setSelectionMode(HbAbstractItemView::SingleSelection);
+    setModel(mListModel);
 }
 
 CntDetailPopup::~CntDetailPopup()
 {
-}
-
-void CntDetailPopup::listItemSelected(QModelIndex index)
-{
-    mSelectedDetail = mListModel->item(index.row())->data(Qt::UserRole).toInt();
-    close();
-}
-
-int CntDetailPopup::selectedDetail()
-{
-    return mSelectedDetail;
+    
 }
 
 void CntDetailPopup::selectDetail( CntViewIdList aList, QObject *receiver, const char *member  )
--- a/phonebookui/pbkcommonui/src/cntdocumentloader.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdocumentloader.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -21,6 +21,7 @@
 #include "cntdocumentloader.h"
 #include "cnteditviewheadingitem.h"
 #include "cntcontactcardheadingitem.h"
+#include "cntfetchmarkall.h"
 #include "cntimagelabel.h"
 
 CntDocumentLoader::CntDocumentLoader()
@@ -59,6 +60,14 @@
            result->setObjectName(name);
        }
     }
+    else if ( type == "CntFetchMarkAll" )
+    {
+        result = new CntFetchMarkAll();
+        if ( result )
+        {
+            result->setObjectName(name);
+        }
+    }
     else
     {
         result = HbDocumentLoader::createObject(type,name);    
--- a/phonebookui/pbkcommonui/src/cnteditview_p.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditview_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -21,7 +21,9 @@
 #include "cntdetailpopup.h"
 #include "cnteditviewheadingitem.h"
 #include "cntimagelabel.h"
+#include "cntsavemanager.h"
 #include "cntglobal.h"
+#include "cntdebug.h"
 
 #include <qtcontacts.h>
 #include <hbdocumentloader.h>
@@ -39,17 +41,22 @@
 #include <hbdevicenotificationdialog.h>
 #include <xqaiwrequest.h>
 #include <xqaiwdecl.h>
-#include <QDir>
+#include <cntservicescontact.h>
+
+#include <QFileInfo>
+#include <QApplication>
+#include <QTimer>
 
 const char *CNT_EDIT_XML = ":/xml/contacts_ev.docml";
 
 CntEditViewPrivate::CntEditViewPrivate() :
-mModel( NULL ),
-mImageLabel( NULL ),
-mThumbnailManager( NULL ),
-mContact( NULL ),
-mReq(0),
-mMenu(NULL)
+    mModel( NULL ),
+    mImageLabel( NULL ),
+    mThumbnailManager( NULL ),
+    mContact( NULL ),
+    mReq(NULL),
+    mMenu(NULL),
+    mSaveManager(NULL)
 {
     mDocument = new CntDocumentLoader;
     
@@ -93,19 +100,30 @@
     connect( mHeading, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) );
     connect( mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(activated(const QModelIndex&)) );
     connect( mListView, SIGNAL(longPressed(HbAbstractViewItem*,const QPointF&)), this, SLOT(longPressed(HbAbstractViewItem*,const QPointF&)) );
+    
+    // closing the application from task swapper or end key will cause the contact to be saved
+    connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveChanges()));
 }
 
 CntEditViewPrivate::~CntEditViewPrivate()
 {
     mView->deleteLater();
+    
     delete mDocument;
+    mDocument = NULL;
     delete mModel;
+    mModel = NULL;
     delete mContact;
+    mContact = NULL;
     if (mMenu) 
     {
         delete mMenu;
+        mMenu = NULL;
     }
     delete mThumbnailManager;
+    mThumbnailManager = NULL;
+    delete mSaveManager;
+    mSaveManager = NULL;
 }
 
 void CntEditViewPrivate::setOrientation(Qt::Orientation orientation)
@@ -124,6 +142,8 @@
 
 void CntEditViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
 {
+    CNT_ENTRY
+    
     mMgr = aMgr;
     mArgs = aArgs;
     
@@ -150,7 +170,16 @@
     QContactLocalId localId = mContact->localId();
     QContactManager* cm = mMgr->contactManager(SYMBIAN_BACKEND);
     QContactLocalId selfContactId = cm->selfContactId();
-    mIsMyCard = ( localId == selfContactId && localId != 0 ) || myCard == "myCard";
+    mIsMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty();
+    
+    if (mIsMyCard)
+    {
+        mSaveManager = new CntSaveManager(CntSaveManager::EMyCard);
+    }
+    else
+    {
+        mSaveManager = new CntSaveManager();
+    }
     
     if ( mHeading )
         mHeading->setDetails( mContact, mIsMyCard );
@@ -195,6 +224,8 @@
             this, SLOT(thumbnailReady(QPixmap, void*, int, int)) );
 
     loadAvatar();
+    
+    CNT_EXIT
 }
 
 void CntEditViewPrivate::deactivate()
@@ -321,10 +352,12 @@
 {
     CntDetailPopup *popup = static_cast<CntDetailPopup*>(sender());
     
-    if (popup && aAction != popup->actions().first())
+    if (popup && aAction != popup->actions().first() && popup->selectedItems().count())
     {
-        int id = popup->selectedDetail();
-        
+        int row = popup->selectedItems().first().toInt();
+        QModelIndex index = popup->model()->index(row, 0);
+        int id = popup->model()->data(index, Qt::UserRole).toInt();
+
         if (id != noView )
         {
             mArgs.insert(EViewId, id );
@@ -423,31 +456,36 @@
     if ( mIsMyCard )
     {
         HbMessageBox::question(hbTrId("txt_phob_dialog_remove_all_personal_data_from_my_c"), this, 
-                SLOT(handleDeleteContact(HbAction*)), 
-                hbTrId("txt_common_button_yes"), 
-                hbTrId("txt_common_button_no"));
+                SLOT(handleDeleteContact(int)), 
+                HbMessageBox::Yes | HbMessageBox::No);
     }
     else
     {
         QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND );
-        QString name = cm->synthesizedDisplayLabel( *mContact );
-        HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)), 
-                hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"));
+        QString name = cm->synthesizedContactDisplayLabel( *mContact );
+        if (name.isEmpty())
+        {
+            name = hbTrId("txt_phob_list_unnamed");
+        }
+        
+        HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)), 
+                HbMessageBox::Delete | HbMessageBox::Cancel);
     }
 }
 
-void CntEditViewPrivate::handleDeleteContact(HbAction *action)
+void CntEditViewPrivate::handleDeleteContact(int action)
 {
     Q_Q(CntEditView);
-    
-    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
-    if(dlg && action == dlg->actions().first())
+
+    if(action == HbMessageBox::Yes || action == HbMessageBox::Delete)
     {
         QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND );
 
+        disconnect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)),
+                this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
         emit q->contactRemoved(cm->removeContact( mContact->localId() ));
         
-        mMgr->back( mArgs );
+        mMgr->back( mArgs, true );
     }
 }
 
@@ -459,155 +497,79 @@
     
     // get a fresh one from backend.
     QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND);
-    mContact = new QContact(mgr->contact( mContact->localId() ));
+    setSelectedContact( mgr->contact( mContact->localId()) );
     
     QVariant var;
     var.setValue(*mContact);
     
     CntViewParameters viewParameters;
     viewParameters.insert(ESelectedContact, var);
-            
-    mMgr->back( viewParameters );
-}
+    
+    if ( mArgs.value( EExtraAction ).toString() == CNT_ROOT_ACTION )
+    {
+        mMgr->back( viewParameters, true );
+    }
+    else
+    {
+        mMgr->back( viewParameters );
+    }
+       
+}   
 
 void CntEditViewPrivate::saveChanges()
 {
     Q_Q(CntEditView);
-
-    QContactManager* mgr = mMgr->contactManager( SYMBIAN_BACKEND );
-    bool isSavedContact = mContact->localId() > 0;
     
-    // if the contact is really changed or a new one
-    if ( (*mContact) != mgr->contact(mContact->localId()) || !isSavedContact )
+    QString name = mMgr->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact);
+    
+    if (name.isEmpty())
     {
-        int detailCount = mContact->details().count();
-         
-        setPreferredDetails( mContact );
-        
-        // If its a new contact
-        if ( !isSavedContact )
-        {
-            if ( detailCount > 2 )
-            {
-                bool success = mgr->saveContact( mContact );
-                if ( success && mIsMyCard )
-                {
-                    mgr->setSelfContactId( mContact->localId() );
-                }
-                
-                QString name = mgr->synthesizedDisplayLabel( *mContact );
-                if (name.isEmpty())
-                {
-                    name = hbTrId("txt_phob_dblist_unnamed");
-                }
-                
-                if ( success )
-                {
-                    emit q->contactUpdated(1);
-                    HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name));
-                }
-                else
-                {
-                    emit q->contactUpdated(0);
-                    //TODO: localization is missing
-                    HbDeviceNotificationDialog::notification(QString(),qtTrId("SAVING FAILED!"));
-                }
-                
-                QVariant var;
-                var.setValue(*mContact);
-                mArgs.insert(ESelectedContact, var);
-                mArgs.insert(ESelectedAction, CNT_CREATE_ACTION);
-            }
-            else
-            {
-                // nothing happened to the contact. Flags should be used
-                emit q->contactUpdated(-2);
-            }
-        }
-        else
-        {
-            // contact details has been cleared out.
-            if ( detailCount <= 4 )
-            {
-                // get the contact from database, it should have the name still in it,
-                // and show the delete notification to user
-                QContact c = mgr->contact( mContact->localId() );
-                
-                bool success = mgr->removeContact( mContact->localId() );
-                emit q->contactRemoved(success);
-            }
-            else
-            {
-                bool success = mgr->saveContact(mContact);
-                
-                QString name = mgr->synthesizedDisplayLabel( *mContact );
-                if (name.isEmpty())
-                {
-                    name = hbTrId("txt_phob_dblist_unnamed");
-                }
-                
-                if ( success )
-                {   
-                    emit q->contactUpdated(1);
-                    HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name));
-                    mArgs.insert(ESelectedAction, CNT_EDIT_ACTION);           
-                }
-                else
-                {
-                    emit q->contactUpdated(0);
-                    //TODO: localization is missing
-                    HbDeviceNotificationDialog::notification(QString(),qtTrId("SAVING FAILED!"));
-                }
-                
-                QVariant var;
-                var.setValue(*mContact);
-                mArgs.insert(ESelectedContact, var);           
-            }
-        }
-    }
-    else
-    {
-        emit q->changesDiscarded();
+        name = hbTrId("txt_phob_list_unnamed");
     }
     
-    mMgr->back( mArgs );
-}
-
-void CntEditViewPrivate::setPreferredDetails( QContact* aContact )
-{
-    QList<QContactPhoneNumber> numberList( aContact->details<QContactPhoneNumber>() );
-    //set preferred number for call if there is only one phone number
-    if ( aContact->preferredDetail("call").isEmpty() && numberList.count() == 1 )
-    {
-        aContact->setPreferredDetail( "call", numberList.first() );
-    }
-    //set preferred number for message if there is only one mobile phone number
-    if ( aContact->preferredDetail("message").isEmpty() && numberList.count() >= 1 )
+    CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mContact, mMgr->contactManager(SYMBIAN_BACKEND));
+    
+    QVariant var;
+    bool backToRoot(false);
+    
+    switch (result)
     {
-        int mobileNumbers = 0;
-        int mobileNumberIndex = -1;
-        for (int i = 0; i < numberList.count(); i++)
-        {
-            if (numberList.at(i).subTypes().count() && numberList.at(i).subTypes().first() == QContactPhoneNumber::SubTypeMobile)
-            {
-                mobileNumbers++;
-                mobileNumberIndex = i;
-            }      
-        }
-        if ( mobileNumbers == 1 )
-        {
-            aContact->setPreferredDetail( "message", numberList.at(mobileNumberIndex) );
-        }
+    case CntSaveManager::ESaved:
+        emit q->contactUpdated(KCntServicesReturnValueContactSaved);
+        HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name));
+        var.setValue(*mContact);
+        mArgs.insert(ESelectedContact, var);
+        mArgs.insert(ESelectedAction, CNT_CREATE_ACTION);
+        break;
+    case CntSaveManager::EUpdated:
+        emit q->contactUpdated(KCntServicesReturnValueContactSaved);
+        HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name));
+        var.setValue(*mContact);
+        mArgs.insert(ESelectedContact, var);
+        mArgs.insert(ESelectedAction, CNT_EDIT_ACTION);
+        break;
+    case CntSaveManager::EFailed:
+        emit q->contactUpdated(KCntServicesReturnValueContactNotModified);
+        HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!"));
+        break;
+    case CntSaveManager::EDeleted:
+        emit q->contactRemoved(true);
+        backToRoot = true;
+        break;
+    case CntSaveManager::ENothingDone:
+    default:
+        emit q->contactUpdated(KCntServicesReturnValueContactNotModified);
+        break;
     }
-    QList<QContactEmailAddress> emailList( aContact->details<QContactEmailAddress>() );
-    //set preferred number for email if there is only one email address
-    if ( aContact->preferredDetail("email").isEmpty() && emailList.count() == 1 )
+
+    if ( mArgs.value( EExtraAction ).toString() == CNT_ROOT_ACTION )
     {
-        aContact->setPreferredDetail( "email", emailList.first() );
-    }   
+        backToRoot = true;
+    }
+    
+    mMgr->back( mArgs, backToRoot );
 }
 
-
 void CntEditViewPrivate::openNameEditor()
 {
     QVariant var;
@@ -670,7 +632,7 @@
         mHeading->setIcon(icon);
         
         mImageLabel->clear();
-        mImageLabel->setIcon(icon);
+        mImageLabel->setIcon(pixmap);
     }
 }
 
@@ -744,14 +706,15 @@
 void CntEditViewPrivate::addDetail( CntEditViewItem* aDetail )
 {
     QVariant id = aDetail->data( ERoleEditorViewId );
-    CntViewParameters viewParameters;
-    viewParameters.insert(EViewId, id.toInt());
+    
+    mArgs.insert(EViewId, id.toInt());
+    mArgs.insert(ESelectedAction, CNT_ADD_ACTION );
     QVariant var;
     var.setValue(*mContact);
-    viewParameters.insert(ESelectedContact, var);
-    viewParameters.insert(ESelectedAction, CNT_ADD_ACTION );
-                                            
-    mMgr->changeView( viewParameters );
+    
+    mArgs.insert(ESelectedContact, var);
+                                        
+    mMgr->changeView( mArgs );
 }
 
 void CntEditViewPrivate::editDetail( CntEditViewItem* aDetail )
@@ -783,19 +746,37 @@
         mContact = NULL;
     }
     mContact = new QContact( aContact );
-    /*
-    mListView->setModel( NULL );
     
-    if ( mModel )
+    QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND );
+    connect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)), 
+        this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)), Qt::UniqueConnection);
+}
+
+void CntEditViewPrivate::contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds)
+{
+    CNT_ENTRY
+    
+    if ( contactIds.contains(mContact->localId()) )
     {
-        delete mModel;
-        mModel = NULL;
+        // Do not switch to the previous view immediately. List views are
+        // not updated properly if this is not done in the event loop
+        QTimer::singleShot(0, this, SLOT(showRootView()));
     }
-    mModel = new CntEditViewListModel( mContact );
     
-    if ( mListView )
-        mListView->setModel( mModel );
-        */
+    CNT_EXIT
 }
+
+void CntEditViewPrivate::showRootView()
+{
+    CNT_ENTRY
+    
+    Q_Q(CntEditView);
+    
+    emit q->contactRemoved(true);
+    mMgr->back( mArgs, true );
+    
+    CNT_EXIT
+}
+
 // End of File
 
--- a/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -26,6 +26,7 @@
 #include <hbtoucharea.h>
 #include <hbinstantfeedback.h>
 #include <hbmainwindow.h>
+#include <hbeffect.h>
 #include <xqsettingsmanager.h>
 #include <xqsettingskey.h>
 #include <cntuids.h>
@@ -38,11 +39,13 @@
     mLabel(NULL),
     mSecondLabel(NULL),
     mFrameItem(NULL),
+    mFocusItem(NULL),
     mIconTouchArea(NULL),
     mIconFocused(false),
     mTextFocused(false)
 {
-
+    HbEffect::add("icon", "groupbox_icon_click", "iconclick");
+    setProperty("state", "normal");
 }
 
 CntEditViewHeadingItem::~CntEditViewHeadingItem()
@@ -113,12 +116,22 @@
     if (!mFrameItem)
     {
         mFrameItem = new HbFrameItem(this);
-        mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox");
+        mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal");
         mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
         mFrameItem->setZValue(-2);
         style()->setItemName(mFrameItem, "background");
     }
 
+    if (!mFocusItem)
+    {
+       mFocusItem = new HbFrameItem(this);
+       mFocusItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_pressed");
+       mFocusItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+       mFocusItem->setZValue(-1);
+       mFocusItem->setVisible(false);
+       style()->setItemName(mFocusItem, "highlight");
+    }
+    
     if (!mIconTouchArea)
     {
         mIconTouchArea = new HbTouchArea(this);
@@ -152,6 +165,20 @@
 void CntEditViewHeadingItem::updatePrimitives()
 {
     HbWidget::updatePrimitives();
+    if (mTextFocused)
+    {
+       mFocusItem->setVisible(true);
+       setProperty("state", "pressed");
+    }
+    else if (mIconFocused)
+    {
+       HbEffect::start(mIcon, QString("icon"), QString("iconclick"));
+    }
+    else
+    {
+       mFocusItem->setVisible(false);
+       setProperty("state", "normal");
+    }
 }
 
 void CntEditViewHeadingItem::setDetails(const QContact* contact, bool myCard)
@@ -171,16 +198,18 @@
                              KCntNameOrdering);
     int setting = settingsMng.readItemValue(nameOrderKey, XQSettingsManager::TypeInt).toInt();
     QStringList nameList = QStringList();
-    QString last;
+    QString last_first;
     
     switch( setting ) {
         case CntOrderLastFirst:
             nameList << name.prefix() << name.lastName() << name.firstName() << name.middleName() << name.suffix();
             break;
         case CntOrderLastCommaFirst:
-            if (!name.lastName().isEmpty())
-                last = name.lastName() + ",";
-            nameList << name.prefix() << last << name.firstName() << name.middleName() << name.suffix();
+            if (!name.firstName().isEmpty() && !name.lastName().isEmpty())
+                last_first = name.lastName() + ", " + name.firstName();
+            else
+                last_first = !name.firstName().isEmpty() ? name.firstName() : name.lastName();
+            nameList << name.prefix() << last_first << name.middleName() << name.suffix();
             break;
         default:    // Default to first name last name
             nameList << name.prefix() << name.firstName() << name.middleName() << name.lastName() << name.suffix();
@@ -231,10 +260,12 @@
     if (mIconTouchArea->rect().contains(event->pos()))
     {
         mIconFocused = true;
+        updatePrimitives();
     }
     else if (rect().contains(event->pos()))
     {
         mTextFocused = true;
+        updatePrimitives();
     }
 
     event->accept();
@@ -249,6 +280,7 @@
     else if ((!rect().contains(event->pos()) || mIconTouchArea->rect().contains(event->pos())) && mTextFocused)
     {
         mTextFocused = false;
+        updatePrimitives();
     }
     event->accept();
 }
@@ -259,11 +291,13 @@
     if (mIconTouchArea->rect().contains(event->pos()) && mIconFocused)
     {
         mIconFocused = false;
+        updatePrimitives();
         emit iconClicked();
     }
     else if (rect().contains(event->pos()) && !mIconTouchArea->rect().contains(event->pos()) && mTextFocused)
     {
         mTextFocused = false;
+        updatePrimitives();
         emit textClicked();
     }
     event->accept();
--- a/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -69,7 +69,13 @@
     
     connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) );
     connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) );
-        
+    
+    // Naming UI components for automation testability
+    QString editorObjName = detail.definitionName() + " line edit %1";
+    mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row()));
+    
+    QString comboBoxObjName = detail.definitionName() + " combo box %1";
+    mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row()));
     return mItem;
     }
     
--- a/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 #include "cntfavoritesmemberview.h"
-#include "cntfetchcontactsview.h"
+#include "cntfetchcontactpopup.h"
 #include "cntglobal.h"
 
 #include <hblistview.h>
@@ -137,16 +137,26 @@
     membersFilter.setRelatedContactId(mContact->id());   
     mOriginalGroupMembers = getContactManager()->contactIds(membersFilter).toSet();
     
+    /*
     if (!mFetchView) {
         mFetchView = new CntFetchContacts(*getContactManager());
         connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageFavorites()));
     }
     mFetchView->setDetails(hbTrId("txt_phob_subtitle_favorites"), hbTrId("txt_common_button_save"));
     mFetchView->displayContacts(HbAbstractItemView::MultiSelection, mOriginalGroupMembers);
+    */
+    CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup(
+            hbTrId("txt_phob_subtitle_favorites"), 
+            hbTrId("txt_common_button_save"),
+            *getContactManager());
+    connect( popup, SIGNAL(fetchReady(QSet<QContactLocalId>)), this, SLOT(handleManageFavorites(QSet<QContactLocalId>)) );
+    popup->setSelectedContacts( mOriginalGroupMembers );
+    popup->showPopup();
 }
 
-void CntFavoritesMemberView::handleManageFavorites()
+void CntFavoritesMemberView::handleManageFavorites(QSet<QContactLocalId> aIds)
 {
+/*
     QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
     bool saveChanges = !mFetchView->wasCanceled();
 
@@ -156,11 +166,11 @@
     if (!saveChanges) {
         return;
     }
-
+*/
     for (int i = 0; i < 2; ++i) {
         // first iteration processes added members, second removed members
-        QSet<QContactLocalId> members = (i == 0 ? selectedContacts - mOriginalGroupMembers
-                                                : mOriginalGroupMembers - selectedContacts);
+        QSet<QContactLocalId> members = (i == 0 ? aIds - mOriginalGroupMembers
+                                                : mOriginalGroupMembers - aIds);
         QList<QContactRelationship> memberships;
 
         foreach (QContactLocalId id, members) {
@@ -261,7 +271,7 @@
     QContact selectedContact = mModel->contact(index);
     
     CntViewParameters viewParameters;
-    viewParameters.insert(EViewId, commLauncherView);
+    viewParameters.insert(EViewId, contactCardView);
     QVariant var;
     var.setValue(selectedContact);
     viewParameters.insert(ESelectedContact, var);
@@ -280,6 +290,9 @@
     QVariant var;
     var.setValue(selectedContact);
     viewParameters.insert(ESelectedContact, var);
+    QVariant varGroup;
+    varGroup.setValue(*mContact);
+    viewParameters.insert(ESelectedGroupContact, varGroup);
     mViewManager->changeView(viewParameters);
 }
 
--- a/phonebookui/pbkcommonui/src/cntfavoritesview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntfavoritesview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 #include "cntfavoritesview.h"
-#include "cntfetchcontactsview.h"
+#include "cntfetchcontactpopup.h"
 #include "cntglobal.h"
 #include <hbpushbutton.h>
 #include <hbaction.h>
@@ -30,8 +30,7 @@
     mContact(NULL),
     mView(NULL),
     mSoftkey(NULL),
-    mViewManager(NULL),
-    mFetchView(NULL)
+    mViewManager(NULL)
 {
     bool ok = false;
     mDocumentLoader.load(CNT_FAVORITE_UI_XML, &ok);
@@ -57,10 +56,7 @@
     mView->deleteLater();
     
     delete mContact;
-    mContact = 0;
-
-    delete mFetchView;
-    mFetchView = 0;
+    mContact = NULL;
 }
 
 void CntFavoritesView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
@@ -85,50 +81,61 @@
 
 void CntFavoritesView::openSelectionPopup()
 {
+    /*
     QSet<QContactLocalId> emptySet;
-    
     if (!mFetchView) {
         mFetchView = new CntFetchContacts(*getContactManager());
         connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMemberSelection()));
     }
     mFetchView->setDetails(hbTrId("txt_phob_subtitle_favorites"), hbTrId("txt_common_button_save"));
     mFetchView->displayContacts(HbAbstractItemView::MultiSelection, emptySet);
+    */
+    CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup(
+            hbTrId("txt_phob_subtitle_favorites"), 
+            hbTrId("txt_common_button_save"),
+            *getContactManager());
+    connect(popup, SIGNAL(fetchReady(QSet<QContactLocalId>)), 
+            this, SLOT(handleMemberSelection(QSet<QContactLocalId>)));
+    popup->showPopup();
 }
 
-void CntFavoritesView::handleMemberSelection()
+void CntFavoritesView::handleMemberSelection( QSet<QContactLocalId> aIds )
 {
-    QSet<QContactLocalId> members = mFetchView->getSelectedContacts();
-    QList<QContactRelationship> memberships;
-    bool saveChanges = !mFetchView->wasCanceled();
+    //QSet<QContactLocalId> members = mFetchView->getSelectedContacts();
+    //bool saveChanges = !mFetchView->wasCanceled();
 
-    delete mFetchView;
-    mFetchView = 0;
-
-    if (!saveChanges || members.count() == 0) {
-        showPreviousView();
-        return;
-    }
+    //delete mFetchView;
+    //mFetchView = 0;
 
-    foreach (QContactLocalId id, members) {
-        QContact contact = getContactManager()->contact(id);
-        QContactRelationship membership;
-        membership.setRelationshipType(QContactRelationship::HasMember);
-        membership.setFirst(mContact->id());
-        membership.setSecond(contact.id());
-        memberships.append(membership);
+    //if (!saveChanges || members.count() == 0)
+    if ( aIds.isEmpty() )
+    {
+        showPreviousView();
     }
-
-    if (!memberships.isEmpty()) {
-        QMap<int, QContactManager::Error> errors;
-        getContactManager()->saveRelationships(&memberships, &errors);
+    else
+    {
+        QList<QContactRelationship> memberships;
+        foreach (QContactLocalId id, aIds) {
+            QContact contact = getContactManager()->contact(id);
+            QContactRelationship membership;
+            membership.setRelationshipType(QContactRelationship::HasMember);
+            membership.setFirst(mContact->id());
+            membership.setSecond(contact.id());
+            memberships.append(membership);
+        }
+    
+        if (!memberships.isEmpty()) {
+            QMap<int, QContactManager::Error> errors;
+            getContactManager()->saveRelationships(&memberships, &errors);
+        }
+    
+        CntViewParameters viewParameters;
+        viewParameters.insert(EViewId, favoritesMemberView);
+        QVariant var;
+        var.setValue(*mContact);
+        viewParameters.insert(ESelectedGroupContact, var);
+        mViewManager->changeView(viewParameters);
     }
-
-    CntViewParameters viewParameters;
-    viewParameters.insert(EViewId, FavoritesMemberView);
-    QVariant var;
-    var.setValue(*mContact);
-    viewParameters.insert(ESelectedGroupContact, var);
-    mViewManager->changeView(viewParameters);
 }
 
 void CntFavoritesView::setOrientation(Qt::Orientation orientation)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntfetchcontactpopup.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,407 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+#include "cntfetchcontactpopup.h"
+#include "cntdocumentloader.h"
+#include "cntfetchmarkall.h"
+#include "cntdebug.h"
+
+#include <cntlistmodel.h>
+#include <hblistview.h>
+#include <hbstyleloader.h>
+#include <hbindexfeedback.h>
+#include <hblistviewitem.h>
+#include <hbscrollbar.h>
+#include <hbmainwindow.h>
+#include <hbdialog.h>
+#include <hblabel.h>
+#include <hbsearchpanel.h>
+#include <hblineedit.h>
+#include <hbaction.h>
+#include <hbtextitem.h>
+#include <hbstaticvkbhost.h>
+
+#include <QGraphicsLinearLayout>
+#include <QCoreApplication>
+const char *CNT_FETCHLIST_XML = ":/xml/contacts_fetchdialog.docml";
+
+CntFetchContactPopup::CntFetchContactPopup( QContactManager& aMgr ) : 
+mManager(aMgr),
+mPopup( NULL ),
+mListView( NULL ),
+mEmptyView( NULL ),
+mHeading( NULL ),
+mPrimaryAction( NULL ),
+mSearch( NULL ),
+mModel( NULL ),
+mMarkAll( NULL ),
+mDoc( NULL )
+{
+    mDoc = new CntDocumentLoader();
+        
+    bool ok;
+    mDoc->load( CNT_FETCHLIST_XML, &ok );
+    
+    if ( !ok )
+    {
+        qFatal("Unable to read %S", CNT_FETCHLIST_XML );
+    }
+    mPopup = static_cast<HbDialog*>( mDoc->findWidget( "dialog" ) );
+    mSearch = static_cast<HbSearchPanel*>( mDoc->findWidget( "searchPanel" ) );
+    mMarkAll = static_cast<CntFetchMarkAll*>( mDoc->findWidget("markAll") );
+    mEmptyView = static_cast<HbTextItem*>( mDoc->findWidget("emptyLabel" ));
+    mListView = static_cast<HbListView*>( mDoc->findWidget("listView") );
+    mHeading = static_cast<HbLabel*>( mDoc->findWidget("heading") );
+   
+    connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(closePopup()) );
+    connect(mPopup, SIGNAL(aboutToClose()), this, SLOT(closePopup()) );
+    connect(mSearch, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString)));
+    connect(mMarkAll, SIGNAL(markAll(int)), this, SLOT(selectAll(int)) );
+    
+    HbLineEdit *editor = static_cast<HbLineEdit*>( mSearch->primitive("lineedit"));
+    editor->setInputMethodHints(Qt::ImhNoPredictiveText);
+    mSearch->setCancelEnabled( false );
+    
+    mVirtualKeyboard = new HbStaticVkbHost(editor);
+    connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen()));
+    connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClosed()));
+}
+
+CntFetchContactPopup::~CntFetchContactPopup()
+{
+    delete mDoc;
+    delete mModel;
+}
+
+CntFetchContactPopup* CntFetchContactPopup::createMultiSelectionPopup( QString aTitle, QString aAction, QContactManager& aManager )
+{
+    CntFetchContactPopup* popup = new CntFetchContactPopup( aManager );
+    popup->constructPopupDialog( aTitle, aAction, HbAbstractItemView::MultiSelection );
+    
+    return popup;
+}
+
+CntFetchContactPopup* CntFetchContactPopup::createSingleSelectionPopup( QString aTitle, QContactManager& aManager )
+{
+    CntFetchContactPopup* popup = new CntFetchContactPopup( aManager );
+    popup->constructPopupDialog( aTitle, "", HbAbstractItemView::NoSelection );
+    
+    return popup;
+}
+
+void CntFetchContactPopup::setSelectedContacts( QSet<QContactLocalId> aIds )
+{
+    CNT_ENTRY
+    if ( mListView->selectionMode() == HbAbstractItemView::MultiSelection )
+    {
+        mIdList.clear();
+        
+        foreach ( QContactLocalId id, aIds ) 
+        {
+            mIdList.append( id );
+            QContact contact = mManager.contact(id);
+            QModelIndex contactIndex = mModel->indexOfContact(contact);
+            mSelectionModel->select( contactIndex, QItemSelectionModel::Select );
+        }
+    }
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::showPopup()
+{
+    CNT_ENTRY
+    HbMainWindow* window = mPopup->mainWindow();
+    if ( window )
+    {
+        connect(window, SIGNAL(orientationChanged(Qt::Orientation)), 
+                this, SLOT(loadLayout(Qt::Orientation)) );
+    }
+    
+    mPopup->open( this, SLOT(dialogDismissed(HbAction*)) );
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::handleKeypadOpen()
+{
+    CNT_ENTRY
+    qreal height = mPopup->size().height() - 
+            mVirtualKeyboard->keyboardArea().height() - 
+            mSearch->size().height();
+    
+    // in single selection we don't have the "mark all" option
+    if ( mMarkAll )
+    {
+        height = height - mMarkAll->size().height();
+    }
+
+    mEmptyView->setMaximumHeight( height );
+    mListView->setMaximumHeight( height );
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::handleKeypadClosed()
+{
+    CNT_ENTRY
+    
+    qreal height =  mPopup->size().height() - mSearch->size().height();
+    if ( mMarkAll )
+    {
+        height = height - mMarkAll->size().height();
+    }   
+    
+    mListView->setMaximumHeight( height );
+    mEmptyView->setMaximumHeight( height );
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::contactSelected( const QModelIndex& aIndex )
+{
+    CNT_ENTRY
+    if ( aIndex.isValid() )
+    {
+        QContact contact = mModel->contact( aIndex );
+        mIdList.append( contact.localId() );
+        
+        emit fetchReady( mIdList.toSet() );
+    }
+    
+    disconnect(mListView, SIGNAL(activated(const QModelIndex&)), 
+                    this, SLOT(contactSelected(const QModelIndex&)) );
+    mPopup->close();
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::contactsSelected(
+        const QItemSelection& aSelected, 
+        const QItemSelection& aDeselected )
+{
+    CNT_ENTRY
+    
+    // remove all deselected items
+    foreach ( QModelIndex index, aDeselected.indexes() )
+    {
+        QContact contact = mModel->contact( index );
+        QContactLocalId id = contact.localId();
+        if ( mIdList.contains(id) )
+        {
+            mIdList.removeAll( id );
+        }
+    }
+    
+    // add all selected items
+    foreach ( QModelIndex index, aSelected.indexes() )
+    {
+        QContact contact = mModel->contact( index );
+        QContactLocalId id = contact.localId();
+        if ( !mIdList.contains(id) )
+        {
+            mIdList.append( id );
+        }
+    }
+        
+    mMarkAll->setSelectedContactCount( mIdList.size() );
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::selectAll( int aState )
+{
+    CNT_ENTRY
+    if ( mListView->selectionMode() == HbAbstractItemView::MultiSelection )
+    {
+        switch ( aState )
+        {
+        case Qt::Checked: 
+            mListView->selectAll();
+            mMarkAll->setSelectedContactCount( mIdList.count() );
+            break;
+            
+        case Qt::Unchecked:
+            mListView->clearSelection();
+            mMarkAll->setSelectedContactCount( 0 );
+            break;
+        default:
+            break;
+        }
+    }
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::dialogDismissed( HbAction* aAction )
+{
+    CNT_ENTRY
+   
+    if ( aAction != mPrimaryAction )
+    {
+        emit fetchCancelled();
+    }
+    else if ( aAction ) 
+    {
+        disconnect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
+                        this, SLOT(contactsSelected(const QItemSelection&, const QItemSelection&)) );
+        
+        QModelIndexList indexList = mSelectionModel->selectedIndexes();
+        foreach ( QModelIndex index, indexList )
+        {
+            QContact contact = mModel->contact( index );
+            mIdList.append( contact.localId() );
+        }
+        emit fetchReady( mIdList.toSet() );
+    }
+    else
+    {
+        // ignore.
+    }
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::setFilter( const QString& aFilter )
+{
+    CNT_ENTRY
+    QContactDetailFilter detailfilter;
+    detailfilter.setMatchFlags( QContactFilter::MatchStartsWith );
+    detailfilter.setValue( aFilter.split(QRegExp("\\s+"), QString::SkipEmptyParts) );
+    detailfilter.setDetailDefinitionName(
+            QContactDisplayLabel::DefinitionName,
+            QContactDisplayLabel::FieldLabel);
+       
+    mModel->setFilter(detailfilter);
+    
+    HbMainWindow* window = mPopup->mainWindow();
+    if ( window )
+    {
+        loadLayout( window->orientation() );
+    }
+    
+    setSelectedContacts( mIdList.toSet() );
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::constructPopupDialog( QString aTitle, QString aAction, HbAbstractItemView::SelectionMode aMode )
+{
+    CNT_ENTRY
+    mIdList.clear();
+    mTitle = aTitle;
+    
+    mPopup->setAttribute( Qt::WA_DeleteOnClose, true );    
+    
+    QContactDetailFilter contactsFilter;
+    contactsFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
+    contactsFilter.setValue(QString(QLatin1String(QContactType::TypeContact)));
+    
+    mModel = new CntListModel( &mManager, contactsFilter, false);
+    mModel->showMyCard(false);
+    mSelectionModel = new QItemSelectionModel( mModel );
+    
+    mListView->setFrictionEnabled(true);
+    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+    mListView->verticalScrollBar()->setInteractive(true);
+
+    HbIndexFeedback* indexFeedback = new HbIndexFeedback(mPopup);
+    indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+    indexFeedback->setItemView(mListView);
+         
+    HbListViewItem *prototype = mListView->listItemPrototype();
+    prototype->setGraphicsSize(HbListViewItem::Thumbnail);
+    prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
+        
+    mListView->setSelectionMode( aMode );
+    mListView->setModel( mModel );
+    mListView->setSelectionModel( mSelectionModel );
+    
+    HbMainWindow* window = mPopup->mainWindow();
+    if ( window )
+    {
+        loadLayout( window->orientation() );
+    }
+    
+    if ( !aAction.isEmpty() )
+    {
+        mPrimaryAction = new HbAction( aAction, mPopup );
+        mPopup->addAction( mPrimaryAction );
+    }
+        
+    HbAction* secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mPopup);
+    mPopup->addAction( secondaryAction );
+        
+    if ( aMode != HbListView::MultiSelection )
+    {
+        connect(mListView, SIGNAL(activated(const QModelIndex&)), 
+                this, SLOT(contactSelected(const QModelIndex&)) );
+        mMarkAll->setVisible( false );
+    }
+    else
+    {
+        mMarkAll->setSelectedContactCount( 0 );
+        mMarkAll->setMaxContactCount( mModel->rowCount() );
+        connect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
+                this, SLOT(contactsSelected(const QItemSelection&, const QItemSelection&)) );
+            
+    }
+        
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::loadLayout( Qt::Orientation aOrientation )
+{
+    CNT_ENTRY
+    
+    bool multi = mListView->selectionMode() == HbAbstractItemView::MultiSelection;
+    if ( mModel->rowCount() > 0 )
+    {
+        if ( aOrientation == Qt::Horizontal )
+        {
+            mPopup->setHeadingWidget( NULL );
+            mDoc->load( CNT_FETCHLIST_XML, "find_list_landscape");
+        }
+        else
+        {
+            mHeading = new HbLabel( mTitle );
+            mPopup->setHeadingWidget( mHeading );
+            qreal popupHeight = mPopup->mainWindow()->layoutRect().height();
+            mPopup->setMinimumHeight(popupHeight);
+            mDoc->load( CNT_FETCHLIST_XML, multi ? "find_list" : "find_list_single");
+        }
+    }
+    else
+    {
+        if ( aOrientation == Qt::Horizontal )
+        {
+            mPopup->setHeadingWidget( NULL );
+            mDoc->load( CNT_FETCHLIST_XML, "find_empty_landscape" );
+        }
+        else
+        {
+            mHeading = new HbLabel( mTitle );
+            mPopup->setHeadingWidget( mHeading );
+            qreal popupHeight = mPopup->mainWindow()->layoutRect().height();
+            mPopup->setMinimumHeight(popupHeight);
+            mDoc->load( CNT_FETCHLIST_XML, multi ? "find_empty" : "find_empty_single" );
+        }
+     }
+    
+    CNT_EXIT
+}
+
+void CntFetchContactPopup::closePopup()
+{
+    CNT_ENTRY
+    disconnect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen()));
+    disconnect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClosed()));
+           
+    deleteLater();
+    CNT_EXIT
+}
+// End of File
--- a/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <hbdialog.h>
-#include <hbscrollbar.h>
-#include <hbindexfeedback.h>
-#include <hbaction.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <hblineedit.h>
-#include <hbmainwindow.h>
-#include <hblistviewitem.h>
-#include <hblistview.h>
-#include <hbsearchpanel.h>
-#include <hbstaticvkbhost.h>
-#include <QGraphicsLinearLayout>
-#include <qcontactid.h>
-#include <cntlistmodel.h>
-#include "cntfetchcontactsview.h"
-
-/*!
-Given a contact manager, CntFetchContacts is responsible for 
-retrieving a set of contacts, if any were chosen by the user. 
-*/
-CntFetchContacts::CntFetchContacts(QContactManager &aManager) :
-QObject(),
-mPopup(NULL),
-mCntModel(NULL),
-mListView(NULL),
-mEmptyListLabel(NULL),
-mSelectionMode(HbAbstractItemView::MultiSelection),
-mManager(&aManager),
-mWasCanceled(false),
-mLabel(NULL),
-mVirtualKeyboard(NULL),
-mPrimaryAction(NULL),
-mSecondaryAction(NULL),
-mIndexFeedback(NULL)
-{
-    mSearchPanel = new HbSearchPanel();
-    mSearchPanel->setVisible(false);
-    mSearchPanel->setCancelEnabled(false);
-    connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString)));
-    
-    HbLineEdit *editor = static_cast<HbLineEdit*>(mSearchPanel->primitive("lineedit"));
-    editor->setInputMethodHints(Qt::ImhNoPredictiveText);
-    
-    mLayout = new QGraphicsLinearLayout(Qt::Vertical);
-    
-    mContainerWidget = new HbWidget();
-}
-
-CntFetchContacts::~CntFetchContacts()
-{
-    delete mCntModel;
-    mCntModel = NULL;
-    
-    delete mVirtualKeyboard;
-    mVirtualKeyboard = NULL;
-    
-    delete mIndexFeedback;
-    mIndexFeedback = NULL;
-}
-
-/*!
-Query to see if the user decided to press Cancel after selecting 
-group members. Must be called to see if results are valid.
-*/
-bool CntFetchContacts::wasCanceled() const
-{
-    return mWasCanceled;
-}
-
-void CntFetchContacts::setDetails(QString aTitle, QString aButtonText)
-{
-    mButtonText = aButtonText;
-    
-    if (!mLabel) {
-        mLabel = new HbLabel(aTitle);
-    }
-}
-
-/*!
-Brings up a list of contacts, awaiting user response. This function is asynchronous.
-When a response is given, a clicked signal will be sent.
-*/
-void CntFetchContacts::displayContacts(HbAbstractItemView::SelectionMode aMode,
-                                                   QSet<QContactLocalId> aContacts)
-{
-    doInitialize(aMode,aContacts);
-    markMembersInView();
-    showPopup();
-}
-
-QSet<QContactLocalId> CntFetchContacts::getSelectedContacts() const
-{
-   return mCurrentlySelected;
-}
-
-void CntFetchContacts::setFilter(const QString &filterString)
-{
-    QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts);
-
-    QContactDetailFilter detailfilter;
-    detailfilter.setDetailDefinitionName(QContactDisplayLabel::DefinitionName, QContactDisplayLabel::FieldLabel);
-    detailfilter.setMatchFlags(QContactFilter::MatchStartsWith);
-    detailfilter.setValue(searchList);
-    
-    mCntModel->setFilter(detailfilter);
-
-    markMembersInView();
-
-    if (mCntModel->rowCount() == 0) {
-        mLayout->removeItem(mListView);
-        
-        if (mEmptyListLabel) {
-            qreal searchHeight = mSearchPanel->size().height();
-            HbLabel* heading = static_cast<HbLabel*>(mPopup->headingWidget());
-            qreal heightToSet =  mPopup->size().height() - mVirtualKeyboard->keyboardArea().height() - searchHeight - heading->size().height();
-            mEmptyListLabel->setMaximumHeight(heightToSet);
-            mEmptyListLabel->setVisible(true);
-            mLayout->insertItem(0, mEmptyListLabel);
-        }
-
-        mListView->setVisible(false);
-        mSearchPanel->setVisible(true);
-    }
-    else {
-        if (mEmptyListLabel) {
-            mEmptyListLabel->setVisible(false);
-        }
-        mLayout->removeItem(mEmptyListLabel);
-        mLayout->insertItem(0, mListView);
-        mListView->setVisible(true);
-    }
-}
-
-void CntFetchContacts::handleKeypadOpen()
-{
-    qreal searchHeight = mSearchPanel->size().height();
-    HbLabel* heading = static_cast<HbLabel*>(mPopup->headingWidget());
-    qreal heightToSet =  mPopup->size().height() - mVirtualKeyboard->keyboardArea().height() - searchHeight - heading->size().height();
-
-    if (mEmptyListLabel) {
-        mEmptyListLabel->setMaximumHeight( heightToSet - mEmptyListLabel->size().height() );
-    }
-    
-    mListView->setMaximumHeight(heightToSet);
-}
-
-void CntFetchContacts::handleKeypadClose()
-{
-    mListView->setMaximumHeight(mPopup->size().height());
-
-    if (mEmptyListLabel) {
-        mEmptyListLabel->setMaximumHeight(mPopup->size().height());
-    }
-}
-
-/*!
-Notify client that we're done.
-*/
-void CntFetchContacts::handleUserResponse(HbAction* action)
-{
-    bool userCanceled = (action == mSecondaryAction); 
-    if (userCanceled) {
-        mCurrentlySelected.clear();
-        
-        mWasCanceled = true;
-    }
-    else {
-        mWasCanceled = false;
-    }
-    
-    mPopup->setVisible(false);
-    mListView->setModel(NULL);
-    delete mCntModel;
-    mCntModel = NULL;
-    
-    emit clicked();
-}
-
-void CntFetchContacts::memberSelectionChanged(const QModelIndex &index)
-{
-    if (!index.isValid()) return;
-
-    if (mSelectionMode == HbAbstractItemView::SingleSelection) {
-        mCurrentlySelected.clear();
-    }
-
-    QContactLocalId contactId = mCntModel->contact(index).localId();
-
-    bool isSelected = mListView->selectionModel()->isSelected(index);
-    if (isSelected != mCurrentlySelected.contains(contactId)) {
-        if (isSelected) {
-            mCurrentlySelected.insert(contactId);
-        }
-        else {
-            mCurrentlySelected.remove(contactId);
-        }
-    }
-    
-    // Check for the case where there is a cancel button only. If so, 
-    // after selecting any contact, should dismiss the dialog immediately.
-    if (mButtonText.isEmpty() && mSelectionMode == HbAbstractItemView::SingleSelection) {
-        mPopup->close();
-    }
-}
-
-void CntFetchContacts::doInitialize(HbAbstractItemView::SelectionMode aMode,
-                                                QSet<QContactLocalId> aContacts)
-{
-    mSelectionMode = aMode;
-    mCurrentlySelected = aContacts;
-
-    if (!mPopup) {
-        mPopup = new HbDialog;
-    }
-
-    QContactDetailFilter contactsFilter;
-    contactsFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
-    contactsFilter.setValue(QString(QLatin1String(QContactType::TypeContact)));
-    if (!mCntModel) {
-        mCntModel = new CntListModel(mManager, contactsFilter, false);
-    }
-    
-    if (!mListView) {
-        mListView = new HbListView(mPopup);
-        mListView->setModel(mCntModel);
-        mListView->setSelectionMode(mSelectionMode);
-        mListView->setFrictionEnabled(true);
-        mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
-        mListView->verticalScrollBar()->setInteractive(true);
-
-        HbListViewItem *prototype = mListView->listItemPrototype();
-        prototype->setGraphicsSize(HbListViewItem::Thumbnail);
-        prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
-
-        mIndexFeedback = new HbIndexFeedback(mPopup);
-        mIndexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
-        mIndexFeedback->setItemView(mListView);
-
-        // Note that the layout takes ownership of the item(s) it contains.
-        if (mCntModel->rowCount()== 0) {
-            mListView->setVisible(false);
-            if (!mEmptyListLabel) {
-                mEmptyListLabel = new HbTextItem(hbTrId("txt_phob_info_no_matching_contacts"));
-                mEmptyListLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-                mEmptyListLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary));
-                mEmptyListLabel->setAlignment(Qt::AlignCenter);
-                mLayout->insertItem(0, mEmptyListLabel);
-            }
-        }
-        else {
-            mLayout->addItem(mListView);
-        }
-
-        mCntModel->showMyCard(false);
-    }
-    
-    // Handle the case where the model was removed for the list view
-    if (!mListView->model()) {
-        mListView->setModel(mCntModel);
-    }
-    
-    // Main window is NULL in unit tests
-    HbMainWindow* window = mListView->mainWindow();
-    if (window) {
-        mContainerWidget->setPreferredHeight(mListView->mainWindow()->size().height());
-    }
-    mContainerWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
-    
-    mSearchPanel->setVisible(true);
-    mLayout->addItem(mSearchPanel);
-    mContainerWidget->setLayout(mLayout);
-    
-    connect(mListView, SIGNAL(activated(const QModelIndex&)),
-            this, SLOT(memberSelectionChanged(const QModelIndex&)), Qt::UniqueConnection);
-}
-
-void CntFetchContacts::showPopup()
-{
-    mPopup->setTimeout(HbPopup::NoTimeout);
-    mPopup->setDismissPolicy(HbPopup::NoDismiss);
-    mPopup->setModal(true);
-    mPopup->setContentWidget(mContainerWidget);
-
-    if (!mVirtualKeyboard) {
-        mVirtualKeyboard = new HbStaticVkbHost(mPopup);
-        connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen()));
-        connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClose()));
-    }
-    
-    if (!mLabel) {
-        mLabel = new HbLabel(hbTrId("txt_phob_title_contacts"));
-    }
-    mPopup->setHeadingWidget(mLabel);
-
-    if (!mButtonText.isEmpty() && !mPrimaryAction) {
-        mPrimaryAction = new HbAction(hbTrId(mButtonText.toAscii()));
-        mPopup->addAction(mPrimaryAction);
-    }
-    
-    if (!mSecondaryAction) {
-        mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
-        mPopup->addAction(mSecondaryAction);
-    }
-
-    mPopup->open(this, SLOT(handleUserResponse(HbAction*)));
-}
-
-void CntFetchContacts::markMembersInView()
-{
-    // If there are no contacts matching the current filter,
-    // show "no matching contacts" label
-    if (mCntModel->rowCount() == 0) {
-        if (!mEmptyListLabel) {
-            mEmptyListLabel = new HbTextItem(hbTrId("txt_phob_info_no_matching_contacts"));
-            mEmptyListLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-            mEmptyListLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary));
-            mEmptyListLabel->setAlignment(Qt::AlignCenter);
-            mLayout->insertItem(1, mEmptyListLabel);
-        }
-    }
-    else {
-        mLayout->removeItem(mEmptyListLabel);
-        delete mEmptyListLabel;
-        mEmptyListLabel = 0;
-    }
-
-    // Mark group members in the listview
-    foreach (QContactLocalId id, mCurrentlySelected) {
-        QContact contact = mManager->contact(id);
-        QModelIndex contactIndex = mCntModel->indexOfContact(contact);
-        mListView->selectionModel()->select(contactIndex, QItemSelectionModel::Select);
-    }
-}
-
-// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntfetchmarkall.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cntfetchmarkall.h"
+
+#include <QGraphicsLinearLayout>
+#include <hbcheckbox.h>
+#include <hbtextitem.h>
+#include <hbframeitem.h>
+
+CntFetchMarkAll::CntFetchMarkAll(QGraphicsItem *aParent)
+: HbWidget(aParent),
+  mCheckBox(NULL),
+  mCounterLabel(NULL),
+  mContactCount( 0 ),
+  mSelectionCount( 0 )
+{
+    setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
+    
+    mCheckBox = new HbCheckBox(this);
+    mCheckBox->setText(hbTrId("txt_common_list_mark_all_items"));
+    mCheckBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+    
+    connect(mCheckBox, SIGNAL(stateChanged(int)), this, SIGNAL(markAll(int)) );
+    
+    mCounterLabel = new HbTextItem( this );
+    
+    mFrame = new HbFrameItem(this);
+    mFrame->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal");
+    mFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    mFrame->setZValue(-2);
+    style()->setItemName(mFrame, "background");
+           
+    HbStyle::setItemName(mCheckBox,"checkbox");
+    HbStyle::setItemName(mCounterLabel,"counter");
+}
+
+void CntFetchMarkAll::setMaxContactCount( int aContactCount )
+{
+    mContactCount = aContactCount;
+    mCounterLabel->setText( QString("%1/%2").arg(mSelectionCount).arg(mContactCount) );
+}
+
+void CntFetchMarkAll::setSelectedContactCount( int aSelectedCount )
+{
+    mSelectionCount = aSelectedCount;
+    mCounterLabel->setText( QString("%1/%2").arg(mSelectionCount).arg(mContactCount) );
+    
+    if ( mSelectionCount < mContactCount )
+    {
+        blockSignals( true );
+        mCheckBox->setCheckState( Qt::Unchecked );
+        blockSignals( false );
+    }
+}
+
+CntFetchMarkAll::~CntFetchMarkAll()
+{
+    delete mCheckBox;
+    mCheckBox = NULL;
+    delete mCounterLabel;
+    mCounterLabel = NULL;
+    delete mFrame;
+    mFrame = NULL;
+}
+
+// EOF
--- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,6 +16,10 @@
 */
 
 #include "cntgroupactionsview.h"
+#include "cntactionlauncher.h"
+#include "cntglobal.h"
+
+#include <cntactionpopup.h>
 
 #include <hblistview.h>
 #include <hbmenu.h>
@@ -30,7 +34,12 @@
 #include <cntlistmodel.h>
 #include <hbframebackground.h>
 #include <hbnumbergrouping.h>
+#include <QKeyEvent> 
+#include <qtcontacts.h>
+#include <hbmainwindow.h>
+#include "cntactionlauncher.h"
 
+#include <QEvent>
 #include <QStandardItemModel>
 
 const char *CNT_GROUPACTIONSVIEW_XML = ":/xml/contacts_groupactions.docml";
@@ -39,7 +48,9 @@
 mGroupContact(NULL),
 mModel(NULL),
 mViewManager(NULL),
-mListView(NULL)
+mListView(NULL),
+mPopupCount(0),
+mIsExecutingAction(false)
 {
     bool ok = false;
     mDocumentLoader.load(CNT_GROUPACTIONSVIEW_XML, &ok);
@@ -120,9 +131,12 @@
     mGroupContact = new QContact(aArgs.value(ESelectedGroupContact).value<QContact>());
     mViewManager = aMgr;
 
-    QContactName groupContactName = mGroupContact->detail( QContactName::DefinitionName );
-    QString groupName(groupContactName.value( QContactName::FieldCustomLabel ));
-    
+    QContactName contactName = mGroupContact->detail( QContactName::DefinitionName );
+    QString groupName = contactName.value( QContactName::FieldCustomLabel );        
+    if (groupName.isEmpty())
+    {
+        groupName = hbTrId("txt_phob_list_unnamed");
+    }
     
     //group box
     HbGroupBox* groupBox = static_cast<HbGroupBox *>(mDocumentLoader.findWidget(QString("groupBox")));
@@ -145,24 +159,32 @@
     
     QContactPhoneNumber confCallNumber = mGroupContact->detail<QContactPhoneNumber>();
     if(!confCallNumber.number().isEmpty())
-        {
+    {
         /*
          * Internationalization support, activate the following code 
          * when support available from Orbit
          */
         //populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),HbNumberGrouping::formatPhoneNumber(confCallNumber.number()));
-        populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),confCallNumber.number());
-        }
+        populatelist(hbTrId("txt_phob_dblist_conference_call"), HbIcon("qtg_large_call_group"),confCallNumber.number(),"call");
+    }
       
-    populatelist(hbTrId("txt_phob_dblist_send_message"),HbIcon("qtg_large_message_group"),hbTrId("txt_phob_dblist_send_message_val_members"));
-    populatelist(hbTrId("txt_phob_dblist_email"),HbIcon("qtg_large_email_group"),hbTrId("txt_phob_dblist_send_message_val_members"));
+    populatelist(hbTrId("txt_phob_dblist_send_message"),HbIcon("qtg_large_message_group"),hbTrId("txt_phob_dblist_send_message_val_members"),"message");
+    populatelist(hbTrId("txt_phob_dblist_email"),HbIcon("qtg_large_email_group"),hbTrId("txt_phob_dblist_send_message_val_members"),"email");
     
     mListView->setModel(mModel);
     mListView->setSelectionMode(HbAbstractItemView::NoSelection);
     
+    connect(mListView, SIGNAL(activated(const QModelIndex&)),
+                this, SLOT(listItemSelected(const QModelIndex&)));
+    
+    HbMainWindow* window = mView->mainWindow();
+    if (window)
+    {
+        window->installEventFilter(this);
+    }
 }
 
-void CntGroupActionsView:: populatelist(QString primaryText,HbIcon icon,QString secondaryText)
+void CntGroupActionsView::populatelist(QString primaryText,HbIcon icon,QString secondaryText,QString action)
 {
     QList<QStandardItem*> items;
     QStandardItem *labelItem = new QStandardItem();
@@ -173,7 +195,172 @@
     
     labelItem->setData(textList, Qt::DisplayRole);
     labelItem->setData(icon, Qt::DecorationRole);
+    labelItem->setData(action, Qt::UserRole+1);
     
     items << labelItem ;
     mModel->appendRow(items);
 }
+
+void CntGroupActionsView::listItemSelected(const QModelIndex &index)
+{
+    if (index.isValid()) {
+        //reset flags
+        mPopupCount=0;
+        mEmailActionParams.clear();
+        mMessageActionParams.clear();
+        
+        QString action = mModel->item(index.row())->data(Qt::UserRole+1).toString();
+        
+        //conference call
+        if (action.compare("call", Qt::CaseInsensitive) == 0 ) {
+            CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action);
+            connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
+            other->execute(*mGroupContact, QContactDetail());
+        }
+        //group email, message
+        else {
+            QContactRelationshipFilter relationshipFilter;
+            relationshipFilter.setRelationshipType(QContactRelationship::HasMember);
+            relationshipFilter.setRelatedContactRole(QContactRelationship::First);
+            relationshipFilter.setRelatedContactId(mGroupContact->id());   
+            QList<QContactLocalId> groupMembers = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(relationshipFilter);
+            
+            for (int i = 0;i<groupMembers.count();i++) {
+                QContact contact = mViewManager->contactManager(SYMBIAN_BACKEND)->contact(groupMembers.at(i));
+                QContactDetail preferredDetail = contact.preferredDetail(action);
+                //use preferred detail if exits
+                if (!preferredDetail.isEmpty()) {
+                    if(action.compare("message", Qt::CaseInsensitive) == 0) {
+                        QContactPhoneNumber phoneNumber = contact.detail<QContactPhoneNumber>();
+                        mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel()));
+                    }
+                    else {
+                        QContactEmailAddress email = contact.detail<QContactEmailAddress>();
+                        mEmailActionParams.append(email.emailAddress());
+                    }
+                }
+                else {
+                    CntActionPopup *actionPopup = new CntActionPopup(&contact);
+                    if(actionPopup->showActionPopup(action)) {
+                        //increment actionpopup counter
+                        mPopupCount++;
+                        
+                        connect( actionPopup, SIGNAL(executeContactAction(QContact&, QContactDetail, QString)), this, 
+                                                    SLOT(executeAction(QContact&, QContactDetail, QString)));
+                        connect(actionPopup, SIGNAL(actionPopupCancelPressed()), this, SLOT(actionCancelled()));
+                    }
+                    else {
+                        delete actionPopup;
+                    }
+                }
+            }
+            //no popup dialog, execute action
+            if (mPopupCount==0) {
+                QVariantMap map;
+                QVariant params;
+                if (action.compare("message", Qt::CaseInsensitive) == 0) {
+                    params.setValue(mMessageActionParams);
+                }
+                else if (action.compare("email", Qt::CaseInsensitive) == 0) {
+                    params.setValue(mEmailActionParams);
+                }
+                map.insert(action,params);
+                CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action);
+                connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
+                other->execute(*mGroupContact, QContactDetail(), map);
+            }
+        }
+    }
+}
+
+void CntGroupActionsView::executeAction(QContact& contact, QContactDetail detail, QString action)
+{
+    Q_UNUSED(contact);
+    
+    if (action.compare("message", Qt::CaseInsensitive) == 0) {
+        QContactPhoneNumber phoneNumber = static_cast<QContactPhoneNumber>(detail);
+        mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel()));
+    }
+    else if (action.compare("email", Qt::CaseInsensitive) == 0) {
+        QContactEmailAddress email = static_cast<QContactEmailAddress>(detail);
+        mEmailActionParams.append(email.emailAddress());
+    }
+    
+    //actionpopup executed, decrement counter
+    mPopupCount--;
+    if (mPopupCount==0) {
+        QVariantMap map;
+        QVariant params;
+        if (action.compare("message", Qt::CaseInsensitive) == 0) {
+            params.setValue(mMessageActionParams);
+        }
+        else if (action.compare("email", Qt::CaseInsensitive) == 0) {
+            params.setValue(mEmailActionParams);
+        }
+        map.insert(action,params);
+        
+        CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), action);
+        connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
+        other->execute(*mGroupContact, QContactDetail(), map);
+        }
+}
+
+bool CntGroupActionsView::eventFilter(QObject *obj, QEvent *event)
+{
+    if (event->type() == QEvent::KeyPress && obj == mView->mainWindow())
+    {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        if (keyEvent->key() == Qt::Key_Yes)
+        {
+            return sendKeyPressed();
+        }
+    }
+    return false;
+}
+
+bool CntGroupActionsView::sendKeyPressed()
+{   
+    QList<QContactPhoneNumber> numberDetails = mGroupContact->details<QContactPhoneNumber>();
+    bool keyConsumed = false;
+        
+    // check if conference call number is present
+    if (!numberDetails.isEmpty()) 
+    { 
+        executeConferenceCallAction( *mGroupContact, mGroupContact->details<QContactPhoneNumber>().first(), "call");
+        
+        keyConsumed = true;
+    }
+    
+    return keyConsumed;
+}
+
+void CntGroupActionsView::executeConferenceCallAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction)
+{
+    if (mIsExecutingAction)
+    {
+        return;
+    }
+    else
+    {
+        mIsExecutingAction = true;
+    }
+    
+    CntActionLauncher* other = new CntActionLauncher(*mViewManager->contactManager(SYMBIAN_BACKEND), aAction);
+    connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
+    other->execute(aContact, aDetail);  
+}
+
+void CntGroupActionsView::actionCancelled()
+{
+    //actionpopup cancelled, decrement counter
+    mPopupCount--;
+}
+
+
+void CntGroupActionsView::actionExecuted(CntActionLauncher* aAction)
+{
+    //cleanup
+    aAction->deleteLater();
+    mIsExecutingAction = false;
+}
+
--- a/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -22,10 +22,10 @@
 #include <hblistview.h>
 #include <hblistviewitem.h>
 #include <qtcontacts.h>
+#include <hbmainwindow.h>
 
 CntGroupDeletePopup::CntGroupDeletePopup(QContactManager *manager, QGraphicsItem *parent):
     HbSelectionDialog(parent),
-    mListView(0),
     mContactManager(manager),
     mModel(0)
 {
@@ -44,41 +44,30 @@
     headingLabel->setHeading(hbTrId("txt_phob_opt_delete_groups"));
     
     setHeadingWidget(headingLabel);
-    
-    mListView = new HbListView(this);
-    
+
+    setSelectionMode( HbAbstractItemView::MultiSelection );
     mModel->initializeGroupsList();
-
-    //Get the index of the contacts
-    // Set the select option for those contacts in the selectionModel
-    mListView->setModel(mModel);
-    // set the listview to multiSelection mode, this will bring MarkAll functionality (from Orbit)
-    mListView->setSelectionMode(HbAbstractItemView::MultiSelection);
-    mListView->setFrictionEnabled(true);
-    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
-    
-    HbListViewItem *prototype = mListView->listItemPrototype();
-    prototype->setGraphicsSize(HbListViewItem::Thumbnail);
-    prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
-    
-    setContentWidget(mListView);
-    
-    setTimeout(HbDialog::NoTimeout);
-    setDismissPolicy(HbDialog::NoDismiss);
-    setModal(true);
-    setAttribute(Qt::WA_DeleteOnClose, true);
-    
+    setModel(mModel);
     clearActions(); 
     HbAction *mPrimaryAction = new HbAction(hbTrId("txt_phob_button_delete_selected"), this);
     addAction(mPrimaryAction);
     
     HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), this);
     addAction(mSecondaryAction);
+    
+    setTimeout(HbDialog::NoTimeout);
+    setDismissPolicy(HbDialog::NoDismiss);
+    setAttribute(Qt::WA_DeleteOnClose, true);
+    setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum );
+    
+    qreal heightToSet = mainWindow()->layoutRect().height();
+    setMinimumHeight(heightToSet);
 }
 
 QList<QContactLocalId> CntGroupDeletePopup::deleteGroup() const
 {
-    QModelIndexList indexes = mListView->selectionModel()->selection().indexes();
+
+    QModelIndexList indexes = selectedModelIndexes();
     QList<QContactLocalId> selectionList;
     for (int i = 0; i < indexes.count(); i++)
     {
--- a/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -31,7 +31,7 @@
         nameDetails.append(emptyName);
     }
     
-    QList<QContactPhoneNumber> numberDetails = CntDetailOrderingHelper::getOrderedSupportedPhoneNumbers(*mContact);
+    QList<QContactPhoneNumber> numberDetails = mContact->details<QContactPhoneNumber>();
     if (numberDetails.isEmpty())
     {
         QContactPhoneNumber emptyNumber;
@@ -46,6 +46,7 @@
     iNumberItem = new HbDataFormModelItem(type, hbTrId("txt_phob_formlabel_conference_number"));
     
     iNameItem->setContentWidgetData("text", iGroupName.customLabel());
+    iNameItem->setContentWidgetData("maxLength", CNT_GROUPNAME_MAXLENGTH);
     iNumberItem->setContentWidgetData("text", iGroupConfCallNumber.number() );
     
     HbDataFormModelItem* root = invisibleRootItem();
--- a/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,30 +16,8 @@
 */
 
 #include "cntgroupmemberview.h"
-#include "cntfetchcontactsview.h"
-#include "cntcontactcardheadingitem.h"
-#include "cntglobal.h"
-#include "cntimagelabel.h"
-#include "cntimageutility.h"
-#include <hbnotificationdialog.h>
-#include <hbmessagebox.h>
-#include <hbmenu.h>
-#include <hblistview.h>
-#include <hblistviewitem.h>
-#include <hbframebackground.h>
-#include <hbindexfeedback.h>
-#include <hbscrollbar.h>
-#include <hbview.h>
-#include <hbaction.h>
-#include <hblabel.h>
-#include <hbparameterlengthlimiter.h>
-#include <thumbnailmanager_qt.h>
-#include <cntlistmodel.h>
-#include <hbmainwindow.h>
-
-#include "cntdocumentloader.h"
-
-const char *CNT_GROUPMEMBERVIEW_XML = ":/xml/contacts_groupmembers.docml";
+#include "cntgroupmemberview_p.h"
+#include "cntabstractviewmanager.h"
 
 /*!
 \class CntGroupMemberView
@@ -56,454 +34,44 @@
 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
 
 */
-CntGroupMemberView::CntGroupMemberView() :
-    mGroupContact(NULL),
-    mViewManager(NULL),
-    mHeadingItem(NULL),
-    mModel(NULL),
-    mImageLabel(NULL), 
-    mListView(NULL),
-    mFetchView(NULL),
-    mAvatar(NULL)
+CntGroupMemberView::CntGroupMemberView() : d_ptr(new CntGroupMemberViewPrivate())
 {
-    mDocument = new CntDocumentLoader;
-    
-    bool ok;
-    mDocument->load( CNT_GROUPMEMBERVIEW_XML, &ok );
-    if ( !ok ){
-        qFatal( "Unable to load %S", CNT_GROUPMEMBERVIEW_XML );
-    }
-
-    mView = static_cast<HbView*>( mDocument->findWidget("view") );
-    
-    //back button
-    mSoftkey = new HbAction(Hb::BackNaviAction, mView);
-    connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView()));
-    
-    mImageLabel = static_cast<CntImageLabel*>(mDocument->findWidget("editViewImage"));
-    connect( mImageLabel, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) );
-    connect( mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)) );
-    
-    mListView = static_cast<HbListView*>( mDocument->findWidget("listView") );
-    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this,
-        SLOT(showContextMenu(HbAbstractViewItem*,QPointF)));
-    connect(mListView, SIGNAL(activated (const QModelIndex&)), this,
-        SLOT(showContactView(const QModelIndex&)));
-    
-    mHeadingItem = static_cast<CntContactCardHeadingItem*>( mDocument->findWidget("editViewHeading") );
-    connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(openImageEditor()) );
-    connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)));
-
-    // menu actions
-    mEditGroupAction = static_cast<HbAction*>( mDocument->findObject("cnt:editgroupdetails"));
-    connect(mEditGroupAction, SIGNAL(triggered()), this, SLOT(editGroup()));
-    
-    // toolbar actions
-    mManageAction = static_cast<HbAction*>( mDocument->findObject("cnt:managemembers"));
-    connect(mManageAction, SIGNAL(triggered()), this, SLOT(manageMembers()));
-    mDeleteAction = static_cast<HbAction*>( mDocument->findObject("cnt:deletegroup"));
-    connect(mDeleteAction, SIGNAL(triggered()), this, SLOT(deleteGroup()));
-    mShowActionsAction = static_cast<HbAction*>( mDocument->findObject("cnt:groupactions"));
-    connect(mShowActionsAction, SIGNAL(triggered()), this, SLOT(openGroupActions()));
-    
-    // thumbnail manager
-    mThumbnailManager = new ThumbnailManager(this);
-    mThumbnailManager->setMode(ThumbnailManager::Default);
-    mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality);
-    mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge);
-   
-    connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)),
-               this, SLOT(thumbnailReady(QPixmap, void*, int, int)));
+    Q_D( CntGroupMemberView );
+    d->q_ptr = this;
 }
 
-/*!
-Destructor
-*/
 CntGroupMemberView::~CntGroupMemberView()
 {
-    mView->deleteLater();
-    
-    delete mGroupContact;
-    mGroupContact = 0;
-    
-    delete mModel;
-    mModel = 0;
-    
-    delete mFetchView;
-    mFetchView = 0;
-    
-    delete mAvatar;
-    mAvatar = NULL;
+    Q_D(CntGroupMemberView);
+    delete d;
 }
-
-void CntGroupMemberView::setOrientation(Qt::Orientation orientation)
-{
-    if (orientation == Qt::Vertical) 
-    {
-        // reading "portrait" section
-        mDocument->load( CNT_GROUPMEMBERVIEW_XML, "portrait" );
-    } 
-    else 
-    {
-        // reading "landscape" section
-        mDocument->load( CNT_GROUPMEMBERVIEW_XML, "landscape" );
-    }
-}
-
+    
 void CntGroupMemberView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
 {
-    mViewManager = aMgr;
-    mArgs = aArgs;
-    
-    if (mView->navigationAction() != mSoftkey)
-        {
-        mView->setNavigationAction(mSoftkey);   
-        }
-        
-    QVariant contact = mArgs.value( ESelectedGroupContact );
-    mGroupContact = new QContact( contact.value<QContact>() );
-    
-    HbMainWindow* window = mView->mainWindow();
-    if ( window )
-    {
-        connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
-        setOrientation(window->orientation());
-    }
-    
-    mHeadingItem->setGroupDetails(mGroupContact);
-
-    // avatar
-    QList<QContactAvatar> details = mGroupContact->details<QContactAvatar>();
-    for (int i = 0;i < details.count();i++)
-    {
-        if (details.at(i).imageUrl().isValid())
-            {
-            mAvatar = new QContactAvatar(details.at(i));
-            mThumbnailManager->getThumbnail(mAvatar->imageUrl().toString());
-            break;
-            }
-    }
-    
-    // create list & model
-    mListView->setFrictionEnabled(true);
-    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
-    mListView->verticalScrollBar()->setInteractive(true);
-    mListView->setUniformItemSizes(true);
-    mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail);
-    HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView);
-    indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
-    indexFeedback->setItemView(mListView);
-
-    HbFrameBackground frame;
-    frame.setFrameGraphicsName("qtg_fr_list_normal");
-    frame.setFrameType(HbFrameDrawer::NinePieces);
-    mListView->itemPrototypes().first()->setDefaultFrame(frame);
-    
-    createModel();
-    
-    if (mArgs.value(ESelectedAction).toString() == CNT_SAVE_ACTION)
-    {
-        QString name = getContactManager()->synthesizedDisplayLabel(*mGroupContact);
-        HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created").arg(name)));
-    }
-    
-    mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND ));
-    connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageMembers()));
+    Q_D(CntGroupMemberView);
+    d->activate(aMgr,aArgs);
 }
 
 void CntGroupMemberView::deactivate()
 {
-    
-}
-
-void CntGroupMemberView::showPreviousView()
-{
-    //save the contact if avatar has been changed.
-    QContact contact = mViewManager->contactManager( SYMBIAN_BACKEND )->contact(mGroupContact->localId());
-    if ( contact != *mGroupContact )
-    {
-        getContactManager()->saveContact(mGroupContact);
-    }
-    mViewManager->back(mArgs);
-}
-
-void CntGroupMemberView::openGroupActions()
-{
-    QVariant var;
-    var.setValue(*mGroupContact);
-    
-    mArgs.insert(EViewId, groupActionsView);
-    mArgs.insert(ESelectedGroupContact, var);
-    mViewManager->changeView(mArgs);
-}
-
-void CntGroupMemberView::manageMembers()
-{
-    QContactRelationshipFilter membersFilter;
-    membersFilter.setRelationshipType(QContactRelationship::HasMember);
-    membersFilter.setRelatedContactRole(QContactRelationship::First);
-    membersFilter.setRelatedContactId(mGroupContact->id());   
-    mOriginalGroupMembers = getContactManager()->contactIds(membersFilter);
-    
-    QSet<QContactLocalId> contactsSet = mOriginalGroupMembers.toSet();
-    QContactName groupContactName = mGroupContact->detail( QContactName::DefinitionName );
-    QString groupName(groupContactName.value( QContactName::FieldCustomLabel ));
-    
-    if (!mFetchView) {
-        mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND ));
-        connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageMembers()));
-    }
-    mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupName),
-                           hbTrId("txt_common_button_save"));
-    mFetchView->displayContacts(HbAbstractItemView::MultiSelection, contactsSet);
+    Q_D(CntGroupMemberView);
+    d->deactivate();
 }
 
-void CntGroupMemberView::handleManageMembers()
-{
-    
-    QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
-    
-    if (mFetchView->wasCanceled()) {
-        delete mFetchView;
-        mFetchView = 0;
-        return;
-    }
-
-    QList<QContactRelationship> removedMemberships;
-    QList<QContactRelationship> addedMemberships;
-
-    QSet<QContactLocalId> removedMembers = mOriginalGroupMembers.toSet() - selectedContacts;
-    setRelationship(removedMembers, removedMemberships);
-
-    QSet<QContactLocalId> addedMembers = selectedContacts - mOriginalGroupMembers.toSet();
-    setRelationship(addedMembers, addedMemberships);
-    
-    QMap<int, QContactManager::Error> errors;
-    if (!addedMemberships.isEmpty()) {
-        getContactManager()->saveRelationships(&addedMemberships, &errors);
-    }
-    
-    if (!removedMemberships.isEmpty()) {
-        getContactManager()->removeRelationships(removedMemberships, &errors);
-    }
-}
-
-void CntGroupMemberView::createModel()
-{
-    QContactRelationshipFilter rFilter;
-    rFilter.setRelationshipType(QContactRelationship::HasMember);
-    rFilter.setRelatedContactRole(QContactRelationship::First);
-    rFilter.setRelatedContactId(mGroupContact->id());
-
-    mModel = new CntListModel(getContactManager(), rFilter, false);
-    mListView->setModel(mModel);
-}
-
-void CntGroupMemberView::editGroup()
+bool CntGroupMemberView::isDefault() const
 {
-    mArgs.insert(EViewId, groupEditorView);
-    QVariant var;
-    var.setValue(*mGroupContact);
-    mArgs.insert(ESelectedGroupContact, var);
-    mViewManager->changeView(mArgs);
-}
-
-void CntGroupMemberView::deleteGroup()
-{
-    QString groupName = mGroupContact->displayLabel();
-    HbLabel *headingLabel = new HbLabel();
-    headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(groupName));
-    
-    HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac"), this, SLOT(handleDeleteGroup(HbAction*)),
-            hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel);
-}
-
-void CntGroupMemberView::handleDeleteGroup(HbAction *action)
-{
-    HbDialog *popup = static_cast<HbDialog*>(sender());
-    
-    if (popup && action == popup->actions().first())
-    {
-        getContactManager()->removeContact(mGroupContact->localId());
-        showPreviousView();
-    }
-}
-
-/*!
-Called when a list item is longpressed
-*/
-void CntGroupMemberView::showContextMenu(HbAbstractViewItem *aItem, const QPointF &aCoords)
-{
-    QVariant data( aItem->modelIndex().row() );
-   
-    QModelIndex index = aItem->modelIndex();
-
-    HbMenu *menu = new HbMenu();
-    menu->setAttribute(Qt::WA_DeleteOnClose);
-    menu->setPreferredPos( aCoords );
-    
-    HbAction *removeFromGroupAction = 0;
-    HbAction *openContactAction = 0;
-    HbAction *editContactAction = 0;
-
-    openContactAction = menu->addAction(hbTrId("txt_common_menu_open"));
-    editContactAction = menu->addAction(hbTrId("txt_common_menu_edit"));
-    removeFromGroupAction = menu->addAction(hbTrId("txt_phob_menu_remove_from_group"));
-    
-    openContactAction->setData( data );
-    editContactAction->setData( data );
-    removeFromGroupAction->setData( data );
-
-    menu->open(this, SLOT(handleMenu(HbAction*)));
+    return false;
 }
 
-void CntGroupMemberView::handleMenu(HbAction* action)
-{
-    int row = action->data().toInt();
-    HbMenu *menuItem = static_cast<HbMenu*>(sender());
-    QModelIndex index = mModel->index(row);
-    
-    if ( action == menuItem->actions().first() )
-        {
-        showContactView(index);
-        }
-    else if (action == menuItem->actions().at(1))
-        {
-        editContact(index);
-        }
-    else if (action == menuItem->actions().at(2))
-        {
-        removeFromGroup(index);
-        }
-}
-
-
-/*!
-Called after user clicked on the listview.
-*/
-void CntGroupMemberView::showContactView(const QModelIndex &index)
+HbView* CntGroupMemberView::view() const
 {
-    mArgs.insert(EViewId, commLauncherView);
-    QVariant var;
-    var.setValue(mModel->contact(index));
-    mArgs.insert(ESelectedContact, var);
-    QVariant varGroup;
-    varGroup.setValue(*mGroupContact);
-    mArgs.insert(ESelectedGroupContact, varGroup);
-    mViewManager->changeView(mArgs);
-        
-}
-
-void CntGroupMemberView::removeFromGroup(const QModelIndex &index)
-{
-    // get contact id using index
-    QContact selectedContact = mModel->contact(index);
-    QContactRelationship relationship;
-    relationship.setRelationshipType(QContactRelationship::HasMember);
-    relationship.setFirst(mGroupContact->id());
-    relationship.setSecond(selectedContact.id());
-    getContactManager()->removeRelationship(relationship);
-}
-
-void CntGroupMemberView::editContact(const QModelIndex &index)
-{
-
-    mArgs.insert(EViewId, editView);
-    QVariant var;
-    var.setValue(mModel->contact(index));
-    mArgs.insert(ESelectedContact, var);
-    mViewManager->changeView(mArgs);
-}
-
-void CntGroupMemberView::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error)
-{
-    Q_UNUSED(data);
-    Q_UNUSED(id);
-    Q_UNUSED(error);
-    if (!error)
-    {
-        QIcon qicon(pixmap);
-        HbIcon icon(qicon);
-        mHeadingItem->setIcon(icon);
-        
-        mImageLabel->clear();
-        mImageLabel->setIcon(icon);
-    }
+    Q_D( const CntGroupMemberView );
+    return d->mView;
 }
 
-void CntGroupMemberView::openImageEditor()
+int CntGroupMemberView::viewId() const
 {
-    QVariant var;
-    var.setValue(*mGroupContact);
-                
-    // SelectedGroupContact is needed so we know which group to show
-    // when we come back to this view, and selected contact is needed
-    // for image editor to be able to assign the image to correct contact.
-    mArgs.insert(ESelectedGroupContact, var);
-    mArgs.insert(ESelectedContact, var);
-    
-    mArgs.insert(EViewId, imageEditorView );
-        
-    mViewManager->changeView( mArgs );
-}
-
-QContactManager* CntGroupMemberView::getContactManager()
-{
-    return mViewManager->contactManager(SYMBIAN_BACKEND);
-}
-
-void CntGroupMemberView::setRelationship(QSet<QContactLocalId>        &aLocalId,
-                                         QList<QContactRelationship>  &aRelationshipList)
-{
-    foreach (QContactLocalId id, aLocalId) {
-        QContact contact = getContactManager()->contact(id);
-
-        QContactRelationship membership;
-        membership.setRelationshipType(QContactRelationship::HasMember);
-        membership.setFirst(mGroupContact->id());
-        membership.setSecond(contact.id());
-        aRelationshipList.append(membership);
-    }
-}
+    return groupMemberView;
+} 
+// EOF
 
-/*!
-Draw the image specific content menu
-*/
-void CntGroupMemberView::drawImageMenu(const QPointF &aCoords)
-{
-    HbMenu *menu = new HbMenu();
-    HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(openImageEditor()));
-    if (mAvatar)
-    {
-        HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(removeImage()));
-    }
-    menu->setPreferredPos(aCoords);
-    menu->open();
-}
-
-
-void CntGroupMemberView::removeImage()
-{
-    if (mAvatar) 
-    {
-        if (!mAvatar->imageUrl().isEmpty())
-        {
-            bool success = mGroupContact->removeDetail(mAvatar);
-            // Check if image removable.
-            CntImageUtility imageUtility;
-            if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString()))
-            {
-                imageUtility.removeImage(mAvatar->imageUrl().toString());
-            }
-            mAvatar->setImageUrl(QUrl());
-            mImageLabel->clear();
-            mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture"));
-            mHeadingItem->setIcon(HbIcon("qtg_large_add_group_picture"));
-            mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact);
-       }
-    }
-}
-
-
-
-// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntgroupmemberview_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,526 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cntgroupmemberview_p.h"
+#include "cntfetchcontactpopup.h"
+#include "cntcontactcardheadingitem.h"
+#include "cntglobal.h"
+#include "cntimagelabel.h"
+#include "cntimageutility.h"
+#include <hbnotificationdialog.h>
+#include <hbmessagebox.h>
+#include <hbmenu.h>
+#include <hblistview.h>
+#include <hblistviewitem.h>
+#include <hbframebackground.h>
+#include <hbindexfeedback.h>
+#include <hbscrollbar.h>
+#include <hbview.h>
+#include <hbaction.h>
+#include <hblabel.h>
+#include <hbparameterlengthlimiter.h>
+#include <thumbnailmanager_qt.h>
+#include <cntlistmodel.h>
+#include <hbmainwindow.h>
+#include <xqservicerequest.h>
+
+#include "cntdocumentloader.h"
+
+const char *CNT_GROUPMEMBERVIEW_XML = ":/xml/contacts_groupmembers.docml";
+
+/*!
+\class CntGroupMemberViewPrivate
+\brief
+
+This is the group members view class that shows list of contacts for a user group. View contains a listview that shows actual contacts that
+have been added to a particular group. There is also toolbar and menu for navigating between different views. Instance of this class is
+created by our viewmanager but view itself is owned by the mainwindow which will also delete it in the end.
+
+*/
+
+/*!
+Constructor, initialize member variables.
+\a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
+
+*/
+CntGroupMemberViewPrivate::CntGroupMemberViewPrivate() :
+    mGroupContact(NULL),
+    mViewManager(NULL),
+    mHeadingItem(NULL),
+    mModel(NULL),
+    mImageLabel(NULL), 
+    mListView(NULL),
+    mAvatar(NULL)
+{
+    mDocument = new CntDocumentLoader;
+    
+    bool ok;
+    mDocument->load( CNT_GROUPMEMBERVIEW_XML, &ok );
+    if ( !ok ){
+        qFatal( "Unable to load %S", CNT_GROUPMEMBERVIEW_XML );
+    }
+
+    mView = static_cast<HbView*>( mDocument->findWidget("view") );
+    
+    //back button
+    mSoftkey = new HbAction(Hb::BackNaviAction, mView);
+    connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView()));
+    
+    mImageLabel = static_cast<CntImageLabel*>(mDocument->findWidget("editViewImage"));
+    connect( mImageLabel, SIGNAL(iconClicked()), this, SLOT(openImageEditor()) );
+    connect( mImageLabel, SIGNAL(iconLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)) );
+    
+    mListView = static_cast<HbListView*>( mDocument->findWidget("listView") );
+    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this,
+        SLOT(showContextMenu(HbAbstractViewItem*,QPointF)));
+    connect(mListView, SIGNAL(activated (const QModelIndex&)), this,
+        SLOT(showContactView(const QModelIndex&)));
+    
+    mHeadingItem = static_cast<CntContactCardHeadingItem*>( mDocument->findWidget("editViewHeading") );
+    connect(mHeadingItem, SIGNAL(passShortPressed(const QPointF&)), this, SLOT(openImageEditor()) );
+    connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)));
+
+    // menu actions
+    mEditGroupAction = static_cast<HbAction*>( mDocument->findObject("cnt:editgroupdetails"));
+    connect(mEditGroupAction, SIGNAL(triggered()), this, SLOT(editGroup()));
+    
+    // toolbar actions
+    mManageAction = static_cast<HbAction*>( mDocument->findObject("cnt:managemembers"));
+    connect(mManageAction, SIGNAL(triggered()), this, SLOT(manageMembers()));
+    mDeleteAction = static_cast<HbAction*>( mDocument->findObject("cnt:deletegroup"));
+    connect(mDeleteAction, SIGNAL(triggered()), this, SLOT(deleteGroup()));
+    mShowActionsAction = static_cast<HbAction*>( mDocument->findObject("cnt:groupactions"));
+    connect(mShowActionsAction, SIGNAL(triggered()), this, SLOT(openGroupActions()));
+    
+    // thumbnail manager
+    mThumbnailManager = new ThumbnailManager(this);
+    mThumbnailManager->setMode(ThumbnailManager::Default);
+    mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality);
+    mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge);
+   
+    connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)),
+               this, SLOT(thumbnailReady(QPixmap, void*, int, int)));
+}
+
+/*!
+Destructor
+*/
+CntGroupMemberViewPrivate::~CntGroupMemberViewPrivate()
+{
+    mView->deleteLater();
+    
+    delete mGroupContact;
+    mGroupContact = NULL;
+    
+    delete mModel;
+    mModel = NULL;
+    
+    delete mAvatar;
+    mAvatar = NULL;
+}
+
+void CntGroupMemberViewPrivate::setOrientation(Qt::Orientation orientation)
+{
+    if (orientation == Qt::Vertical) 
+    {
+        // reading "portrait" section
+        mDocument->load( CNT_GROUPMEMBERVIEW_XML, "portrait" );
+    } 
+    else 
+    {
+        // reading "landscape" section
+        mDocument->load( CNT_GROUPMEMBERVIEW_XML, "landscape" );
+    }
+}
+
+void CntGroupMemberViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
+{
+    mViewManager = aMgr;
+    mArgs = aArgs;
+    
+    if (mView->navigationAction() != mSoftkey)
+        {
+        mView->setNavigationAction(mSoftkey);   
+        }
+        
+    QVariant contact = mArgs.value( ESelectedGroupContact );
+    mGroupContact = new QContact( contact.value<QContact>() );
+    
+    HbMainWindow* window = mView->mainWindow();
+    if ( window )
+    {
+        connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
+        setOrientation(window->orientation());
+    }
+    
+    mHeadingItem->setGroupDetails(mGroupContact);
+
+    // avatar
+    QList<QContactAvatar> details = mGroupContact->details<QContactAvatar>();
+    for (int i = 0;i < details.count();i++)
+    {
+        if (details.at(i).imageUrl().isValid())
+            {
+            mAvatar = new QContactAvatar(details.at(i));
+            mThumbnailManager->getThumbnail(mAvatar->imageUrl().toString());
+            break;
+            }
+    }
+    
+    // create list & model
+    mListView->setFrictionEnabled(true);
+    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+    mListView->verticalScrollBar()->setInteractive(true);
+    mListView->setUniformItemSizes(true);
+    mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail);
+    HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView);
+    indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+    indexFeedback->setItemView(mListView);
+
+    HbFrameBackground frame;
+    frame.setFrameGraphicsName("qtg_fr_list_normal");
+    frame.setFrameType(HbFrameDrawer::NinePieces);
+    mListView->itemPrototypes().first()->setDefaultFrame(frame);
+    
+    createModel();
+    
+    if (mArgs.value(ESelectedAction).toString() == CNT_SAVE_ACTION)
+    {
+        QString name = getContactManager()->synthesizedContactDisplayLabel(*mGroupContact);
+        HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created").arg(name)));
+    }
+}
+
+void CntGroupMemberViewPrivate::deactivate()
+{
+}
+
+void CntGroupMemberViewPrivate::showPreviousView()
+{
+    Q_Q(CntGroupMemberView);
+    
+    emit q->backPressed();
+    
+    //save the contact if avatar has been changed.
+    QContact contact = mViewManager->contactManager( SYMBIAN_BACKEND )->contact(mGroupContact->localId());
+    if ( contact != *mGroupContact )
+    {
+        getContactManager()->saveContact(mGroupContact);
+    }
+    mViewManager->back(mArgs);
+}
+
+void CntGroupMemberViewPrivate::openGroupActions()
+{
+    QVariant var;
+    var.setValue(*mGroupContact);
+    
+    mArgs.insert(EViewId, groupActionsView);
+    mArgs.insert(ESelectedGroupContact, var);
+    mViewManager->changeView(mArgs);
+}
+
+void CntGroupMemberViewPrivate::manageMembers()
+{
+    QContactRelationshipFilter membersFilter;
+    membersFilter.setRelationshipType(QContactRelationship::HasMember);
+    membersFilter.setRelatedContactRole(QContactRelationship::First);
+    membersFilter.setRelatedContactId(mGroupContact->id());   
+    
+    mOriginalGroupMembers = getContactManager()->contactIds(membersFilter);
+    
+    QContactName contactName = mGroupContact->detail( QContactName::DefinitionName );
+    QString groupName = contactName.value( QContactName::FieldCustomLabel );
+    if (groupName.isEmpty())
+    {
+        groupName = hbTrId("txt_phob_list_unnamed");
+    }
+    
+    CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup(
+            HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupName),
+            hbTrId("txt_common_button_save"),
+            *mViewManager->contactManager(SYMBIAN_BACKEND));
+    connect( popup, SIGNAL(fetchReady(QSet<QContactLocalId>)),this, SLOT(handleManageMembers(QSet<QContactLocalId>)) );
+    popup->setSelectedContacts( mOriginalGroupMembers.toSet() );
+    popup->showPopup();
+}
+
+void CntGroupMemberViewPrivate::handleManageMembers( QSet<QContactLocalId> aIds )
+{
+    QList<QContactRelationship> removedMemberships;
+    QList<QContactRelationship> addedMemberships;
+
+    QSet<QContactLocalId> removedMembers = mOriginalGroupMembers.toSet() - aIds;
+    setRelationship(removedMembers, removedMemberships);
+
+    QSet<QContactLocalId> addedMembers = aIds - mOriginalGroupMembers.toSet();
+    setRelationship(addedMembers, addedMemberships);
+    
+    QMap<int, QContactManager::Error> errors;
+    if (!addedMemberships.isEmpty()) 
+    {
+        getContactManager()->saveRelationships(&addedMemberships, &errors);
+    }
+    
+    if (!removedMemberships.isEmpty()) 
+    {
+        getContactManager()->removeRelationships(removedMemberships, &errors);
+    }
+}
+
+void CntGroupMemberViewPrivate::createModel()
+{
+    QContactRelationshipFilter rFilter;
+    rFilter.setRelationshipType(QContactRelationship::HasMember);
+    rFilter.setRelatedContactRole(QContactRelationship::First);
+    rFilter.setRelatedContactId(mGroupContact->id());
+
+    mModel = new CntListModel(getContactManager(), rFilter, false);
+    mListView->setModel(mModel);
+}
+
+void CntGroupMemberViewPrivate::editGroup()
+{
+    mArgs.insert(EViewId, groupEditorView);
+    QVariant var;
+    var.setValue(*mGroupContact);
+    mArgs.insert(ESelectedGroupContact, var);
+    mViewManager->changeView(mArgs);
+}
+
+void CntGroupMemberViewPrivate::deleteGroup()
+{
+    QContactName contactName = mGroupContact->detail( QContactName::DefinitionName );
+    QString groupName = contactName.value( QContactName::FieldCustomLabel );
+    if (groupName.isNull())
+    {
+        groupName = hbTrId("txt_phob_list_unnamed");
+    }
+    
+    HbLabel *headingLabel = new HbLabel();
+    headingLabel->setPlainText(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(groupName));
+    
+    HbMessageBox::question(hbTrId("txt_phob_dialog_only_group_will_be_removed_contac"), this, SLOT(handleDeleteGroup(int)),
+            HbMessageBox::Delete | HbMessageBox::Cancel, headingLabel);
+}
+
+void CntGroupMemberViewPrivate::handleDeleteGroup(int action)
+{
+    if (action == HbMessageBox::Delete)
+    {
+        getContactManager()->removeContact(mGroupContact->localId());
+        showPreviousView();
+    }
+}
+
+/*!
+Called when a list item is longpressed
+*/
+void CntGroupMemberViewPrivate::showContextMenu(HbAbstractViewItem *aItem, const QPointF &aCoords)
+{
+    QVariant data( aItem->modelIndex().row() );
+   
+    QModelIndex index = aItem->modelIndex();
+
+    HbMenu *menu = new HbMenu();
+    menu->setAttribute(Qt::WA_DeleteOnClose);
+    menu->setPreferredPos( aCoords );
+    
+    HbAction *removeFromGroupAction = 0;
+    HbAction *openContactAction = 0;
+    HbAction *editContactAction = 0;
+    HbAction *sendToHsAction = 0;
+
+    openContactAction = menu->addAction(hbTrId("txt_common_menu_open"));
+    editContactAction = menu->addAction(hbTrId("txt_common_menu_edit"));
+    removeFromGroupAction = menu->addAction(hbTrId("txt_phob_menu_remove_from_group"));
+    sendToHsAction = menu->addAction(hbTrId("txt_phob_menu_send_to_homescreen"));
+    
+    openContactAction->setData( data );
+    editContactAction->setData( data );
+    removeFromGroupAction->setData( data );
+    sendToHsAction->setData( data );
+
+    menu->open(this, SLOT(handleMenu(HbAction*)));
+}
+
+void CntGroupMemberViewPrivate::handleMenu(HbAction* action)
+{
+    int row = action->data().toInt();
+    HbMenu *menuItem = static_cast<HbMenu*>(sender());
+    QModelIndex index = mModel->index(row);
+    
+    if ( action == menuItem->actions().first() )
+        {
+        showContactView(index);
+        }
+    else if (action == menuItem->actions().at(1))
+        {
+        editContact(index);
+        }
+    else if (action == menuItem->actions().at(2))
+        {
+        removeFromGroup(index);
+        }
+    else if (action == menuItem->actions().at(3))
+        {
+        sendToHs(index);
+        }
+}
+
+/*!
+Called after user clicked on the listview.
+*/
+void CntGroupMemberViewPrivate::sendToHs(const QModelIndex &index)
+{
+    QVariantHash preferences;
+    preferences["contactId"] = mModel->contact(index).id().localId();
+    
+    XQServiceRequest snd("com.nokia.symbian.IHomeScreenClient",
+                         "addWidget(QString,QVariantHash)",
+                         false);
+    snd << QString("contactwidgethsplugin");
+    snd << preferences;
+    snd.send();
+}
+
+/*!
+Called after user clicked on the listview.
+*/
+void CntGroupMemberViewPrivate::showContactView(const QModelIndex &index)
+{
+    mArgs.insert(EViewId, contactCardView);
+    QVariant var;
+    var.setValue(mModel->contact(index));
+    mArgs.insert(ESelectedContact, var);
+    QVariant varGroup;
+    varGroup.setValue(*mGroupContact);
+    mArgs.insert(ESelectedGroupContact, varGroup);
+    mViewManager->changeView(mArgs);
+        
+}
+
+void CntGroupMemberViewPrivate::removeFromGroup(const QModelIndex &index)
+{
+    // get contact id using index
+    QContact selectedContact = mModel->contact(index);
+    QContactRelationship relationship;
+    relationship.setRelationshipType(QContactRelationship::HasMember);
+    relationship.setFirst(mGroupContact->id());
+    relationship.setSecond(selectedContact.id());
+    getContactManager()->removeRelationship(relationship);
+}
+
+void CntGroupMemberViewPrivate::editContact(const QModelIndex &index)
+{
+
+    mArgs.insert(EViewId, editView);
+    QVariant var;
+    var.setValue(mModel->contact(index));
+    mArgs.insert(ESelectedContact, var);
+    mViewManager->changeView(mArgs);
+}
+
+void CntGroupMemberViewPrivate::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error)
+{
+    Q_UNUSED(data);
+    Q_UNUSED(id);
+    Q_UNUSED(error);
+    if (!error)
+    {
+        HbIcon icon(pixmap);
+        mHeadingItem->setIcon(icon);
+        
+        mImageLabel->clear();
+        mImageLabel->setIcon(pixmap);
+    }
+}
+
+void CntGroupMemberViewPrivate::openImageEditor()
+{
+    QVariant var;
+    var.setValue(*mGroupContact);
+       
+    // only group contact is assigned since we want to only
+    // change the groups image
+    mArgs.insert(ESelectedGroupContact, var);
+    
+    mArgs.insert(EViewId, imageEditorView );
+        
+    mViewManager->changeView( mArgs );
+}
+
+QContactManager* CntGroupMemberViewPrivate::getContactManager()
+{
+    return mViewManager->contactManager(SYMBIAN_BACKEND);
+}
+
+void CntGroupMemberViewPrivate::setRelationship(QSet<QContactLocalId>        &aLocalId,
+                                         QList<QContactRelationship>  &aRelationshipList)
+{
+    foreach (QContactLocalId id, aLocalId) {
+        QContact contact = getContactManager()->contact(id);
+
+        QContactRelationship membership;
+        membership.setRelationshipType(QContactRelationship::HasMember);
+        membership.setFirst(mGroupContact->id());
+        membership.setSecond(contact.id());
+        aRelationshipList.append(membership);
+    }
+}
+
+/*!
+Draw the image specific content menu
+*/
+void CntGroupMemberViewPrivate::drawImageMenu(const QPointF &aCoords)
+{
+    HbMenu *menu = new HbMenu();
+    HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(openImageEditor()));
+    if (mAvatar && !mAvatar->imageUrl().isEmpty())
+    {
+        HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(removeImage()));
+    }
+    menu->setPreferredPos(aCoords);
+    menu->open();
+}
+
+
+void CntGroupMemberViewPrivate::removeImage()
+{
+    if (mAvatar) 
+    {
+        if (!mAvatar->imageUrl().isEmpty())
+        {
+            bool success = mGroupContact->removeDetail(mAvatar);
+            // Check if image removable.
+            CntImageUtility imageUtility;
+            if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString()))
+            {
+                imageUtility.removeImage(mAvatar->imageUrl().toString());
+            }
+            mAvatar->setImageUrl(QUrl());
+            mImageLabel->clear();
+            mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture"));
+            mHeadingItem->setIcon(HbIcon("qtg_large_add_group_picture"));
+            getContactManager()->saveContact(mGroupContact);
+       }
+    }
+}
+
+
+
+// end of file
--- a/phonebookui/pbkcommonui/src/cnthistoryview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnthistoryview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -30,9 +30,12 @@
 #include <hbparameterlengthlimiter.h>
 #include <hbmainwindow.h>
 #include <hbframebackground.h>
+#include <QTimer>
+#include <qtcontacts.h>
 
 #include "cnthistoryviewitem.h"
 #include "cntglobal.h"
+#include "cntdebug.h"
 
 const char *CNT_HISTORYVIEW_XML = ":/xml/contacts_history.docml";
 
@@ -99,6 +102,9 @@
  */
 void CntHistoryView::deactivate()
 {
+    QContactManager* cm = mViewMgr->contactManager(SYMBIAN_BACKEND);
+    disconnect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)),
+            this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
 }
 
 /**
@@ -108,11 +114,18 @@
 {
     mViewMgr = aMgr;
     mArgs = aArgs;
+    
+    QContactManager* cm = mViewMgr->contactManager(SYMBIAN_BACKEND);
     mContact = new QContact(mArgs.value(ESelectedContact).value<QContact>());
     
     // Set history view heading
     HbGroupBox* groupBox = static_cast<HbGroupBox*>(docLoader()->findWidget(QString("groupBox")));
-    groupBox->setHeading(hbTrId("txt_phob_subtitle_history_with_1").arg(mContact->displayLabel()));
+    QString name = mContact->displayLabel();
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
+    groupBox->setHeading(hbTrId("txt_phob_subtitle_history_with_1").arg(name));
     
     //construct listview
     mHistoryListView = static_cast<HbListView*>(docLoader()->findWidget(QString("listView")));
@@ -125,8 +138,7 @@
     // Connect listview items to respective slots
     connect(mHistoryListView, SIGNAL(activated(const QModelIndex &)),
                       this,  SLOT(itemActivated(const QModelIndex &)));
-    mHistoryModel = new CntHistoryModel(mContact->localId(),
-                                        mViewMgr->contactManager(SYMBIAN_BACKEND));
+    mHistoryModel = new CntHistoryModel(mContact->localId(), cm);
     mHistoryListView->setModel(mHistoryModel); //ownership is not taken
     
     //start listening to the events amount changing in the model
@@ -150,6 +162,9 @@
     HbMainWindow* mainWindow = mView->mainWindow();
     connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), 
             this, SLOT(updateScrollingPosition()));
+    
+    connect(cm, SIGNAL(contactsRemoved(const QList<QContactLocalId>&)), 
+        this, SLOT(contactDeletedFromOtherSource(const QList<QContactLocalId>&)));
 }
 
 /*!
@@ -171,19 +186,21 @@
 {
     // Ask the use if they want to clear the history
     QString name = mContact->displayLabel();
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
     
     HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_clear_communications_history_with_1")).arg(name), this, 
-            SLOT(handleClearHistory(HbAction*)), hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"));
+            SLOT(handleClearHistory(int)), HbMessageBox::Delete | HbMessageBox::Cancel);
 }
 
 /*
 Handle the selected action for clearing history
 */
-void CntHistoryView::handleClearHistory(HbAction *action)
+void CntHistoryView::handleClearHistory(int action)
 {
-    HbMessageBox *note = static_cast<HbMessageBox*>(sender());
-    
-    if (note && action == note->actions().first())
+    if (action == HbMessageBox::Delete)
     {
         mHistoryModel->clearHistory();
     }
@@ -213,17 +230,17 @@
             operation = "dial(QString)";
             args << number;
             createRequest = true;
+            
+            // TODO: Using XQApplicationManager is not working with calls
+            // The factory method cannot create a request. Find out why
+            createRequest = false;
+            QString service("com.nokia.symbian.ICallDial");
+            QString type("dial(QString,int)");
+            XQServiceRequest snd(interface, operation, false);
+            snd << number.toString() << mContact->localId();
+            snd.send();
         }
         
-        // TODO: Using XQApplicationManager is not working with calls
-        // The factory method cannot create a request. Find out why
-        createRequest = false;
-        QString service("com.nokia.symbian.ICallDial");
-        QString type("dial(QString)");
-        XQServiceRequest snd(interface, operation, false);
-        snd << number.toString();
-        snd.send();
-        
     } else if ( flags & CntMessage ) {
         // Open conversation view
         QVariant id = index.data(CntConverstaionIdRole);
@@ -262,6 +279,27 @@
 }
 
 /*!
+Go back to the root view
+*/
+void CntHistoryView::showRootView()
+{   
+    mViewMgr->back( mArgs, true );
+}
+
+
+void CntHistoryView::contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds)
+{
+    CNT_ENTRY
+    if ( contactIds.contains(mContact->localId()) )
+    {
+        // Do not switch to the previous view immediately. List views are
+        // not updated properly if this is not done in the event loop
+        QTimer::singleShot(0, this, SLOT(showRootView()));
+    }
+    CNT_EXIT
+}
+
+/*!
 Show or hide the clear history menu
 */
 void CntHistoryView::showClearHistoryMenu()
--- a/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -20,6 +20,7 @@
 #include <cnthistorymodel.h>
 #include <hbframedrawer.h>
 #include <hbframeitem.h>
+#include <QGraphicsWidget>
 
 #define NEW_EVENT_FRAME "qtg_fr_list_new_item"
 #define INCOMING_FOCUS_FRAME "qtg_fr_convlist_received_pressed"
@@ -117,4 +118,26 @@
         }
     }
 }
+
+bool CntHistoryViewItem::event(QEvent* e)
+{
+    bool result;
+    if (e->type() == QEvent::GraphicsSceneResize)
+    {
+        // HbAbstractItemView has a performance improvement when drawing backrounds but seems
+        // to screw the layout of history view items. This workaround fixes the issue. There should
+        // be minimal performance drawbacks since GraphicsSceneResize events are quite few.
+        // TODO: Remove this once Orbit changes their implementation. Not known when
+        QGraphicsWidget *frame = static_cast<QGraphicsWidget*>(primitive("frame"));
+        QRectF frameGeometry = frame->geometry();
+        result = HbListViewItem::event(e);
+        frame->setGeometry(frameGeometry);
+    } 
+    else
+    {
+        result = HbListViewItem::event(e);
+    }
+    return result;
+}
+
 // EOF
--- a/phonebookui/pbkcommonui/src/cntimageeditorview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntimageeditorview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,12 +17,15 @@
 
 #include "cntimageeditorview.h"
 #include "cntimageutility.h"
+#include "cntsavemanager.h"
+#include "cntimagelabel.h"
 
 #include <hblabel.h>
 #include <xqaiwrequest.h>
 #include <xqaiwdecl.h>
 
 #include "cntdebug.h"
+#include "cntglobal.h"
 
 #include <thumbnailmanager_qt.h>
 #include <hbaction.h>
@@ -31,8 +34,11 @@
 #include <hblistview.h>
 #include <hblistviewitem.h>
 #include <hbframebackground.h>
+#include <hbdevicenotificationdialog.h>
+#include <hbparameterlengthlimiter.h>
 
 #include <QStandardItemModel>
+#include <QApplication>
 
 const char *CNT_IMAGE_XML = ":/xml/contacts_if.docml";
 
@@ -40,13 +46,14 @@
 Constructor
 */
 CntImageEditorView::CntImageEditorView() :
-        mContact(NULL),
-        mAvatar(NULL),
-        mImageLabel(NULL),
-        mRequest(NULL),
-        mViewManager(NULL),
-        mListView(NULL),
-        mModel(NULL)
+    mContact(NULL),
+    mAvatar(NULL),
+    mImageLabel(NULL),
+    mRequest(NULL),
+    mViewManager(NULL),
+    mListView(NULL),
+    mModel(NULL),
+    mSaveManager(NULL)
 {
     bool ok = false;
     mDocumentLoader.load(CNT_IMAGE_XML, &ok);
@@ -76,6 +83,9 @@
     
     connect( mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)),
         this, SLOT(thumbnailReady(QPixmap, void*, int, int)) );
+    
+    // closing the application from task swapper or end key will cause the contact to be saved
+    connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(saveContact()));
 }
 
 /*!
@@ -88,15 +98,17 @@
     mView->deleteLater();
 
     delete mAvatar;
-    mAvatar = 0;
+    mAvatar = NULL;
     delete mContact;
-    mContact = 0;
+    mContact = NULL;
     delete mRequest;
-    mRequest = 0;
+    mRequest = NULL;
     delete mRemoveImage;
-    mRemoveImage = 0;
+    mRemoveImage = NULL;
     delete mModel;
-    mModel = 0;
+    mModel = NULL;
+    delete mSaveManager;
+    mSaveManager = NULL;
     
     CNT_EXIT
 }
@@ -115,14 +127,41 @@
     HbMainWindow* window = mView->mainWindow();
     if ( window )
     {
-    connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
-    setOrientation(window->orientation());
+        connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
+        setOrientation(window->orientation());
+    }
+    
+    if ( mArgs.contains(ESelectedContact))
+    {
+        mContact = new QContact(mArgs.value(ESelectedContact).value<QContact>());
+    }
+    
+    if ( mArgs.contains(ESelectedGroupContact) && !mContact ) 
+    {
+        mContact = new QContact(mArgs.value(ESelectedGroupContact).value<QContact>());
     }
     
-    mContact = new QContact(mArgs.value(ESelectedContact).value<QContact>());
+    QString myCard = mArgs.value( EMyCard ).toString();
+    QContactLocalId localId = mContact->localId();
+    QContactLocalId selfContactId = mViewManager->contactManager(SYMBIAN_BACKEND)->selfContactId();
+    bool isMyCard = ( localId == selfContactId && localId != 0 ) || !myCard.isEmpty();
+    
+    if (isMyCard)
+    {
+        mSaveManager = new CntSaveManager(CntSaveManager::EMyCard);
+    }
+    else if (mContact->type() == QContactType::TypeGroup)
+    {
+        mSaveManager = new CntSaveManager(CntSaveManager::EGroup);
+    }
+    else
+    {
+        mSaveManager = new CntSaveManager();
+    }
     
     // set the correct image if the contact already has an image set
-    mImageLabel = static_cast<HbLabel*>(mDocumentLoader.findWidget(QString("cnt_image_label")));
+    mImageLabel = static_cast<CntImageLabel*>(mDocumentLoader.findWidget(QString("cnt_image_label")));
+    mImageLabel->ungrabGesture(Qt::TapGesture);
     QList<QContactAvatar> details = mContact->details<QContactAvatar>();
     if (details.count() > 0)
         {
@@ -142,7 +181,7 @@
         mRemoveImage->setEnabled(false);
         if (mContact->type() == QContactType::TypeGroup)
             {
-            mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture"));
+            mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture"));
             }
         }
     
@@ -196,7 +235,7 @@
         mRequest = 0;
     }
     
-    mRequest = mAppManager.create(XQI_CAMERA_CAPTURE, "capture(int,QVariantMap)", false);
+    mRequest = mAppManager.create(XQI_CAMERA_CAPTURE, XQOP_CAMERA_CAPTURE, false);
     if ( mRequest ) 
     {
         int mode = 0; //image mode
@@ -257,8 +296,18 @@
     QVariant var;
     var.setValue(*mContact);
     
-    mArgs.insert(ESelectedContact, var);
-    mArgs.insert(ESelectedGroupContact, var);
+    // If the arguments didn't originally contain "normal" contact,
+    // then the group contact should be updated. This case applies only
+    // when group image is edited
+    if ( !mArgs.contains(ESelectedContact) )
+    {
+        mArgs.insert(ESelectedGroupContact, var);
+    }
+    else
+    {
+        mArgs.insert(ESelectedContact, var);
+    }
+    
     mArgs.insert(ECustomParam, viewId());
     mViewManager->back( mArgs );
 }
@@ -278,9 +327,9 @@
         mAvatar->setImageUrl(QUrl());
         mImageLabel->clear();
         if (mContact->type() == QContactType::TypeGroup)
-            mImageLabel->setIcon(HbIcon("qtg_large_add_group_picture"));
+            mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_group_picture"));
         else
-            mImageLabel->setIcon(HbIcon("qtg_large_add_contact_picture"));
+            mImageLabel->setAvatarIcon(HbIcon("qtg_large_add_contact_picture"));
         mRemoveImage->setEnabled(false);
     }
 }
@@ -338,10 +387,8 @@
     Q_UNUSED(id);
     if (!error)
     {
-        QIcon qicon(pixmap);
-        HbIcon icon(qicon);
         mImageLabel->clear();
-        mImageLabel->setIcon(icon);
+        mImageLabel->setIcon(pixmap);
     }
     
     CNT_EXIT
@@ -385,6 +432,47 @@
 
 void CntImageEditorView::handleError(int errorCode, const QString& errorMessage)
 {
+    Q_UNUSED(errorCode);
+    Q_UNUSED(errorMessage);
     CNT_LOG_ARGS("error code = " << errorCode << "errorMessage=" << errorMessage)
 }
 
+void CntImageEditorView::saveContact()
+{
+    mContact->saveDetail(mAvatar);
+
+    if ( mAvatar->imageUrl().isEmpty())
+    {
+        mContact->removeDetail(mAvatar);
+    }
+    
+    QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedContactDisplayLabel(*mContact);
+    
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
+    
+    CntSaveManager::CntSaveResult result = mSaveManager->saveContact(mContact, mViewManager->contactManager(SYMBIAN_BACKEND));
+    
+    if (mContact->type() != QContactType::TypeGroup)
+    {
+        switch (result)
+        {
+        case CntSaveManager::ESaved:
+            HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contact_1_saved")).arg(name));
+            break;
+        case CntSaveManager::EUpdated:
+            HbDeviceNotificationDialog::notification(QString(),HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_contacts_1_updated")).arg(name));
+            break;
+        case CntSaveManager::EFailed:
+            HbDeviceNotificationDialog::notification(QString(),hbTrId("SAVING FAILED!"));
+            break;
+        case CntSaveManager::EDeleted:
+        case CntSaveManager::ENothingDone:
+        default:
+            break;
+        }
+    }
+}
+
--- a/phonebookui/pbkcommonui/src/cntimagelabel.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntimagelabel.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,14 +17,40 @@
 
 #include "cntimagelabel.h"
 
+#include <QPainter>
+#include <QGraphicsDropShadowEffect>
+
 #include <hbinstantfeedback.h>
 #include <hbtapgesture.h>
-#include <QGraphicsSceneMouseEvent>
+#include <hbeffect.h>
+#include <hbdeviceprofile.h>
+#include <hbiconitem.h>
+#include <hbicon.h>
+#include <hbstyle.h>
 
+static const qreal ImageRounding = 1.5; // units 
+
+/*
+ * Imagel label for landscape views.
+ */
 CntImageLabel::CntImageLabel(QGraphicsItem *parent) :
-    HbLabel(parent)
+    HbWidget(parent)
 {
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+    
+    mDefaultAvatar = new HbIconItem(this);
+    style()->setItemName(mDefaultAvatar, "icon");
+    mDefaultAvatar->setAlignment(Qt::AlignCenter);
+   
     grabGesture(Qt::TapGesture);
+    HbEffect::add(this, "groupbox_icon_click", "iconclick");
+    
+    //shadow effect
+    QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this);
+    effect->setColor(QColor(0, 0, 0, 150));
+    effect->setBlurRadius(5);
+    effect->setOffset(3);
+    setGraphicsEffect(effect);
 }
 
 CntImageLabel::~CntImageLabel()
@@ -32,12 +58,85 @@
 
 }
 
+void CntImageLabel::setIcon(const QPixmap &pixmap)
+{
+    mPixmap = pixmap;
+    
+    if (!mPixmap.isNull()) 
+    {
+       mDefaultAvatar->setVisible(false);
+       mDefaultAvatar->setIcon(HbIcon());
+    } 
+    else 
+    {
+       mDefaultAvatar->setIconName(QLatin1String("qtg_large_add_contact_picture"));
+       mDefaultAvatar->setVisible(true);
+    }
+    
+    update();
+}
+
+void CntImageLabel::setAvatarIcon(const HbIcon &icon)
+{
+    mIcon = icon;
+    
+    if (mIcon.isNull()) 
+    {
+        mDefaultAvatar->setVisible(false);
+        mDefaultAvatar->setIcon(HbIcon());
+    } 
+    else 
+    {
+        mDefaultAvatar->setIcon(icon);
+        mDefaultAvatar->setVisible(true);
+    }
+}
+
+HbIcon CntImageLabel::avatarIcon() const
+{
+    return mIcon;
+}
+
+void CntImageLabel::clear()
+{
+    mIcon.clear();
+    mPixmap = NULL;
+    mDefaultAvatar->setIconName(QLatin1String("qtg_large_add_contact_picture"));
+    mDefaultAvatar->setVisible(true);
+}
+
+void CntImageLabel::paint(QPainter* painter,
+    const QStyleOptionGraphicsItem* option,
+    QWidget* widget)
+{
+    Q_UNUSED(option);
+    Q_UNUSED(widget);
+    
+    if (mPixmap.isNull())
+    {
+        return;
+    }
+    else
+    {
+        painter->save();
+        QPainterPath clip;
+        qreal rounding = ImageRounding * HbDeviceProfile::profile(this).unitValue();
+        clip.addRoundRect(rect(), rounding, rounding);
+        painter->setClipPath(clip);
+        painter->drawPixmap(rect().toRect(), mPixmap);
+        painter->restore();
+    } 
+}
+
 void CntImageLabel::gestureEvent(QGestureEvent* event)
 { 
     if (HbTapGesture *tap = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) 
     {    
         switch (tap->state()) 
         {
+            case Qt::GestureStarted:
+                HbEffect::start(this, QString("iconclick"));
+                break;
             case Qt::GestureFinished:
                 if (tap->tapStyleHint() == HbTapGesture::Tap)
                 {
@@ -48,8 +147,9 @@
             case Qt::GestureUpdated:
                 if (tap->tapStyleHint() == HbTapGesture::TapAndHold) 
                 {
+                    HbEffect::cancel(this, QString("iconclick"));
                     emit iconLongPressed(tap->scenePosition());
-                }
+                }      
                 break;
             default:
                 break;
--- a/phonebookui/pbkcommonui/src/cntimportsview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntimportsview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -37,6 +37,8 @@
 #include <hbparameterlengthlimiter.h>
 #include <hblistviewitem.h>
 #include <hbstringutil.h>
+#include <QCoreApplication>
+#include <hbdevicenotificationdialog.h>
 
 const char *CNT_IMPORT_UI_XML = ":/xml/contacts_sim.docml";
 const int KTimerValue = 1; // used as 1 msec timer for saving ADN contacts from SIM   
@@ -59,7 +61,8 @@
     mAdnStoreEntries(0),
     mSdnStoreEntries(0),
     mSimError(0),
-    mWaitingForAdnCache(0)
+    mWaitingForAdnCache(0),
+    mImportInProgress(false)
 {
     bool ok = false;
     mDocumentLoader.load(CNT_IMPORT_UI_XML, &ok);
@@ -111,6 +114,7 @@
     Q_UNUSED(aArgs);
     //back button
     HbMainWindow* window = mView->mainWindow();
+          
     if (mView->navigationAction() != mSoftkey)
     {
         mView->setNavigationAction(mSoftkey);
@@ -168,7 +172,7 @@
                     mAdnStorePresent = true;
                     mAdnEntriesPresent = true;
                     mWaitingForAdnCache = true;
-                    connect(mAdnSimUtility, SIGNAL(adnCacheStatusReady(SimUtility::CacheStatus&, int)), this, SLOT(adnCacheStatusReady(SimUtility::CacheStatus&, int)));
+                    connect(mAdnSimUtility, SIGNAL(adnCacheStatusReady(CntSimUtility::CacheStatus&, int)), this, SLOT(adnCacheStatusReady(CntSimUtility::CacheStatus&, int)));
                     if (!mAdnSimUtility->notifyAdnCacheStatus()) {
                         mAdnStorePresent = false;
                         mAdnEntriesPresent = false;
@@ -290,6 +294,7 @@
     
     mListView->setModel(mModel);
     mListView->setSelectionMode(HbAbstractItemView::NoSelection);
+    connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(endKeyPressed()));
 }
 
 void CntImportsView::simInfoErrorMessage(int infoError)
@@ -322,7 +327,9 @@
 
 bool CntImportsView::startSimImport()
 {
+
     bool started = false;
+    mImportInProgress = true;
 
     delete mFetchRequestADN;
     mContactSimManagerADN = mViewManager->contactManager(SIM_BACKEND_ADN);
@@ -370,6 +377,7 @@
 void CntImportsView::stopSimImport()
 {
     mImportSimPopup->close();
+    mImportInProgress = false;
     if (mFetchIsDone)
     {
         // indicates that timer has been started
@@ -422,6 +430,7 @@
             mListView->reset();
         }
     }
+   
 }
 
 void CntImportsView::importFetchResultReceivedADN()
@@ -584,6 +593,7 @@
         // no SDN contacts to fetch
         showSimImportResults();
         mImportSimPopup->close();
+        mImportInProgress = false;
         // Importing finished, go back to NamesView
         showPreviousView();
     }
@@ -602,6 +612,7 @@
         showSimImportResults();
         mSaveSimContactsListSDN.clear(); 
         mImportSimPopup->close();
+        mImportInProgress = false;
         // Importing finished, go back to NamesView
         showPreviousView();
     }
@@ -668,6 +679,7 @@
         showSimImportResults();
         mSaveSimContactsListSDN.clear(); 
         mImportSimPopup->close();
+        mImportInProgress = false;
         // Importing finished, go back to NamesView
         showPreviousView();
     }   
@@ -707,6 +719,7 @@
         {
             //dismiss wait note
             mImportSimPopup->close();
+            mImportInProgress = false;
             //and show error note
             simInfoErrorMessage(KErrAccessDenied);
         }
@@ -734,4 +747,14 @@
     }
 }
 
+void CntImportsView::endKeyPressed()
+{   
+    if(mImportInProgress && !mSimError)
+    {
+        QString results = hbTrId("txt_phob_dpophead_ln_contacts_imported").arg(mSaveCount).arg(mAdnStoreEntries + mSdnStoreEntries);
+        HbDeviceNotificationDialog::notification(QString(),results);
+    }    
+}
+
+
 // EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntkeygrabber.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cntkeygrabber.h"
+
+#include <logsservices.h>
+#include <hbmainwindow.h>
+#include <xqaiwrequest.h>
+#include <xqaiwdecl.h>
+#include <xqappmgr.h>
+#include <QCoreApplication>
+#include <QKeyEvent>
+
+/*!
+    Key press event handler for default actions when pressing either send or end key.
+    End key closes the application and send key opens dialer. Default functionality
+    can be overwritten to have view-specific functionality by installing an additional 
+    event filter for the main window.
+    
+    See CntGroupActionsView for an example.
+*/
+CntKeyGrabber::CntKeyGrabber(HbMainWindow *window, QObject *parent) :
+    QObject(parent),
+    mMainWindow(window),
+    mRequest(NULL)
+{
+    mMainWindow->installEventFilter(this);
+}
+
+/*!
+    Destructor
+*/
+CntKeyGrabber::~CntKeyGrabber()
+{
+    delete mRequest;
+}
+
+/*!
+    Listens to events coming to the QObject obj (in this case HbMainWindow instance) and
+    grabs/handles the necessary ones.
+
+    \param obj QObject to which the event was sent to
+    \param event QEvent that happened (key press, mouse press etc...)
+    \return bool true if the event was handled (and thus it wont be passed on anymore)
+*/
+bool CntKeyGrabber::eventFilter(QObject *obj, QEvent *event)
+{
+    if (event->type() == QEvent::KeyPress && obj == mMainWindow)
+    {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        
+        if (keyEvent->key() == Qt::Key_No )
+        {
+            qApp->exit();
+            
+            return true;
+        }
+        else if (keyEvent->key() == Qt::Key_Yes)
+        {
+            XQApplicationManager appManager;
+            
+            if (mRequest)
+            {
+                delete mRequest;
+                mRequest = NULL;
+            }
+            
+            mRequest = appManager.create(XQI_LOGS_VIEW, XQOP_LOGS_SHOW, false);
+            
+            if (mRequest)
+            {
+                QList<QVariant> args;
+                QVariantMap map;
+                map.insert(XQLOGS_VIEW_INDEX, QVariant(int(LogsServices::ViewAll)));
+                map.insert(XQLOGS_SHOW_DIALPAD, QVariant(true));
+                map.insert(XQLOGS_DIALPAD_TEXT, QVariant(QString()));
+                args.append(QVariant(map));
+                mRequest->setArguments(args);
+                mRequest->send();
+            }
+            
+            return true;
+        }
+    }
+
+    return QObject::eventFilter(obj, event);
+}
--- a/phonebookui/pbkcommonui/src/cntmainwindow.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntmainwindow.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -18,24 +18,30 @@
 #include "cntmainwindow.h"
 #include "cntdefaultviewmanager.h"
 #include "cntviewnavigator.h"
-#include <QCoreApplication>
+#include "cntkeygrabber.h"
 #include <cntdebug.h>
 
 CntMainWindow::CntMainWindow(QWidget *parent, int defaultView)
     : HbMainWindow(parent),
-    mViewManager(NULL)
+    mViewManager(NULL),
+    mDefaultView(defaultView)
 {
     CNT_ENTRY
-
+    
+    CntKeyGrabber *keyGrabber = new CntKeyGrabber(this, this);
+    
     if (defaultView != noView)
     {
         CntViewNavigator* navigator = new CntViewNavigator(this);
-        navigator->addException( editView, namesView );
-        navigator->addException( FavoritesMemberView, collectionView );
+        navigator->addException( favoritesMemberView, collectionView );
         navigator->addEffect( groupMemberView, groupActionsView );
         navigator->addEffect( groupActionsView, groupMemberView );
-        navigator->addEffect( commLauncherView, historyView );
-        navigator->addEffect( historyView, commLauncherView );
+        navigator->addEffect( contactCardView, historyView );
+        navigator->addEffect( historyView, contactCardView );
+        navigator->addRoot( namesView );
+        navigator->addRoot( collectionView );
+        navigator->addRoot( groupMemberView );
+        navigator->addRoot( favoritesMemberView );
                 
         mViewManager = new CntDefaultViewManager( this );
         mViewManager->setViewNavigator( navigator );
@@ -59,20 +65,4 @@
     CNT_EXIT
 }
 
-/*
- * Lets let views handle send/end key press events, because if toolbar or menu has been focused
- * the view wont get the key press events
- */
-void CntMainWindow::keyPressEvent(QKeyEvent *event)
-{
-    if (event->key() == Qt::Key_Yes || event->key() == Qt::Key_No)
-    {
-       emit keyPressed(event);
-    }
-    else
-    {
-        HbMainWindow::keyPressEvent(event);
-    }
-}
-
 // end of file
--- a/phonebookui/pbkcommonui/src/cntmycardselectionview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include "cntmycardselectionview.h"
-#include <QModelIndex>
-#include <cntlistmodel.h>
-#include <hblistview.h>
-#include <qcontact.h>
-
-CntMyCardSelectionView::CntMyCardSelectionView() : CntBaseSelectionView()
-{
-    connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(onListViewActivated(const QModelIndex&)));
-}
-
-CntMyCardSelectionView::~CntMyCardSelectionView()
-{
-}
-
-/*!
-Set index to mycard
-*/
-void CntMyCardSelectionView::onListViewActivated(const QModelIndex& index)
-{
-    if (index.isValid())
-    {  
-        QContact contact = mListModel->contact(index);
-        QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND);
-        mgr->setSelfContactId(contact.localId());
-        
-        removeFromGroup(&contact);
-        
-        CntViewParameters params;
-        params.insert(EViewId, namesView);
-        mMgr->changeView(params);
-    }
-}
-    
-void CntMyCardSelectionView::removeFromGroup(const QContact* aContact)
-{
-    QContactDetailFilter groupFilter;
-    groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
-    groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
-
-    QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND);
-    QList<QContactLocalId> 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);  
-         }
-    }
-}
-
--- a/phonebookui/pbkcommonui/src/cntmycardview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 #include "cntmycardview.h"
-#include "cntfetchcontactsview.h"
+#include "cntfetchcontactpopup.h"
 #include "cntglobal.h"
 #include <qtcontacts.h>
 #include <hbpushbutton.h>
@@ -28,8 +28,7 @@
 
 CntMyCardView::CntMyCardView() :
     mContact(NULL),
-    mViewManager(NULL),
-    mFetchView(NULL)
+    mViewManager(NULL)
 {
     bool ok = false;
     mDocumentLoader.load(CNT_MYCARD_UI_XML, &ok);
@@ -53,10 +52,7 @@
     mView->deleteLater();
     
     delete mContact;
-    mContact = 0;
-    
-    delete mFetchView;
-    mFetchView = NULL;
+    mContact = NULL;
 }
 
 /*!
@@ -98,11 +94,6 @@
     {
         chooseButton->setEnabled(false);
     }
-    
-    if (!mFetchView) {
-        mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND ));
-        connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection()));
-    }
 }
 
 void CntMyCardView::deactivate()
@@ -135,6 +126,7 @@
     QVariant var;
     var.setValue(*mContact);
     viewParameters.insert(ESelectedContact, var);
+    viewParameters.insert(EExtraAction, CNT_ROOT_ACTION);
     mViewManager->changeView(viewParameters);
 }
 
@@ -143,20 +135,19 @@
 */
 void CntMyCardView::openMyCardSelectionView()
 {
-    // Display a list of contacts to choose a mycard from.
-    mFetchView->setDetails(hbTrId("txt_phob_title_select_contact"), "");
-    QSet<QContactLocalId> emptyContactsSet;
-    mFetchView->displayContacts(HbAbstractItemView::SingleSelection, emptyContactsSet);
+    CntFetchContactPopup* popup = CntFetchContactPopup::createSingleSelectionPopup(
+            hbTrId("txt_phob_title_select_contact"),
+            *mViewManager->contactManager(SYMBIAN_BACKEND));
+    connect( popup, SIGNAL(fetchReady(QSet<QContactLocalId>)), this, SLOT(handleMultiCardSelection(QSet<QContactLocalId>)));
+    popup->showPopup();
 }
 
-void CntMyCardView::handleMultiCardSelection()
+void CntMyCardView::handleMultiCardSelection( QSet<QContactLocalId> aIds )
 {
     QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
 
-    QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
-
-    if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) {
-        QList<QContactLocalId> selectedContactsList = selectedContacts.values();
+    if ( !aIds.isEmpty() ) {
+        QList<QContactLocalId> selectedContactsList = aIds.values();
         QContact contact = manager->contact(selectedContactsList.front());
         removeFromGroup(&contact);
         
--- a/phonebookui/pbkcommonui/src/cntnamesview_p.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnamesview_p.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,15 +17,15 @@
 
 #include "cntnamesview_p.h"
 #include "cntactionlauncher.h"
-#include "cntfetchcontactsview.h"
+#include "cntfetchcontactpopup.h"
 #include "cntextensionmanager.h"
 #include "cntglobal.h"
 #include "cntdebug.h"
+#include "cntapplication.h"
 
 #include <cntuiextensionfactory.h>
 #include <cntuisocialextension.h>
 
-#include <qapplication.h>
 #include <hbabstractviewitem.h>
 #include <hbaction.h>
 #include <hbmenu.h>
@@ -47,6 +47,8 @@
 #include <hbmessagebox.h>
 #include <hbparameterlengthlimiter.h>
 
+#include <QInputContext>
+
 const char *CNT_CONTACTLIST_XML = ":/xml/contacts_namelist.docml";
 static const int CNT_MIN_ROW_COUNT = 2;
 
@@ -64,7 +66,6 @@
     mNamesAction(NULL),
     mMenuBuilder(NULL),
     mHandledContactId(0),
-    mFetchView(NULL),
     mIsDefault(true),
     mId( namesView ),
     mActionGroup(NULL),
@@ -137,9 +138,24 @@
     connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(hideFinder()));
     connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString)));
     
+    HbMainWindow* win = mView->mainWindow();
+    CntApplication* cntApp = static_cast<CntApplication*>(qApp);
+    connect(win, SIGNAL(viewReady()), cntApp, SIGNAL(applicationReady()));
+    
+#ifdef __WINS__
+    mView->menu()->addAction("Change Orientation", this, SLOT(switchOrientation()) );
+#endif
     CNT_EXIT
 }
 
+void CntNamesViewPrivate::switchOrientation()
+{
+    HbMainWindow* win = mView->mainWindow();
+    Qt::Orientation orientation = win->orientation();
+    
+    win->setOrientation( orientation == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal );
+}
+
 CntNamesViewPrivate::~CntNamesViewPrivate()
 {
     CNT_ENTRY
@@ -172,6 +188,10 @@
     CNT_ENTRY
     
     mViewManager = aMgr;
+    if (mView->mainWindow() != NULL && !(mView->visibleItems() & Hb::AllItems))
+    {
+        hideFinder();
+    }
     
     if (!mListModel) {
         QContactDetailFilter filter;
@@ -212,18 +232,23 @@
         setScrollPosition(aArgs.value(ESelectedContact).value<QContact>().localId());
     }
    
+    if ( aArgs.value( EExtraAction ).toString() == CNT_FIND_ACTION  )
+    {
+        showFinder();
+    }
+    
     CNT_EXIT
 }
 
 void CntNamesViewPrivate::deactivate()
 {
     CNT_ENTRY
-    
-    if (!(mView->visibleItems() & Hb::AllItems))
+    HbMainWindow* win = mView->mainWindow();
+    if ( win != NULL)
     {
-        hideFinder();
+        CntApplication* cntApp = static_cast<CntApplication*>(qApp);
+        disconnect(win, SIGNAL(viewReady()), cntApp, SIGNAL(applicationReady()));
     }
-
     delete mMenuBuilder;
     mMenuBuilder = NULL;
     
@@ -252,6 +277,16 @@
     {
         editor->setText("");
         editor->setFocus();
+        
+        // This opens the VKB
+        QInputContext *ic = qApp->inputContext();
+        if (ic)
+        {
+            QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel);
+            ic->filterEvent(event);
+            delete event;
+        }
+
     }
 
     CNT_EXIT
@@ -295,6 +330,8 @@
     mImportSim->setVisible(false);
     mNewContact->setVisible(false);
     mMultipleDeleter->setVisible(false);
+    HbAction* settings = static_cast<HbAction*>(document()->findObject("cnt:settings") );
+    settings->setVisible(false);
     
     CNT_EXIT
 }
@@ -303,9 +340,6 @@
 {
     CNT_ENTRY
     
-    mVirtualKeyboard->closeKeypad();
-    mView->setMaximumHeight(-1);
-    
     document()->load( CNT_CONTACTLIST_XML, "no_find" );
     mView->showItems(Hb::AllItems);
     
@@ -324,6 +358,8 @@
     mNewContact->setVisible(true);
     mImportSim->setVisible(true);
     mMultipleDeleter->setVisible(true);
+    HbAction* settings = static_cast<HbAction*>(document()->findObject("cnt:settings") );
+    settings->setVisible(true);
 
     CNT_EXIT    
 }
@@ -397,12 +433,16 @@
     CNT_ENTRY
     
     QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
-    QString name = manager->synthesizedDisplayLabel(aContact);
+    QString name = manager->synthesizedContactDisplayLabel(aContact);
+    if (name.isEmpty())
+    {
+        name = hbTrId("txt_phob_list_unnamed");
+    }
     
     mHandledContactId = aContact.localId();
     
-    HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)),
-            hbTrId("txt_common_button_delete"), hbTrId("txt_common_button_cancel"));
+    HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(int)),
+            HbMessageBox::Delete | HbMessageBox::Cancel);
     
     CNT_EXIT
 }
@@ -410,36 +450,26 @@
 void CntNamesViewPrivate::deleteMultipleContacts()
 {
     CNT_ENTRY
+    CntFetchContactPopup* popup = CntFetchContactPopup::createMultiSelectionPopup(
+            hbTrId("txt_phob_title_delete_contacts"),
+            hbTrId("txt_common_button_delete"),
+            *mViewManager->contactManager(SYMBIAN_BACKEND));
+    connect(popup, SIGNAL(fetchReady(QSet<QContactLocalId>)), 
+            this, SLOT(handleDeleteMultipleContacts(QSet<QContactLocalId>)) );
     
-    if (!mFetchView) {
-        mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND ));
-        connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleDeleteMultipleContacts()));
-    }
-
-    mFetchView->setDetails(hbTrId("txt_phob_title_delete_contacts"),hbTrId("txt_common_button_delete"));
-    QSet<QContactLocalId> emptyContactsSet;
-
-    // Pop up a list of contacts for deletion
-    mFetchView->displayContacts(HbAbstractItemView::MultiSelection, emptyContactsSet);
+    popup->showPopup();
     CNT_EXIT
 }
 
-void CntNamesViewPrivate::handleDeleteMultipleContacts()
+void CntNamesViewPrivate::handleDeleteMultipleContacts( QSet<QContactLocalId> aIds )
 {
     CNT_ENTRY
     
-    QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
-
     QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
-    if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) {
-        foreach ( QContactLocalId id, selectedContacts.values() )
-        {
-            manager->removeContact( id );
-        }
+    foreach ( QContactLocalId id, aIds )
+    {
+        manager->removeContact( id );
     }
-
-    delete mFetchView;
-    mFetchView = NULL;
     
     CNT_EXIT
 }
@@ -459,7 +489,7 @@
     CNT_ENTRY
     
     CntViewParameters args;
-    args.insert(EViewId, commLauncherView);
+    args.insert(EViewId, contactCardView);
     if (aContact.localId() == mListModel->myCardId() && aContact.details().count() <= 4)
     {
         args.insert(EViewId, myCardView);
@@ -485,6 +515,7 @@
         if (mMenu) 
         {
             delete mMenu;
+            mMenu = NULL;
         }
         mMenu = mMenuBuilder->actionMenu( contact, mListModel->myCardId() );
         mMenu->setPreferredPos( aPoint );
@@ -514,13 +545,11 @@
     CNT_EXIT
 }
 
-void CntNamesViewPrivate::handleDeleteContact( HbAction* aAction )
+void CntNamesViewPrivate::handleDeleteContact( int aAction )
 {
     CNT_ENTRY
     
-    HbMessageBox *note = static_cast<HbMessageBox*>(sender());
-    
-    if (note && aAction == note->actions().first())
+    if (aAction == HbMessageBox::Delete)
     {
         mViewManager->contactManager( SYMBIAN_BACKEND )->removeContact(mHandledContactId);
     }
--- a/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -71,6 +71,10 @@
     widget->setLayout( mLayout );
     
     connect( mEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)) );
+    
+    // Naming UI components for automation testability
+    QString editorObjName = detail.definitionName() + " line edit %1";
+    mEdit->setObjectName(editorObjName.arg(modelIndex().row()));
     return widget;
     }
 // End of File
--- a/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -135,6 +135,12 @@
     connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) );
     connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) );
     
+    // Naming UI components for automation testability
+    QString editorObjName = detail.definitionName() + " line edit %1";
+    mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row()));
+    
+    QString comboBoxObjName = detail.definitionName() + " combo box %1";
+    mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row()));
     return mItem;
     }
 
@@ -157,6 +163,7 @@
         QContactPhoneNumber number;
         number.setSubTypes( aSubType );
         number.setContexts( aContext );
+        number.setNumber( mItem->editor()->text() );
         aItem->setDetail( number );
         }
     else
--- a/phonebookui/pbkcommonui/src/cntpresencelistener.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntpresencelistener.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -20,6 +20,11 @@
 #include <prcpresencebuddyinfo_qt.h>
 #include <prcpresencereader_qt.h>
 
+/*!
+    Presence listener for contact card. It provides aggregated
+    presence information for a contact and separately for each
+    valid QContactOnlineAccount.
+*/
 CntPresenceListener::CntPresenceListener(const QContact& contact, QObject* parent) :
     QObject(parent),
     mReader(NULL),
@@ -30,12 +35,22 @@
                            this, SLOT(handlePresenceUpdate(bool, PrcPresenceBuddyInfoQt*)));
 }
 
+/*!
+    Destructor
+*/
 CntPresenceListener::~CntPresenceListener()
 {
     delete mReader;
     mReader = NULL;
 }
 
+/*!
+    Subscribes all valid QContactOnlineAccounts to receive status updates from presence cache and
+    returns initial presence statuses for each of the accounts.
+
+    \param combinedOnlineStatus aggregated online status
+    \return QMap with account specific (for example "sip:sip@sip.com") online information
+*/
 QMap<QString, bool> CntPresenceListener::initialPresences(bool &combinedOnlineStatus)
 {
     QMap<QString, bool> initialMap;
@@ -67,7 +82,14 @@
     
     return initialMap;
 }
+
+/*!
+    Private slot that handles emitting changes for separate accounts along
+    with the aggregated information.
     
+    \param aSuccess information if the request/update was succesful
+    \param aPresenceBuddyInfo the account that got updated
+*/
 void CntPresenceListener::handlePresenceUpdate(bool aSuccess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo)
 {
     if (aSuccess && aPresenceBuddyInfo != NULL)
@@ -90,14 +112,20 @@
                 }
             }
             
-            // emit the combined presence status
+            // emit the aggregated presence status
             emit fullPresenceUpdated(parsePresence(buddies));
             
             qDeleteAll(buddies);
         }
     }
 }
-    
+
+/*!
+    Returns the aggregated online status.
+
+    \param buddyList list of accounts to parse the aggregated status from
+    \return bool true if any of the accounts is online
+*/
 bool CntPresenceListener::parsePresence(QList<PrcPresenceBuddyInfoQt*> buddyList)
 {
     foreach (PrcPresenceBuddyInfoQt* buddy, buddyList)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntsavemanager.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cntsavemanager.h"
+#include "cntdebug.h"
+
+/*!
+    Contact saving helper class. Used mainly in edit view for contact saving,
+    but should also be used in other (special) cases a contact needs to be saved.
+    For example "forcing" phonebook to shut down (end key, from task swapper etc..)
+    in detail editors.
+*/
+CntSaveManager::CntSaveManager(CntContactType type, QObject* parent) :
+    QObject(parent),
+    mContactType(type)
+{
+    CNT_ENTRY
+    
+    CNT_EXIT
+}
+
+/*!
+    Destructor
+*/
+CntSaveManager::~CntSaveManager()
+{
+    CNT_ENTRY
+    
+    CNT_EXIT
+}
+
+/*!
+    Saves the given QContact to the given QContactManager. Also takes care of checking
+    if the contact is MyCard or a group and behaves different accordingly.
+
+    \param aContact the contact to be saved, ownership not taken
+    \param aManager the QContactManager which should be used for saving the contact, ownership not taken
+    \return CntSaveResult enum to describe what was done to the contact (saved, updated etc...)
+*/
+CntSaveManager::CntSaveResult CntSaveManager::saveContact(QContact* aContact, QContactManager* aManager)
+{
+    CNT_ENTRY
+    
+    CntSaveResult result = ENothingDone;
+    bool isSavedContact = aContact->localId() > 0;
+    
+    // if the contact is really changed or a new one
+    if ( (*aContact) != aManager->contact(aContact->localId()) || !isSavedContact )
+    {
+        int detailCount = aContact->details().count();
+        
+        // Don't set preferred details for a group
+        if (mContactType != EGroup)
+        {
+            setPreferredDetails( aContact );
+        }
+        
+        // If its a new contact
+        if ( !isSavedContact )
+        {
+            // if a new contact has 2 or less details, it's still considered empty
+            if ( detailCount > 2 )
+            {
+                bool success = aManager->saveContact( aContact );
+                if ( success && mContactType == EMyCard )
+                {
+                    aManager->setSelfContactId( aContact->localId() );
+                }
+                
+                result = success ? ESaved : EFailed;
+            }
+        }
+        else
+        {
+            // Contact details has been cleared out, a symbian QContact with 
+            // 4 or less details is in reality empty.
+            if ( detailCount <= 4 )
+            {
+                bool success = aManager->removeContact( aContact->localId() );
+                
+                result = success ? EDeleted : EFailed;
+            }
+            else
+            {
+                bool success = aManager->saveContact(aContact);
+                
+                result = success ? EUpdated : EFailed;     
+            }
+        }
+    }
+    
+    CNT_EXIT_ARGS(result)
+    
+    return result;
+}
+
+/*!
+    Set the preferred call, sms and email details for a contact if possible
+    and needed.
+
+    \param aContact the contact being handled
+*/
+void CntSaveManager::setPreferredDetails( QContact* aContact )
+{
+    CNT_ENTRY
+    
+    QList<QContactPhoneNumber> numberList( aContact->details<QContactPhoneNumber>() );
+    //set preferred number for call if there is only one phone number
+    if ( aContact->preferredDetail("call").isEmpty() && numberList.count() == 1 )
+    {
+        aContact->setPreferredDetail( "call", numberList.first() );
+    }
+    //set preferred number for message if there is only one mobile phone number
+    if ( aContact->preferredDetail("message").isEmpty() && numberList.count() >= 1 )
+    {
+        int mobileNumbers = 0;
+        int mobileNumberIndex = -1;
+        for (int i = 0; i < numberList.count(); i++)
+        {
+            QStringList subTypes = numberList.at(i).subTypes();
+            if (subTypes.count() && subTypes.first() == QContactPhoneNumber::SubTypeMobile)
+            {
+                mobileNumbers++;
+                mobileNumberIndex = i;
+            }      
+        }
+        if ( mobileNumbers == 1 )
+        {
+            aContact->setPreferredDetail( "message", numberList.at(mobileNumberIndex) );
+        }
+    }
+    QList<QContactEmailAddress> emailList( aContact->details<QContactEmailAddress>() );
+    //set preferred number for email if there is only one email address
+    if ( aContact->preferredDetail("email").isEmpty() && emailList.count() == 1 )
+    {
+        aContact->setPreferredDetail( "email", emailList.first() );
+    }
+    
+    CNT_EXIT
+}
--- a/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -57,7 +57,13 @@
     mItem->editor()->setText( detail.url() );
     connect( mItem->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)) );
     connect( mItem->editor(), SIGNAL(textChanged(QString)),this, SLOT(textChanged(QString)) );
-        
+    
+    // Naming UI components for automation testability
+    QString editorObjName = detail.definitionName() + " line edit %1";
+    mItem->editor()->setObjectName(editorObjName.arg(modelIndex().row()));
+    
+    QString comboBoxObjName = detail.definitionName() + " combo box %1";
+    mItem->comboBox()->setObjectName(comboBoxObjName.arg(modelIndex().row()));
     return mItem;
 }
     
--- a/phonebookui/pbkcommonui/src/cntviewnavigator.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntviewnavigator.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -47,7 +47,7 @@
     iViewStack.push( aId );
 }
 
-const int& CntViewNavigator::back( QFlags<Hb::ViewSwitchFlag> &flags )
+const int& CntViewNavigator::back( QFlags<Hb::ViewSwitchFlag> &flags, bool toRoot )
 {
     qDebug() << "CntViewNavigator::back() - IN";
     iTop = noView;
@@ -59,8 +59,23 @@
     {
         int top = iViewStack.top();
         
+        // If we need to go to the latest root view
+        if ( toRoot )
+        {
+            while ( !iViewStack.isEmpty() ) 
+            {
+                int current = iViewStack.top();
+                
+                if ( iRoots.contains( current ) )
+                {
+                    iTop = current;
+                    break;
+                }
+                iViewStack.pop();
+            }
+        }
         // If any exception defined for the current (top) view
-        if ( iExceptions.contains( top ) ) 
+        else if ( iExceptions.contains( top ) ) 
         {
             iTop = iExceptions.value( top );
             // cleanup the history until the exception value is found
@@ -122,5 +137,10 @@
         iEffects.remove( aCurrent );
     }
 }
+
+void CntViewNavigator::addRoot( const int& aCurrent )
+{
+    iRoots.append( aCurrent );
+}
     
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookapp/inc/cntapplication.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef CNTAPP_H_
+#define CNTAPP_H_
+
+#include <hbapplication.h>
+
+class CntApplication : public HbApplication
+{
+    Q_OBJECT
+    
+public:
+    CntApplication(int &argc,
+          char *argv[],
+          Hb::ApplicationFlags flags = Hb::DefaultApplicationFlags) :
+    HbApplication( argc, argv, flags ){}
+
+signals:
+    void applicationReady();
+};
+
+#endif /* CNTAPP_H_ */
--- a/phonebookui/phonebookapp/phonebookapp.pro	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookapp/phonebookapp.pro	Wed Aug 18 09:39:00 2010 +0300
@@ -44,6 +44,7 @@
 SERVICE.OPTIONS = embeddable
 
 # Input
+HEADERS += inc/cntapplication.h
 HEADERS += inc/cntinterface.h
 HEADERS += inc/cntappservicehandler.h
 
@@ -63,8 +64,8 @@
         
         SKINICON = qtg_large_phonebook 
 
-        :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml \epoc32\release\winscw\udeb\z\resource\hb\splashml\phonebook.splashml
-        :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml \epoc32\data\z\resource\hb\splashml\phonebook.splashml
-        :BLD_INF_RULES.prj_exports += "resources/phonebook.docml \epoc32\release\winscw\udeb\z\resource\hb\splashml\phonebook.docml
-        :BLD_INF_RULES.prj_exports += "resources/phonebook.docml \epoc32\data\z\resource\hb\splashml\phonebook.docml
+        :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml /epoc32/release/winscw/udeb/z/resource/hb/splashml/phonebook.splashml
+        :BLD_INF_RULES.prj_exports += "resources/phonebook.splashml /epoc32/data/z/resource/hb/splashml/phonebook.splashml
+        :BLD_INF_RULES.prj_exports += "resources/phonebook.docml /epoc32/release/winscw/udeb/z/resource/hb/splashml/phonebook.docml
+        :BLD_INF_RULES.prj_exports += "resources/phonebook.docml /epoc32/data/z/resource/hb/splashml/phonebook.docml
 }
\ No newline at end of file
--- a/phonebookui/phonebookapp/src/main.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookapp/src/main.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -15,23 +15,22 @@
 *
 */
 
-#include <hbapplication.h>
-#include <QTranslator>
-#include <QLocale>
+#include <hbtranslator.h>
 #include "cntmainwindow.h"
 #include "cntappservicehandler.h"
 #include "cntglobal.h"
+#include "cntdebug.h"
+#include "cntapplication.h"
 
 int main(int argc, char **argv)
 {
+    qInstallMsgHandler(MSG_HANDLER);
 
-    HbApplication a( argc, argv );
+    CntApplication a( argc, argv );
 
-    QTranslator translator;
-    QString lang = QLocale::system().name();
-    QString path = "z:/resource/qt/translations/";
-    translator.load(path + "contacts_" + lang);
-    a.installTranslator(&translator);
+    //For translation, loading and installing translator
+    HbTranslator translator("contacts");
+    translator.loadCommon();
     
     CntAppServiceHandler serviceHandler;
     CntMainWindow mainWindow;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntabstractserviceprovider.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Abstract interface for highway providers used in phonebookservices.
+ *
+ */
+
+#ifndef CNTABSTRACTSERVICEPROVIDER_H
+#define CNTABSTRACTSERVICEPROVIDER_H
+
+
+QTM_USE_NAMESPACE
+
+/*!
+ * Abstract interface for highway providers used in phonebookservices.
+ */
+class CntAbstractServiceProvider
+{
+public:
+
+    /*!
+     Complete the Qt Highway service (through a XQServiceProvider instance).
+     Closes the app after the completing is done (message sending to client is done).
+     */
+    virtual void CompleteServiceAndCloseApp(const QVariant& retValue) = 0;
+
+};
+
+#endif /* CNTABSTRACTSERVICEPROVIDER_H */
--- a/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntserviceassigncontactcardview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -25,6 +25,7 @@
 
 class CntServiceHandler;
 class CntAbstractViewManager;
+class CntAbstractServiceProvider;
 
 QTM_BEGIN_NAMESPACE
 class QContact;
@@ -39,7 +40,6 @@
 
 public slots:
     void doCloseView();
-    void addActionsToToolBar();
     void addToContacts();
     void saveNew();
     void updateExisting();
@@ -47,13 +47,13 @@
     void doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs);
 
 public:
-    CntServiceAssignContactCardView(CntServiceHandler *aServiceHandler);
+    CntServiceAssignContactCardView( CntAbstractServiceProvider& aServiceController );
     ~CntServiceAssignContactCardView();
 
     int viewId() const { return serviceAssignContactCardView; }
 
 private:
-    CntServiceHandler       *mServiceHandler;
+    CntAbstractServiceProvider& mProvider;
     CntAbstractViewManager  *mViewManager;
     QContact                mContact;
     QContactDetail          mDetail;
--- a/phonebookui/phonebookservices/inc/cntservicecontactcardview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntservicecontactcardview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -22,23 +22,23 @@
 #include "cntcontactcardview.h"
 
 class CntServiceHandler;
+class CntAbstractServiceProvider;
 
 class CntServiceContactCardView : public CntContactCardView
 {
     Q_OBJECT
 
-private slots:
-
-    void doShowPreviousView();
-
 public:
-    CntServiceContactCardView(CntServiceHandler *aServiceHandler);
+    CntServiceContactCardView( CntAbstractServiceProvider& aServiceProvider );
     ~CntServiceContactCardView();
 
     int viewId() const { return serviceContactCardView; }
     
+private slots:
+    void closeContactCard();
+
 private:
-    CntServiceHandler *mServiceHandler;
+    CntAbstractServiceProvider& mProvider;
    
 };
 
--- a/phonebookui/phonebookservices/inc/cntservicecontactfetchview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntservicecontactfetchview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -21,26 +21,39 @@
 #include <QObject>
 
 #include "cntbaseselectionview.h"
+#include <cntservicescontact.h>
+#include "cntabstractserviceprovider.h"
 
-class CntServiceHandler;
+class CntServicesContact;
 
 class CntServiceContactFetchView : public CntBaseSelectionView
 {
     Q_OBJECT
 
 public:
-    CntServiceContactFetchView( CntServiceHandler *aServiceHandler );
+    CntServiceContactFetchView( CntAbstractServiceProvider& aServiceProvider );
     ~CntServiceContactFetchView();
 
     int viewId() const { return serviceContactFetchView; }
     
 public slots:
     void aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters);
-    void aboutToCloseView();
+    void closeFetchView();
     void cancelFetch();
+    void popupContactAction(QContact& aContact,QContactDetail contactDetail, QString aAction);
+    void actionPopupCancelSlot();
+    
+private:
+    void serviceCallMessageAction(QContact& aContact, QString aAction);
+    void serviceEmailAction(QContact& aContact);
+    void serviceAllAction(QContact& aContact);
+    void showPreviousView();
 
 private:
-    CntServiceHandler *mServiceHandler;
+    CntAbstractServiceProvider& mProvider;
+    QString mAction;
+    CntServicesContactList mServiceList;
+    int mIndex;
 };
 
 #endif /* CNTSERVICECONTACTFETCHVIEW_H */
--- a/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntservicecontactselectionview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -21,6 +21,7 @@
 #include <QObject>
 
 #include "cntbaseselectionview.h"
+#include "cntabstractserviceprovider.h"
 
 class QModelIndex;
 class CntServiceHandler;
@@ -30,7 +31,7 @@
     Q_OBJECT
 
 public:
-    CntServiceContactSelectionView(CntServiceHandler *aServiceHandler);
+    CntServiceContactSelectionView( CntAbstractServiceProvider& aServiceProvider );
     ~CntServiceContactSelectionView();
 
     int viewId() const { return serviceContactSelectionView; }
@@ -41,7 +42,7 @@
     void aboutToCloseView();
         
 private:
-    CntServiceHandler *mServiceHandler;
+    CntAbstractServiceProvider& mProvider;
     QContactDetail     mDetail;
 };
 
--- a/phonebookui/phonebookservices/inc/cntserviceeditview.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntserviceeditview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -20,6 +20,7 @@
 
 #include <QObject>
 #include "cnteditview.h"
+#include "cntabstractserviceprovider.h"
 
 class CntServiceHandler;
 
@@ -30,7 +31,7 @@
 
 public:
 
-    CntServiceEditView(CntServiceHandler *aServiceHandler );
+    CntServiceEditView( CntAbstractServiceProvider& aServiceProvider );
     ~CntServiceEditView();
 
     int viewId() const { return serviceEditView; }
@@ -41,7 +42,7 @@
     void doChangesDiscarded();
 
 private:
-    CntServiceHandler *mServiceHandler;
+    CntAbstractServiceProvider& mProvider;
     
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntservicegroupmemberview.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CNTSERVICEGROUPMEMBERVIEW_H
+#define CNTSERVICEGROUPMEMBERVIEW_H
+
+#include <QObject>
+#include "cntgroupmemberview.h"
+
+class CntServiceHandler;
+class CntAbstractServiceProvider;
+
+class CntServiceGroupMemberView : public CntGroupMemberView
+{
+    Q_OBJECT
+
+public:
+    CntServiceGroupMemberView( CntAbstractServiceProvider& aServiceProvider );
+    ~CntServiceGroupMemberView();
+
+    int viewId() const { return serviceGroupMemberView; }
+    
+private slots:
+    void closeGroupMemberView();
+
+private:
+    CntAbstractServiceProvider& mProvider;
+   
+};
+
+#endif // CNTSERVICEGROUPMEMBERVIEW_H
+
+// EOF
--- a/phonebookui/phonebookservices/inc/cntservicehandler.h	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef CNTSERVICEHANDLER_H
-#define CNTSERVICEHANDLER_H
-
-#include <cntservicescontact.h>
-#include <xqserviceprovider.h>
-#include <cntviewparams.h>
-#include <qtcontacts.h>
-
-QTM_USE_NAMESPACE
-
-class CntServiceHandler : public XQServiceProvider
-{
-    Q_OBJECT
-public:
-    CntServiceHandler(QObject *parent = 0);
-    ~CntServiceHandler();
-    
-    enum CntServiceViewParams
-    {
-        ETitle = ECustomParam,
-        EFilter,
-        EAction
-    };
-
-public:
-    void completeFetch(const CntServicesContactList &contactList);
-    void completeEdit(int result);
-
-public slots:
-    // Services offered to clients
-    void fetch(const QString &title,
-               const QString &action,
-               const QString &filter);
-    
-    void Dofetch(const QString &title,
-                 const QString &action,
-                 const QString &filter,
-                 const QString &mode = KCntNoSelectionMode);
-
-    void editCreateNew(const QString &definitionName, const QString &value);
-    void editCreateNew(const QString &vCardFile);
-    void editUpdateExisting(const QString &definitionName, const QString &value);
-    void open(int contactId);
-    void open(const QString &definitionName, const QString &value);
-
-signals:
-    void launchFetch(const QString &title,
-                     const QString &action,
-                     const QString &filter);
-    
-    void launchFetchVerified(const QString &title,
-                             const QString &action,
-                             const QString &filter,
-                             const QString &mode);
-    
-    void launchEditor(QContact contact);
-    void launchContactSelection(QContactDetail detail);
-    void launchContactCard(QContact contact);
-    void launchAssignContactCard(QContact contact, QContactDetail detail);
-    
-private:
-    void removeNotSupportedFields(QContact& contact);
-    void removeNotSupportedDetails(QContact& contact);
-
-private:
-    int mCurrentRequestIndex;
-    QStringList m_definitionNames;
-};
-
-#endif /* CNTSERVICEHANDLER_H */
--- a/phonebookui/phonebookservices/inc/cntservicemainwindow.h	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CNTSERVICEMAINWINDOW_H
-#define CNTSERVICEMAINWINDOW_H
-
-#include <QObject>
-#include "cntmainwindow.h"
-
-class CntServiceHandler;
-class CntServiceViewManager;
-
-class CntServiceMainWindow : public CntMainWindow
-{
-    Q_OBJECT
-
-public:
-    CntServiceMainWindow(CntServiceHandler *handler, QWidget *parent=0);
-    ~CntServiceMainWindow();
-
-private:
-    CntServiceHandler       *mServiceHandler;
-    CntServiceViewManager   *mServiceViewManager;
-};
-
-#endif // CNTSERVICEMAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceprovideredit.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This class offers contact editing UI services.
+ *
+ */
+
+#ifndef CNTSERVICEPROVIDEREDIT_H
+#define CNTSERVICEPROVIDEREDIT_H
+
+#include <cntservicescontact.h>
+#include <xqserviceprovider.h>
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntServices;
+
+QTM_USE_NAMESPACE
+
+/*!
+  This class offers contact editing UI services.
+*/
+class CntServiceProviderEdit : public XQServiceProvider, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+public:
+    CntServiceProviderEdit(CntServices& aServices, QObject *parent = 0);
+    ~CntServiceProviderEdit();
+
+public slots:  // operations offered to clients
+
+    /**
+     * Launch editor for creating a new contact with a given detail.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     */
+    void editCreateNew(const QString& definitionName, const QString& value);
+
+    /**
+     * Launch editor for creating a new contact with a given detail and subtype.
+     * If the given subtype string is empty, then QContactPhoneNumber::SubTypeMobile is used.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
+     */
+    void editCreateNew(const QString &definitionName, const QString &value, const QString &subType);
+
+    /**
+     * Launch editor for creating a new contact based on vCard file indicated in arg.
+     * @param vCardFile The vCard file name and path.
+     */
+    void editCreateNewFromVCard(const QString &vCardFile);
+    
+    /**
+     * Open the editor for an existing contact.'
+     * @param contactId
+     */
+    void editExisting(int contactId);
+    
+    /**
+     * User can first choose a contact, and then an editor is opened.
+     * A new detail is provided by caller and it will be prefilled in the editor.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     */
+    void editUpdateExisting(const QString &definitionName, const QString &value);
+
+    /**
+     * User can first choose a contact, and then an editor is opened.
+     * A new detail is provided by caller and it will be prefilled in the editor.
+     * The detail sub type can also be given.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param subType The sub type for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
+     */
+    void editUpdateExisting(const QString &definitionName, const QString &value, const QString &subType);
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+
+private:
+    CntServices& mServices;
+    int mCurrentRequestIndex;
+};
+
+#endif /* CNTSERVICEPROVIDEREDIT_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceproviderfetch.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CNTSERVICEPROVIDERFETCH_H
+#define CNTSERVICEPROVIDERFETCH_H
+
+#include <cntservicescontact.h>
+#include <xqserviceprovider.h>
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntServices;
+
+QTM_USE_NAMESPACE
+
+/*!
+  This class offers services through the old interface name & old signatures.
+*/
+class CntServiceProviderFetch : public XQServiceProvider, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+public:
+    CntServiceProviderFetch(CntServices& aServices, QObject *parent = 0);
+    ~CntServiceProviderFetch();
+
+public slots:  // operations offered to clients
+
+    /**
+     * Opens contact selection view where multiple contacts can be selected.
+     * @param title The view title
+     * @param action Filter definition for filtering contacts based on supported action. Can be left empty.
+     */
+    void multiFetch(const QString &title,
+               const QString &action );
+
+    /**
+     * Opens contact selection view where multiple contacts can be selected.
+     * @param title The view title
+     * @param action Filter definition for filtering contacts based on supported action. Can be left empty.
+     */
+    void singleFetch(const QString &title,
+               const QString &action );
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+
+private:
+    CntServices& mServices;
+    int mCurrentRequestIndex;
+};
+
+#endif /* CNTSERVICEPROVIDERFETCH_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceproviderold.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CNTSERVICEPROVIDEROLD_H
+#define CNTSERVICEPROVIDEROLD_H
+
+#include <cntservicescontact.h>
+#include <xqserviceprovider.h>
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntServices;
+
+QTM_USE_NAMESPACE
+
+/*!
+  This class offers services through the old interface name & old signatures.
+*/
+class CntServiceProviderOld : public XQServiceProvider, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+public:
+    CntServiceProviderOld(CntServices& aServices, QObject *parent = 0);
+    ~CntServiceProviderOld();
+
+public slots:  // operations offered to clients
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      multiFetch(QString, QString, QString)
+     *      com.nokia.symbian.IContactFetch.
+     */
+    void fetch(const QString &title,
+               const QString &action,
+               const QString &filter);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      singleFetch(QString, QString, QString)
+     *      com.nokia.symbian.IContactFetch.
+     */
+    void Dofetch(const QString &title,
+                 const QString &action,
+                 const QString &filter,
+                 const QString &mode = KCntNoSelectionMode);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editCreateNew(QString, QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editCreateNew(const QString& definitionName, const QString& value);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editCreateNewFromVCard(QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editCreateNew(const QString& vCardFile);
+    
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editUpdateExisting(QString, QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editUpdateExisting(const QString& definitionName, const QString& value);
+    
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      openContactCard(int contactId)
+     *      com.nokia.symbian.IContactView
+     */
+    void open(int contactId);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      openContactCard(QString, QString)
+     *      com.nokia.symbian.IContactView
+     */
+    void open(const QString& definitionName, const QString& value);
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+
+private:
+    CntServices& mServices;
+    int mCurrentRequestIndex;
+};
+
+#endif /* CNTSERVICEPROVIDEROLD_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceproviderold2.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CNTSERVICEPROVIDEROLD2_H
+#define CNTSERVICEPROVIDEROLD2_H
+
+#include <cntservicescontact.h>
+#include <xqserviceprovider.h>
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntServices;
+
+QTM_USE_NAMESPACE
+
+/*!
+  This class offers services through the old interface name & old signatures.
+*/
+class CntServiceProviderOld2 : public XQServiceProvider, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+public:
+    CntServiceProviderOld2(CntServices& aServices, QObject *parent = 0);
+    ~CntServiceProviderOld2();
+
+public slots:  // operations offered to clients
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      multiFetch(QString, QString, QString)
+     *      com.nokia.symbian.IContactFetch.
+     */
+    void fetch(const QString &title,
+               const QString &action,
+               const QString &filter);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      singleFetch(QString, QString, QString)
+     *      com.nokia.symbian.IContactFetch.
+     */
+    void Dofetch(const QString &title,
+                 const QString &action,
+                 const QString &filter,
+                 const QString &mode = KCntNoSelectionMode);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editCreateNew(QString, QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editCreateNew(const QString& definitionName, const QString& value);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editCreateNewFromVCard(QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editCreateNew(const QString& vCardFile);
+    
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      editUpdateExisting(QString, QString)
+     *      com.nokia.symbian.IContactEdit
+     */
+    void editUpdateExisting(const QString& definitionName, const QString& value);
+    
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      openContactCard(int contactId)
+     *      com.nokia.symbian.IContactView
+     */
+    void open(int contactId);
+
+    /**
+     * Interface name has changed (see other impl. class)
+     * @deprecated
+     * Replaced with:
+     *      openContactCard(QString, QString)
+     *      com.nokia.symbian.IContactView
+     */
+    void open(const QString& definitionName, const QString& value);
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+
+private:
+    CntServices& mServices;
+    int mCurrentRequestIndex;
+};
+
+#endif /* CNTSERVICEPROVIDEROLD2_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceproviderviewing.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This class offers contact viewing UI services.
+ *
+ */
+
+#ifndef CNTSERVICEPROVIDERVIEW_H
+#define CNTSERVICEPROVIDERVIEW_H
+
+#include <cntservicescontact.h>
+#include <xqserviceprovider.h>
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntServices;
+
+QTM_USE_NAMESPACE
+
+/*!
+  This class offers contact viewing UI services.
+*/
+class CntServiceProviderViewing : public XQServiceProvider, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+public:
+    CntServiceProviderViewing(CntServices& aServices, QObject *parent = 0);
+    ~CntServiceProviderViewing();
+
+public slots:  // operations offered to clients
+
+    /**
+     * Opens Contact Card.
+     * @param aContactId
+     */
+    void openContactCard( int aContactId );
+
+    /**
+     * Opens Contact Card for non-saved contact which is not saved yet.
+     * @param aFieldName
+     * @param aValue The value for the field.
+     */
+    void openTemporaryContactCard( QString aFieldName, QString aFieldValue );
+    
+    /**
+     * Opens Group Member View.
+     * @param aContactId
+     */
+    void openGroup( int aContactId );
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+
+private:
+    CntServices& mServices;
+    int mCurrentRequestIndex;
+};
+
+#endif /* CNTSERVICEPROVIDERVIEW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntservices.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CNTSERVICES_H
+#define CNTSERVICES_H
+
+#include <cntviewparams.h>
+#include <qtcontacts.h>
+
+#include "cntabstractserviceprovider.h"
+
+class CntAbstractViewManager;
+class XQServiceProvider;
+
+QTM_USE_NAMESPACE
+
+class CntServices : public QObject, public CntAbstractServiceProvider
+{
+    Q_OBJECT
+    
+public:
+    CntServices();
+    ~CntServices();
+
+public:
+
+    void setViewManager( CntAbstractViewManager& aViewManager );
+    
+    /**
+     * Opens contact selection view where multiple contacts can be selected.
+     * @param title The view title
+     * @param action Filter definition for filtering contacts based on supported action. Can be left empty.
+     * @param aServiceProvider The service provider
+     */
+    void singleFetch(const QString &title,
+                const QString &action,
+                CntAbstractServiceProvider& aServiceProvider  );
+
+    /**
+     * Opens contact selection view where multiple contacts can be selected.
+     * @param title The view title
+     * @param action Filter definition for filtering contacts based on supported action. Can be left empty.
+     * @param aServiceProvider The service provider
+     */
+    void multiFetch(const QString &title,
+                const QString &action,
+                CntAbstractServiceProvider& aServiceProvider  );
+
+    /**
+     * Launch editor for creating a new contact with a given detail.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param aServiceProvider The service provider
+     * @param defaultForOnlineAccountIsImpp If no subtype is given, default
+     *          for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then
+     *          the default is QContactOnlineAccount::SubTypeSipVoip.
+     */
+    void editCreateNew(const QString &definitionName, const QString &value,
+        CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true );
+
+    /**
+     * Launch editor for creating a new contact with a given detail and subtype.
+     * If the given subtype string is empty, then QContactPhoneNumber::SubTypeMobile is used.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param subType The subtype for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
+     * @param aServiceProvider The service provider
+     * @param defaultForOnlineAccountIsImpp If no subtype is given, default
+     *          for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then
+     *          the default is QContactOnlineAccount::SubTypeSipVoip.
+     */
+    void editCreateNew(const QString &definitionName, const QString &value, const QString& subType,
+        CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true );
+
+    /**
+     * Launch editor for creating a new contact based on vCard file indicated in arg.
+     * @param vCardFile The vCard file name and path.
+     * @param aServiceProvider The service provider
+     */
+    void editCreateNewFromVCard(const QString &vCardFile,
+        CntAbstractServiceProvider& aServiceProvider );
+
+    /**
+     * User can first choose a contact, and then an editor is opened.
+     * A new detail is provided by caller and it will be prefilled in the editor.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param aServiceProvider The service provider
+     */
+    void editUpdateExisting(const QString &definitionName, const QString &value,
+        CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true );
+
+    /**
+     * User can first choose a contact, and then an editor is opened.
+     * A new detail is provided by caller and it will be prefilled in the editor.
+     * @param definitionName The field type
+     * @param value The value for the field.
+     * @param subType The subtype for the field. (for eg. QContactPhoneNumber::SubTypeLandline)
+     * @param aServiceProvider The service provider
+     * @param defaultForOnlineAccountIsImpp If no subtype is given, default
+     *          for QContactOnlineAccount is QContactOnlineAccount::SubTypeImpp. If false, then
+     *          the default is QContactOnlineAccount::SubTypeSipVoip.
+     */
+    void editUpdateExisting(const QString &definitionName, const QString &value, const QString& subType,
+        CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp = true );
+
+    /**
+     * Open the editor for an existing contact.'
+     * @param contactId
+     * @param aServiceProvider The service provider
+     */
+    void editExisting(int contactId,
+        CntAbstractServiceProvider& aServiceProvider);
+
+    /**
+     * Opens Contact Card.
+     * @param contactId The contact ID
+     * @param aServiceProvider The service provider
+     */
+    void launchContactCard(int contactId,
+        CntAbstractServiceProvider& aServiceProvider );
+    
+    /**
+     * Opens Group member view.
+     * @param contactId The contact ID
+     * @param aServiceProvider The service provider
+     */
+    void launchGroupMemberView(int contactId,
+        CntAbstractServiceProvider& aServiceProvider );
+
+    /**
+     * Opens Contact Card for non-saved contact.
+     * @param definitionName Field name.
+     * @param value The field value.
+     * @param aServiceProvider The service provider
+     */
+    void launchTemporaryContactCard(const QString &definitionName, const QString &value,
+        CntAbstractServiceProvider& aServiceProvider );
+    
+    /**
+     * Set the flag that allows quitting the application explicitly
+     * using the quitApp slot. By default the value is always true.
+     */
+    void setQuittable(bool quittable);
+        
+public slots:
+    /**
+     * Quit the application
+     */
+    void quitApp();
+    /**
+     * Terminate a service
+     */
+    void terminateService();
+    
+private:
+    void removeNotSupportedFields(QContact& contact);
+    void removeNotSupportedDetails(QContact& contact);
+    void fillOnlineAccount( QContactOnlineAccount& account, const QString& value, const QString& subType, bool defaultForOnlineAccountIsImpp);
+    QContactManager* contactManager();
+
+private: // from CntAbstractServiceProvider
+    void CompleteServiceAndCloseApp(const QVariant& retValue);
+private:
+    CntAbstractViewManager* mViewManager; // not owned
+    QStringList m_definitionNames;
+    CntAbstractServiceProvider* mCurrentProvider; // not owned
+    bool mIsQuittable;
+};
+
+#endif /* CNTSERVICES_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntservicestrings.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Contacts highway service interface strings.
+ *
+ */
+
+#ifndef CNTSERVICESTRINGS_H
+#define CNTSERVICESTRINGS_H
+
+// Full interface names. The beginning part "phonebookservices" is the service name.
+#define KCntServiceInterfaceView  "phonebookservices.com.nokia.symbian.IContactsView"
+#define KCntServiceInterfaceFetch "phonebookservices.com.nokia.symbian.IContactsFetch"
+#define KCntServiceInterfaceEdit  "phonebookservices.com.nokia.symbian.IContactsEdit"
+
+
+#endif /* CNTSERVICESTRINGS_H */
--- a/phonebookui/phonebookservices/inc/cntservicesubeditview.h	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CNTSERVICESUBEDITVIEW_H
-#define CNTSERVICESUBEDITVIEW_H
-
-#include <QObject>
-#include "cnteditview.h"
-
-class CntServiceHandler;
-
-class CntServiceSubEditView : public CntEditView
-{
-
-Q_OBJECT
-
-public:
-
-    CntServiceSubEditView( CntServiceHandler *aServiceHandler );
-    ~CntServiceSubEditView();
-
-    int viewId() const { return serviceSubEditView; }
-
-//public slots:
-//    void aboutToCloseView();
-//    int handleExecutedCommand(QString aCommand, const QContact &aContact);
-//    void discardAllChanges();
-
-private:
-    CntServiceHandler *mServiceHandler;
-    
-};
-
-#endif //CNTSERVICESUBEDITVIEW_H
-// EOF
--- a/phonebookui/phonebookservices/inc/cntserviceviewfactory.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntserviceviewfactory.h	Wed Aug 18 09:39:00 2010 +0300
@@ -21,18 +21,18 @@
 #include "cntabstractviewfactory.h"
 
 class CntAbstractView;
-class CntServiceHandler;
+class CntAbstractServiceProvider;
 
 class CntServiceViewFactory : public CntDefaultViewFactory
 {
 public:
-    CntServiceViewFactory( CntServiceHandler* aService ); 
+    CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider ); 
     ~CntServiceViewFactory();
     
 public:
     CntAbstractView* createView( int aViewId );
     
 private:
-    CntServiceHandler* mService;
+    CntAbstractServiceProvider& mProvider;
 };
 #endif /* CNTSERVICEVIEWFACTORY_H_ */
--- a/phonebookui/phonebookservices/inc/cntserviceviewmanager.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntserviceviewmanager.h	Wed Aug 18 09:39:00 2010 +0300
@@ -26,28 +26,19 @@
 
 class CntBaseView;
 class CntServiceHandler;
+class CntAbstractServiceProvider;
 
 class CntServiceViewManager : public CntDefaultViewManager
 {
     Q_OBJECT
 
 public:
-    CntServiceViewManager(HbMainWindow *mainWindow, CntServiceHandler *aHandler);
+    CntServiceViewManager(HbMainWindow *mainWindow, CntAbstractServiceProvider& aProvider );
     ~CntServiceViewManager();
-    
-public slots:
-    void handleFetch(const QString &title, const QString &action, const QString &filter);
-    void launchFetch(const QString &title, const QString &action, const QString &filter, const QString &mode = KCntMultiSelectionMode);
-    void launchEditor(QContact contact);
-    void launchContactSelection(QContactDetail detail);
-    void launchContactCard(QContact contact);
-    void launchAssignContactCard(QContact contact, QContactDetail detail);
-
 protected slots:
     virtual void closeApp();
-
-private:
-    CntServiceHandler *mServiceHandler;
+signals:
+    void applicationClosed();
 };
 
 #endif // CNTSERVICEVIEWMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/inc/cntserviceviewparams.h	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: View parameter constants used internally in phonebookservices.
+ *
+ */
+
+#ifndef CNTSERVICEVIEWPARAMS_H
+#define CNTSERVICEVIEWPARAMS_H
+
+
+#include <cntservicescontact.h>
+
+/// View parameters used inside phonebookservices.
+enum CntServiceViewParams
+    {
+    /// Specifies the title string for a service view
+    KCntServiceViewParamTitle = ECustomParam
+    };
+
+
+#endif /* CNTSERVICEVIEWPARAMS_H */
--- a/phonebookui/phonebookservices/phonebookservices.pro	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/phonebookservices.pro	Wed Aug 18 09:39:00 2010 +0300
@@ -23,35 +23,46 @@
 INCLUDEPATH += ../../phonebookengines/cntimageutility/inc
 
 INCLUDEPATH += . \
-    inc
+    inc \
+    ../../inc
 
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 MOC_DIR = moc
 
 # Input
-HEADERS += inc/cntservicemainwindow.h \
-           inc/cntserviceviewmanager.h \
-           inc/cntservicehandler.h \
+HEADERS += inc/cntserviceviewmanager.h \
+           inc/cntserviceproviderold.h \
+           inc/cntserviceproviderold2.h \
            inc/cntservicecontactfetchview.h \
            inc/cntservicecontactselectionview.h \
            inc/cntserviceeditview.h \
            inc/cntservicecontactcardview.h \
-           inc/cntservicesubeditview.h \
+           inc/cntservicegroupmemberview.h \
            inc/cntserviceassigncontactcardview.h \
-           inc/cntserviceviewfactory.h 
+           inc/cntserviceviewfactory.h \
+           inc/cntservices.h \
+           inc/cntabstractserviceprovider.h \
+           inc/cntserviceproviderfetch.h \
+           inc/cntserviceproviderviewing.h \
+           inc/cntserviceprovideredit.h \
+           inc/cntserviceviewparams.h
 
 SOURCES += src/main.cpp \
-           src/cntservicemainwindow.cpp \
            src/cntserviceviewmanager.cpp \
-           src/cntservicehandler.cpp \
+           src/cntserviceproviderold.cpp \
+           src/cntserviceproviderold2.cpp \
            src/cntservicecontactfetchview.cpp \
            src/cntservicecontactselectionview.cpp \
            src/cntserviceeditview.cpp \
            src/cntservicecontactcardview.cpp \
-           src/cntservicesubeditview.cpp \
+           src/cntservicegroupmemberview.cpp \
            src/cntserviceassigncontactcardview.cpp \
-           src/cntserviceviewfactory.cpp
+           src/cntserviceviewfactory.cpp \
+           src/cntservices.cpp \
+           src/cntserviceproviderfetch.cpp \
+           src/cntserviceproviderviewing.cpp \
+           src/cntserviceprovideredit.cpp
 
 # capability
 TARGET.CAPABILITY = CAP_APPLICATION
--- a/phonebookui/phonebookservices/service_conf.xml	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/service_conf.xml	Wed Aug 18 09:39:00 2010 +0300
@@ -1,7 +1,32 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services.phonebookservices"  filepath="must-not-be-empty" >
-  <description>Phonebook service</description>
-  <interface name="Fetch" version="1.0" capabilities="">
+<service>
+  <name>phonebookservices</name>
+  <filepath>No path</filepath>
+  <description>xPhonebook services</description>
+  <interface>
+    <name>com.nokia.symbian.IContactsFetch</name>
+    <version>1.0</version>
+    <description>Fetch interface</description>
+  </interface>
+  <interface>
+    <name>phonebookservices.Fetch</name>
+    <version>1.0</version>
     <description>Fetch interface</description>
   </interface>
+  <interface>
+    <name>Fetch</name>
+    <version>1.0</version>
+    <description>Fetch interface</description>
+    <customproperty key="deprecatedsn">com.nokia.services.phonebookservices</customproperty>
+  </interface>
+  <interface>
+    <name>com.nokia.symbian.IContactsView</name>
+    <version>1.0</version>
+    <description>Contact viewing interface</description>
+  </interface>
+  <interface>
+    <name>com.nokia.symbian.IContactsEdit</name>
+    <version>1.0</version>
+    <description>Contact editing interface</description>
+  </interface>
 </service>
\ No newline at end of file
--- a/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntserviceassigncontactcardview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,7 +16,8 @@
 */
 
 #include "cntserviceassigncontactcardview.h"
-#include "cntservicehandler.h"
+#include "cntabstractserviceprovider.h"
+#include "cntdebug.h"
 
 #include <hbaction.h>
 #include <hbdialog.h>
@@ -32,14 +33,15 @@
 Constructor, initialize member variables.
 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
 */
-CntServiceAssignContactCardView::CntServiceAssignContactCardView(CntServiceHandler *aServiceHandler) : 
-    CntContactCardView(),
-    mServiceHandler(aServiceHandler)
+CntServiceAssignContactCardView::CntServiceAssignContactCardView( CntAbstractServiceProvider& aServiceProvider ) : 
+    CntContactCardView(true),
+    mProvider( aServiceProvider )
 {
+    CNT_ENTRY
     connect(this, SIGNAL(backPressed()), this, SLOT(doCloseView()));
-    connect(this, SIGNAL(viewActivated(CntAbstractViewManager*, QContactDetail)), this, SLOT(doViewActivated(CntAbstractViewManager*,QContactDetail)));
-    
-    addActionsToToolBar();
+    connect(this, SIGNAL(viewActivated(CntAbstractViewManager*, const CntViewParameters)), this, SLOT(doViewActivated(CntAbstractViewManager*,const CntViewParameters)));
+    connect(this, SIGNAL(addToContacts()), this, SLOT(addToContacts()));
+    CNT_EXIT
 }
 
 /*!
@@ -47,17 +49,8 @@
 */
 CntServiceAssignContactCardView::~CntServiceAssignContactCardView()
 {
-
-}
-
-/*!
-Add actions to the toolbar
-*/
-void CntServiceAssignContactCardView::addActionsToToolBar()
-{
-    view()->toolBar()->clearActions();  
-    HbAction* addToContact = view()->toolBar()->addAction("txt_phob_button_add_to_contacts");
-    connect(addToContact, SIGNAL(triggered()), this, SLOT(addToContacts()));
+    CNT_ENTRY
+    CNT_EXIT
 }
 
 /*!
@@ -65,23 +58,44 @@
 */
 void CntServiceAssignContactCardView::addToContacts()
 {  
-    HbDialog *popup = new HbDialog();
+    CNT_ENTRY
+    
+    HbDialog* popup = new HbDialog();
     popup->setDismissPolicy(HbDialog::NoDismiss);
-    popup->setHeadingWidget(new HbLabel(hbTrId("txt_phob_title_add_to_contacts"), popup));
+    popup->setHeadingWidget(
+            new HbLabel(hbTrId("txt_phob_title_add_to_contacts"), popup));
     popup->setAttribute(Qt::WA_DeleteOnClose);
+    popup->setTimeout( HbPopup::NoTimeout );
+    popup->addAction(
+            new HbAction(hbTrId("txt_common_button_cancel"), popup));
 
-    HbWidget *buttonWidget = new HbWidget(popup);
-    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
-    HbPushButton *addButton = new HbPushButton(hbTrId("txt_missing_list_save_as_a_new_contact"), buttonWidget);
+    HbWidget* buttonWidget = new HbWidget(popup);
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+    
+    HbPushButton* addButton = new HbPushButton(buttonWidget);
+    addButton->setStretched(true);
+    addButton->setText(hbTrId("txt_phob_button_save_as_a_new_contact"));
+    HbIcon plusIcon("qtg_mono_plus");
+    addButton->setIcon(plusIcon);
+    connect(addButton, SIGNAL(clicked()), popup, SLOT(close()));
     connect(addButton, SIGNAL(clicked()), this, SLOT(saveNew()));
-    HbPushButton *updateButton = new HbPushButton(hbTrId("txt_missing_list_update_existing_contact"), buttonWidget);
+    
+    HbPushButton* updateButton = new HbPushButton(buttonWidget);
+    updateButton->setStretched(true);
+    updateButton->setText(hbTrId("txt_phob_button_update_existing_contact"));
+    updateButton->setIcon(plusIcon);
+    connect(updateButton, SIGNAL(clicked()), popup, SLOT(close()));
     connect(updateButton, SIGNAL(clicked()), this, SLOT(updateExisting()));
+    
     layout->addItem(addButton);
     layout->addItem(updateButton);
+    
     buttonWidget->setLayout(layout);
     popup->setContentWidget(buttonWidget);
+
+    popup->open();
     
-    popup->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), popup));
+    CNT_EXIT
 }
 
 /*!
@@ -89,12 +103,16 @@
 */
 void CntServiceAssignContactCardView::saveNew()
 {
+    CNT_ENTRY
     CntViewParameters viewParameters;
     viewParameters.insert(EViewId, serviceEditView);
+    QContactName contactName = mContact.detail<QContactName>();
+    mContact.removeDetail(&contactName);
     QVariant var;
     var.setValue(mContact);
     viewParameters.insert(ESelectedContact, var);
     mViewManager->changeView(viewParameters);
+    CNT_EXIT
 }
 
 /*!
@@ -102,12 +120,14 @@
 */
 void CntServiceAssignContactCardView::updateExisting()
 {
+    CNT_ENTRY
     CntViewParameters viewParameters;
     viewParameters.insert(EViewId, serviceContactSelectionView);
     QVariant var;
     var.setValue(mDetail);
     viewParameters.insert(ESelectedDetail, var);
     mViewManager->changeView(viewParameters);
+    CNT_EXIT
 }
 
 /*!
@@ -115,9 +135,11 @@
 */
 void CntServiceAssignContactCardView::doViewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs)
 {
+    CNT_ENTRY
     mViewManager = aMgr;
     mContact = aArgs.value(ESelectedContact).value<QContact>();
     mDetail = aArgs.value(ESelectedDetail).value<QContactDetail>();
+    CNT_EXIT
 }
 
 /*!
@@ -125,7 +147,9 @@
 */
 void CntServiceAssignContactCardView::doCloseView()
 {
+    CNT_ENTRY
     qApp->quit();
+    CNT_EXIT
 }
 
 // end of file
--- a/phonebookui/phonebookservices/src/cntservicecontactcardview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntservicecontactcardview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,18 +16,21 @@
 */
 
 #include "cntservicecontactcardview.h"
-#include "cntservicehandler.h"
-#include <QCoreApplication>
+#include "cntabstractserviceprovider.h"
+#include "cntdebug.h"
+#include <cntservicescontact.h>
 
 /*!
 Constructor, initialize member variables.
 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
 */
-CntServiceContactCardView::CntServiceContactCardView(CntServiceHandler *aServiceHandler) : 
+CntServiceContactCardView::CntServiceContactCardView( CntAbstractServiceProvider& aServiceProvider ) : 
     CntContactCardView(),
-    mServiceHandler(aServiceHandler)
+    mProvider( aServiceProvider )
 {
-    connect(this, SIGNAL(backPressed()), this, SLOT(doShowPreviousView()));
+    CNT_ENTRY
+    connect(this, SIGNAL(backPressed()), this, SLOT(closeContactCard()));
+    CNT_EXIT
 }
 
 /*!
@@ -35,17 +38,20 @@
 */
 CntServiceContactCardView::~CntServiceContactCardView()
 {
-
+    CNT_ENTRY
+    CNT_EXIT
 }
 
 /*!
 Close the view (quits the service as well)
 */
-void CntServiceContactCardView::doShowPreviousView()
+void CntServiceContactCardView::closeContactCard()
 {
-    int result = -2;
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mServiceHandler->completeEdit(result);
+    CNT_ENTRY
+    QVariant variant;
+    variant.setValue(KCntServicesTerminated);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    CNT_EXIT
 }
 
 // end of file
--- a/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -19,25 +19,25 @@
 
 #include <cntservicescontact.h>
 #include <cntlistmodel.h>
-#include "cntservicehandler.h"
+#include "cntserviceviewparams.h"
 
 #include <hbmenu.h>
 #include <hbview.h>
 #include <hblistview.h>
 #include <hbdocumentloader.h>
 #include <hbaction.h>
+#include "cntactionpopup.h"
 
 #include <QCoreApplication>
 
-CntServiceContactFetchView::CntServiceContactFetchView(CntServiceHandler *aServiceHandler):
+CntServiceContactFetchView::CntServiceContactFetchView( CntAbstractServiceProvider& aServiceProvider ):
 CntBaseSelectionView(),
-mServiceHandler(aServiceHandler)
-{
+mProvider( aServiceProvider )
+    {
     HbAction* cancel = static_cast<HbAction*>( mDocument->findObject( "cnt:cancel" ) );
     mView->menu()->addAction( cancel );
-    
     connect(cancel,  SIGNAL(triggered()), this, SLOT(cancelFetch()) );
-    connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) );
+    connect( this, SIGNAL(viewClosed()), this, SLOT(closeFetchView()) );
     connect( this, SIGNAL(viewOpened(CntAbstractViewManager*, const CntViewParameters)), this, SLOT(aboutToOpenView(CntAbstractViewManager*, const CntViewParameters)) );
 }
 
@@ -47,51 +47,182 @@
 
 
 void CntServiceContactFetchView::cancelFetch()
-{
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    {
     CntServicesContactList serviceList;
-    mServiceHandler->completeFetch(serviceList);
-}
+    QVariant variant;
+    variant.setValue(serviceList);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    }
 
-void CntServiceContactFetchView::aboutToCloseView()
+
+
+void CntServiceContactFetchView::closeFetchView()
 {
-    CntServicesContactList serviceList;
     QContactManager* mgr = mMgr->contactManager(SYMBIAN_BACKEND);
     QModelIndexList temp = mListView->selectionModel()->selection().indexes();
+    mIndex = 0;
     for(int i = 0; i < temp.count(); i++ )
     {
         QContact contact = mListModel->contact(temp.at(i));
-        CntServicesContact servicesContact;
-
-        //get the name
-        servicesContact.mDisplayName = contact.displayLabel();
-
-        //get the phonenumber
-        QList<QContactPhoneNumber> phonenumbers = contact.details<QContactPhoneNumber>();
-        if(phonenumbers.count() > 0)
+        if (mAction == KCntActionCall)
+        {
+            serviceCallMessageAction(contact, KCntActionCall);
+        }
+        else if (mAction == KCntActionSms )
         {
-            servicesContact.mPhoneNumber = phonenumbers.first().number();
+            serviceCallMessageAction(contact, "message");
+        }
+        else if (mAction == KCntActionEmail)
+        {
+            serviceEmailAction(contact);
         }
         else
         {
-            servicesContact.mPhoneNumber = "";
+            serviceAllAction(contact);
         }
+    }
+    showPreviousView();
+}
+
+void CntServiceContactFetchView::serviceCallMessageAction(QContact& aContact, QString aAction)
+{
+    CntServicesContact servicesContact;
+    //get the phonenumber
+    QList<QContactPhoneNumber> phonenumbers = aContact.details<QContactPhoneNumber>();
+    
+    Q_ASSERT_X( phonenumbers.count() > 0, "serviceCallMessageAction", "Number count is zero");
+    
+    QContactDetail detail = aContact.preferredDetail(aAction);
+    if (!detail.isEmpty())
+    {
+        //Set preferred detail for services
+        QContactPhoneNumber number = detail;
+        servicesContact.mDisplayName = aContact.displayLabel();
+        servicesContact.mPhoneNumber = number.number();
+        servicesContact.mEmailAddress = "";
+        servicesContact.mContactId = aContact.localId();
+        mServiceList.append(servicesContact);
+    }
+    else 
+    {
+        // show popup for call numbers
+        CntActionPopup *actionPopup = new CntActionPopup(&aContact);
+        bool popup = actionPopup->showActionPopup(aAction);
+        if(popup)
+        {
+            //if call numbers are present wait for signals
+            mIndex++;
+            connect( actionPopup, SIGNAL(executeContactAction(QContact&,QContactDetail, QString)), this, 
+                    SLOT(popupContactAction(QContact&, QContactDetail, QString)));
+            connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, 
+                                SLOT(actionPopupCancelSlot()));
+        }
+        else 
+        {
+            //else delete popup if no call number present
+            delete actionPopup;
+        }
+    }
+}
 
+void CntServiceContactFetchView::serviceEmailAction(QContact& aContact)
+{
+    CntServicesContact servicesContact;
+    //get the email address
+    QList<QContactEmailAddress> emailAddresses = aContact.details<QContactEmailAddress>();
+    
+    Q_ASSERT_X( emailAddresses.count() > 0, "serviceEmailAction", "email address count is zero");
+    
+    QContactDetail detail = aContact.preferredDetail("email");
+    if (!detail.isEmpty())
+    {
+        //Set preferred detail for services
+        QContactEmailAddress email = detail;
+        servicesContact.mDisplayName = aContact.displayLabel();
+        servicesContact.mPhoneNumber = "";
+        servicesContact.mEmailAddress = email.emailAddress();
+        servicesContact.mContactId = aContact.localId();
+        mServiceList.append(servicesContact);
+        
+    }
+    else 
+    {
+        // show popup for email id's 
+        CntActionPopup *actionPopup = new CntActionPopup(&aContact);
+        bool popup = actionPopup->showActionPopup("email");
+        if(popup)
+        {
+            //if email id's are present wait for signals
+            mIndex++;
+            connect( actionPopup, SIGNAL(executeContactAction(QContact&,QContactDetail, QString)), this, 
+                    SLOT(popupContactAction(QContact&, QContactDetail, QString)));
+            connect( actionPopup, SIGNAL(actionPopupCancelPressed()), this, 
+                                SLOT(actionPopupCancelSlot()));
+        }
+        else 
+        {
+            //else delete popup if no email present
+            delete actionPopup;
+        }
+    }
+}
+
+void CntServiceContactFetchView::serviceAllAction(QContact& aContact)
+{
+    CntServicesContact servicesContact;
+    servicesContact.mDisplayName = aContact.displayLabel();
+    QContactDetail callDetail = aContact.preferredDetail("call");
+    //Check for preferredDetail from call
+    // if not present check for preferredDetail for message
+    // if not present pick first phone number
+    if (!callDetail.isEmpty())
+    {
+        QContactPhoneNumber number = callDetail;
+        servicesContact.mPhoneNumber = number.number();
+    }
+    else
+    {
+        QContactDetail smsDetail = aContact.preferredDetail("message");
+        if (!callDetail.isEmpty())
+        {
+            QContactPhoneNumber number = smsDetail;
+            servicesContact.mPhoneNumber = number.number();
+        }
+        else 
+        {
+            QList<QContactPhoneNumber> phonenumbers = aContact.details<QContactPhoneNumber>();
+            if(phonenumbers.count() > 0)
+            {
+            servicesContact.mPhoneNumber = phonenumbers.first().number();
+            }
+            else
+            {
+            servicesContact.mPhoneNumber = "";
+            }
+        }
+    }
+    
+    QContactDetail emailDetail = aContact.preferredDetail("email");
+    if (!emailDetail.isEmpty())
+    {
+        QContactEmailAddress email = emailDetail;
+        servicesContact.mEmailAddress = email.emailAddress();
+    }
+    else
+    {
         //get first email address
-        QList<QContactEmailAddress> emailAddresses = contact.details<QContactEmailAddress>();
+        QList<QContactEmailAddress> emailAddresses = aContact.details<QContactEmailAddress>();
         if(emailAddresses.count() > 0)
         {
             servicesContact.mEmailAddress = emailAddresses.first().emailAddress();
         }
-        //contact id
-        servicesContact.mContactId = contact.localId();
-
-        //append it to the list
-        serviceList.append(servicesContact);
+        else 
+        {
+            servicesContact.mEmailAddress = "";
+        }
     }
-
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mServiceHandler->completeFetch(serviceList);
+    servicesContact.mContactId = aContact.localId();
+    mServiceList.append(servicesContact);
 }
 
 void CntServiceContactFetchView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters aArgs)
@@ -99,25 +230,30 @@
     mMgr = aMgr;
     
     // Set title of the view.
-    QString title = aArgs.value(CntServiceHandler::ETitle).toString();
+    QString title = aArgs.value(KCntServiceViewParamTitle).toString();
     mView->setTitle(title);
     
     // Set action filter
-    QString filter = aArgs.value(CntServiceHandler::EFilter).toString();
-    QString action = aArgs.value(CntServiceHandler::EAction).toString();
-    if (action == KCntActionSms)
+    mAction = aArgs.value(ESelectedAction).toString();
+    // ESelectedAction is defined in cntviewparams.h
+
+    // Has never been implemented.
+    //QString filterStr = aArgs.value(KCntServiceViewParamFilter).toString();
+    // KCntServiceViewParamFilter is defined in cntserviceviewparams.h
+
+    if (mAction == KCntActionSms)
         {
             QContactActionFilter actionFilter;
             actionFilter.setActionName("message");
             mListModel->setFilter(actionFilter);
         }
-        else if (action == KCntActionCall)
+        else if (mAction == KCntActionCall)
         {
             QContactActionFilter actionFilter;
             actionFilter.setActionName("call");
             mListModel->setFilter(actionFilter);
         }
-        else if (action == KCntActionEmail)
+        else if (mAction == KCntActionEmail)
         {
             QContactActionFilter actionFilter;
             actionFilter.setActionName("email");
@@ -139,4 +275,59 @@
         }
 }
 
+void CntServiceContactFetchView::popupContactAction(QContact& aContact,QContactDetail contactDetail, QString aAction)
+{
+    if (aAction.compare("call", Qt::CaseInsensitive) == 0 
+           || aAction.compare("message", Qt::CaseInsensitive) == 0 )
+       {       
+           CntServicesContact servicesContact;
+           QContactPhoneNumber number = static_cast<QContactPhoneNumber>(contactDetail);
+           QString name = aContact.displayLabel();
+           servicesContact.mDisplayName = aContact.displayLabel();
+           servicesContact.mPhoneNumber = number.number();
+           servicesContact.mEmailAddress = "";
+           servicesContact.mContactId = aContact.localId();
+           mServiceList.append(servicesContact);
+           mIndex--;
+       }
+       else if (aAction.compare("email", Qt::CaseInsensitive) == 0 )
+       {
+           CntServicesContact servicesContact;
+           QContactEmailAddress email = static_cast<QContactEmailAddress>(contactDetail);
+           servicesContact.mDisplayName = aContact.displayLabel();
+           servicesContact.mPhoneNumber = "";
+           servicesContact.mEmailAddress = email.emailAddress();
+           servicesContact.mContactId = aContact.localId();
+           mServiceList.append(servicesContact);
+           mIndex--;
+       }
+    
+    if (aContact.preferredDetail(aAction).isEmpty() && (aAction == "call" || aAction == "message" || aAction == "email"))
+    {
+        aContact.setPreferredDetail(aAction, contactDetail);
+        //return value will be ignored because we cannot do anything if it fails.
+        mMgr->contactManager(SYMBIAN_BACKEND)->saveContact(&aContact);
+    }
+    
+    showPreviousView();
+}
+
+void CntServiceContactFetchView::actionPopupCancelSlot()
+{
+    mIndex--;
+    showPreviousView();
+}
+
+void CntServiceContactFetchView::showPreviousView()
+{
+    if(mIndex==0)
+    {
+        QVariant variant;
+        variant.setValue(mServiceList);
+        mProvider.CompleteServiceAndCloseApp(variant);
+        
+        CntViewParameters args;
+        mMgr->back( args );
+    }
+}
 // EOF
--- a/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntservicecontactselectionview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,15 +17,15 @@
 
 #include "cntservicecontactselectionview.h"
 
+#include <cntservicescontact.h>
 #include <QCoreApplication>
 #include <QModelIndex>
-#include "cntservicehandler.h"
 #include <hblistview.h>
 #include <cntlistmodel.h>
 
-CntServiceContactSelectionView::CntServiceContactSelectionView(CntServiceHandler *aServiceHandler):
+CntServiceContactSelectionView::CntServiceContactSelectionView( CntAbstractServiceProvider& aServiceProvider ):
 CntBaseSelectionView(),
-mServiceHandler(aServiceHandler)
+mProvider( aServiceProvider )
 {
     connect(mListView, SIGNAL(activated(const QModelIndex&)), this, SLOT(onListViewActivated(const QModelIndex&)));
     connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) );
@@ -37,6 +37,7 @@
 
 }
 
+// An item in the selection list has been clicked
 void CntServiceContactSelectionView::onListViewActivated(const QModelIndex &aIndex)
 {
     QContact contact = mListModel->contact(aIndex);
@@ -52,8 +53,11 @@
 
 void CntServiceContactSelectionView::aboutToCloseView()
 {
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mServiceHandler->completeEdit(0);
+    QVariant variant;
+    variant.setValue(KCntServicesReturnValueContactNotModified);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    CntViewParameters args;
+    mMgr->back( args );
 }
 
 void CntServiceContactSelectionView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters viewParameters)
--- a/phonebookui/phonebookservices/src/cntserviceeditview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntserviceeditview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,11 +16,13 @@
 */
 
 #include "cntserviceeditview.h"
-#include "cntservicehandler.h"
+#include <cntservicescontact.h>
 #include <QCoreApplication>
+#include "cntdebug.h"
 
-CntServiceEditView::CntServiceEditView(CntServiceHandler *aServiceHandler ) : CntEditView(),
-mServiceHandler(aServiceHandler)
+CntServiceEditView::CntServiceEditView( CntAbstractServiceProvider& aServiceProvider )
+: CntEditView(),
+mProvider( aServiceProvider )
 {   
     connect( this, SIGNAL(contactUpdated(int)), this, SLOT(doContactUpdated(int)) );
     connect( this, SIGNAL(contactRemoved(bool)), this, SLOT(doContactRemoved(bool)) );
@@ -33,67 +35,37 @@
 
 void CntServiceEditView::doContactUpdated(int aSuccess)
 {
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mServiceHandler->completeEdit(aSuccess);
+    CNT_ENTRY_ARGS(aSuccess)
+    
+    int retValue = aSuccess ? KCntServicesReturnValueContactSaved : KCntServicesReturnValueContactNotModified;
+    QVariant variant;
+    variant.setValue(retValue);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    
+    CNT_EXIT
 }
 
 void CntServiceEditView::doContactRemoved(bool aSuccess)
 {
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    int retValue = aSuccess ? -1 : 0;
-    mServiceHandler->completeEdit(retValue);
+    CNT_ENTRY_ARGS(aSuccess)
+            
+    int retValue = aSuccess ? KCntServicesReturnValueContactDeleted : KCntServicesReturnValueContactNotModified;
+    QVariant variant;
+    variant.setValue(retValue);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    
+    CNT_EXIT
 }
 
 void CntServiceEditView::doChangesDiscarded()
 {
-    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mServiceHandler->completeEdit(0);
+    CNT_ENTRY
+    
+    QVariant variant;
+    variant.setValue(KCntServicesReturnValueContactNotModified);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    
+    CNT_EXIT
 }
 
-//
-///*!
-//Saves the contact
-//*/
-//void CntServiceEditView::aboutToCloseView()
-//{
-//    int result = 0;
-//    // save contact if there is one
-//    if (contact() && !contact()->isEmpty())
-//    {
-//        bool isSaved = contactManager()->saveContact(contact());
-//        if (isSaved)
-//        {
-//            result = 1;
-//        }
-//    }
-//    
-//    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-//    mServiceHandler->completeEdit(result);
-//}
-//
-///*!
-//Cancel all changes made and return to the application editor was opened from
-//*/
-//void CntServiceEditView::discardAllChanges()
-//{
-//    connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-//    mServiceHandler->completeEdit(0);
-//}
-//
-///*
-//Handle signals emitted from CntCommands, only used for delete command for now.
-//*/
-//int CntServiceEditView::handleExecutedCommand(QString aCommand, const QContact &aContact)
-//{
-//    Q_UNUSED(aContact);
-//    int result=-1;
-//    if (aCommand == "delete")
-//    {
-//        connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-//        mServiceHandler->completeEdit(result);
-//        result = 0;
-//    }
-//    return result;
-//}
-
 // EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntservicegroupmemberview.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cntservicegroupmemberview.h"
+#include "cntabstractserviceprovider.h"
+#include "cntdebug.h"
+#include <cntservicescontact.h>
+
+/*!
+Constructor, initialize member variables.
+\a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
+*/
+CntServiceGroupMemberView::CntServiceGroupMemberView( CntAbstractServiceProvider& aServiceProvider ) : 
+    CntGroupMemberView(),
+    mProvider( aServiceProvider )
+{
+    CNT_ENTRY
+    connect(this, SIGNAL(backPressed()), this, SLOT(closeGroupMemberView()));
+    CNT_EXIT
+}
+
+/*!
+Destructor
+*/
+CntServiceGroupMemberView::~CntServiceGroupMemberView()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+/*!
+Close the view (quits the service as well)
+*/
+void CntServiceGroupMemberView::closeGroupMemberView()
+{
+    CNT_ENTRY
+    QVariant variant;
+    variant.setValue(KCntServicesTerminated);
+    mProvider.CompleteServiceAndCloseApp(variant);
+    CNT_EXIT
+}
+
+// end of file
--- a/phonebookui/phonebookservices/src/cntservicehandler.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#include "cntservicehandler.h"
-#include "cntimageutility.h"
-
-#include <qversitreader.h>
-#include <qversitcontactimporter.h>
-#include <qversitdocument.h>
-
-#include <QPixmap>
-#include <QFile>
-#include <QUrl>
-
-/* NOTE! THIS SERVICE WILL BE RENAMED TO com.nokia.services.phonebook.Services */
-CntServiceHandler::CntServiceHandler(QObject *parent):
-    XQServiceProvider(QLatin1String("com.nokia.services.phonebookservices.Fetch"), parent),
-    mCurrentRequestIndex(0)
-{
-    publishAll();
-    
-    // Definition names supported in symbian back-end
-    m_definitionNames << QContactName::DefinitionName;
-    m_definitionNames << QContactNickname::DefinitionName;
-    m_definitionNames << QContactPhoneNumber::DefinitionName;
-    m_definitionNames << QContactEmailAddress::DefinitionName;
-    m_definitionNames << QContactAddress::DefinitionName;
-    m_definitionNames << QContactUrl::DefinitionName;
-    m_definitionNames << QContactBirthday::DefinitionName;
-    m_definitionNames << QContactOrganization::DefinitionName;
-    m_definitionNames << QContactSyncTarget::DefinitionName;
-    m_definitionNames << QContactNote::DefinitionName;
-    m_definitionNames << QContactFamily::DefinitionName;
-    m_definitionNames << QContactAvatar::DefinitionName;
-    m_definitionNames << QContactAnniversary::DefinitionName;
-    m_definitionNames << QContactGeoLocation::DefinitionName;
-    m_definitionNames << QContactGender::DefinitionName;
-    m_definitionNames << QContactOnlineAccount::DefinitionName;
-}
-
-CntServiceHandler::~CntServiceHandler()
-{
-}
-
-/*
-Complete the fetch and return the list selected contacts
-*/
-void CntServiceHandler::completeFetch( const CntServicesContactList &contactList )
-{
-    QVariant retValue;
-    retValue.setValue(contactList);
-    completeRequest(mCurrentRequestIndex, retValue);
-    mCurrentRequestIndex = 0;
-}
-
-/*
-Complete edit and return if contact wasn't modified (-2), was deleted (-1), saved (1) or if saving failed (0)
-*/
-void CntServiceHandler::completeEdit(int result)
-{
-    QVariant retValue(result);
-    completeRequest(mCurrentRequestIndex, retValue);
-    mCurrentRequestIndex = 0;
-}
-
-/*
-Launch fetch service with given parameters
-*/
-void CntServiceHandler::fetch(const QString &title, const QString &action, const QString &filter)
-{
-    emit launchFetch(title, action, filter);
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-Launch fetch service with given parameters. Fetching mode is No-select by default.
-*/
-void CntServiceHandler::Dofetch(const QString &title, const QString &action, const QString &filter, const QString &mode)
-{
-    emit launchFetchVerified(title, action, filter, mode);
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-Launch new contact editor with a given detail
-*/
-void CntServiceHandler::editCreateNew(const QString &definitionName, const QString &value)
-{
-    QContact contact;
-    
-    if (definitionName == QContactPhoneNumber::DefinitionName)
-    {
-        QContactPhoneNumber phoneNumber;
-        phoneNumber.setNumber(value);
-        phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
-        contact.saveDetail(&phoneNumber);
-    }
-    else if (definitionName == QContactEmailAddress::DefinitionName)
-    {
-        QContactEmailAddress email;
-        email.setEmailAddress(value);
-        contact.saveDetail(&email);
-    }
-    else if (definitionName == QContactOnlineAccount::DefinitionName)
-    {
-        QContactOnlineAccount account;
-        account.setAccountUri(value);
-        account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
-        contact.saveDetail(&account);
-    }    
-    
-    emit launchEditor(contact);
-
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-Launch new contact editor with a given vCard filename
-*/
-void CntServiceHandler::editCreateNew(const QString &vCardFile)
-{
-    CntImageUtility imageUtility;
-    QContact contact;
-    QVersitReader reader;
-    QFile file(vCardFile);
-
-    if (!file.open(QIODevice::ReadOnly))
-        return;
-    reader.setDevice(&file);
-    reader.startReading();
-    reader.waitForFinished();
-
-    // Use the resulting document(s)...
-    QVersitContactImporter importer;
-    QList<QVersitDocument> versitDocuments = reader.results();
-    if (versitDocuments.count() > 0 
-        && importer.importDocuments(versitDocuments))
-    {
-        QList<QContact> contacts = importer.contacts();
-        if (contacts.count() > 0)
-            contact = contacts.first();
-    }
-    file.close();
-    
-    // Save thumbnail images
-    QList<QContactThumbnail> details = contact.details<QContactThumbnail>();
-    for (int i = 0;i < details.count();i++)
-    {
-        if (!details.at(i).thumbnail().isNull())
-        {
-            QString imagepath;
-            QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail());
-            if (imageUtility.createImage(pixmap,imagepath))
-            {
-                // Update contact detail
-                QContactAvatar detail=details.at(i);
-                detail.setImageUrl(imagepath);
-                contact.saveDetail(&detail);
-            }
-        }
-    }
-    
-    removeNotSupportedDetails(contact);
-    removeNotSupportedFields(contact);
-    emit launchEditor(contact);
-
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-* Remove details not supported in symbian back-end.
-*/
-void CntServiceHandler::removeNotSupportedDetails(QContact& contact)
-{
-    // Check definition map, remove details not supported
-    for (int i=0; i < contact.details().count(); i++)
-    {
-        if (!m_definitionNames.contains(contact.details().at(i).definitionName()))
-        {
-            QContactDetail detail= contact.details().at(i);
-            contact.removeDetail(&detail);
-        }
-    }
-}
-/*
-* Remove fields not supported in symbian back-end.
-*/
-void CntServiceHandler::removeNotSupportedFields(QContact& contact)
-{
-    QContactManager cm("symbian");
-    
-    // Not all fields are supported in symbian back-end
-    // Remove not supported fields
-    for (int i=0; i < contact.details().count(); i++)
-    {
-        QContactDetail detail = contact.details().at(i);
-        if (detail.definitionName() == QContactAddress::DefinitionName)
-        {
-            QContactAddress addrDetail = static_cast<QContactAddress>(detail);
-            
-            // Sub-types not supported
-            if (detail.removeValue(QContactAddress::FieldSubTypes))
-                contact.saveDetail(&detail);
-        }
-        else if (detail.definitionName() == QContactAnniversary::DefinitionName)
-        {
-            QContactAnniversary annivDetail = static_cast<QContactAnniversary>(detail);
-            
-            // Sub-types not supported
-            if (detail.removeValue(QContactAnniversary::FieldSubType))
-                contact.saveDetail(&detail);
-            
-            // Context not supported
-            if (detail.removeValue(QContactDetail::FieldContext))
-                contact.saveDetail(&detail);
-        }
-        else if (detail.definitionName() == QContactPhoneNumber::DefinitionName)
-        {
-            QContactPhoneNumber phoneDetail = static_cast<QContactPhoneNumber>(detail);
-            
-            if (phoneDetail.subTypes().size() == 0)
-            {
-                // No Sub-type found, set as SubTypeMobile
-                phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile);
-                contact.saveDetail(&phoneDetail);
-            }
-            else if (phoneDetail.subTypes().size() > 0 )
-            {
-                // Sub-types not supported
-                if (phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice)
-                    || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable)
-                    || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVideo))
-                {
-                    // Replace as SubTypeMobile
-                    phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile);
-                    contact.saveDetail(&phoneDetail);
-                }
-            }
-        }
-        else if (detail.definitionName() == QContactUrl::DefinitionName)
-        {
-            QContactUrl urlDetail = static_cast<QContactUrl>(detail);
-            
-            QString stype=QContactUrl::SubTypeHomePage;
-            if (urlDetail.subType().compare(stype) != 0)
-            {
-                detail.removeValue(QContactUrl::FieldSubType);
-                contact.saveDetail(&detail);
-            }
-        }
-    }
-}
-/*
-Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail)
-*/
-void CntServiceHandler::editUpdateExisting(const QString &definitionName, const QString &value)
-{
-    QContactDetail detail;
-    
-    if (definitionName == QContactPhoneNumber::DefinitionName)
-    {
-        QContactPhoneNumber phoneNumber;
-        phoneNumber.setNumber(value);
-        phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
-        detail = phoneNumber;
-    }
-    else if (definitionName == QContactEmailAddress::DefinitionName)
-    {
-        QContactEmailAddress email;
-        email.setEmailAddress(value);
-        detail = email;
-    }
-    else if (definitionName == QContactOnlineAccount::DefinitionName)
-    {
-        QContactOnlineAccount account;
-        account.setAccountUri(value);
-        account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
-        detail = account;
-    }
-    
-    emit launchContactSelection(detail);
-
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-Launch communication launcher view for the contact with the given ID (QContactLocalId -> int)
-*/
-void CntServiceHandler::open(int contactId)
-{
-    QContactManager manager("symbian");
-    QContact contact = manager.contact(contactId);
-
-    emit launchContactCard(contact);
-
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-/*
-Launch temporary communication launcher view with the given detail
-*/
-void CntServiceHandler::open(const QString &definitionName, const QString &value)
-{
-    QContact contact;
-    QContactDetail detail;
-    
-    if (definitionName == QContactPhoneNumber::DefinitionName)
-    {
-        QContactPhoneNumber phoneNumber;
-        phoneNumber.setNumber(value);
-        phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
-        contact.saveDetail(&phoneNumber);
-        detail = phoneNumber;
-    }
-    else if (definitionName == QContactEmailAddress::DefinitionName)
-    {
-        QContactEmailAddress email;
-        email.setEmailAddress(value);
-        contact.saveDetail(&email);
-        detail = email;
-    }
-    else if (definitionName == QContactOnlineAccount::DefinitionName)
-    {
-        QContactOnlineAccount account;
-        account.setAccountUri(value);
-        account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
-        contact.saveDetail(&account);
-        detail = account;
-    }
-    
-    emit launchAssignContactCard(contact, detail);
-
-    mCurrentRequestIndex = setCurrentRequestAsync();
-}
-
-Q_IMPLEMENT_USER_METATYPE(CntServicesContact)
-Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
--- a/phonebookui/phonebookservices/src/cntservicemainwindow.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "cntservicemainwindow.h"
-#include "cntservicehandler.h"
-#include "cntserviceviewmanager.h"
-#include "cntviewnavigator.h"
-
-CntServiceMainWindow::CntServiceMainWindow(CntServiceHandler *handler, QWidget *parent):
-    CntMainWindow(parent, noView),
-    mServiceHandler(handler),
-    mServiceViewManager(0)
-{   
-    CntViewNavigator* navigator = new CntViewNavigator( this );
-    navigator->addException( serviceEditView, noView );
-
-    mServiceViewManager = new CntServiceViewManager(this, mServiceHandler);
-    mServiceViewManager->setViewNavigator( navigator );
-}
-
-CntServiceMainWindow::~CntServiceMainWindow()
-{
-    delete mServiceViewManager;
-    mServiceViewManager = 0;
-    delete mServiceHandler;
-    mServiceHandler = 0;
-}
-
-// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntserviceprovideredit.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This class offers contact viewing UI services.
+ *
+ */
+
+#include "cntserviceprovideredit.h"
+#include "cntservices.h"
+#include "cntservicestrings.h"
+#include "cntdebug.h"
+
+#include <qapplication.h>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServiceProviderEdit::CntServiceProviderEdit(CntServices& aServices, QObject *parent):
+    XQServiceProvider(QLatin1String(KCntServiceInterfaceEdit), parent),
+    mServices(aServices),
+    mCurrentRequestIndex(0)
+{
+    CNT_ENTRY
+    publishAll();
+    connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp()));
+    CNT_EXIT
+}
+
+CntServiceProviderEdit::~CntServiceProviderEdit()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+void CntServiceProviderEdit::editCreateNew(const QString& definitionName, const QString& value)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNew( definitionName, value, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::editCreateNew(const QString& definitionName, const QString& value, const QString &subType)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNew( definitionName, value, subType, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::editCreateNewFromVCard(const QString &vCardFile)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNewFromVCard( vCardFile, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::editExisting(int contactId)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editExisting( contactId, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::editUpdateExisting(const QString &definitionName, const QString &value)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editUpdateExisting( definitionName, value, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::editUpdateExisting(const QString &definitionName, const QString &value, const QString &subType)
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editUpdateExisting( definitionName, value, subType, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderEdit::CompleteServiceAndCloseApp(const QVariant& retValue)
+    {
+    CNT_ENTRY
+    connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    if ( mCurrentRequestIndex != 0 )
+        {
+        const bool success = completeRequest(mCurrentRequestIndex, retValue);
+        if ( !success )
+        {
+            CNT_LOG_ARGS("Failed to complete highway request.");
+        }
+        mCurrentRequestIndex = 0;
+        }
+    CNT_EXIT
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntserviceproviderfetch.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "cntserviceproviderfetch.h"
+#include "cntservices.h"
+#include "cntservicestrings.h"
+#include "cntdebug.h"
+
+#include <qapplication.h>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServiceProviderFetch::CntServiceProviderFetch(CntServices& aServices, QObject *parent):
+    XQServiceProvider(QLatin1String(KCntServiceInterfaceFetch), parent),
+    mServices(aServices),
+    mCurrentRequestIndex(0)
+{
+    CNT_ENTRY
+    publishAll();
+    connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp()));
+    CNT_EXIT
+}
+
+CntServiceProviderFetch::~CntServiceProviderFetch()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+void CntServiceProviderFetch::multiFetch(const QString &title, const QString &action )
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.multiFetch( title, action, *this );
+    CNT_EXIT
+}
+
+void CntServiceProviderFetch::singleFetch(const QString &title, const QString &action )
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.singleFetch( title, action, *this );
+    CNT_EXIT
+}
+
+void CntServiceProviderFetch::CompleteServiceAndCloseApp(const QVariant& retValue)
+{
+    CNT_ENTRY
+    if ( mCurrentRequestIndex != 0 )
+    {
+        connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+        const bool success = completeRequest(mCurrentRequestIndex, retValue);
+        if ( !success )
+        {
+            CNT_LOG_ARGS("Failed to complete highway request.");
+        }
+        mCurrentRequestIndex = 0;
+    }
+    CNT_EXIT
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntserviceproviderold.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "cntserviceproviderold.h"
+#include "cntservices.h"
+#include "cntdebug.h"
+
+#include <qapplication.h>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServiceProviderOld::CntServiceProviderOld(CntServices& aServices, QObject *parent):
+    XQServiceProvider(QLatin1String("com.nokia.services.phonebookservices.Fetch"), parent),
+    mServices(aServices),
+    mCurrentRequestIndex(0)
+{
+    CNT_ENTRY
+    publishAll();
+    connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp()));
+    CNT_EXIT
+}
+
+CntServiceProviderOld::~CntServiceProviderOld()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+/*!
+Launch fetch service with given parameters. OLD INTERFACE.
+*/
+void CntServiceProviderOld::fetch(const QString &title, const QString &action, const QString& /*filter*/)
+{
+    CNT_ENTRY
+    // Ignore the filter parameter
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.multiFetch( title, action, *this );
+    CNT_EXIT
+}
+
+
+/*
+Launch fetch service with given parameters. Fetching mode is No-select by default. OLD INTERFACE.
+*/
+void CntServiceProviderOld::Dofetch(const QString &title, const QString &action, const QString& /*filter*/, const QString& /*mode*/)
+{
+    CNT_ENTRY
+    // Ignore the filter parameter
+    // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching.
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.singleFetch( title, action, *this );
+    CNT_EXIT
+}
+
+
+/*
+Launch new contact editor with a given detail
+*/
+void CntServiceProviderOld::editCreateNew(const QString& definitionName, const QString& value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false
+    CNT_EXIT
+}
+
+void CntServiceProviderOld::editCreateNew(const QString &vCardFile)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNewFromVCard( vCardFile, *this );
+    CNT_EXIT
+}
+
+
+/*!
+Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail)
+*/
+void CntServiceProviderOld::editUpdateExisting(const QString &definitionName, const QString &value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false
+    CNT_EXIT
+}
+
+
+/*!
+Launch communication launcher view for the contact with the given ID (QContactLocalId -> int)
+*/
+void CntServiceProviderOld::open(int contactId)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchContactCard( contactId, *this );
+    CNT_EXIT
+}
+
+/*!
+  Launch temporary communication launcher view with the given detail.
+*/
+void CntServiceProviderOld::open(const QString &definitionName, const QString &value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type      value = actual field value for prefilling editor
+    CNT_EXIT
+}
+
+
+void CntServiceProviderOld::CompleteServiceAndCloseApp(const QVariant& retValue)
+{
+    CNT_ENTRY
+    connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    if ( mCurrentRequestIndex != 0 )
+    {
+        CNT_LOG_ARGS("next, completing request.")
+        const bool success = completeRequest(mCurrentRequestIndex, retValue);
+        if ( !success )
+        {
+            CNT_LOG_ARGS("Failed to complete highway request.");
+        }
+        mCurrentRequestIndex = 0;
+    }
+    CNT_EXIT
+}
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntserviceproviderold2.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "cntserviceproviderold2.h"
+#include "cntservices.h"
+#include "cntdebug.h"
+
+#include <qapplication.h>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServiceProviderOld2::CntServiceProviderOld2(CntServices& aServices, QObject *parent):
+    XQServiceProvider(QLatin1String("phonebookservices.Fetch"), parent),
+    mServices(aServices),
+    mCurrentRequestIndex(0)
+{
+    CNT_ENTRY
+    publishAll();
+    connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp()));
+    CNT_EXIT
+}
+
+CntServiceProviderOld2::~CntServiceProviderOld2()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+/*!
+Launch fetch service with given parameters. OLD INTERFACE.
+*/
+void CntServiceProviderOld2::fetch(const QString &title, const QString &action, const QString& /*filter*/)
+{
+    CNT_ENTRY
+    // Ignore the filter parameter
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.multiFetch( title, action, *this );
+    CNT_EXIT
+}
+
+
+/*
+Launch fetch service with given parameters. Fetching mode is No-select by default. OLD INTERFACE.
+*/
+void CntServiceProviderOld2::Dofetch(const QString &title, const QString &action, const QString& /*filter*/, const QString& /*mode*/)
+{
+    CNT_ENTRY
+    // Ignore the filter parameter
+    // Ignoring fourth argument, because it's not needed. DoFetch() by old contract is only for single-fetching.
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.singleFetch( title, action, *this );
+    CNT_EXIT
+}
+
+
+/*
+Launch new contact editor with a given detail
+*/
+void CntServiceProviderOld2::editCreateNew(const QString& definitionName, const QString& value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNew( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false
+}
+
+void CntServiceProviderOld2::editCreateNew(const QString &vCardFile)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editCreateNewFromVCard( vCardFile, *this );
+    CNT_EXIT
+}
+
+
+/*!
+Launch contact selection view with a given detail (selecting detail there opens the editor and adds the new detail)
+*/
+void CntServiceProviderOld2::editUpdateExisting(const QString &definitionName, const QString &value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.editUpdateExisting( definitionName, value, *this, false ); // defaultForOnlineAccountIsImpp = false
+    CNT_EXIT
+}
+
+
+/*!
+Launch communication launcher view for the contact with the given ID (QContactLocalId -> int)
+*/
+void CntServiceProviderOld2::open(int contactId)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchContactCard( contactId, *this );
+    CNT_EXIT
+}
+
+/*!
+  Launch temporary communication launcher view with the given detail.
+*/
+void CntServiceProviderOld2::open(const QString &definitionName, const QString &value)
+{
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchTemporaryContactCard( definitionName, value, *this ); // definitionName = field type      value = actual field value for prefilling editor
+    CNT_EXIT
+}
+
+
+void CntServiceProviderOld2::CompleteServiceAndCloseApp(const QVariant& retValue)
+{
+    CNT_ENTRY
+    connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    if ( mCurrentRequestIndex != 0 )
+    {
+        CNT_LOG_ARGS("next, completing request.")
+        const bool success = completeRequest(mCurrentRequestIndex, retValue);
+        if ( !success )
+        {
+            CNT_LOG_ARGS("Failed to complete highway request.");
+        }
+        mCurrentRequestIndex = 0;
+    }
+    CNT_EXIT
+}
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntserviceproviderviewing.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This class offers contact viewing UI services.
+ *
+ */
+
+#include "cntserviceproviderviewing.h"
+#include "cntservices.h"
+#include "cntservicestrings.h"
+#include "cntdebug.h"
+
+#include <qapplication.h>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServiceProviderViewing::CntServiceProviderViewing(CntServices& aServices, QObject *parent):
+    XQServiceProvider(QLatin1String(KCntServiceInterfaceView), parent),
+    mServices(aServices),
+    mCurrentRequestIndex(0)
+{
+    CNT_ENTRY
+    publishAll();
+    connect(this, SIGNAL(clientDisconnected()), &mServices, SLOT(quitApp()));
+    CNT_EXIT
+}
+
+CntServiceProviderViewing::~CntServiceProviderViewing()
+{
+    CNT_ENTRY
+    CNT_EXIT
+}
+
+void CntServiceProviderViewing::openContactCard( int aContactId )
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchContactCard( aContactId, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderViewing::openTemporaryContactCard( QString aFieldName, QString aFieldValue )
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchTemporaryContactCard( aFieldName, aFieldValue, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderViewing::openGroup( int aContactId )
+    {
+    CNT_ENTRY
+    mCurrentRequestIndex = setCurrentRequestAsync();
+    mServices.setQuittable(requestInfo().isEmbedded());
+    mServices.launchGroupMemberView( aContactId, *this );
+    CNT_EXIT
+    }
+
+void CntServiceProviderViewing::CompleteServiceAndCloseApp(const QVariant& retValue)
+    {
+    CNT_ENTRY
+    connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+    if ( mCurrentRequestIndex != 0 )
+    {
+        const bool success = completeRequest(mCurrentRequestIndex, retValue);
+        if ( !success )
+        {
+            CNT_LOG_ARGS("Failed to complete highway request.");
+        }
+        mCurrentRequestIndex = 0;
+    }
+    CNT_EXIT
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/phonebookservices/src/cntservices.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -0,0 +1,557 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "cntservices.h"
+#include "cntglobal.h"
+#include "cntdebug.h"
+#include <cntabstractviewmanager.h>
+#include "cntserviceviewmanager.h"
+#include "cntimageutility.h"
+#include "cntserviceviewparams.h"
+#include <cntservicescontact.h>
+
+#include <hbview.h>
+#include <hblistview.h>
+#include <qversitreader.h>
+#include <qversitcontactimporter.h>
+#include <qversitdocument.h>
+#include <xqserviceprovider.h>
+
+#include <QApplication>
+#include <QPixmap>
+#include <QFile>
+#include <QUrl>
+
+CntServices::CntServices() :
+mViewManager(NULL),
+mCurrentProvider(NULL),
+mIsQuittable(true)
+{
+    CNT_ENTRY
+
+    // Definition names supported in symbian back-end
+    m_definitionNames << QContactName::DefinitionName;
+    m_definitionNames << QContactNickname::DefinitionName;
+    m_definitionNames << QContactPhoneNumber::DefinitionName;
+    m_definitionNames << QContactEmailAddress::DefinitionName;
+    m_definitionNames << QContactAddress::DefinitionName;
+    m_definitionNames << QContactUrl::DefinitionName;
+    m_definitionNames << QContactBirthday::DefinitionName;
+    m_definitionNames << QContactOrganization::DefinitionName;
+    m_definitionNames << QContactSyncTarget::DefinitionName;
+    m_definitionNames << QContactNote::DefinitionName;
+    m_definitionNames << QContactFamily::DefinitionName;
+    m_definitionNames << QContactAvatar::DefinitionName;
+    m_definitionNames << QContactAnniversary::DefinitionName;
+    m_definitionNames << QContactGeoLocation::DefinitionName;
+    m_definitionNames << QContactGender::DefinitionName;
+    m_definitionNames << QContactOnlineAccount::DefinitionName;
+    
+    CNT_EXIT
+}
+
+
+CntServices::~CntServices()
+{
+    CNT_LOG
+}
+
+
+void CntServices::setViewManager( CntAbstractViewManager& aViewManager )
+{
+    CNT_LOG
+    mViewManager = &aViewManager;
+    CntServiceViewManager* srvMng = static_cast<CntServiceViewManager*>(mViewManager);
+    connect(srvMng, SIGNAL(applicationClosed()), this, SLOT(terminateService()));
+}
+
+
+void CntServices::singleFetch(
+    const QString &title, const QString &action,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    CntViewParameters params;
+    params.insert(EViewId, serviceContactFetchView);
+    params.insert(ESelectedAction, action);
+    params.insert(KCntServiceViewParamTitle, title);
+    // SINGLE fetch
+    params.insert(ESelectionMode, HbAbstractItemView::SingleSelection);
+
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+
+void CntServices::multiFetch(
+    const QString &title, const QString &action,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    CntViewParameters params;
+    params.insert(EViewId, serviceContactFetchView);
+    params.insert(ESelectedAction, action);
+    params.insert(KCntServiceViewParamTitle, title);
+    // MULTI fetch
+    params.insert(ESelectionMode, HbAbstractItemView::MultiSelection);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+void CntServices::editCreateNew(const QString &definitionName, const QString &value,
+    CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
+{
+    CNT_ENTRY
+    editCreateNew( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp);
+    CNT_EXIT
+}
+
+void CntServices::editCreateNew(const QString &definitionName, const QString &value, const QString& subType,
+    CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    QContact contact;
+    
+    if (definitionName == QContactPhoneNumber::DefinitionName)
+    {
+        QContactPhoneNumber phoneNumber;
+        phoneNumber.setNumber(value);
+        if (!subType.isEmpty())
+        {
+            phoneNumber.setSubTypes(subType);
+        }
+        else
+        {
+            phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); // Mobile is the default if subtype is not given.
+        }
+         contact.saveDetail(&phoneNumber);
+    }
+    else if (definitionName == QContactEmailAddress::DefinitionName)
+    {
+        QContactEmailAddress email;
+        email.setEmailAddress(value);
+        // Email addresses can't have subtypes.
+        contact.saveDetail(&email);
+    }
+    else if (definitionName == QContactOnlineAccount::DefinitionName)
+    {
+        QContactOnlineAccount account;
+        fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp);
+        contact.saveDetail(&account);
+    }    
+
+    // Launch editor now
+    CntViewParameters params;
+    params.insert(EViewId, serviceEditView);
+    QVariant var;
+    var.setValue(contact);
+    params.insert(ESelectedContact, var);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+
+void CntServices::editCreateNewFromVCard(const QString &vCardFile,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    CntImageUtility imageUtility;
+    QContact contact;
+    QVersitReader reader;
+    QFile file(vCardFile);
+    if (!file.open(QIODevice::ReadOnly))
+        return;
+    reader.setDevice(&file);
+    
+    reader.startReading();
+    reader.waitForFinished();
+    // Use the resulting document(s)...
+    QVersitContactImporter importer;
+    QList<QVersitDocument> versitDocuments = reader.results();
+    if(versitDocuments.count() > 0 
+       && importer.importDocuments(versitDocuments))
+        {
+        QList<QContact> contacts = importer.contacts();
+        if(contacts.count() > 0)
+            contact = contacts.first();
+        }
+    file.close();
+    
+    // Save thumbnail images
+    QList<QContactThumbnail> details = contact.details<QContactThumbnail>();
+    for (int i = 0;i < details.count();i++)
+        {
+        if (!details.at(i).thumbnail().isNull())
+            {
+            QString imagepath;
+            QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail());
+            if(imageUtility.createImage(pixmap,imagepath))
+                {
+                // Update contact detail
+                QContactAvatar detail=details.at(i);
+                detail.setImageUrl(imagepath);
+                contact.saveDetail(&detail);
+                }
+            }
+        }
+    
+    removeNotSupportedDetails(contact);
+    removeNotSupportedFields(contact);
+
+    // Launch editor now
+    CntViewParameters params;
+    params.insert(EViewId, serviceEditView);
+    QVariant var;
+    var.setValue(contact);
+    params.insert(ESelectedContact, var);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+void CntServices::editUpdateExisting(const QString &definitionName, const QString &value,
+    CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
+{
+    CNT_ENTRY
+    editUpdateExisting( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp );
+    CNT_EXIT
+}
+
+void CntServices::editUpdateExisting(const QString &definitionName, const QString &value, const QString& subType,
+    CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    QContactDetail detail;
+    
+    if (definitionName == QContactPhoneNumber::DefinitionName)
+    {
+        QContactPhoneNumber phoneNumber;
+        phoneNumber.setNumber(value);
+        if (!subType.isEmpty())
+        {        
+            phoneNumber.setSubTypes(subType);
+        }
+        else
+        {
+            phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);    
+        }
+        detail = phoneNumber;
+    }
+    else if (definitionName == QContactEmailAddress::DefinitionName)
+    {
+        QContactEmailAddress email;
+        email.setEmailAddress(value);
+        // Email addresses can't have subtypes.
+        detail = email;
+    }
+    else if (definitionName == QContactOnlineAccount::DefinitionName)
+    {
+        QContactOnlineAccount account;
+        fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp);
+        detail = account;
+    }
+
+    CntViewParameters params;
+    params.insert(EViewId, serviceContactSelectionView);
+    QVariant var;
+    var.setValue(detail);
+    params.insert(ESelectedDetail, var);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+void CntServices::editExisting(int contactId,
+CntAbstractServiceProvider& aServiceProvider)
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    // Give parameters for launching editor.
+    CntViewParameters params;
+    params.insert(EViewId, serviceEditView);
+
+    QContact contact = contactManager()->contact(contactId);
+    QVariant varContact;
+    varContact.setValue(contact);
+    params.insert(ESelectedContact, varContact);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+
+void CntServices::launchContactCard(int aContactId,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    QContact contact = contactManager()->contact(aContactId);
+
+    // Launch Contact Card view
+    CntViewParameters params;
+    params.insert(EViewId, serviceContactCardView);
+    QVariant var;
+    var.setValue(contact);
+    params.insert(ESelectedContact, var);
+    mViewManager->changeView( params );
+    CNT_EXIT
+}
+
+
+void CntServices::launchTemporaryContactCard(const QString &definitionName, const QString &value,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    QContact contact;
+    QContactDetail detail;
+    
+    QContactName name;
+    name.setFirstName(hbTrId("txt_phob_list_unknown"));
+    contact.saveDetail(&name);
+    
+    if (definitionName == QContactPhoneNumber::DefinitionName)
+    {
+        QContactPhoneNumber phoneNumber;
+        phoneNumber.setNumber(value);
+        phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
+        contact.saveDetail(&phoneNumber);
+        detail = phoneNumber;
+    }
+    else if (definitionName == QContactEmailAddress::DefinitionName)
+    {
+        QContactEmailAddress email;
+        email.setEmailAddress(value);
+        contact.saveDetail(&email);
+        detail = email;
+    }
+    else if (definitionName == QContactOnlineAccount::DefinitionName)
+    {
+        QContactOnlineAccount account;
+        account.setAccountUri(value);
+        account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
+        contact.saveDetail(&account);
+        detail = account;
+    }
+
+    // Launch the view
+    CntViewParameters params;
+    params.insert(EViewId, serviceAssignContactCardView);
+    QVariant var;
+    var.setValue(contact);
+    params.insert(ESelectedContact, var);
+    QVariant varDetail;
+    varDetail.setValue(detail);
+    params.insert(ESelectedDetail, varDetail);
+    mViewManager->changeView(params);
+    CNT_EXIT
+}
+
+void CntServices::launchGroupMemberView(int aContactId,
+    CntAbstractServiceProvider& aServiceProvider )
+{
+    CNT_ENTRY
+    mCurrentProvider = &aServiceProvider;
+
+    QContact contact = contactManager()->contact(aContactId);
+
+    // Launch Group member view
+    CntViewParameters params;
+    params.insert(EViewId, serviceGroupMemberView);
+    QVariant var;
+    var.setValue(contact);
+    params.insert(ESelectedGroupContact, var);
+    mViewManager->changeView( params );
+    CNT_EXIT
+}
+
+void CntServices::setQuittable(bool quittable)
+{
+    mIsQuittable = quittable;
+}
+
+void CntServices::quitApp()
+{
+    CNT_ENTRY
+   
+    // Only embedded applications should be exited once a client
+    // disconnects. At the moments QtHighWay has unresolved issues
+    // when closing non-embedded applications. Error ou1cimx1#472852
+    // has more info
+    if ( mIsQuittable ) 
+    {
+       qApp->quit();
+    }   
+    CNT_EXIT
+}
+
+void CntServices::removeNotSupportedDetails(QContact& contact)
+{
+    CNT_ENTRY
+    // Check definition map, remove details not supported
+    for (int i=0; i < contact.details().count(); i++)
+    {
+        if (!m_definitionNames.contains(contact.details().at(i).definitionName()))
+        {
+            QContactDetail detail= contact.details().at(i);
+            contact.removeDetail(&detail);
+        }
+    }
+    CNT_EXIT
+}
+
+void CntServices::removeNotSupportedFields(QContact& contact)
+{
+    CNT_ENTRY
+    QList<QContactDetail>   removeList;
+    
+    // Not all fields are supported in symbian back-end
+    // Remove not supported fields
+    for (int i=0; i < contact.details().count(); i++)
+    {
+        QContactDetail detail = contact.details().at(i);
+        if(detail.definitionName() == QContactAddress::DefinitionName)
+        {
+            QContactAddress addrDetail = static_cast<QContactAddress>(detail);
+            
+            // Sub-types not supported
+            if(detail.removeValue(QContactAddress::FieldSubTypes))
+                contact.saveDetail(&detail);
+        }
+        else if(detail.definitionName() == QContactAnniversary::DefinitionName)
+        {
+            QContactAnniversary annivDetail = static_cast<QContactAnniversary>(detail);
+            
+            // Sub-types not supported
+            if(detail.removeValue(QContactAnniversary::FieldSubType))
+                contact.saveDetail(&detail);
+            
+            // Context not supported
+            if(detail.removeValue(QContactDetail::FieldContext))
+                contact.saveDetail(&detail);
+        }
+        else if(detail.definitionName() == QContactPhoneNumber::DefinitionName)
+        {
+            QContactPhoneNumber phoneDetail = static_cast<QContactPhoneNumber>(detail);
+            
+            if(phoneDetail.subTypes().size() > 0 )
+            {
+                // Sub-types not supported
+                if(phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice)
+                   || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable))
+                {
+                    // Default to subtype mobile
+                    QStringList l;
+                    l << QLatin1String(QContactPhoneNumber::SubTypeMobile);
+                    detail.setValue(QContactPhoneNumber::FieldSubTypes, l);
+                    contact.saveDetail(&detail);
+                }
+            }
+        }
+        else if(detail.definitionName() == QContactUrl::DefinitionName)
+        {
+            QContactUrl urlDetail = static_cast<QContactUrl>(detail);
+            
+            QString stype=QContactUrl::SubTypeHomePage;
+            if(urlDetail.subType().compare(stype) != 0)
+            {
+                detail.removeValue(QContactUrl::FieldSubType);
+                contact.saveDetail(&detail);
+            }
+        }
+    }
+    CNT_EXIT
+}
+
+void CntServices::fillOnlineAccount( QContactOnlineAccount& account, const QString& value,
+    const QString& subType, bool defaultForOnlineAccountIsImpp )
+    {
+        // The value should normally consist of two parts:
+        //    <service provider>:<user ID>
+        // for eg. "serviceprovider:jack@serviceprovider.com"
+        QStringList accountDetails = value.split(":");
+        if (accountDetails.count() == 1)
+        {
+            // For some reason it only had one part, so we're assuming it's the user ID.
+            account.setAccountUri(accountDetails.at(0));
+        }
+        else if (accountDetails.count() >= 2)
+        {
+            account.setServiceProvider(accountDetails.at(0));        
+            account.setAccountUri(accountDetails.at(1)); // the user ID
+        }
+
+        if (!subType.isEmpty())
+        {        
+            account.setSubTypes(subType);
+        }
+        else
+        {
+            if (defaultForOnlineAccountIsImpp)
+            {
+                account.setSubTypes( QContactOnlineAccount::SubTypeImpp );
+            }
+            else
+            {
+                account.setSubTypes( QContactOnlineAccount::SubTypeSipVoip );
+            }
+        }
+    }
+
+// This method is inherited from CntAbstractServiceProvider
+void CntServices::CompleteServiceAndCloseApp(const QVariant& retValue)
+{
+    CNT_ENTRY
+    if (  mCurrentProvider )
+    {
+        mCurrentProvider->CompleteServiceAndCloseApp( retValue );
+    }
+    CNT_EXIT
+}
+
+void CntServices::terminateService()
+{
+    CNT_ENTRY
+    if (  mCurrentProvider )
+    {
+        // Complete the service with KCntServicesTerminated return value
+        QVariant var(KCntServicesTerminated);
+        mCurrentProvider->CompleteServiceAndCloseApp( var );
+    }
+    CNT_EXIT
+}
+
+QContactManager* CntServices::contactManager()
+{
+    if ( mViewManager )
+        return mViewManager->contactManager(SYMBIAN_BACKEND);
+    return NULL;
+}
+
+Q_IMPLEMENT_USER_METATYPE(CntServicesContact)
+Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
+
--- a/phonebookui/phonebookservices/src/cntservicesubeditview.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-    /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "cntservicesubeditview.h"
-#include "cntservicehandler.h"
-
-CntServiceSubEditView::CntServiceSubEditView(CntServiceHandler *aServiceHandler) : CntEditView(),
-mServiceHandler(aServiceHandler)
-{   
-
-}
-
-CntServiceSubEditView::~CntServiceSubEditView()
-{
-
-}
-    
-///*!
-//Saves the contact
-//*/
-//void CntServiceSubEditView::aboutToCloseView()
-//{
-//    // save contact if there is one
-//    if (contact())
-//    {
-//        contactManager()->saveContact(contact());
-//    }
-//    
-//    CntViewParameters viewParameters;
-//    QVariant var;
-//    var.setValue(*contact());
-//    viewParameters.insert(ESelectedContact, var);
-//    viewManager()->back(viewParameters);
-//}
-//
-///*!
-//Cancel all changes made and return to comm launcher view
-//*/
-//void CntServiceSubEditView::discardAllChanges()
-//{
-//    QContact oldContact = contactManager()->contact(contact()->localId());
-//    
-//    CntViewParameters viewParameters;
-//    QVariant var;
-//    var.setValue(oldContact);
-//    viewParameters.insert(ESelectedContact, var);
-//    viewManager()->back(viewParameters);
-//}
-//
-///*
-//Handle signals emitted from CntCommands, only used for delete command for now.
-//*/
-//int CntServiceSubEditView::handleExecutedCommand(QString aCommand, const QContact &aContact)
-//{
-//    Q_UNUSED(aContact);
-//    int result = -1;
-//    if (aCommand == "delete")
-//    {
-//        connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-//        mServiceHandler->completeEdit(result);
-//        result = 0;
-//    }
-//    return result;
-//}
-
-// EOF
--- a/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntserviceviewfactory.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -17,16 +17,20 @@
 
 #include "cntserviceviewfactory.h"
 #include "cntabstractview.h"
+
+
 #include "cntserviceeditview.h"
-#include "cntservicesubeditview.h"
+#include "cntservicecontactselectionview.h"
+
+#include "cntservicecontactcardview.h"
+#include "cntservicegroupmemberview.h"
 #include "cntservicecontactfetchview.h"
-#include "cntservicecontactselectionview.h"
-#include "cntservicecontactcardview.h"
 #include "cntserviceassigncontactcardview.h"
 
-CntServiceViewFactory::CntServiceViewFactory(CntServiceHandler* aHandler) : 
+
+CntServiceViewFactory::CntServiceViewFactory( CntAbstractServiceProvider& aServiceProvider ) : 
 CntDefaultViewFactory(),
-mService( aHandler )
+mProvider( aServiceProvider )
 {
 }
 
@@ -38,26 +42,26 @@
 {
     switch ( aViewId )
     {
-    // contact fetch service view (fetching contacts from for example messaging)
+    // contact fetch service view (for eg. requested by messaging)
     case serviceContactFetchView:
-        return new CntServiceContactFetchView( mService );
-    
+        return new CntServiceContactFetchView( mProvider );
+
     // contact selection service view (selecting contact to edit when updating existing contact)
     case serviceContactSelectionView:
-        return new CntServiceContactSelectionView( mService );
+        return new CntServiceContactSelectionView( mProvider );
             
     case serviceEditView:
-        return new CntServiceEditView( mService );
-        
-    case serviceSubEditView:
-        return new CntServiceSubEditView( mService );
-    
+        return new CntServiceEditView( mProvider );
+
     case serviceContactCardView:
-        return new CntServiceContactCardView( mService );
+        return new CntServiceContactCardView( mProvider );
             
     case serviceAssignContactCardView:
-        return new CntServiceAssignContactCardView( mService );
+        return new CntServiceAssignContactCardView( mProvider );
         
+    case serviceGroupMemberView:
+        return new CntServiceGroupMemberView( mProvider );
+
     default:
         return CntDefaultViewFactory::createView( aViewId );
     }
--- a/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntserviceviewmanager.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,40 +16,18 @@
 */
 
 #include "cntserviceviewmanager.h"
-
-#include "cntservicehandler.h"
-
-#include "cntservicecontactfetchview.h"
-#include "cntservicecontactselectionview.h"
-#include "cntserviceeditview.h"
-#include "cntservicecontactcardview.h"
-#include "cntservicesubeditview.h"
-#include "cntserviceassigncontactcardview.h"
 #include "cntserviceviewfactory.h"
 
-#include <hbabstractitemview.h>
 /*!
 Constructor
 */
-CntServiceViewManager::CntServiceViewManager(HbMainWindow *mainWindow, CntServiceHandler *aHandler):
-    CntDefaultViewManager(mainWindow),
-    mServiceHandler(aHandler)
-{
-    
-    setViewFactory( new CntServiceViewFactory(mServiceHandler) );
-    connect(mServiceHandler, SIGNAL(launchFetch(const QString&, const QString&, const QString&)), 
-            this, SLOT(handleFetch(const QString&, const QString&, const QString&)));
-    
-    // Handles signal with mode selected.
-    connect(mServiceHandler, SIGNAL(launchFetchVerified(const QString&, const QString&, const QString&, const QString&)), 
-            this, SLOT(launchFetch(const QString&, const QString&, const QString&, const QString&)));
-    
-    connect(mServiceHandler, SIGNAL(launchEditor(QContact)), this, SLOT(launchEditor(QContact)));
-    connect(mServiceHandler, SIGNAL(launchContactSelection(QContactDetail)), this, SLOT(launchContactSelection(QContactDetail)));
-    connect(mServiceHandler, SIGNAL(launchContactCard(QContact)), this, SLOT(launchContactCard(QContact)));
-    connect(mServiceHandler, SIGNAL(launchAssignContactCard(QContact, QContactDetail)), this, 
-            SLOT(launchAssignContactCard(QContact, QContactDetail)));
-}
+CntServiceViewManager::CntServiceViewManager( HbMainWindow *mainWindow,
+    CntAbstractServiceProvider& aProvider ):
+    CntDefaultViewManager(mainWindow)
+    {
+    // ownership of the factory is given to the base class.
+    setViewFactory( new CntServiceViewFactory( aProvider ) );
+    }
 
 /*!
 Destructor
@@ -61,91 +39,9 @@
 
 void CntServiceViewManager::closeApp()
 {
-    // quit happens when returnValueDelivered signal is returned
-    // from service handler, see constructor.
-}
-
-/*!
-Launch fetch service view.
-*/
-void CntServiceViewManager::handleFetch(const QString &title, const QString &action, const QString &filter)
-{
-    launchFetch(title,action,filter);
-}
-
-/*!
-Launch fetch service view. Uses a mode to determine fetching type.
-*/
-void CntServiceViewManager::launchFetch(const QString &title, const QString &action, const QString &filter, const QString &mode)
-{
-    CntViewParameters params;
-    params.insert(EViewId, serviceContactFetchView);
-    params.insert(CntServiceHandler::EAction, action);
-    params.insert(CntServiceHandler::EFilter, filter);
-    params.insert(CntServiceHandler::ETitle, title);
-
-    if (!mode.compare(KCntSingleSelectionMode, Qt::CaseSensitive)) {
-        params.insert(ESelectionMode, HbAbstractItemView::SingleSelection);
-    }
-    else {
-        params.insert(ESelectionMode, HbAbstractItemView::MultiSelection);
-    }
-    changeView(params);
-}
-
-/*!
-Launch editor service view
-*/
-void CntServiceViewManager::launchEditor(QContact contact)
-{
-    CntViewParameters params;
-    params.insert(EViewId, serviceEditView);
-    QVariant var;
-    var.setValue(contact);
-    params.insert(ESelectedContact, var);
-    changeView(params);
-}
-
-/*!
-Launch contact selection service view (update existing contact with detail)
-*/
-void CntServiceViewManager::launchContactSelection(QContactDetail detail)
-{
-    CntViewParameters params;
-    params.insert(EViewId, serviceContactSelectionView);
-    QVariant var;
-    var.setValue(detail);
-    params.insert(ESelectedDetail, var);
-    changeView(params);
-}
-
-/*!
-Launch contact card service view
-*/
-void CntServiceViewManager::launchContactCard(QContact contact)
-{
-    CntViewParameters params;
-    params.insert(EViewId, serviceContactCardView);
-    QVariant var;
-    var.setValue(contact);
-    params.insert(ESelectedContact, var);
-    changeView(params);
-}
-
-/*!
-Launch assign (temporary) contact card service view
-*/
-void CntServiceViewManager::launchAssignContactCard(QContact contact, QContactDetail detail)
-{
-    CntViewParameters params;
-    params.insert(EViewId, serviceAssignContactCardView);
-    QVariant var;
-    var.setValue(contact);
-    params.insert(ESelectedContact, var);
-    QVariant varDetail;
-    varDetail.setValue(detail);
-    params.insert(ESelectedDetail, varDetail);
-    changeView(params);
+    // Quit happens when returnValueDelivered signal from XQServiceProver
+    // is caught from service handler.
+    emit applicationClosed();
 }
 
 // end of file
--- a/phonebookui/phonebookservices/src/main.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/src/main.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -16,13 +16,26 @@
 */
 
 #include <hbapplication.h>
+#include <hbmainwindow.h>
 #include <QTranslator>
 #include <QLocale>
-#include "cntservicemainwindow.h"
-#include "cntservicehandler.h"
+#include "cntserviceproviderold.h"
+#include "cntserviceproviderold2.h"
+#include "cntserviceproviderfetch.h"
+#include "cntserviceproviderold2.h"
+#include "cntserviceproviderviewing.h"
+#include "cntserviceprovideredit.h"
+#include "cntservices.h"
+#include "cntserviceviewmanager.h"
+#include "cntviewnavigator.h"
+#include "cntkeygrabber.h"
+#include "cntdebug.h"
+#include <cntviewparams.h>
 
 int main(int argc, char **argv)
 {
+    qInstallMsgHandler(MSG_HANDLER);
+    
     HbApplication a( argc, argv );
 
     QTranslator translator;
@@ -30,9 +43,32 @@
     QString path = "z:/resource/qt/translations/";
     translator.load(path + "contacts_" + lang);
     a.installTranslator(&translator);
-    
-    CntServiceHandler *handler = new CntServiceHandler();
-    CntServiceMainWindow mainWindow(handler);
+
+    HbMainWindow mainWindow;
+    CntKeyGrabber *keyGrabber = new CntKeyGrabber(&mainWindow, &mainWindow);
+
+    CntViewNavigator* navigator = new CntViewNavigator( &mainWindow );
+    navigator->addException( serviceEditView, noView );
+    navigator->addEffect( serviceContactCardView, historyView );
+    navigator->addEffect( historyView, serviceContactCardView );
+
+    // This object actually executes the services
+    CntServices* services = new CntServices();
+    services->setParent( &mainWindow ); // for ownership
+
+    CntServiceViewManager* viewManager = new CntServiceViewManager(
+        &mainWindow,
+        *services ); // as CntAbstractServiceProvider
+    viewManager->setViewNavigator( navigator );
+
+    services->setViewManager( *viewManager );
+
+    // These objects talk with QT Highway (send/receive)
+    CntServiceProviderOld* serviceProviderOld = new CntServiceProviderOld( *services, &mainWindow ); // com.nokia.services.phonebookservices.Fetch
+    CntServiceProviderOld2* serviceProviderOld2 = new CntServiceProviderOld2( *services, &mainWindow ); // phonebookservices.Fetch
+    CntServiceProviderFetch* serviceProviderFetch = new CntServiceProviderFetch( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactFetch
+    CntServiceProviderViewing* serviceProviderViewing = new CntServiceProviderViewing( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactView
+    CntServiceProviderEdit* serviceProviderEdit = new CntServiceProviderEdit( *services, &mainWindow ); // phonebookservices.com.nokia.symbian.IContactEdit
 
     mainWindow.show();
 
--- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/main.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -88,6 +88,14 @@
     mainLayout->addItem(button, row, 1);
     row++;
 
+    button = new HbPushButton("Edit create new - number with subtype");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_numberWithSubtype()));
+    mainLayout->addItem(button, row, 0);
+    button = new HbPushButton("old");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_numberWithSubtype_old()));
+    mainLayout->addItem(button, row, 1);
+    row++;    
+    
     button = new HbPushButton("Edit create new - email");
     QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_email()));
     mainLayout->addItem(button, row, 0);
@@ -104,6 +112,14 @@
     mainLayout->addItem(button, row, 1);
     row++;
 
+    button = new HbPushButton("Edit create new - onlineAccount with subtype");
+    bool res = QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_onlineAccountWithSubtype()));
+    mainLayout->addItem(button, row, 0);
+    button = new HbPushButton("old");
+    res = QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditCreateNew_onlineAccountWithSubtype_old()));
+    mainLayout->addItem(button, row, 1);
+    row++;
+    
     button = new HbPushButton("Launch editor with vCard");
     QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditorVCard()));
     mainLayout->addItem(button, row, 0);
@@ -121,6 +137,14 @@
     QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_number_old()));
     mainLayout->addItem(button, row, 1);
     row++;
+    
+    button = new HbPushButton("Edit/update existing - number with subtype");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_numberWithSubtype()));
+    mainLayout->addItem(button, row, 0);
+    button = new HbPushButton("old");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_numberWithSubtype_old()));
+    mainLayout->addItem(button, row, 1);
+    row++;
 
     button = new HbPushButton("Edit/update existing - email");
     QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_email()));
@@ -138,6 +162,14 @@
     mainLayout->addItem(button, row, 1);
     row++;
 
+    button = new HbPushButton("Edit/update existing - onlineAccount with subtype");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_onlineAccountWithSubtype()));
+    mainLayout->addItem(button, row, 0);
+    button = new HbPushButton("old");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchEditUpdateExisting_onlineAccountWithSubtype_old()));
+    mainLayout->addItem(button, row, 1);
+    row++;
+    
     // CONTACT CARD ==========================================================
 
     button = new HbPushButton("Launch contact card");
@@ -172,6 +204,13 @@
     mainLayout->addItem(button, row, 1);
     row++;
     
+    // Launch - Group Member View ==========================================================
+    
+    button = new HbPushButton("Launch group member view");
+    QObject::connect(button, SIGNAL(pressed()), service, SLOT(launchGroupMemberView()));
+    mainLayout->addItem(button, row, 0);
+    row++;
+    
     QGraphicsWidget *graphicsWidget = new QGraphicsWidget();
     graphicsWidget->setLayout(mainLayout);
     HbScrollArea *scrollArea = new HbScrollArea();
--- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp	Wed Aug 18 09:39:00 2010 +0300
@@ -28,16 +28,17 @@
 #include <hbview.h>
 #include <QGraphicsLinearLayout>
 #include <QDebug>
+#include <HbAction>
 
 #include "cntdebug.h"
 
 
-testPbkServices::testPbkServices(HbMainWindow *aParent)
+testPbkServices::testPbkServices(HbMainWindow *aParent) :
+mRequest(NULL),
+mMainWindow(aParent),
+mPopup(NULL)
 {
-    mRequest=NULL;
-    mMainWindow=aParent;
     setParent(aParent);
-
 }
 
 testPbkServices::~testPbkServices()
@@ -138,6 +139,28 @@
     CNT_EXIT
 }
 
+void testPbkServices::launchEditCreateNew_numberWithSubtype()
+{
+    CNT_ENTRY
+    launchEditCreateNew(
+        true,                                // aNewInterface
+        QContactPhoneNumber::DefinitionName, // aDetailType
+        "1234567",                           // aFieldContent
+        QContactPhoneNumber::SubTypeLandline); //aDetailSubtype
+    CNT_EXIT
+}
+
+void testPbkServices::launchEditCreateNew_numberWithSubtype_old()
+{
+    CNT_ENTRY
+    launchEditCreateNew(
+        false,                               // aNewInterface
+        QContactPhoneNumber::DefinitionName, // aDetailType
+        "1234567",                          // aFieldContent
+        QContactPhoneNumber::SubTypeLandline); //aDetailSubtype
+    CNT_EXIT
+}
+
 void testPbkServices::launchEditCreateNew_email()
 {
     CNT_ENTRY
@@ -178,6 +201,28 @@
     CNT_EXIT
 }
 
+void testPbkServices::launchEditCreateNew_onlineAccountWithSubtype()
+{
+    CNT_ENTRY
+    launchEditCreateNew(
+        true,                                  // aNewInterface
+        QContactOnlineAccount::DefinitionName, // aDetailType
+        "provider:account@provider.com",                // aFieldContent
+        QContactOnlineAccount::SubTypeImpp); // aDetailSubtype
+    CNT_EXIT
+}
+
+void testPbkServices::launchEditCreateNew_onlineAccountWithSubtype_old()
+{
+    CNT_ENTRY
+    launchEditCreateNew(
+        false,                                  // aNewInterface
+        QContactOnlineAccount::DefinitionName, // aDetailType
+        "provider:account@provider.com",                // aFieldContent
+        QContactOnlineAccount::SubTypeImpp); // aDetailSubtype
+    CNT_EXIT
+}
+
 void testPbkServices::launchEditorVCard()
 {
     CNT_ENTRY
@@ -214,6 +259,28 @@
     CNT_EXIT
 }
 
+void testPbkServices::launchEditUpdateExisting_numberWithSubtype()
+{
+    CNT_ENTRY
+    launchEditUpdateExisting(
+        true,                                // aNewInterface
+        QContactPhoneNumber::DefinitionName, // aDetailType
+        "1234567",                           // aDetailValue
+        QContactPhoneNumber::SubTypeLandline);// aDetailSubtype 
+    CNT_EXIT
+}
+
+void testPbkServices::launchEditUpdateExisting_numberWithSubtype_old()
+{
+    CNT_ENTRY
+    launchEditUpdateExisting(
+        false,                               // aNewInterface
+        QContactPhoneNumber::DefinitionName, // aDetailType
+        "1234567",                           // aDetailValue
+        QContactPhoneNumber::SubTypeLandline);// aDetailSubtype    
+    CNT_EXIT
+}
+
 void testPbkServices::launchEditUpdateExisting_email()
 {
     CNT_ENTRY
@@ -254,6 +321,28 @@
     CNT_EXIT
 }
 
+void testPbkServices::launchEditUpdateExisting_onlineAccountWithSubtype()
+{
+    CNT_ENTRY
+    launchEditUpdateExisting(
+        true,                                  // aNewInterface
+        QContactOnlineAccount::DefinitionName, // aDetailType
+        "provider:account@provider.com",       // aDetailValue
+        QContactOnlineAccount::SubTypeImpp); // aDetailSubtype              
+    CNT_EXIT
+}
+
+void testPbkServices::launchEditUpdateExisting_onlineAccountWithSubtype_old()
+{
+    CNT_ENTRY
+    launchEditUpdateExisting(
+        false,                                 // aNewInterface
+        QContactOnlineAccount::DefinitionName, // aDetailType
+        "provider:account@provider.com",       // aDetailValue
+        QContactOnlineAccount::SubTypeImpp); // aDetailSubtype    
+    CNT_EXIT
+}
+
 void testPbkServices::launchContactCard()
 {
     CNT_ENTRY
@@ -331,6 +420,67 @@
     CNT_EXIT
 }
 
+void testPbkServices::launchGroupMemberView()
+{
+    CNT_ENTRY
+    delete mRequest;
+    mRequest=0;
+
+    // save test contact
+    QContactManager mgr("symbian");
+    QContact contact;
+    QContactName name;
+    QContactPhoneNumber number;
+    
+    name.setFirstName("Test_Contact");
+    number.setNumber("0202223344");
+    contact.saveDetail(&name);
+    contact.saveDetail(&number);
+    mgr.saveContact(&contact);
+    
+    // save test group
+    QString text("Work");
+    QContact groupContact;
+    groupContact.setType(QContactType::TypeGroup);
+    QContactName groupName;
+    groupName.setCustomLabel(text);
+    groupContact.saveDetail(&groupName);
+    mgr.saveContact(&groupContact);
+    QContactRelationship relationship;
+    relationship.setRelationshipType(QContactRelationship::HasMember);
+    relationship.setFirst(groupContact.id());
+    relationship.setSecond(contact.id());
+    // Save relationship
+    mgr.saveRelationship(&relationship);
+    
+    // get contact id
+    int id = groupContact.id().localId();
+        
+    QVariantList args; 
+    XQApplicationManager appMng;
+    QString interface("com.nokia.symbian.IContactsView");
+    QString operation("openGroup(int)");
+    // interface name is not needed
+    mRequest = appMng.create( interface, operation, true); // embedded 
+    if ( mRequest )
+    {    
+        CNT_LOG_ARGS("Request created.")
+        // Result handlers 
+        connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&)));
+        
+        args << id;
+        
+        mRequest->setArguments(args); 
+        mRequest->send();
+        CNT_LOG_ARGS("Request sent.")
+    }
+    else
+    {
+        CNT_LOG_ARGS("Failed to create request")
+    }
+    CNT_EXIT
+}
+
 void testPbkServices::onEditCompleted(const QVariant& value)
 {
     CNT_ENTRY
@@ -396,26 +546,26 @@
             listWidget->addItem( contactId );
 
             }
-            HbDialog *popup = new HbDialog();
-            popup->setAttribute(Qt::WA_DeleteOnClose, true);
+            mPopup = new HbDialog();
+            mPopup->setAttribute(Qt::WA_DeleteOnClose, true);
 
             // Set dismiss policy that determines what tap events will cause the popup
             // to be dismissed
-            popup->setDismissPolicy(HbDialog::NoDismiss);
+            mPopup->setDismissPolicy(HbDialog::NoDismiss);
+            mPopup->setModal(true);
 
             // Set the label as heading widget
-            popup->setHeadingWidget(new HbLabel(tr("Contact")));
+            mPopup->setHeadingWidget(new HbLabel(tr("Contact")));
 
             // Set a list widget as content widget in the popup
-            popup->setContentWidget(listWidget);
-
-            // Sets the primary action and secondary action
-            //popup.setPrimaryAction(new HbAction(tr("Ok"),&popup));
-            //popup.setSecondaryAction(new HbAction(tr("Cancel"),&popup));
+            mPopup->setContentWidget(listWidget);
+            
+            // Add an OK action to dismiss the popup
+            HbAction *okAction = new HbAction(tr("Ok"), mPopup);
+            mPopup->addAction(okAction);
 
             // Launch popup asyncronously
-            popup->setTimeout(15000);
-            popup->open();
+            mPopup->open();
     }
     CNT_EXIT
 }
@@ -431,8 +581,8 @@
     XQApplicationManager appMng;
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactFetch"); 
-        QString operation("multiFetch(QString,QString,QString)");
+        QString interface("com.nokia.symbian.IContactsFetch"); 
+        QString operation("multiFetch(QString,QString)");
         // There are two kinds of create() methods in XQApplicationManager. The one with four arguments
         // takes the service name also. The one with three arguments (used below) does not take the service name.
         // The interface name is enough for finding the correct provider at run time.
@@ -477,8 +627,8 @@
     XQApplicationManager appMng;
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactFetch"); 
-        QString operation("singleFetch(QString,QString,QString)");
+        QString interface("com.nokia.symbian.IContactsFetch"); 
+        QString operation("singleFetch(QString,QString)");
         // There are two kinds of create() methods in XQApplicationManager. The one with four arguments
         // takes the service name also. The one with three arguments (used below) does not take the service name.
         // The interface name is enough for finding the correct provider at run time.
@@ -517,7 +667,7 @@
     CNT_EXIT
 }
 
-void testPbkServices::launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent )
+void testPbkServices::launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent, QString aDetailSubtype )
 {
     CNT_ENTRY
     delete mRequest;
@@ -526,9 +676,14 @@
     QVariantList args; 
     XQApplicationManager appMng;
     QString operation("editCreateNew(QString,QString)");
+    if ( !aDetailSubtype.isEmpty() )
+    {
+        operation = "editCreateNew(QString,QString,QString)";
+    }
+    
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactFetch"); 
+        QString interface("com.nokia.symbian.IContactsFetch"); 
         // service name is not needed
         mRequest = appMng.create( interface, operation, true); // embedded
     }
@@ -548,6 +703,10 @@
         
         args << aDetailType;
         args << aFieldContent;
+        if ( !aDetailSubtype.isEmpty() )
+        {
+            args << aDetailSubtype;
+        }
         
         mRequest->setArguments(args); 
         mRequest->send();
@@ -570,7 +729,7 @@
     XQApplicationManager appMng;
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactEdit"); 
+        QString interface("com.nokia.symbian.IContactsEdit"); 
         QString operation("editCreateNewFromVCard(QString)");
         // service name is not needed
         mRequest = appMng.create( interface, operation, true); // embedded 
@@ -603,7 +762,7 @@
     CNT_EXIT
 }
 
-void testPbkServices::launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue )
+void testPbkServices::launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue, QString aDetailSubtype )
 {
     CNT_ENTRY
     delete mRequest;
@@ -612,9 +771,14 @@
     QVariantList args; 
     XQApplicationManager appMng;
     QString operation("editUpdateExisting(QString,QString)");
+    if ( !aDetailSubtype.isEmpty() )
+    {
+        operation = "editUpdateExisting(QString,QString,QString)";
+    }
+        
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactEdit");
+        QString interface("com.nokia.symbian.IContactsEdit");
         // service name is not needed
         mRequest = appMng.create(interface, operation, true); // embedded 
     }
@@ -633,6 +797,10 @@
         
         args << aDetailType;
         args << aDetailValue;
+        if ( !aDetailSubtype.isEmpty() )
+        {
+            args << aDetailSubtype;
+        }
         
         mRequest->setArguments(args); 
         mRequest->send();
@@ -670,7 +838,7 @@
     XQApplicationManager appMng;
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactView");
+        QString interface("com.nokia.symbian.IContactsView");
         QString operation("openContactCard(int)");
         // interface name is not needed
         mRequest = appMng.create( interface, operation, true); // embedded 
@@ -711,8 +879,8 @@
     XQApplicationManager appMng;
     if ( aNewInterface )
     {
-        QString interface("com.nokia.symbian.IContactView");
-        QString operation("openContactCard(QString,QString)");
+        QString interface("com.nokia.symbian.IContactsView");
+        QString operation("openTemporaryContactCard(QString,QString)");
         // service name is not needed
         mRequest = appMng.create(interface, operation, true); // embedded 
     }
--- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h	Wed Aug 18 09:39:00 2010 +0300
@@ -25,6 +25,8 @@
 #include <xqappmgr.h>
 
 class HbMainWindow;
+class HbAction;
+class HbDialog;
 
 /**
  * Launches phonebookservices highway services, for functional testing.
@@ -47,20 +49,28 @@
     // EDIT - create new
     void launchEditCreateNew_number();
     void launchEditCreateNew_number_old();
+    void launchEditCreateNew_numberWithSubtype();
+    void launchEditCreateNew_numberWithSubtype_old();    
     void launchEditCreateNew_email();
     void launchEditCreateNew_email_old();
     void launchEditCreateNew_onlineAccount();
     void launchEditCreateNew_onlineAccount_old();
+    void launchEditCreateNew_onlineAccountWithSubtype();
+    void launchEditCreateNew_onlineAccountWithSubtype_old();
     void launchEditorVCard();
     void launchEditorVCard_old();
 
     // EDIT - update existing
     void launchEditUpdateExisting_number();
     void launchEditUpdateExisting_number_old();
+    void launchEditUpdateExisting_numberWithSubtype();
+    void launchEditUpdateExisting_numberWithSubtype_old();    
     void launchEditUpdateExisting_email();
     void launchEditUpdateExisting_email_old();
     void launchEditUpdateExisting_onlineAccount();
     void launchEditUpdateExisting_onlineAccount_old();
+    void launchEditUpdateExisting_onlineAccountWithSubtype();
+    void launchEditUpdateExisting_onlineAccountWithSubtype_old();
 
     // CONTACT CARD
     void launchContactCard();
@@ -71,6 +81,9 @@
     void launchContactCardEmail_old();
     void launchContactCardOnlineAccount();
     void launchContactCardOnlineAccount_old();
+    
+    // GROUP MEMBER VIEW
+    void launchGroupMemberView();
 
     void onEditCompleted(const QVariant& value);
     void onRequestCompleted(const QVariant& value);
@@ -82,9 +95,9 @@
 private:
     void launchMultiFetch( bool aNewInterface, QString aAction );
     void launchSingleFetch( bool aNewInterface, QString aAction );
-    void launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent );
+    void launchEditCreateNew( bool aNewInterface, QString aDetailType, QString aFieldContent, QString aDetailSubtype = QString() );
     void launchEditorVCard( bool aNewInterface );
-    void launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue );
+    void launchEditUpdateExisting( bool aNewInterface, QString aDetailType, QString aDetailValue, QString aDetailSubtype = QString());
     void launchContactCard( bool aNewInterface );
     void launchContactCard( bool aNewInterface, QString aDetailType, QString aDetailValue );
 
@@ -92,6 +105,7 @@
 
     XQAiwRequest         *mRequest; 
     HbMainWindow         *mMainWindow;
+    HbDialog             *mPopup;
 
 };
 
--- a/phonebookui/rom/phonebook.iby	Tue Jul 06 14:05:47 2010 +0300
+++ b/phonebookui/rom/phonebook.iby	Wed Aug 18 09:39:00 2010 +0300
@@ -30,7 +30,6 @@
 file=ABI_DIR\BUILD_DIR\cntmaptileservice.dll             SHARED_LIB_DIR\cntmaptileservice.dll UNPAGED
 file=ABI_DIR\BUILD_DIR\cntsimutility.dll            		SHARED_LIB_DIR\cntsimutility.dll UNPAGED
 file=ABI_DIR\BUILD_DIR\cntimageutility.dll            	SHARED_LIB_DIR\cntimageutility.dll UNPAGED
-file=ABI_DIR\BUILD_DIR\cntsettingsutility.dll            	SHARED_LIB_DIR\cntsettingsutility.dll UNPAGED
 
 // UI
 file=ABI_DIR\BUILD_DIR\pbkcommonui.dll                	SHARED_LIB_DIR\pbkcommonui.dll UNPAGED
--- a/pimprotocols/pbap/group/bld.inf	Tue Jul 06 14:05:47 2010 +0300
+++ b/pimprotocols/pbap/group/bld.inf	Wed Aug 18 09:39:00 2010 +0300
@@ -14,7 +14,7 @@
 //
 
 PRJ_EXPORTS
-../client/pbapcli.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(pbapcli.h)
+../client/pbapcli.h APP_LAYER_PLATFORM_EXPORT_PATH(pbapcli.h)
 
 pbap.iby  	/epoc32/rom/include/pbap.iby
 
--- a/pimprotocols/phonebooksync/group/BLD.INF	Tue Jul 06 14:05:47 2010 +0300
+++ b/pimprotocols/phonebooksync/group/BLD.INF	Wed Aug 18 09:39:00 2010 +0300
@@ -17,7 +17,7 @@
 
 PRJ_EXPORTS
 ../group/phbksync.iby	        		/epoc32/rom/include/phbksync.iby
-../Client/phbksync.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(phbksync.h)
+../Client/phbksync.h APP_LAYER_PUBLIC_EXPORT_PATH(phbksync.h)
 
 
 PRJ_TESTEXPORTS