--- a/contacts_plat/contacts_ui_api/inc/cntviewparams.h Mon May 03 12:24:20 2010 +0300
+++ b/contacts_plat/contacts_ui_api/inc/cntviewparams.h Fri May 14 15:42:23 2010 +0300
@@ -37,6 +37,7 @@
ESelectedGroupContact,
ESelectedDetail,
ESelectionMode,
+ EMyCard,
ECustomParam = 100
};
@@ -72,6 +73,7 @@
groupMemberView,
groupActionsView,
historyView,
+ importsView,
customPhonebookView = 100, // reserved for internal view plugins, DO NOT USE THESE
customView = 200 // for all other view plugins
};
--- a/phonebookengines/bwins/cntimageutilityu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/bwins/cntimageutilityu.def Fri May 14 15:42:23 2010 +0300
@@ -1,19 +1,22 @@
EXPORTS
- ?trUtf8@CntImageUtility@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString CntImageUtility::trUtf8(char const *, char const *, int)
- ??_ECntImageUtility@@UAE@I@Z @ 2 NONAME ; CntImageUtility::~CntImageUtility(unsigned int)
- ?qt_metacall@CntImageUtility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3 NONAME ; int CntImageUtility::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?staticMetaObject@CntImageUtility@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const CntImageUtility::staticMetaObject
- ?metaObject@CntImageUtility@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * CntImageUtility::metaObject(void) const
- ??1CntImageUtility@@UAE@XZ @ 6 NONAME ; CntImageUtility::~CntImageUtility(void)
- ?initPath@CntImageUtility@@AAEXAAVQString@@H@Z @ 7 NONAME ; void CntImageUtility::initPath(class QString &, int)
- ?trUtf8@CntImageUtility@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString CntImageUtility::trUtf8(char const *, char const *)
- ?tr@CntImageUtility@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString CntImageUtility::tr(char const *, char const *)
- ?getStaticMetaObject@CntImageUtility@@SAABUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const & CntImageUtility::getStaticMetaObject(void)
- ?removeImage@CntImageUtility@@QAE_NABVQString@@AAH@Z @ 11 NONAME ; bool CntImageUtility::removeImage(class QString const &, int &)
- ?qt_metacast@CntImageUtility@@UAEPAXPBD@Z @ 12 NONAME ; void * CntImageUtility::qt_metacast(char const *)
- ?selectDrive@CntImageUtility@@AAEHAAH@Z @ 13 NONAME ; int CntImageUtility::selectDrive(int &)
- ?tr@CntImageUtility@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString CntImageUtility::tr(char const *, char const *, int)
- ?createImage@CntImageUtility@@QAE_NABVQPixmap@@AAVQString@@AAH@Z @ 15 NONAME ; bool CntImageUtility::createImage(class QPixmap const &, class QString &, int &)
- ?createImage@CntImageUtility@@QAE_NABVQString@@AAV2@AAH@Z @ 16 NONAME ; bool CntImageUtility::createImage(class QString const &, class QString &, int &)
- ??0CntImageUtility@@QAE@PAVQObject@@@Z @ 17 NONAME ; CntImageUtility::CntImageUtility(class QObject *)
+ ??_ECntImageUtility@@UAE@I@Z @ 1 NONAME ; CntImageUtility::~CntImageUtility(unsigned int)
+ ?qt_metacall@CntImageUtility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int CntImageUtility::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?staticMetaObject@CntImageUtility@@2UQMetaObject@@B @ 3 NONAME ; struct QMetaObject const CntImageUtility::staticMetaObject
+ ?metaObject@CntImageUtility@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * CntImageUtility::metaObject(void) const
+ ?createImage@CntImageUtility@@QAE_NABVQPixmap@@AAVQString@@@Z @ 5 NONAME ; bool CntImageUtility::createImage(class QPixmap const &, class QString &)
+ ?selectDrive@CntImageUtility@@AAEHAAH@Z @ 6 NONAME ; int CntImageUtility::selectDrive(int &)
+ ?tr@CntImageUtility@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString CntImageUtility::tr(char const *, char const *, int)
+ ?trUtf8@CntImageUtility@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString CntImageUtility::trUtf8(char const *, char const *, int)
+ ??1CntImageUtility@@UAE@XZ @ 9 NONAME ; CntImageUtility::~CntImageUtility(void)
+ ?createImage@CntImageUtility@@QAE_NABVQString@@AAV2@@Z @ 10 NONAME ; bool CntImageUtility::createImage(class QString const &, class QString &)
+ ?trUtf8@CntImageUtility@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString CntImageUtility::trUtf8(char const *, char const *)
+ ?initPath@CntImageUtility@@AAE_NAAVQString@@H@Z @ 12 NONAME ; bool CntImageUtility::initPath(class QString &, int)
+ ?tr@CntImageUtility@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString CntImageUtility::tr(char const *, char const *)
+ ?getStaticMetaObject@CntImageUtility@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & CntImageUtility::getStaticMetaObject(void)
+ ?error@CntImageUtility@@QAE?AW4Error@1@XZ @ 15 NONAME ; enum CntImageUtility::Error CntImageUtility::error(void)
+ ?qt_metacast@CntImageUtility@@UAEPAXPBD@Z @ 16 NONAME ; void * CntImageUtility::qt_metacast(char const *)
+ ?isMassStorageAvailable@CntImageUtility@@QAE_NXZ @ 17 NONAME ; bool CntImageUtility::isMassStorageAvailable(void)
+ ?isImageRemovable@CntImageUtility@@QAE_NABVQString@@@Z @ 18 NONAME ; bool CntImageUtility::isImageRemovable(class QString const &)
+ ??0CntImageUtility@@QAE@PAVQObject@@@Z @ 19 NONAME ; CntImageUtility::CntImageUtility(class QObject *)
+ ?removeImage@CntImageUtility@@QAE_NABVQString@@@Z @ 20 NONAME ; bool CntImageUtility::removeImage(class QString const &)
--- a/phonebookengines/bwins/simutilityu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/bwins/simutilityu.def Fri May 14 15:42:23 2010 +0300
@@ -23,4 +23,6 @@
?getStaticMetaObject@SimUtility@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & SimUtility::getStaticMetaObject(void)
?simInfoReady@SimUtility@@IAEXAAUSimInfo@1@H@Z @ 23 NONAME ; void SimUtility::simInfoReady(struct SimUtility::SimInfo &, int)
?isSimInserted@SimUtility@@ABE_NXZ @ 24 NONAME ; bool SimUtility::isSimInserted(void) const
+ ?adnCacheStatusReady@SimUtility@@IAEXAAW4CacheStatus@1@H@Z @ 25 NONAME ; void SimUtility::adnCacheStatusReady(enum SimUtility::CacheStatus &, int)
+ ?notifyAdnCacheStatus@SimUtility@@QAE_NXZ @ 26 NONAME ; bool SimUtility::notifyAdnCacheStatus(void)
--- a/phonebookengines/cntimageutility/inc/cntimageutility.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/cntimageutility/inc/cntimageutility.h Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,9 @@
#include <qglobal.h>
#include <QObject>
+
+#include <f32file.h>
+
#include "cntimageutilityglobal.h"
class QPixmap;
@@ -28,16 +31,29 @@
Q_OBJECT
public:
+ enum Error {
+ NoError = 0,
+ NotSupportedError,
+ UnspecifiedError,
+ };
+
CntImageUtility(QObject *parent = 0);
~CntImageUtility();
- bool createImage(const QString& filePath, QString& imagePath, int& error);
- bool createImage(const QPixmap& pixmap, QString& imagePath, int& error);
- bool removeImage(const QString& imagePath, int& error);
+ bool createImage(const QString& filePath, QString& imagePath);
+ bool createImage(const QPixmap& pixmap, QString& imagePath);
+ bool removeImage(const QString& imagePath);
+ bool isImageRemovable(const QString& filePath);
+ bool isMassStorageAvailable();
+ CntImageUtility::Error error();
private:
int selectDrive(int &driveIndex);
- void initPath(QString &path, int drive);
+ bool initPath(QString &path, int drive);
+
+private:
+ RFs m_Fs;
+ CntImageUtility::Error m_error;
};
#endif
--- a/phonebookengines/cntimageutility/src/cntimageutility.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/cntimageutility/src/cntimageutility.cpp Fri May 14 15:42:23 2010 +0300
@@ -25,87 +25,117 @@
#include <QPixmap>
#include <QDateTime>
-const char* PBK_FOLDER = "Private\\20022EF9";
+const char* CNT_IMAGES_FOLDER = "Data\\20022EF9\\";
const char* IMAGEFILE_EXT = ".jpg";
const char* IMAGE_TYPE = "JPEG";
-const char* FOLDER_SEPARATOR = "\\";
const TInt64 KMinRequiredSpaceImage = 2000000;
+_LIT( KImagesFolder, "Data\\20022EF9\\");
+
+// Local function
+inline TPtrC16 convertToTPtrC16(const QString& string)
+{
+ return TPtrC16(reinterpret_cast<const TUint16*>(string.utf16()));
+}
+
+
CntImageUtility::CntImageUtility(QObject *parent)
: QObject(parent)
{
+ m_Fs.Connect();
}
CntImageUtility::~CntImageUtility()
{
+ m_Fs.Close();
}
-bool CntImageUtility::createImage(const QString& filePath, QString& imagePath, int& error)
+/*
+ * Create thumbnail image.
+ *
+ * \param filePath The file path of source image.
+ * \param imagePath The file path of new/created image.
+ * \return Success status.
+ */
+bool CntImageUtility::createImage(const QString& filePath, QString& imagePath)
{
- Q_UNUSED(error);
-
int drive;
bool success(false);
+ m_error = CntImageUtility::NoError;
+ int err= selectDrive(drive);
+ if (KErrNone==err
+ && initPath(imagePath, drive)) {
+ // Filename format
+ // image_<yyhh_mm_ss_zzz>.jpg
+ QDateTime dateTime = QDateTime::currentDateTime();
+ QString dateTimeString = dateTime.toString("yyhh_mm_ss_zzz");
+ QFileInfo fi(filePath);
+ QString filename = "image_" + dateTimeString + "." + fi.suffix();
+ imagePath += filename;
+
+ // Copy image
+ QFile destFile;
+ success= destFile.copy(filePath,imagePath);
+ }
+ else {
+ m_error = CntImageUtility::UnspecifiedError;
+ }
+ return success;
+}
+
+/*
+ * Create thumbnail image.
+ *
+ * \param pixmap The pixmap of source image.
+ * \param imagePath The file path of new/created image.
+ * \return Success status.
+ */
+bool CntImageUtility::createImage(const QPixmap& pixmap, QString& imagePath)
+{
+ int drive;
+ bool success(false);
+ m_error = CntImageUtility::NoError;
QString fileExt(IMAGEFILE_EXT);
int err= selectDrive(drive);
- if (KErrNone==err)
- {
- initPath(imagePath, drive);
+ if (KErrNone==err
+ && initPath(imagePath, drive)) {
// Filename format
// image_<yyhh_mm_ss_zzz>.jpg
QDateTime dateTime = QDateTime::currentDateTime();
QString dateTimeString = dateTime.toString("yyhh_mm_ss_zzz");
QString filename = "image_" + dateTimeString + fileExt;
- imagePath += FOLDER_SEPARATOR + filename;
+ imagePath += filename;
- // Copy source image to contacts images
- QFile destFile;
- success= destFile.copy(filePath,imagePath);
+ if(!pixmap.isNull()) {
+ QPixmap pix(pixmap);
+ QImage image(pix.toImage());
+ success= image.save(imagePath, IMAGE_TYPE);
}
+ }
+ else {
+ m_error = CntImageUtility::UnspecifiedError;
+ }
return success;
}
-bool CntImageUtility::createImage(const QPixmap& pixmap, QString& imagePath, int& error)
+/*
+ * Remove thumbnail image.
+ *
+ * \param imagePath The file path of thumbnail image.
+ * \return Success status.
+ */
+bool CntImageUtility::removeImage(const QString& imagePath)
{
- Q_UNUSED(error);
-
- int drive;
- bool success(false);
- QString fileExt(IMAGEFILE_EXT);
- int err= selectDrive(drive);
- if (KErrNone==err)
- {
- initPath(imagePath, drive);
- // Filename format
- // image_<yyhh_mm_ss_zzz>.jpg
- QDateTime dateTime = QDateTime::currentDateTime();
- QString dateTimeString = dateTime.toString("yyhh_mm_ss_zzz");
- QString filename = "image_" + dateTimeString + fileExt;
- imagePath += FOLDER_SEPARATOR + filename;
-
- if(!pixmap.isNull())
- {
- QPixmap pix(pixmap);
- QImage image(pix.toImage());
- success= image.save(imagePath, IMAGE_TYPE);
- }
- }
- return success;
-}
-
-bool CntImageUtility::removeImage(const QString& imagePath, int& error)
-{
- Q_UNUSED(error);
-
QDir dir;
bool success(false);
+ m_error = CntImageUtility::NoError;
QFile file( imagePath );
if( !file.exists()
- || dir.remove(imagePath))
+ || dir.remove(imagePath)) {
success= true;
-
+ }
return success;
}
@@ -113,43 +143,94 @@
{
int err = KErrNone;
TInt64 minSpaceInBytes = KMinRequiredSpaceImage;
- RFs fsSession;
-
- // Connect to file session
- err= fsSession.Connect();
- if(err!=KErrNone)
- return err;
// Get the drive/volume details
TVolumeInfo vInfo;
err = DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, driveIndex);
- if (KErrNone==err)
- {
- err = fsSession.Volume(vInfo, driveIndex);
- }
+ if (KErrNone==err) {
+ err = m_Fs.Volume(vInfo, driveIndex);
+ }
// Check the availability and disk space
- if ( !err && vInfo.iFree < minSpaceInBytes)
- {
+ if ( !err && vInfo.iFree < minSpaceInBytes) {
// All drives are full or inaccessible
err = KErrDiskFull;
- }
+ }
return err;
}
-void CntImageUtility::initPath(QString &path, int drive)
+bool CntImageUtility::initPath(QString &path, int drive)
+{
+ int err = KErrNone;
+ bool success(false);
+
+ // Get contacts images path
+ TFileName tPath;
+ PathInfo::GetRootPath(tPath, drive);
+ tPath.Append(KImagesFolder());
+ path = QString::fromUtf16(tPath.Ptr(), tPath.Length());
+
+ /* Contact images should go to the
+ * hidden folder \data\20022EF9
+ */
+ QDir dir(path);
+ if (!dir.cd(CNT_IMAGES_FOLDER)) {
+ TPtrC16 pathDesc(convertToTPtrC16(path));
+ err=m_Fs.MkDirAll(tPath);
+ err=m_Fs.SetAtt(tPath, KEntryAttHidden, 0);
+ }
+
+ success = (err == KErrNone);
+ return success;
+}
+
+/*
+ * \return whether mass storage is supported in phone.
+ */
+bool CntImageUtility::isMassStorageAvailable()
{
- // Get the root path for the given drive.
- TFileName tPath;
- PathInfo::GetRootPath(tPath, drive);
- path = QString::fromUtf16(tPath.Ptr(), tPath.Length());
-
- // Image files saved in Phonebook folder
- // Create folder if not exists
- QDir dir(path);
- if (!dir.cd(PBK_FOLDER))
- {
- dir.mkpath(PBK_FOLDER);
- }
- path = dir.path();
+ int err = KErrNone;
+ bool success(false);
+ m_error = CntImageUtility::NoError;
+
+ int drive;
+ err = DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, drive);
+ success = (err == KErrNone);
+ return success;
}
+
+/*
+ * \return whether thumbnail image is removable.
+ */
+bool CntImageUtility::isImageRemovable(const QString& filePath)
+{
+ int drive;
+ bool success(false);
+ m_error = CntImageUtility::NoError;
+
+ // Image removable if saved in contacts images folder
+ // Folder <Drive>:/Data/20022EF9
+ int err= selectDrive(drive);
+ if(KErrNone==err) {
+ // Get the root path
+ TFileName tPath;
+ PathInfo::GetRootPath(tPath, drive);
+ QString basePath = QString::fromUtf16(tPath.Ptr(), tPath.Length());
+
+ QDir dir(basePath);
+ if (dir.cd(CNT_IMAGES_FOLDER)) {
+ basePath=QDir::toNativeSeparators(dir.path());
+ if(filePath.startsWith(basePath))
+ success=true;
+ }
+ }
+ return success;
+}
+
+/*
+ * \return Error status.
+ */
+CntImageUtility::Error CntImageUtility::error()
+{
+ return m_error;
+}
--- a/phonebookengines/contactsmodel/cntdbdumper/src/dbsqldumper.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntdbdumper/src/dbsqldumper.cpp Fri May 14 15:42:23 2010 +0300
@@ -148,6 +148,10 @@
return KSqlContactPredSearchTable8;
case KContactPredSearchTable9Name:
return KSqlContactPredSearchTable9;
+ case KContactPredSearchTable10Name:
+ return KSqlContactPredSearchTable10;
+ case KContactPredSearchTable11Name:
+ return KSqlContactPredSearchTable11;
default:
{
@@ -340,6 +344,8 @@
case KContactPredSearchTable7Name:
case KContactPredSearchTable8Name:
case KContactPredSearchTable9Name:
+ case KContactPredSearchTable10Name:
+ case KContactPredSearchTable11Name:
switch(aColumnIndex)
{
case 0:
--- a/phonebookengines/contactsmodel/cntplsql/inc/clplcontactproperties.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/inc/clplcontactproperties.h Fri May 14 15:42:23 2010 +0300
@@ -123,7 +123,7 @@
CContactIdArray& CardTemplateIdsL();
CContactIdArray& GroupIdListL();
- CContactIdArray* SearchIdListL(const TDesC& aSearchQuery) const;
+ CBufSeg* DetailsListL(const TDesC& aSearchQuery) const;
TInt64 MachineIdL() const;
void SetMachineIdL(TInt64 aMachineId);
TPtrC UniqueIdL();
--- a/phonebookengines/contactsmodel/cntplsql/inc/cpcskeymap.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/inc/cpcskeymap.h Fri May 14 15:42:23 2010 +0300
@@ -90,7 +90,7 @@
/**
* Construct mappings between keys and characters.
*/
- TBool ContructKeyboardMappings();
+ void ContructKeyboardMappings();
/**
* Returns a list of languages installed on the phone.
@@ -108,8 +108,10 @@
*/
TChar KeyForCharacter(const TChar& aChar) const;
+#if defined(_DEBUG)
TInt KeyIdToNumber(TInt aKeyId) const;
-
+#endif // #if defined(_DEBUG)
+
TChar ArrayIndexToNumberChar(TInt aArrayIndex) const;
#else // #if defined(USE_ORBIT_KEYMAP)
TChar GetNumericValueForChar(TChar input) const;
@@ -118,10 +120,18 @@
private: // Data
#if defined(USE_ORBIT_KEYMAP)
- // One QString for each key of the keyboard (1-9,0).
+ // One QString for each key of the keyboard (1-9,0,*,#).
// Each contains all the characters that can originate from that key,
// considering the languages available on the device.
+ //
+ // iKeyMapping[0] has mappings for 1-key, iKeyMapping[1] for 2-key, ...
+ // iKeyMapping[8] for 9-key, iKeyMapping[9] for 0-key,
+ // iKeyMapping[10] for *-key, iKeyMapping[11] for #-key.
QList<QString> iKeyMapping;
+
+ // Characters that have been hardcoded to certain keys, regardless of
+ // actual keymap.
+ QString iHardcodedChars;
#endif // #if defined(USE_ORBIT_KEYMAP)
// For unit testing
--- a/phonebookengines/contactsmodel/cntplsql/inc/dbsqlconstants.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/inc/dbsqlconstants.h Fri May 14 15:42:23 2010 +0300
@@ -21,9 +21,7 @@
#include <cntdef.hrh>
const TInt KInitialValue = -1;
-
-// TODO: update this to handle all 10 predictive search tables
-const TInt KNumOfTables = 14;
+const TInt KNumOfTables = 16;
const TInt KNumColInPrefTable = 6;
const TInt KNumColInContactTable = 16;
const TInt KNumColInGroupTable = 3;
@@ -46,6 +44,8 @@
_LIT(KSqlContactPredSearchTable7,"predictivesearch7");
_LIT(KSqlContactPredSearchTable8,"predictivesearch8");
_LIT(KSqlContactPredSearchTable9,"predictivesearch9");
+_LIT(KSqlContactPredSearchTable10,"predictivesearch10");
+_LIT(KSqlContactPredSearchTable11,"predictivesearch11");
_LIT(KSqlContactPresenceTableName, "presence");
enum TDatabaseTables
@@ -63,7 +63,9 @@
KContactPredSearchTable6Name,
KContactPredSearchTable7Name,
KContactPredSearchTable8Name,
- KContactPredSearchTable9Name
+ KContactPredSearchTable9Name,
+ KContactPredSearchTable10Name,
+ KContactPredSearchTable11Name
};
// columns for contact table
@@ -225,6 +227,14 @@
"CREATE TABLE predictivesearch9 (contact_id INTEGER PRIMARY KEY,\
nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\
first_name CHAR(16) NULL, last_name CHAR(16) NULL);");
+_LIT(KPredSearchCreateTable10Stmnt,
+"CREATE TABLE predictivesearch10 (contact_id INTEGER PRIMARY KEY,\
+ nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\
+ first_name CHAR(16) NULL, last_name CHAR(16) NULL);");
+_LIT(KPredSearchCreateTable11Stmnt,
+"CREATE TABLE predictivesearch11 (contact_id INTEGER PRIMARY KEY,\
+ nbr BIGINT NULL, nbr2 BIGINT NULL, nbr3 BIGINT NULL, nbr4 BIGINT NULL,\
+ first_name CHAR(16) NULL, last_name CHAR(16) NULL);");
// create table indexes
@@ -278,6 +288,16 @@
_LIT(KPredSearchCreateNbr3IndexTable9, "CREATE INDEX index9_nbr3 on predictivesearch9 (nbr3);");
_LIT(KPredSearchCreateNbr4IndexTable9, "CREATE INDEX index9_nbr4 on predictivesearch9 (nbr4);");
+_LIT(KPredSearchCreateNbrIndexTable10, "CREATE INDEX index10_nbr on predictivesearch10 (nbr);");
+_LIT(KPredSearchCreateNbr2IndexTable10, "CREATE INDEX index10_nbr2 on predictivesearch10 (nbr2);");
+_LIT(KPredSearchCreateNbr3IndexTable10, "CREATE INDEX index10_nbr3 on predictivesearch10 (nbr3);");
+_LIT(KPredSearchCreateNbr4IndexTable10, "CREATE INDEX index10_nbr4 on predictivesearch10 (nbr4);");
+
+_LIT(KPredSearchCreateNbrIndexTable11, "CREATE INDEX index11_nbr on predictivesearch11 (nbr);");
+_LIT(KPredSearchCreateNbr2IndexTable11, "CREATE INDEX index11_nbr2 on predictivesearch11 (nbr2);");
+_LIT(KPredSearchCreateNbr3IndexTable11, "CREATE INDEX index11_nbr3 on predictivesearch11 (nbr3);");
+_LIT(KPredSearchCreateNbr4IndexTable11, "CREATE INDEX index11_nbr4 on predictivesearch11 (nbr4);");
+
// create table indexes for readable names for ordering results alphabetically
_LIT(KPredSearchCreateFNIndexInTable0,
"CREATE INDEX index_last_name0 on predictivesearch0 (last_name);");
@@ -329,6 +349,16 @@
_LIT(KPredSearchCreateLNIndexInTable9,
"CREATE INDEX index_first_name9 on predictivesearch9 (first_name);");
+_LIT(KPredSearchCreateFNIndexInTable10,
+"CREATE INDEX index_last_name10 on predictivesearch10 (last_name);");
+_LIT(KPredSearchCreateLNIndexInTable10,
+"CREATE INDEX index_first_name10 on predictivesearch10 (first_name);");
+
+_LIT(KPredSearchCreateFNIndexInTable11,
+"CREATE INDEX index_last_name11 on predictivesearch11 (last_name);");
+_LIT(KPredSearchCreateLNIndexInTable11,
+"CREATE INDEX index_first_name11 on predictivesearch11 (first_name);");
+
_LIT(KPresenceContactId, "contact_id");
--- a/phonebookengines/contactsmodel/cntplsql/inc/pltables.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/inc/pltables.h Fri May 14 15:42:23 2010 +0300
@@ -344,7 +344,6 @@
// aString ownership is not transferred
void AddTokens(HBufC* aString, QStringList& aTokens) const;
- TBool IsValidChar(TInt aChar) const;
TBool IsValidChar(QChar aChar) const;
// aFirstName ownership is not transferred
@@ -354,10 +353,11 @@
void DeleteFromAllTablesL(TContactItemId aContactId,
TBool& aLowDiskErrorOccurred) const;
- QList<TChar> FillTableList() const;
+ QList<TChar> FillAllTables() const;
// Return next table's name, ownership is transferred
- HBufC* GetTableNameL(QList<TChar>& aTables) const;
+ HBufC* GetNextTableNameL(QList<TChar>& aTables) const;
+ const TDesC& TableNameL(TChar aCh) const;
quint64 ConvertToHex(QString aToken) const;
--- a/phonebookengines/contactsmodel/cntplsql/inc/pplcontactitemmanager.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/inc/pplcontactitemmanager.h Fri May 14 15:42:23 2010 +0300
@@ -71,7 +71,7 @@
TBool IsDatabaseEmptyL();
CPplPreferencesPersistor& PreferencesPersitor();
CContactIdArray* GroupIdListL();
- CContactIdArray* SearchIdListL (const TDesC& aSearchQuery) const;
+ CBufSeg* DetailsListL (const TDesC& aSearchQuery) const;
CContactIdArray& CardTemplateIdsL();
TContactItemId OwnCardIdL();
void SetOwnCardIdL(TContactItemId aId);
--- a/phonebookengines/contactsmodel/cntplsql/src/clplcontactproperties.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/src/clplcontactproperties.cpp Fri May 14 15:42:23 2010 +0300
@@ -177,11 +177,11 @@
}
-CContactIdArray* CLplContactProperties::SearchIdListL(const TDesC& aSearchQuery) const
+CBufSeg* CLplContactProperties::DetailsListL(const TDesC& aSearchQuery) const
{
- return iContactItemManager->SearchIdListL(aSearchQuery);
+ return iContactItemManager->DetailsListL(aSearchQuery);
+ }
- }
TInt64 CLplContactProperties::MachineIdL() const
{
--- a/phonebookengines/contactsmodel/cntplsql/src/cpcskeymap.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/src/cpcskeymap.cpp Fri May 14 15:42:23 2010 +0300
@@ -20,7 +20,7 @@
#if defined(USE_ORBIT_KEYMAP)
// If defined, only the currently used language's keymap is used
-#define USE_ONLY_DEFAULT_LANG_KEYMAP
+//#define USE_ONLY_DEFAULT_LANG_KEYMAP
#include <QLocale>
@@ -55,8 +55,8 @@
_LIT(KSeparator, " ");
#if defined(USE_ORBIT_KEYMAP)
-// How many keys have mappings (keys 0..9 have mapping)
-const TInt KAmountOfKeys = 10;
+// How many keys have mappings in ITU-T keypad (keys 0..9, * and # have mappings)
+const TInt KAmountOfKeys = 12;
// The first key of the keyboard has value zero ('1' in the 12-key virtual keypad)
enum TKeyId
@@ -70,10 +70,25 @@
EKey7,
EKey8,
EKey9,
- EKey0
+ EKey0,
+ EKeyStar,
+ EKeyHash,
+ ELastKey = EKeyHash
};
+
+const QChar KStar = '*';
+const QChar KPlus = '+';
+const QChar KHash = '#';
#endif // #if defined(USE_ORBIT_KEYMAP)
+// * key is mapped to this
+const TChar KMappedCharForStar = 'a';
+// # key is mapped to this
+const TChar KMappedCharForHash = 'b';
+// Unmapped (unknown) characters are replaced with this
+const TChar KPadChar = 'f';
+
+
// ============================== MEMBER FUNCTIONS ============================
// ----------------------------------------------------------------------------
@@ -81,14 +96,14 @@
// ----------------------------------------------------------------------------
CPcsKeyMap* CPcsKeyMap::NewL()
{
- PRINT( _L("Enter CPcsKeyMap::NewL") );
+ PRINT(_L("Enter CPcsKeyMap::NewL"));
- CPcsKeyMap* self = new ( ELeave ) CPcsKeyMap();
- CleanupStack::PushL( self );
+ CPcsKeyMap* self = new (ELeave) CPcsKeyMap();
+ CleanupStack::PushL(self);
self->ConstructL();
- CleanupStack::Pop( self );
+ CleanupStack::Pop(self);
- PRINT( _L("End CPcsKeyMap::NewL") );
+ PRINT(_L("End CPcsKeyMap::NewL"));
return self;
}
@@ -97,8 +112,8 @@
// ----------------------------------------------------------------------------
CPcsKeyMap::~CPcsKeyMap()
{
- PRINT( _L("Enter CPcsKeyMap::~CPcsKeyMap") );
- PRINT( _L("End CPcsKeyMap::~CPcsKeyMap") );
+ PRINT(_L("Enter CPcsKeyMap::~CPcsKeyMap"));
+ PRINT(_L("End CPcsKeyMap::~CPcsKeyMap"));
}
// ----------------------------------------------------------------------------
@@ -109,7 +124,7 @@
HBufC* CPcsKeyMap::GetNumericKeyStringL(const TDesC& aSource,
TBool aPlainConversion) const
{
- PRINT1( _L("Enter CPcsKeyMap::GetNumericKeyStringL input '%S'"), &aSource );
+ PRINT1(_L("Enter CPcsKeyMap::GetNumericKeyStringL input '%S'"), &aSource);
TInt length = aSource.Length();
HBufC* destination = HBufC::NewL(length);
@@ -133,7 +148,7 @@
}
}
- PRINT1( _L("End CPcsKeyMap::GetNumericKeyStringL result '%S'"), destination );
+ PRINT1(_L("End CPcsKeyMap::GetNumericKeyStringL result '%S'"), destination);
return destination;
}
@@ -153,10 +168,6 @@
CPcsKeyMap::CPcsKeyMap() :
iKeyMapping()
{
- for (TInt i = 0; i < KAmountOfKeys; ++i)
- {
- iKeyMapping << QString("");
- }
}
// ----------------------------------------------------------------------------
@@ -164,35 +175,40 @@
// ----------------------------------------------------------------------------
void CPcsKeyMap::ConstructL()
{
- TBool ok(EFalse);
TInt err(KErrNone);
- QT_TRYCATCH_ERROR(err, ok = ContructKeyboardMappings());
+ QT_TRYCATCH_ERROR(err, ContructKeyboardMappings());
if (err != KErrNone)
{
PRINT1(_L("ContructKeyboardMappings threw exception, err=%d"), err);
User::Leave(err);
}
- if (!ok)
- {
- PRINT(_L("ContructKeyboardMappings returns error"));
- User::Leave(KErrGeneral);
- }
}
// ----------------------------------------------------------------------------
// CPcsKeyMap::ContructKeyboardMappings
// Fetch keymap for every language/country pair present.
-// 10.1 only has virtual 12 key ITU-T keyboard
+// Even though most languages map *, + and # to 1-key, they are here mapped to
+// the distinct *-key or #-key of the 12-key ITU-T keypad.
// ----------------------------------------------------------------------------
-TBool CPcsKeyMap::ContructKeyboardMappings()
+void CPcsKeyMap::ContructKeyboardMappings()
{
- PRINT( _L("Enter CPcsKeyMap::ContructKeyboardMappings") );
+ PRINT(_L("Enter CPcsKeyMap::ContructKeyboardMappings"));
+
+ for (TInt i = 0; i < KAmountOfKeys; ++i)
+ {
+ iKeyMapping << QString("");
+ }
+
+ iKeyMapping[EKeyStar].append(KStar);
+ iKeyMapping[EKeyStar].append(KPlus);
+ iKeyMapping[EKeyHash].append(KHash);
+ iHardcodedChars.append(KStar);
+ iHardcodedChars.append(KPlus);
+ iHardcodedChars.append(KHash);
#if defined(_DEBUG)
TInt count(0);
#endif
-
- TInt err(KErrNone);
QList<HbInputLanguage> languages;
#if defined(USE_ONLY_DEFAULT_LANG_KEYMAP)
HbInputLanguage inputLanguage(QLocale::system().language());
@@ -200,66 +216,49 @@
#else
languages = AvailableLanguages();
#endif
- // Calling HbKeymapFactory::keymap() causes "no memory" exception after
- // ~20 different language/variant combinations in emulator.
- // In text shell all languages can be handled successfully.
- // In device, already the first call to HbKeymapFactory::keymap()
- // crashes.
- const TInt KMaxLanguages = 30;
- TInt handleMaxLanguages = languages.size();
- if (handleMaxLanguages > KMaxLanguages)
- {
- handleMaxLanguages = KMaxLanguages;
- }
- PRINT1( _L("handle %d languages"), handleMaxLanguages ); // test
-
- for (TInt lang = 0; lang < handleMaxLanguages; ++lang)
+ TInt languageCount = languages.size();
+ for (TInt lang = 0; lang < languageCount; ++lang)
{
-// PRINT1( _L("handle language %d"), languages[lang].language() ); // test
+ PRINT2(_L("(%d) handle language %d"), lang, languages[lang].language());
if (IsLanguageSupported(languages[lang].language()))
{
- PRINT2(_L("Constructing keymap for lang=%d,var=%d"),
+/* PRINT2(_L("Constructing keymap for lang=%d,var=%d"),
languages[lang].language(),
- languages[lang].variant());
+ languages[lang].variant()); */
const HbKeymap* keymap =
HbKeymapFactory::instance()->keymap(languages[lang].language(),
languages[lang].variant());
if (keymap)
{
- for (TInt key = EKey1; key <= EKey0; ++key)
+ for (TInt key = EKey1; key <= ELastKey; ++key)
{
- PRINT1( _L("handle key(enum value %d)"), key ); // test
+// PRINT1(_L("handle key(enum value %d)"), key); // test
const HbMappedKey* mappedKey = keymap->keyForIndex(HbKeyboardVirtual12Key, key);
- if (!mappedKey)
- {
- PRINT1(_L("Mapped key not found, key(%d)"), KeyIdToNumber(key));
- return EFalse;
- }
- // Get both upper and lowercase letters
- const QString lowerCase = mappedKey->characters(HbModifierNone); // e.g. "abc2.."
- const QString upperCase = mappedKey->characters(HbModifierShiftPressed); // e.g. "ABC2.."
- const QString charsForKey = lowerCase + upperCase;
-
- // Filter out duplicate characters
- for (TInt i = charsForKey.length() - 1; i >= 0 ; --i)
+ // mappedKey can be NULL, as most languages don't have mapping for EKeyStar, EKeyHash
+ if (mappedKey)
{
- QChar ch = charsForKey[i];
- // Key '1' is at index 0 in iKeyMapping, key '2' at index 1 etc.
- // and key '0' at the last index.
- TInt index = key - EKey1;
- if (!iKeyMapping[index].contains(ch))
- {
-/*
- PRINT3(_L("CPcsKeyMap: map key(%d) <-> char='%c'(0x%x)"),
- KeyIdToNumber(key),
- ch.toAscii(),
- ch.toAscii()); */
+ const QString lowerCase = mappedKey->characters(HbModifierNone); // "abc2.."
+ const QString upperCase = mappedKey->characters(HbModifierShiftPressed); // "ABC2.."
+ const QString charsForKey = lowerCase + upperCase;
+
+ // Filter out duplicate characters
+ for (TInt i = charsForKey.length() - 1; i >= 0 ; --i)
+ {
+ QChar ch = charsForKey[i];
+ if (!iKeyMapping[key].contains(ch) &&
+ !iHardcodedChars.contains(ch))
+ {
+/* PRINT3(_L("CPcsKeyMap: map key(%d) <-> char='%c'(0x%x)"),
+ KeyIdToNumber(key),
+ ch.toAscii(),
+ ch.toAscii()); */
#if defined(_DEBUG)
- ++count;
+ ++count;
#endif
- iKeyMapping[index] += ch;
- }
- }
+ iKeyMapping[key] += ch;
+ }
+ }
+ }
}
}
else
@@ -270,9 +269,8 @@
}
#if defined(_DEBUG)
- PRINT1( _L("End CPcsKeyMap::ContructKeyboardMappings keymap has %d chars"), count );
+ PRINT1(_L("End CPcsKeyMap::ContructKeyboardMappings keymap has %d chars"), count);
#endif
- return ETrue;
}
// ----------------------------------------------------------------------------
@@ -282,31 +280,31 @@
// ----------------------------------------------------------------------------
QList<HbInputLanguage> CPcsKeyMap::AvailableLanguages() const
{
- PRINT( _L("Enter CPcsKeyMap::AvailableLanguages") );
+ PRINT(_L("Enter CPcsKeyMap::AvailableLanguages"));
QList<HbInputLanguage> languages = HbKeymapFactory::availableLanguages();
-#if 0 // This code would make sure the default language is at the beginning of
+#if 1 // This code would make sure the default language is at the beginning of
// list of available languages. But since there is resource leak, the code
// is currently commented out until the leak is fixed.
QLocale::Language currentLanguage = QLocale::system().language();
if (!IsLanguageSupported(currentLanguage))
{
- PRINT( _L("current lang not supported, use english") ); //test
+ PRINT(_L("current lang not supported, use english")); //test
currentLanguage = QLocale::English;
}
HbInputLanguage defaultLanguage(currentLanguage);
if (languages.contains(defaultLanguage))
{
- PRINT( _L("remove default lang") ); //test
+ PRINT(_L("remove default lang")); //test
languages.removeOne(defaultLanguage);
}
- PRINT( _L("insert default lang as first lang") ); //test
+ PRINT(_L("insert default lang as first lang")); //test
languages.prepend(defaultLanguage); // THIS LEAKS RESOURCES!
#endif
- PRINT1( _L("End CPcsKeyMap::AvailableLanguages found %d languages"),
- languages.count() );
+ PRINT1(_L("End CPcsKeyMap::AvailableLanguages found %d languages"),
+ languages.count());
return languages;
}
@@ -324,11 +322,10 @@
// If the character is not mapped, use the character itself.
// ----------------------------------------------------------------------------
TChar CPcsKeyMap::KeyForCharacter(const TChar& aChar) const
- {
+ {
TUint charValue(aChar);
QChar ch(charValue);
-
- for (TInt index = 0; index < KAmountOfKeys; ++index)
+ for (TInt index = 0; index < KAmountOfKeys; ++index)
{
if (iKeyMapping[index].contains(ch))
{
@@ -336,11 +333,12 @@
}
}
- PRINT2( _L("CPcsKeyMap::KeyForCharacter no mapping for char '%c' (0x%x)"),
- (TUint)aChar, (TUint)aChar ); // test
- return aChar;
+ PRINT2(_L("CPcsKeyMap::KeyForCharacter no mapping for char '%c' (0x%x)"),
+ (TUint)aChar, (TUint)aChar);
+ return KPadChar;
}
+#if defined(_DEBUG)
// ----------------------------------------------------------------------------
// CPcsKeyMap::KeyIdToNumber
// Map Orbit API's key id to the number that the key results when pressed.
@@ -358,15 +356,18 @@
case EKey7:
case EKey8:
case EKey9:
+ case EKeyStar:
+ case EKeyHash:
return aKeyId + 1;
case EKey0:
return 0;
default:
- PRINT1( _L("CPcsKeyMap::KeyIdToNumber invalid index %d"), aKeyId );
+ PRINT1(_L("CPcsKeyMap::KeyIdToNumber invalid index %d"), aKeyId);
User::Panic(_L("CPcsKeyMap::KeyIdToNumber"), KErrArgument);
return 0;
}
}
+#endif
// ----------------------------------------------------------------------------
// CPcsKeyMap::ArrayIndexToNumberChar
@@ -377,11 +378,17 @@
__ASSERT_DEBUG(aArrayIndex < KAmountOfKeys,
User::Panic(_L("CPcsKeyMap::ArrayIndexToNumberChar"),
KErrOverflow));
- if (aArrayIndex == KAmountOfKeys - 1)
+ switch (aArrayIndex)
{
- return '0';
+ case EKey0:
+ return '0';
+ case EKeyStar:
+ return KMappedCharForStar;
+ case EKeyHash:
+ return KMappedCharForHash;
+ default:
+ return aArrayIndex + '1';
}
- return aArrayIndex + '1';
}
#else // #if defined(USE_ORBIT_KEYMAP)
CPcsKeyMap::CPcsKeyMap()
@@ -389,10 +396,10 @@
}
void CPcsKeyMap::ConstructL()
- {
+ {
}
-TChar CPcsKeyMap::GetNumericValueForChar(TChar input ) const
+TChar CPcsKeyMap::GetNumericValueForChar(TChar input) const
{
TChar ret = '0';
switch (input)
@@ -400,8 +407,9 @@
case 'A':
case 'B':
case 'C':
- ret = '2';
- break;
+ ret = '2';
+ break;
+
case 'D':
case 'E':
case 'F':
@@ -445,13 +453,32 @@
case 'Z':
ret = '9';
break;
-
- case ' ':
- ret = '0';
- break;
+
+ case '*':
+ case '+':
+ ret = KMappedCharForStar;
+ break;
+
+ case '#':
+ ret = KMappedCharForHash;
+ break;
- default: // Other chars, e.g. numbers
- ret = input;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case ' ':
+ ret = input; // Numbers and space
+ break;
+
+ default: // Other (unknown) chars
+ ret = KPadChar;
}
return ret;
}
--- a/phonebookengines/contactsmodel/cntplsql/src/cpplpredictivesearchtable.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/src/cpplpredictivesearchtable.cpp Fri May 14 15:42:23 2010 +0300
@@ -34,10 +34,18 @@
// to prevent overflow when comparing upper and lower limits.
const TInt KMaxDigits = 15;
-const QChar KPadChar = 'a'; // Pad with hex-digit 0xA
-
const quint64 KConversionError = 0xeeeeeeeeeeeeeee;
+#define MAPPED_CHAR_FOR_STAR 'a'
+#define MAPPED_CHAR_FOR_HASH 'b'
+
+const QChar KMappedQCharForStar = MAPPED_CHAR_FOR_STAR;
+const QChar KMappedQCharForHash = MAPPED_CHAR_FOR_HASH;
+
+// These must be same as in cpcskeymap.cpp
+const TChar KMappedCharForStar = MAPPED_CHAR_FOR_STAR;
+const TChar KMappedCharForHash = MAPPED_CHAR_FOR_HASH;
+const QChar KPadChar = 'f'; // Pad with hex-digit 0xF
/**
@@ -92,7 +100,7 @@
/**
@param aItem A contact item whose data are added to the table.
*/
-void CPplPredictiveSearchTable::CreateInDbL( CContactItem& aItem )
+void CPplPredictiveSearchTable::CreateInDbL(CContactItem& aItem)
{
RDebug::Print(_L("CPplPredictiveSearchTable::CreateInDbL"));
WriteToDbL(aItem);
@@ -106,7 +114,7 @@
@param aItem A contact item whose data is updated in the database.
*/
-void CPplPredictiveSearchTable::UpdateL( const CContactItem& aItem )
+void CPplPredictiveSearchTable::UpdateL(const CContactItem& aItem)
{
RDebug::Print(_L("CPplPredictiveSearchTable::UpdateL"));
@@ -146,7 +154,7 @@
{
RDebug::Print(_L("CPplPredictiveSearchTable::CreateTableL"));
- RDebug::Print(_L("Create 10 tables"));
+ RDebug::Print(_L("Create 12 tables"));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable0Stmnt));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable1Stmnt));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable2Stmnt));
@@ -157,6 +165,8 @@
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable7Stmnt));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable8Stmnt));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable9Stmnt));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable10Stmnt));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateTable11Stmnt));
RDebug::Print(_L("Create indexes"));
@@ -210,6 +220,16 @@
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr3IndexTable9));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr4IndexTable9));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbrIndexTable10));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr2IndexTable10));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr3IndexTable10));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr4IndexTable10));
+
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbrIndexTable11));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr2IndexTable11));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr3IndexTable11));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateNbr4IndexTable11));
+
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateFNIndexInTable0));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateLNIndexInTable0));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateFNIndexInTable1));
@@ -230,6 +250,10 @@
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateLNIndexInTable8));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateFNIndexInTable9));
User::LeaveIfError(iDatabase.Exec(KPredSearchCreateLNIndexInTable9));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateFNIndexInTable10));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateLNIndexInTable10));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateFNIndexInTable11));
+ User::LeaveIfError(iDatabase.Exec(KPredSearchCreateLNIndexInTable11));
RDebug::Print(_L("CPplPredictiveSearchTable::CreateTableL ends"));
}
@@ -247,7 +271,7 @@
TCntSqlStatementType deleteType(EDelete, KSqlContactPredSearchTable0);
// Insert new record
- // INSERT INTO predictivesearchX (X=0..9)
+ // INSERT INTO predictivesearchX (X=0..11)
// (contact_id, nbr, nbr2, nbr3, nbr4, first_name, last_name)
// VALUES (contact_id value, nbr value, nbr2 value, nbr3 value, nbr4 value,
// first_name value, last_name value);
@@ -277,7 +301,7 @@
&KPredSearchContactId, &KPredSearchContactIdParam);
// Delete information of a particular contact item
- // DELETE FROM predictivesearchX (X=0..9)
+ // DELETE FROM predictivesearchX (X=0..11)
// WHERE contact_id = [contact id value];
iDeleteStmnt = TSqlProvider::GetSqlStatementL(deleteType);
iDeleteStmnt->SetConditionL(*whereContactIdClause);
@@ -321,7 +345,7 @@
});
HBufC* tableName(NULL);
- while ((tableName = GetTableNameL(tables)) != NULL)
+ while ((tableName = GetNextTableNameL(tables)) != NULL)
{
// Takes ownership. Clears also earlier SQL statement.
iInsertStmnt->SetTableName(tableName);
@@ -447,9 +471,9 @@
QList<TChar> tables;
for (TInt i = aTokens.count() - 1; i >= 0; --i)
{
+ __ASSERT_ALWAYS(IsValidChar(aTokens[i][0]),
+ User::Panic(_L("DetermineTables"), KErrArgument));
TChar ch(aTokens[i][0].unicode());
- __ASSERT_ALWAYS(IsValidChar(ch),
- User::Panic(_L("DetermineTables"), KErrArgument));
if (!tables.contains(ch))
{
tables.append(ch);
@@ -459,44 +483,6 @@
}
-// Ignore tokens beginning with something else than '0'..'9'.
-// Keep duplicate tokens to support e.g. search "202" when both FN and LN are "23".
-void
-CPplPredictiveSearchTable::AddTokens(HBufC* aString, QStringList& aTokens) const
- {
- if (aString)
- {
- QString s((QChar*)aString->Ptr(), aString->Length());
-#if defined(USE_ORBIT_KEYMAP)
- QStringList tokens = s.split(iKeyMap->Separator(), QString::SkipEmptyParts);
-#else
- QStringList tokens = s.split(' ', QString::SkipEmptyParts);
-#endif
-
- // Select tokens in the same order they are in original aString
- for (TInt i = 0; i < tokens.count(); ++i)
- {
- if (IsValidChar(tokens[i][0]))
- {
- aTokens.append(tokens[i]);
- }
- }
- }
- }
-
-
-TBool CPplPredictiveSearchTable::IsValidChar(TInt aChar) const
- {
- return (aChar >= '0' && aChar <= '9');
- }
-
-
-TBool CPplPredictiveSearchTable::IsValidChar(QChar aChar) const
- {
- return (aChar >= '0' && aChar <= '9');
- }
-
-
// 1. get first token of LN
// 2. get first token of FN
// 3. get second token of LN
@@ -530,6 +516,40 @@
}
+// Ignore tokens beginning with invalid (unknown) character.
+// Keep duplicate tokens to support e.g. search "202" when both FN and LN are "23".
+void
+CPplPredictiveSearchTable::AddTokens(HBufC* aString, QStringList& aTokens) const
+ {
+ if (aString)
+ {
+ QString s((QChar*)aString->Ptr(), aString->Length());
+#if defined(USE_ORBIT_KEYMAP)
+ QStringList tokens = s.split(iKeyMap->Separator(), QString::SkipEmptyParts);
+#else
+ QStringList tokens = s.split(' ', QString::SkipEmptyParts);
+#endif
+
+ // Select tokens in the same order they are in original aString
+ for (TInt i = 0; i < tokens.count(); ++i)
+ {
+ if (IsValidChar(tokens[i][0]))
+ {
+ aTokens.append(tokens[i]);
+ }
+ }
+ }
+ }
+
+
+TBool CPplPredictiveSearchTable::IsValidChar(QChar aChar) const
+ {
+ return (aChar >= '0' && aChar <= '9') ||
+ aChar == MAPPED_CHAR_FOR_STAR ||
+ aChar == MAPPED_CHAR_FOR_HASH;
+ }
+
+
void CPplPredictiveSearchTable::GetNextToken(QStringList& aSource,
QStringList& aDestination) const
{
@@ -547,10 +567,10 @@
TBool& aLowDiskErrorOccurred) const
{
QList<TChar> tables;
- QT_TRYCATCH_LEAVING(tables = FillTableList());
+ QT_TRYCATCH_LEAVING(tables = FillAllTables());
HBufC* tableName(NULL);
- while ((tableName = GetTableNameL(tables)) != NULL)
+ while ((tableName = GetNextTableNameL(tables)) != NULL)
{
iDeleteStmnt->SetTableName(tableName); // Clears also earlier SQL statement
@@ -567,9 +587,8 @@
const TInt KContactIdParamIndex(KFirstIndex);
User::LeaveIfError(stmnt.BindInt(KContactIdParamIndex, aContactId));
RDebug::Print(_L("CPplPredictiveSearchTable::DeleteFromAllTablesL execute statement"));
- // Returns the amount of rows that were changed/inserted/deleted.
- // Since contact is not present in all tables, some operations return 0,
- // it is not an error.
+ // Returns the amount of affected rows. As contact is not present each
+ // table, some operations return 0, it is not an error.
TInt status = stmnt.Exec();
RDebug::Print(_L("CPplPredictiveSearchTable::DeleteFromAllTablesL rows deleted=%d"), status);
CleanupStack::PopAndDestroy(&stmnt);
@@ -588,43 +607,69 @@
}
-QList<TChar> CPplPredictiveSearchTable::FillTableList() const
+QList<TChar> CPplPredictiveSearchTable::FillAllTables() const
{
QList<TChar> tables;
- const TInt KLargestKey = '9';
- for (TInt i = '0'; i <= KLargestKey; ++i)
+
+ const TInt KLargestDigitKey = '9';
+ for (TInt i = '0'; i <= KLargestDigitKey; ++i)
{
TChar ch = i;
tables << ch;
}
+ tables << KMappedCharForStar;
+ tables << KMappedCharForHash;
+
return tables;
}
-HBufC* CPplPredictiveSearchTable::GetTableNameL(QList<TChar>& aTables) const
+HBufC* CPplPredictiveSearchTable::GetNextTableNameL(QList<TChar>& aTables) const
{
HBufC* tableName(NULL);
if (aTables.count() > 0)
{
- TChar ch = aTables[0];
- __ASSERT_ALWAYS(IsValidChar(ch), User::Leave(KErrArgument));
+ // Enough space for the longest table name
+ tableName = HBufC::NewL(KSqlContactPredSearchTable11().Length());
+ TPtr ptr = tableName->Des();
+ ptr.Append(TableNameL(aTables[0]));
- // Each table's name has same length, replace last char with the correct one
- tableName = HBufC::NewL(KSqlContactPredSearchTable0().Length());
- TPtr ptr = tableName->Des();
- ptr.Append(KSqlContactPredSearchTable0);
- ptr[ptr.Length() - 1] = ch;
aTables.removeFirst();
- RDebug::Print(_L("CPplPredictiveSearchTable::GetTableNameL '%S'"), tableName);
+ RDebug::Print(_L("CPplPredictiveSearchTable::GetNextTableNameL '%S'"), tableName);
}
return tableName;
}
+// when qwerty will be supported, keymap prob maps original chars to
+// 0..9, a..z + few capital letters
+const TDesC& CPplPredictiveSearchTable::TableNameL(TChar aCh) const
+ {
+ switch (aCh)
+ {
+ case '0': return KSqlContactPredSearchTable0;
+ case '1': return KSqlContactPredSearchTable1;
+ case '2': return KSqlContactPredSearchTable2;
+ case '3': return KSqlContactPredSearchTable3;
+ case '4': return KSqlContactPredSearchTable4;
+ case '5': return KSqlContactPredSearchTable5;
+ case '6': return KSqlContactPredSearchTable6;
+ case '7': return KSqlContactPredSearchTable7;
+ case '8': return KSqlContactPredSearchTable8;
+ case '9': return KSqlContactPredSearchTable9;
+ case MAPPED_CHAR_FOR_STAR: return KSqlContactPredSearchTable10;
+ case MAPPED_CHAR_FOR_HASH: return KSqlContactPredSearchTable11;
+ default:
+ TUint ch = aCh;
+ RDebug::Print(_L("CPplPredictiveSearchTable::TableName unknown char '%c'"), ch);
+ User::Leave(KErrArgument);
+ return KNullDesC;
+ }
+ }
-// E.g. aToken = "01230" -> append 'a' until has KMaxDigits characters
-// -> "01230aaaaaaaaaa" -> convert to hexadecimal number -> 0x01230aaaaaaaaaa.
-// Leaving from this function causes panic, perhaps because of QString
-// parameter? So rather return an error code if conversion fails.
+
+// E.g. aToken = "01230" -> append KPadChar until has KMaxDigits characters
+// -> "01230ffffffffff" -> convert to hexadecimal number -> 0x01230ffffffffff.
+// If this function would leave, causes panic, perhaps because of QString parameter?
quint64 CPplPredictiveSearchTable::ConvertToHex(QString aToken) const
{
if (aToken.length() > KMaxDigits)
--- a/phonebookengines/contactsmodel/cntplsql/src/pplcontactitemmanager.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntplsql/src/pplcontactitemmanager.cpp Fri May 14 15:42:23 2010 +0300
@@ -722,22 +722,39 @@
return idArray;
}
-CContactIdArray* CPplContactItemManager::SearchIdListL(const TDesC& aSearchQuery) const
+/**
+Fast access method for retrieving a list of contact details as raw data.
+This method can be used for example to fetch the names of all contacts
+in a very efficient manner. It is assumed that the first column in
+aSearchQuery is 'id' and that the other columns are text.
+
+The returned buffer can be read with RBufReadStream - the first column
+of each row is a 32-bit integer (the id), the rest of the columns are
+16-bit descriptors. An id of 0 signifies the end of the list.
+*/
+CBufSeg* CPplContactItemManager::DetailsListL(const TDesC& aSearchQuery) const
{
- CContactIdArray* idArray = CContactIdArray::NewLC();
-
+ CBufSeg* array = CBufSeg::NewL(4096);
+ CleanupStack::PushL(array);
+
//Prepare and execute the sql query
RSqlStatement selectStatement;
CleanupClosePushL(selectStatement);
User::LeaveIfError(selectStatement.Prepare(iDatabase, aSearchQuery));
- const TInt KIdx = iSelectStatement->ParameterIndex(KContactId);
-
+
// Iterate through the results and append the contactIds to idArray
TInt err;
- while((err = selectStatement.Next()) == KSqlAtRow)
+ RBufWriteStream stream;
+ stream.Open(*array);
+ TInt columnCount = selectStatement.ColumnCount();
+ while ((err = selectStatement.Next()) == KSqlAtRow)
{
- idArray->AddL(selectStatement.ColumnInt(KIdx));
+ stream.WriteInt32L(selectStatement.ColumnInt(0));
+ for (TInt i = 1; i < columnCount; ++i)
+ stream << selectStatement.ColumnTextL(i);
}
+ stream.WriteInt32L(0);
+ stream.Close();
if(err != KSqlAtEnd)
{
@@ -746,11 +763,12 @@
//Cleanup
CleanupStack::PopAndDestroy(&selectStatement);
- CleanupStack::Pop(idArray);
+ CleanupStack::Pop(array);
- return idArray;
+ return array;
}
+
/**
Utility method used to rthe prefered card template id
*/
--- a/phonebookengines/contactsmodel/cntsrv/inc/CCntIpcCodes.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntsrv/inc/CCntIpcCodes.h Fri May 14 15:42:23 2010 +0300
@@ -37,7 +37,7 @@
#define KCapabilityWriteUserData 400
// To be removed. Should be defined in a header file
-#define KCntSearchResultIdLists 99
+#define KCntSearchResultList 99
/**
Contacts database filename maximum length. Used to police descriptors on Client
@@ -108,9 +108,9 @@
ECntOpenViewSession,
ECntCloseViewSession,
ECntViewChangeSortOrderL,
- ECntSearchResultIdLists = KCntSearchResultIdLists, // Do not change this enum value
- // and do not add anything immediately
- // after this.
+ ECntSearchResultList = KCntSearchResultList, // Do not change this enum value
+ // and do not add anything immediately
+ // after this.
// ---- Read User Data capability ----
ECntOpenDataBase= KCapabilityReadUserData,
ECntReOpenDbTables,
--- a/phonebookengines/contactsmodel/cntsrv/inc/persistencelayer.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntsrv/inc/persistencelayer.h Fri May 14 15:42:23 2010 +0300
@@ -174,7 +174,7 @@
virtual TInt64 MachineIdL() const = 0;
virtual CContactIdArray& CardTemplateIdsL() = 0;
virtual CContactIdArray& GroupIdListL() = 0;
- virtual CContactIdArray* SearchIdListL(const TDesC& aSearchQuery) const = 0;
+ virtual CBufSeg* DetailsListL(const TDesC& aSearchQuery) const = 0;
virtual void SetMachineIdL(TInt64 aMachineId) = 0;
virtual TPtrC UniqueIdL() = 0;
--- a/phonebookengines/contactsmodel/cntsrv/src/CCntFileManagerMsgHandler.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntsrv/src/CCntFileManagerMsgHandler.cpp Fri May 14 15:42:23 2010 +0300
@@ -56,7 +56,7 @@
ECntGetDatabaseReady,
ECntFetchTemplateIds,
ECntFetchGroupIdLists,
- ECntSearchResultIdLists,
+ ECntSearchResultList,
ECntFilesSize,
ECntGetDefinitionsForExistingView
};
@@ -397,26 +397,26 @@
aMessage.ReadL(1, searchQueryPtr);
CheckForManagerL();
- CContactIdArray* arrayPtr = iManager->GetPersistenceLayer().ContactProperties().SearchIdListL(searchQuery->Des());
- CleanupStack::PushL(arrayPtr);
- TPtr8 cntIDBuff = iPackager.PackL(*arrayPtr);
- TInt length = cntIDBuff.Length();
- CleanupStack::PopAndDestroy(); //arrayPtr
- CleanupStack::PopAndDestroy(); //searchQuery
-
- // Write data if client buffer is large enough otherwise return the
- // required buffer size.
- if(aMessage.GetDesMaxLength(0) >= length)
- {
- aMessage.WriteL(0, cntIDBuff);
+
+ CBufSeg* buffer = iManager->GetPersistenceLayer().ContactProperties().DetailsListL(searchQuery->Des());
+ if (aMessage.GetDesMaxLength(0) >= buffer->Size())
+ {
+ TInt offset = 0;
+ while (offset < buffer->Size())
+ {
+ TPtr8 ptr = buffer->Ptr(offset);
+ aMessage.WriteL(0, ptr, offset);
+ offset += ptr.Size();
+ }
aMessage.Complete(KErrNone);
}
else
- {
- aMessage.Complete(length);
+ {
+ aMessage.Complete(buffer->Size());
}
-
-
+
+ delete buffer;
+ CleanupStack::PopAndDestroy(); //searchQuery
}
@@ -425,6 +425,7 @@
DefinitionsOfExistingViewsL(aMessage);
}
+
void CCntFileManagerMsgHandler::FilesSizeL(const RMessage2& aMessage)
{
CheckForManagerL();
--- a/phonebookengines/contactsmodel/cntsrv/src/CCntServer.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/cntsrv/src/CCntServer.cpp Fri May 14 15:42:23 2010 +0300
@@ -364,7 +364,7 @@
iMsgLut.InsertL(ECntGetDatabaseReady, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::GetDatabaseReadyL));
iMsgLut.InsertL(ECntFetchTemplateIds, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::FetchTemplateIdsL));
iMsgLut.InsertL(ECntFetchGroupIdLists, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::FetchGroupIdListsL));
- iMsgLut.InsertL(ECntSearchResultIdLists, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::FetchSearchResultsL));
+ iMsgLut.InsertL(ECntSearchResultList, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::FetchSearchResultsL));
iMsgLut.InsertL(ECntFilesSize, static_cast<MsgHandlerFptr>(&CCntFileManagerMsgHandler::FilesSizeL));
--- a/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpcskeymap.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpcskeymap.cpp Fri May 14 15:42:23 2010 +0300
@@ -112,11 +112,14 @@
void UT_CPcsKeyMap::UT_NewLL()
{
#if defined(USE_ORBIT_KEYMAP)
- const TInt KAmountOfKeys = 10; // Must have same value as in cpcskeymap.cpp
+ // Must be same as in cpcskeymap.cpp
+ const TInt KAmountOfKeys = 12;
+ // Note that * and # keys do not have mappings in most languages
+ const TInt KAmountOfNumberKeys = 10;
// Each numeric key has been mapped
EUNIT_ASSERT_EQUALS( KAmountOfKeys, iKeyMap->iKeyMapping.count() );
- for (TInt i = 0; i < KAmountOfKeys; ++i)
+ for (TInt i = 0; i < KAmountOfNumberKeys; ++i)
{
EUNIT_ASSERT( iKeyMap->iKeyMapping.at(i).length() > 0 );
}
@@ -225,13 +228,11 @@
//
void UT_CPcsKeyMap::UT_GetNumericKeyStringWithSpecialCharactersL()
{
- _LIT( KAlpha, " +g-[5]t" );
+ _LIT( KAlpha, " +g-*[#5]?t" );
#if defined(USE_ORBIT_KEYMAP)
- // Orbit keymap code is used
- _LIT( KNumeric, " 141[5]8" );
+ _LIT( KNumeric, " a41afb5f18" );
#else
- // Hardcoded keymap is used
- _LIT( KNumeric, " +4-[5]8" );
+ _LIT( KNumeric, " a4-a[b5]?8" );
#endif
HBufC* numericBuf = iKeyMap->GetNumericKeyStringL( KAlpha, EFalse );
CleanupStack::PushL( numericBuf );
--- a/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpplpredictivesearchtable.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpplpredictivesearchtable.cpp Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,7 @@
#include "t_cpplpredictivesearchtable.h"
#include "pltables.h"
#include "dbsqlconstants.h"
+#include "cpcskeymap.h" // USE_ORBIT_KEYMAP macro
// SYSTEM INCLUDES
#include <digia/eunit/eunitmacros.h>
@@ -45,6 +46,9 @@
// Must have same value as KMaxDigits in cpplpredictivesearchtable.cpp
const TInt KMaxDigits = 15;
+
+const TInt KTableCount = 12;
+
// Must have same value as KConversionError in cpplpredictivesearchtable.cpp
const quint64 KConversionError = 0xeeeeeeeeeeeeeee;
@@ -787,31 +791,34 @@
void UT_CPplPredictiveSearchTable::UT_ConvertToHexL()
{
// Basic case
- EUNIT_ASSERT_EQUALS(0x4458aaaaaaaaaaa, iTable->ConvertToHex("4458"));
+ EUNIT_ASSERT_EQUALS(0x4458fffffffffff, iTable->ConvertToHex("4458"));
+
+ // Long digit
+ EUNIT_ASSERT_EQUALS(0x123456789012345, iTable->ConvertToHex("123456789012345"));
// Trailing zeros
- EUNIT_ASSERT_EQUALS(0x12345678900aaaa, iTable->ConvertToHex("12345678900"));
+ EUNIT_ASSERT_EQUALS(0x12345678900ffff, iTable->ConvertToHex("12345678900"));
// Leading zeros
- EUNIT_ASSERT_EQUALS(0x00123456789aaaa, iTable->ConvertToHex("00123456789"));
+ EUNIT_ASSERT_EQUALS(0x00123456789ffff, iTable->ConvertToHex("00123456789"));
// Just zeros
- EUNIT_ASSERT_EQUALS(0x00000aaaaaaaaaa, iTable->ConvertToHex("00000"));
- EUNIT_ASSERT_EQUALS(0x00000000000000a, iTable->ConvertToHex("00000000000000"));
+ EUNIT_ASSERT_EQUALS(0x00000ffffffffff, iTable->ConvertToHex("00000"));
+ EUNIT_ASSERT_EQUALS(0x00000000000000f, iTable->ConvertToHex("00000000000000"));
EUNIT_ASSERT_EQUALS(0x000000000000000, iTable->ConvertToHex("000000000000000"));
- EUNIT_ASSERT_EQUALS(0x0aaaaaaaaaaaaaa, iTable->ConvertToHex("0"));
+ EUNIT_ASSERT_EQUALS(0x0ffffffffffffff, iTable->ConvertToHex("0"));
// Zeros in the middle
- EUNIT_ASSERT_EQUALS(0x12300450008000a, iTable->ConvertToHex("12300450008000"));
+ EUNIT_ASSERT_EQUALS(0x12300450008000f, iTable->ConvertToHex("12300450008000"));
// Empty string
- EUNIT_ASSERT_EQUALS(0xaaaaaaaaaaaaaaa, iTable->ConvertToHex(""));
+ EUNIT_ASSERT_EQUALS(0xfffffffffffffff, iTable->ConvertToHex(""));
// Unmapped characters
- EUNIT_ASSERT_EQUALS(0x123aaaaaaaaaaaa, iTable->ConvertToHex("123??45??67"));
- EUNIT_ASSERT_EQUALS(0x00aaaaaaaaaaaaa, iTable->ConvertToHex("00?1234567"));
- EUNIT_ASSERT_EQUALS(0xaaaaaaaaaaaaaaa, iTable->ConvertToHex("?1234567"));
- EUNIT_ASSERT_EQUALS(0xaaaaaaaaaaaaaaa, iTable->ConvertToHex("???"));
+ EUNIT_ASSERT_EQUALS(0x123ffffffffffff, iTable->ConvertToHex("123??45??67"));
+ EUNIT_ASSERT_EQUALS(0x00fffffffffffff, iTable->ConvertToHex("00?1234567"));
+ EUNIT_ASSERT_EQUALS(0xfffffffffffffff, iTable->ConvertToHex("?1234567"));
+ EUNIT_ASSERT_EQUALS(0xfffffffffffffff, iTable->ConvertToHex("???"));
// Too many digits
EUNIT_ASSERT_EQUALS(KConversionError, iTable->ConvertToHex("12345678901234567890"));
@@ -864,9 +871,10 @@
TInt aCountInTable6,
TInt aCountInTable7,
TInt aCountInTable8,
- TInt aCountInTable9)
+ TInt aCountInTable9,
+ TInt aCountInTable10,
+ TInt aCountInTable11)
{
- const TInt KTableCount = 10;
TPtrC tableNames[KTableCount] =
{
KSqlContactPredSearchTable0,
@@ -878,15 +886,17 @@
KSqlContactPredSearchTable6,
KSqlContactPredSearchTable7,
KSqlContactPredSearchTable8,
- KSqlContactPredSearchTable9
+ KSqlContactPredSearchTable9,
+ KSqlContactPredSearchTable10,
+ KSqlContactPredSearchTable11
};
TInt rowCounts[KTableCount] = {0};
for (TInt i = 0; i < KTableCount; ++i)
{
HBufC* s = HBufC::NewLC(KCountSelect().Length() +
- // All table names are same length
- KSqlContactPredSearchTable0().Length());
+ // Enough space for longest table name
+ KSqlContactPredSearchTable11().Length());
TPtr ptr = s->Des();
ptr.Format(KCountSelect, &tableNames[i]);
@@ -906,6 +916,8 @@
EUNIT_ASSERT_EQUALS(aCountInTable7, rowCounts[7]);
EUNIT_ASSERT_EQUALS(aCountInTable8, rowCounts[8]);
EUNIT_ASSERT_EQUALS(aCountInTable9, rowCounts[9]);
+ EUNIT_ASSERT_EQUALS(aCountInTable10, rowCounts[10]);
+ EUNIT_ASSERT_EQUALS(aCountInTable11, rowCounts[11]);
}
// There is only need to search from one table (unless search string begins
@@ -930,7 +942,7 @@
// No need to use "WHERE.." or "ORDER BY first_name ASC"
_LIT(KSearchOneDigitFormat, "SELECT contact_id FROM %S");
select = HBufC::NewLC(KSearchOneDigitFormat().Length() +
- KSqlContactPredSearchTable0().Length());
+ KSqlContactPredSearchTable11().Length());
select->Des().AppendFormat(KSearchOneDigitFormat, &tableName);
}
else
@@ -944,7 +956,7 @@
TInt KNbrColumns = 4;
TInt KSpaceForLimits = KNbrColumns * 2 * (KMaxDigits + 2); // Two extra for decimal representation of max 15 hex digits
select = HBufC::NewLC(KSearchFormat().Length() +
- KSqlContactPredSearchTable0().Length() +
+ KSqlContactPredSearchTable11().Length() +
KSpaceForLimits);
select->Des().AppendFormat(KSearchFormat, &tableName,
lowerLimit, upperLimit,
@@ -998,6 +1010,10 @@
return KSqlContactPredSearchTable8;
case '9':
return KSqlContactPredSearchTable9;
+ case 'a':
+ return KSqlContactPredSearchTable10;
+ case 'b':
+ return KSqlContactPredSearchTable11;
default:
return KNullDesC;
}
@@ -1010,7 +1026,7 @@
TInt64 UT_CPplPredictiveSearchTable::UpperLimitL(const TDesC& aString) const
{
- return ConvertToNbrL(aString, 'a');
+ return ConvertToNbrL(aString, 'f');
}
TInt64 UT_CPplPredictiveSearchTable::ConvertToNbrL(const TDesC& aString,
@@ -1044,7 +1060,7 @@
_LIT(KCheckIfTableExistsFormat, "SELECT %S FROM %S;");
TInt bufSize = KCheckIfTableExistsFormat().Length() +
KPredSearchContactId().Length() +
- KSqlContactPredSearchTable0().Length();
+ KSqlContactPredSearchTable11().Length();
HBufC* sqlStatement = HBufC::NewLC(bufSize);
sqlStatement->Des().AppendFormat(KCheckIfTableExistsFormat,
&KPredSearchContactId,
@@ -1063,7 +1079,6 @@
// This function has code copied from CPplContactItemManager::DeletePredSearchTablesL
void UT_CPplPredictiveSearchTable::CPplContactItemManager_DeletePredSearchTablesL()
{
- const TInt KTableCount = 10;
const TDesC* KTableNames[KTableCount] =
{
&KSqlContactPredSearchTable0,
@@ -1075,7 +1090,9 @@
&KSqlContactPredSearchTable6,
&KSqlContactPredSearchTable7,
&KSqlContactPredSearchTable8,
- &KSqlContactPredSearchTable9
+ &KSqlContactPredSearchTable9,
+ &KSqlContactPredSearchTable10,
+ &KSqlContactPredSearchTable11
};
// IF EXISTS suppresses error that would occur if table does not exist
--- a/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpplpredictivesearchtable.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/contactsmodel/tsrc/cntplsql/src/t_cpplpredictivesearchtable.h Fri May 14 15:42:23 2010 +0300
@@ -91,7 +91,9 @@
TInt aCountInTable6 = 0,
TInt aCountInTable7 = 0,
TInt aCountInTable8 = 0,
- TInt aCountInTable9 = 0);
+ TInt aCountInTable9 = 0,
+ TInt aCountInTable10 = 0,
+ TInt aCountInTable11 = 0);
/**
* Adds a new contact to table.
--- a/phonebookengines/eabi/cntimageutilityu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/eabi/cntimageutilityu.def Fri May 14 15:42:23 2010 +0300
@@ -1,19 +1,22 @@
EXPORTS
- _ZN15CntImageUtility11createImageERK7QPixmapR7QStringRi @ 1 NONAME
- _ZN15CntImageUtility11createImageERK7QStringRS0_Ri @ 2 NONAME
+ _ZN15CntImageUtility11createImageERK7QPixmapR7QString @ 1 NONAME
+ _ZN15CntImageUtility11createImageERK7QStringRS0_ @ 2 NONAME
_ZN15CntImageUtility11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
_ZN15CntImageUtility11qt_metacastEPKc @ 4 NONAME
- _ZN15CntImageUtility11removeImageERK7QStringRi @ 5 NONAME
+ _ZN15CntImageUtility11removeImageERK7QString @ 5 NONAME
_ZN15CntImageUtility11selectDriveERi @ 6 NONAME
- _ZN15CntImageUtility16staticMetaObjectE @ 7 NONAME DATA 16
- _ZN15CntImageUtility19getStaticMetaObjectEv @ 8 NONAME
- _ZN15CntImageUtility8initPathER7QStringi @ 9 NONAME
- _ZN15CntImageUtilityC1EP7QObject @ 10 NONAME
- _ZN15CntImageUtilityC2EP7QObject @ 11 NONAME
- _ZN15CntImageUtilityD0Ev @ 12 NONAME
- _ZN15CntImageUtilityD1Ev @ 13 NONAME
- _ZN15CntImageUtilityD2Ev @ 14 NONAME
- _ZNK15CntImageUtility10metaObjectEv @ 15 NONAME
- _ZTI15CntImageUtility @ 16 NONAME
- _ZTV15CntImageUtility @ 17 NONAME
+ _ZN15CntImageUtility16isImageRemovableERK7QString @ 7 NONAME
+ _ZN15CntImageUtility16staticMetaObjectE @ 8 NONAME DATA 16
+ _ZN15CntImageUtility19getStaticMetaObjectEv @ 9 NONAME
+ _ZN15CntImageUtility22isMassStorageAvailableEv @ 10 NONAME
+ _ZN15CntImageUtility5errorEv @ 11 NONAME
+ _ZN15CntImageUtility8initPathER7QStringi @ 12 NONAME
+ _ZN15CntImageUtilityC1EP7QObject @ 13 NONAME
+ _ZN15CntImageUtilityC2EP7QObject @ 14 NONAME
+ _ZN15CntImageUtilityD0Ev @ 15 NONAME
+ _ZN15CntImageUtilityD1Ev @ 16 NONAME
+ _ZN15CntImageUtilityD2Ev @ 17 NONAME
+ _ZNK15CntImageUtility10metaObjectEv @ 18 NONAME
+ _ZTI15CntImageUtility @ 19 NONAME
+ _ZTV15CntImageUtility @ 20 NONAME
--- a/phonebookengines/eabi/simutilityu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/eabi/simutilityu.def Fri May 14 15:42:23 2010 +0300
@@ -23,4 +23,6 @@
_ZTI10SimUtility @ 22 NONAME
_ZTV10SimUtility @ 23 NONAME
_ZNK10SimUtility13isSimInsertedEv @ 24 NONAME
+ _ZN10SimUtility19adnCacheStatusReadyERNS_11CacheStatusEi @ 25 NONAME
+ _ZN10SimUtility20notifyAdnCacheStatusEv @ 26 NONAME
--- a/phonebookengines/mobcntactions/inc/mobcntemailaction.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntactions/inc/mobcntemailaction.h Fri May 14 15:42:23 2010 +0300
@@ -28,8 +28,9 @@
MobCntEmailAction();
~MobCntEmailAction();
- bool supportsDetail(const QContactDetail& detail) const;
QContactFilter contactFilter(const QVariant& value) const;
+ bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const;
+ QList<QContactDetail> supportedDetails(const QContact& contact) const;
MobCntEmailAction* clone() const;
void performAction();
};
--- a/phonebookengines/mobcntactions/inc/mobcntmessageaction.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntactions/inc/mobcntmessageaction.h Fri May 14 15:42:23 2010 +0300
@@ -28,6 +28,9 @@
MobCntMessageAction();
~MobCntMessageAction();
+ bool isDetailSupported(const QContactDetail &detail, const QContact &contact) const;
+ QList<QContactDetail> supportedDetails(const QContact& contact) const;
+
MobCntMessageAction* clone() const;
void performAction();
};
--- a/phonebookengines/mobcntactions/src/mobcntaction.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntactions/src/mobcntaction.cpp Fri May 14 15:42:23 2010 +0300
@@ -96,9 +96,10 @@
return (detail.definitionName() == QContactPhoneNumber::DefinitionName);
}
-QList<QContactDetail> MobCntAction::supportedDetails(const QContact& /*contact*/) const
+//virtual function, common code for call, videocall and message actions
+QList<QContactDetail> MobCntAction::supportedDetails(const QContact& contact) const
{
- return QList<QContactDetail>();
+ return contact.details(QContactPhoneNumber::DefinitionName);
}
QContactActionDescriptor MobCntAction::actionDescriptor() const
--- a/phonebookengines/mobcntactions/src/mobcntemailaction.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntactions/src/mobcntemailaction.cpp Fri May 14 15:42:23 2010 +0300
@@ -32,11 +32,6 @@
{
}
-bool MobCntEmailAction::supportsDetail(const QContactDetail& detail) const
-{
- return (detail.definitionName() == QContactEmailAddress::DefinitionName);
-}
-
QContactFilter MobCntEmailAction::contactFilter(const QVariant& value) const
{
Q_UNUSED(value);
@@ -47,6 +42,16 @@
return emailFilter;
}
+bool MobCntEmailAction::isDetailSupported(const QContactDetail &detail, const QContact &/*contact*/) const
+{
+ return (detail.definitionName() == QContactEmailAddress::DefinitionName);
+}
+
+QList<QContactDetail> MobCntEmailAction::supportedDetails(const QContact& contact) const
+{
+ return contact.details(QContactEmailAddress::DefinitionName);
+}
+
MobCntEmailAction* MobCntEmailAction::clone() const
{
return new MobCntEmailAction();
--- a/phonebookengines/mobcntactions/src/mobcntmessageaction.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntactions/src/mobcntmessageaction.cpp Fri May 14 15:42:23 2010 +0300
@@ -36,6 +36,34 @@
return new MobCntMessageAction();
}
+bool MobCntMessageAction::isDetailSupported(const QContactDetail &detail, const QContact &/*contact*/) const
+{
+ if (detail.definitionName() == QContactPhoneNumber::DefinitionName
+ && !static_cast<QContactPhoneNumber>(detail).subTypes().isEmpty())
+ {
+ return (static_cast<QContactPhoneNumber>(detail).subTypes().first() == QContactPhoneNumber::SubTypeMobile);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+QList<QContactDetail> MobCntMessageAction::supportedDetails(const QContact& contact) const
+{
+ QList<QContactDetail> details = contact.details(QContactPhoneNumber::DefinitionName);
+ QList<QContactDetail> supportedDetails;
+ for (int i = 0; i < details.count(); i++)
+ {
+ if (!static_cast<QContactPhoneNumber>(details[i]).subTypes().isEmpty()
+ && static_cast<QContactPhoneNumber>(details[i]).subTypes().first() == QContactPhoneNumber::SubTypeMobile)
+ {
+ supportedDetails.append(details[i]);
+ }
+ }
+ return supportedDetails;
+}
+
void MobCntMessageAction::performAction()
{
QString service("com.nokia.services.hbserviceprovider.conversationview");
--- a/phonebookengines/mobcntmodel/inc/mobcntmodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntmodel/inc/mobcntmodel.h Fri May 14 15:42:23 2010 +0300
@@ -19,7 +19,7 @@
#include <QAbstractListModel>
#include <QSharedData>
-#include <QIcon>
+#include <HbIcon>
#include "mobcntmodelglobal.h"
#include <qcontactmanager.h>
@@ -99,7 +99,8 @@
private:
QSharedDataPointer<MobCntModelData> d;
MobCntIconManager *mIconManager;
- QIcon mDefaultIcon;
+ HbIcon mDefaultIcon;
+ HbIcon mDefaultMyCardIcon;
};
#endif
--- a/phonebookengines/mobcntmodel/src/mobcntmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntmodel/src/mobcntmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -42,7 +42,8 @@
mIconManager = new MobCntIconManager();
connect(mIconManager, SIGNAL(contactIconReady(int)), this, SLOT(updateContactIcon(int)));
- mDefaultIcon = QIcon(":/icons/qtg_large_avatar.svg");
+ mDefaultIcon = HbIcon("qtg_large_avatar");
+ mDefaultMyCardIcon = HbIcon("qtg_large_mycard");
d = new MobCntModelData(contactFilter, contactSortOrders, showMyCard);
d->m_contactManager = new QContactManager;
@@ -71,7 +72,8 @@
mIconManager = new MobCntIconManager();
connect(mIconManager, SIGNAL(contactIconReady(int)), this, SLOT(updateContactIcon(int)));
- mDefaultIcon = QIcon(":/icons/qtg_large_avatar.svg");
+ mDefaultIcon = HbIcon("qtg_large_avatar");
+ mDefaultMyCardIcon = HbIcon("qtg_large_mycard");
d = new MobCntModelData(contactFilter, contactSortOrders, showMyCard);
d->m_contactManager = manager;
@@ -117,8 +119,11 @@
definitionRestrictions.append(QContactAvatar::DefinitionName);
definitionRestrictions.append(QContactPhoneNumber::DefinitionName);
definitionRestrictions.append(QContactOrganization::DefinitionName);
+ QContactFetchHint restrictions;
+ restrictions.setDetailDefinitionsHint(definitionRestrictions);
+ restrictions.setOptimizationHints(QContactFetchHint::NoRelationships);
- d->currentContact = d->m_contactManager->contact(d->contactIds[row], definitionRestrictions);
+ d->currentContact = d->m_contactManager->contact(d->contactIds[row], restrictions);
}
d->currentRow = row;
}
@@ -132,7 +137,7 @@
else if (role == Qt::BackgroundRole) {
if (d->mMyCardId == d->contactIds[row] ||
dummyMyCardId == d->contactIds[row]) {
- return HbFrameBackground("qtg_fr_groupbox", HbFrameDrawer::NinePieces);
+ return HbFrameBackground("qtg_fr_list_parent_normal", HbFrameDrawer::NinePieces);
}
}
else if (role == Qt::DecorationRole) {
@@ -142,14 +147,27 @@
if(!contactAvatar.imageUrl().isEmpty()) {
QIcon icon = mIconManager->contactIcon(contactAvatar.imageUrl().toString(), row);
if (icon.isNull()) {
- icons.append(mDefaultIcon);
+ if (d->mMyCardId == d->contactIds[row] ||
+ dummyMyCardId == d->contactIds[row]) {
+ icons.append(mDefaultMyCardIcon);
+ }
+ else {
+ icons.append(mDefaultIcon);
+ }
}
else {
icons.append(icon);
}
}
else {
- icons.append(mDefaultIcon);
+ if (d->mMyCardId == d->contactIds[row] ||
+ dummyMyCardId == d->contactIds[row]) {
+ icons.append(mDefaultMyCardIcon);
+ }
+ else {
+ icons.append(mDefaultIcon);
+ }
+
}
return QVariant(icons);
@@ -419,8 +437,8 @@
isSelfContact = true;
if (d->currentContact.details().count() <= 4) {
//empty card
- name = tr("My card");
- number = tr("Create my identity");
+ name = hbTrId("txt_phob_dblist_mycard");
+ number = hbTrId("txt_phob_dblist_mycard_val_create_my_identity");
}
else {
isNonEmptySelfContact = true;
@@ -500,8 +518,6 @@
if (contactIds.contains(d->mMyCardId))
d->mMyCardId = 0;
- updateContactIdsArray();
-
for (int i = (indexSequences.count() - 1);i >= 0; i--)
{
if (indexSequences.at(i).first() == 0 && d->showMyCard) {
@@ -522,6 +538,7 @@
endRemoveRows();
}
}
+ updateContactIdsArray();
}
/*!
--- a/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcntmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/mobcntmodel/tsrc/ut_mobcntmodel/src/ut_mobcntmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -28,7 +28,7 @@
mManager = new QContactManager("symbian");
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMapInit;
- mManager->removeContacts(&ids, &errorMapInit);
+ mManager->removeContacts(ids, &errorMapInit);
}
void TestMobCntModel::create()
@@ -57,8 +57,8 @@
//create and save contact
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QContactPhoneNumber number;
number.setNumber("1234567");
@@ -140,9 +140,7 @@
ret = mCntModel->data(modelIndex, Qt::DisplayRole);
QVERIFY(ret.type() == QVariant::StringList);
displayContent = ret.toStringList();
- QVERIFY(displayContent.count() == 2);
- QVERIFY(displayContent.at(0) == "My card");
- QVERIFY(displayContent.at(1) == "Create my identity");
+ QVERIFY(displayContent.count() == 2);// "My card" ; "Create my identity"
// add some content to MyCard
myCard.saveDetail(&number);
@@ -157,26 +155,26 @@
void TestMobCntModel::rowCount()
{
// we should have 2 contacts in the model saved from the last test case
- QCOMPARE(mCntModel->rowCount(),2);
- QVERIFY(mCntModel->rowCount() == 2);
+ QCOMPARE(mCntModel->rowCount(),3);
+ QVERIFY(mCntModel->rowCount() == 3);
}
void TestMobCntModel::contact()
{
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMapContact;
- mManager->removeContacts(&ids,&errorMapContact);
+ mManager->removeContacts(ids,&errorMapContact);
QTest::qWait(1000);
QModelIndex modelIndex = mCntModel->index(0, 0);
QContact empty = mCntModel->contact(modelIndex);
- QVERIFY(empty.isEmpty());
+ //QVERIFY(empty.isEmpty());
//create and save contact
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QContactPhoneNumber number;
number.setNumber("1234567");
@@ -213,14 +211,14 @@
void TestMobCntModel::setFilterAndSortOrder()
{
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -261,14 +259,14 @@
mCntModel = new MobCntModel(mManager);
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -302,14 +300,14 @@
void TestMobCntModel::rowId()
{
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -322,14 +320,14 @@
void TestMobCntModel::dataForDisplayRole()
{
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -343,14 +341,14 @@
void TestMobCntModel::updateContactIcon()
{
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -366,15 +364,15 @@
{
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMapHandleAdded;
- mManager->removeContacts(&ids,&errorMapHandleAdded);
+ mManager->removeContacts(ids,&errorMapHandleAdded);
QTest::qWait(1000);
QSignalSpy spy(mCntModel, SIGNAL(rowsAboutToBeInserted(const QModelIndex&, int, int)));
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -385,19 +383,19 @@
{
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMapHandleChanged;
- mManager->removeContacts(&ids,&errorMapHandleChanged);
+ mManager->removeContacts(ids,&errorMapHandleChanged);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
QSignalSpy spy(mCntModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex&)));
- name.setMiddle("mid");
+ name.setMiddleName("mid");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -410,7 +408,7 @@
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMapHandle;
- mManager->removeContacts(&ids,&errorMapHandle);
+ mManager->removeContacts(ids,&errorMapHandle);
QTest::qWait(1000);
QCOMPARE(spy.count(), 1);
@@ -418,14 +416,14 @@
void TestMobCntModel::handleMyCardChanged()
{
- QList<QContactLocalId> ids = mManager->contacts();
+ QList<QContactLocalId> ids = mManager->contactIds();
mManager->removeContacts(&ids);
QTest::qWait(1000);
QContact c;
QContactName name;
- name.setFirst("firstname");
- name.setLast("lastname");
+ name.setFirstName("firstname");
+ name.setLastName("lastname");
c.saveDetail(&name);
QVERIFY(mManager->saveContact(&c));
@@ -444,7 +442,8 @@
//let's have clean database after running tests
QList<QContactLocalId> ids = mManager->contactIds();
QMap<int, QContactManager::Error> errorMap;
- mManager->removeContacts(&ids, &errorMap);
+ mManager->removeContacts(ids, &errorMap);
delete mManager;
+ mManager = 0;
}
--- a/phonebookengines/simutility/inc/simutility.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/simutility/inc/simutility.h Fri May 14 15:42:23 2010 +0300
@@ -20,6 +20,7 @@
#include <qglobal.h>
#include <QObject>
#include <etelmm.h>
+#include <rmmcustomapi.h>
#include <secuisecuritysettings.h>
#include <secui.h>
@@ -38,7 +39,8 @@
enum ActiveRequest {
ENoActiveRequest = 0,
EGetInfo,
- EGetAvailableStores
+ EGetAvailableStores,
+ EGetCacheStatus
};
public:
@@ -81,17 +83,24 @@
};
struct AvailableStores {
+ bool SimPresent;
bool AdnStorePresent;
bool SdnStorePresent;
bool FdnStorePresent;
AvailableStores() {
+ SimPresent = false;
AdnStorePresent = false;
SdnStorePresent = false;
FdnStorePresent = false;
};
};
+ enum CacheStatus {
+ ECacheReady,
+ ECacheFailed
+ };
+
public:
SimUtility(StoreType type, int& error, QObject *parent = 0);
~SimUtility();
@@ -106,6 +115,7 @@
//async request
bool startGetSimInfo();
bool startGetAvailableStores();
+ bool notifyAdnCacheStatus();
public:
void RequestCompleted(int error);
@@ -113,6 +123,7 @@
signals:
void simInfoReady(SimUtility::SimInfo& simInfo, int error);
void availableStoresReady(SimUtility::AvailableStores& availableStores, int error);
+ void adnCacheStatusReady(SimUtility::CacheStatus& cacheStatus, int error);
private:
void ParseServiceTable(AvailableStores* availableStores) const;
@@ -127,6 +138,8 @@
RMobilePhone::TMobilePhoneServiceTableV1 m_serviceTable;
RMobilePhone::TMobilePhoneServiceTableV1Pckg m_serviceTablePckg;
RMobilePhone::TMobilePhoneServiceTable m_serviceTableType;
+ RMmCustomAPI m_customPhone;
+ TName m_etelStoreNameCached;
AsyncWorker* m_asyncWorker;
int m_activeRequest;
--- a/phonebookengines/simutility/simutility.pro Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/simutility/simutility.pro Fri May 14 15:42:23 2010 +0300
@@ -41,4 +41,5 @@
LIBS += -letel \
-letelmm \
- -lsecui
+ -lsecui \
+ -lcustomapi
--- a/phonebookengines/simutility/src/simutility.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookengines/simutility/src/simutility.cpp Fri May 14 15:42:23 2010 +0300
@@ -23,8 +23,15 @@
: QObject(parent),
m_etelStoreInfoPckg(m_etelStoreInfo),
m_serviceTablePckg(m_serviceTable),
- m_activeRequest(ENoActiveRequest)
+ m_asyncWorker(NULL),
+ m_activeRequest(ENoActiveRequest),
+ m_securitySettings(NULL)
{
+#ifdef __WINS__
+ error = KErrNotSupported;
+ return;
+#endif
+
error = m_etelServer.Connect();
if (error == KErrNone) {
error = m_etelServer.LoadPhoneModule(KMmTsyModuleName);
@@ -53,6 +60,10 @@
}
if (error == KErrNone) {
+ error = m_customPhone.Open(m_etelPhone);
+ }
+
+ if (error == KErrNone) {
TRAP(error,
m_asyncWorker = new (ELeave)AsyncWorker(this);
TSecUi::InitializeLibL();
@@ -194,6 +205,47 @@
return true;
}
+bool SimUtility::notifyAdnCacheStatus()
+{
+ if(m_asyncWorker->IsActive()) {
+ return false;
+ }
+ CacheStatus cacheStatus;
+
+ //check current cache status
+ TRequestStatus requestStatus;
+ RMmCustomAPI::TPndCacheStatus pndStatus;
+ TName storeName;
+ storeName.Copy(KETelIccAdnPhoneBook);
+ m_customPhone.GetPndCacheStatus(requestStatus, pndStatus, storeName);
+ User::WaitForRequest(requestStatus);
+ if (requestStatus.Int() != KErrNone) {
+ return false;
+ }
+
+ if (pndStatus == RMmCustomAPI::ECacheReady ||
+ pndStatus == RMmCustomAPI::ECacheNotUsed) {
+ cacheStatus = ECacheReady;
+ emit adnCacheStatusReady(cacheStatus, KErrNone);
+ return true;
+ }
+ else if (pndStatus == RMmCustomAPI::ECacheFailed) {
+ cacheStatus = ECacheFailed;
+ emit adnCacheStatusReady(cacheStatus, KErrNone);
+ return true;
+ }
+ else if (pndStatus == RMmCustomAPI::ECacheNotReady) {
+ //wait for cache notification
+ m_customPhone.NotifyPndCacheReady(m_asyncWorker->iStatus, m_etelStoreNameCached);
+ m_asyncWorker->SetActive();
+ m_activeRequest = EGetCacheStatus;
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
void SimUtility::RequestCompleted(int error)
{
if (m_activeRequest == EGetInfo) {
@@ -219,23 +271,40 @@
AvailableStores availableStores;
if (error == KErrNone) {
//parse service table to find what stores are supported
- ParseServiceTable(&availableStores);
+ ParseServiceTable(&availableStores);
}
emit availableStoresReady(availableStores, error);
}//EGetAvailableStores
+ else if (m_activeRequest == EGetCacheStatus) {
+ if ( m_etelStoreNameCached.Compare(KETelIccAdnPhoneBook) == 0) {
+ //ADN cache is ready
+ CacheStatus cacheStatus;
+ if (error != KErrNone) {
+ cacheStatus = ECacheFailed;
+ emit adnCacheStatusReady(cacheStatus, error);
+ }
+ else {
+ cacheStatus = ECacheReady;
+ emit adnCacheStatusReady(cacheStatus, error);
+ }
+ }
+ else {
+ //another store is cached, continue listening for ADN cache
+ notifyAdnCacheStatus();
+ }
+ }//EGetCacheStatus
- m_activeRequest = ENoActiveRequest;
+ if (!m_asyncWorker->IsActive()) {
+ m_activeRequest = ENoActiveRequest;
+ }
}
void SimUtility::ParseServiceTable(AvailableStores* availableStores) const
{
+ availableStores->SimPresent = true;
if (m_serviceTableType == RMobilePhone::EUSIMServiceTable) {
- if (m_serviceTable.iServices1To8 & RMobilePhone::KUstLocalPhBk ) {
- availableStores->AdnStorePresent = true;
- }
- else {
- availableStores->AdnStorePresent = false;
- }
+ //ADN store is always present if SIM card is inserted
+ availableStores->AdnStorePresent = true;
if (m_serviceTable.iServices1To8 & RMobilePhone::KUstSDN ) {
availableStores->SdnStorePresent = true;
@@ -252,12 +321,8 @@
}
}
else if (m_serviceTableType == RMobilePhone::ESIMServiceTable) {
- if (m_serviceTable.iServices1To8 & RMobilePhone::KSstADN ) {
- availableStores->AdnStorePresent = true;
- }
- else {
- availableStores->AdnStorePresent = false;
- }
+ //ADN store is always present if SIM card is inserted
+ availableStores->AdnStorePresent = true;
if (m_serviceTable.iServices17To24 & RMobilePhone::KSstSDN) {
availableStores->SdnStorePresent = true;
--- a/phonebookui/bwins/cnthistorymodelu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/bwins/cnthistorymodelu.def Fri May 14 15:42:23 2010 +0300
@@ -1,37 +1,37 @@
EXPORTS
- ?clearHistory@CntHistoryModel@@QAEXXZ @ 1 NONAME ; void CntHistoryModel::clearHistory(void)
- ??1CntHistoryModel@@UAE@XZ @ 2 NONAME ; CntHistoryModel::~CntHistoryModel(void)
- ?messageAdded@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 3 NONAME ; void CntHistoryModel::messageAdded(class MsgItem &)
- ?qt_metacast@CntHistoryModel@@UAEPAXPBD@Z @ 4 NONAME ; void * CntHistoryModel::qt_metacast(char const *)
- ?validateRowIndex@CntHistoryModel@@ABE_NH@Z @ 5 NONAME ; bool CntHistoryModel::validateRowIndex(int) const
- ?metaObject@CntHistoryModel@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * CntHistoryModel::metaObject(void) const
- ?messageChanged@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 7 NONAME ; void CntHistoryModel::messageChanged(class MsgItem &)
- ?readLogEvent@CntHistoryModel@@AAEXPAVLogsEvent@@AAVHistoryItem@@@Z @ 8 NONAME ; void CntHistoryModel::readLogEvent(class LogsEvent *, class HistoryItem &)
- ?qt_metacall@CntHistoryModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int CntHistoryModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?messagesReady@CntHistoryModel@@AAEXAAV?$QList@VMsgItem@@@@@Z @ 10 NONAME ; void CntHistoryModel::messagesReady(class QList<class MsgItem> &)
- ?staticMetaObject@CntHistoryModel@@2UQMetaObject@@B @ 11 NONAME ; struct QMetaObject const CntHistoryModel::staticMetaObject
- ?sort@CntHistoryModel@@UAEXHW4SortOrder@Qt@@@Z @ 12 NONAME ; void CntHistoryModel::sort(int, enum Qt::SortOrder)
- ?trUtf8@CntHistoryModel@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString CntHistoryModel::trUtf8(char const *, char const *)
- ?tr@CntHistoryModel@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString CntHistoryModel::tr(char const *, char const *)
- ?initializeLogsModel@CntHistoryModel@@AAEXXZ @ 15 NONAME ; void CntHistoryModel::initializeLogsModel(void)
- ?trUtf8@CntHistoryModel@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString CntHistoryModel::trUtf8(char const *, char const *, int)
- ?sortAndRefresh@CntHistoryModel@@QAEXW4SortOrder@Qt@@@Z @ 17 NONAME ; void CntHistoryModel::sortAndRefresh(enum Qt::SortOrder)
- ?markAllAsSeen@CntHistoryModel@@QAEXXZ @ 18 NONAME ; void CntHistoryModel::markAllAsSeen(void)
- ??0CntHistoryModel@@QAE@IPAVQContactManager@QtMobility@@PAVQObject@@@Z @ 19 NONAME ; CntHistoryModel::CntHistoryModel(unsigned int, class QtMobility::QContactManager *, class QObject *)
- ?data@CntHistoryModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 20 NONAME ; class QVariant CntHistoryModel::data(class QModelIndex const &, int) const
- ?markingCompleted@CntHistoryModel@@AAEXH@Z @ 21 NONAME ; void CntHistoryModel::markingCompleted(int)
- ?initializeMsgModel@CntHistoryModel@@AAEXXZ @ 22 NONAME ; void CntHistoryModel::initializeMsgModel(void)
- ?findIndices@CntHistoryModel@@AAE?AV?$QList@V?$QList@H@@@@ABV?$QList@H@@@Z @ 23 NONAME ; class QList<class QList<int> > CntHistoryModel::findIndices(class QList<int> const &)
- ??_ECntHistoryModel@@UAE@I@Z @ 24 NONAME ; CntHistoryModel::~CntHistoryModel(unsigned int)
- ?displayRoleData@CntHistoryModel@@ABE?AVQVariant@@ABVHistoryItem@@@Z @ 25 NONAME ; class QVariant CntHistoryModel::displayRoleData(class HistoryItem const &) const
- ?initializeModel@CntHistoryModel@@AAEXXZ @ 26 NONAME ; void CntHistoryModel::initializeModel(void)
- ?rowCount@CntHistoryModel@@UBEHABVQModelIndex@@@Z @ 27 NONAME ; int CntHistoryModel::rowCount(class QModelIndex const &) const
- ?logsRowsRemoved@CntHistoryModel@@AAEXABVQModelIndex@@HH@Z @ 28 NONAME ; void CntHistoryModel::logsRowsRemoved(class QModelIndex const &, int, int)
- ?readMsgEvent@CntHistoryModel@@AAEXAAVMsgItem@@AAVHistoryItem@@@Z @ 29 NONAME ; void CntHistoryModel::readMsgEvent(class MsgItem &, class HistoryItem &)
- ?messageDeleted@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 30 NONAME ; void CntHistoryModel::messageDeleted(class MsgItem &)
- ?tr@CntHistoryModel@@SA?AVQString@@PBD0H@Z @ 31 NONAME ; class QString CntHistoryModel::tr(char const *, char const *, int)
- ?getStaticMetaObject@CntHistoryModel@@SAABUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const & CntHistoryModel::getStaticMetaObject(void)
- ?logsDataChanged@CntHistoryModel@@AAEXABVQModelIndex@@0@Z @ 33 NONAME ; void CntHistoryModel::logsDataChanged(class QModelIndex const &, class QModelIndex const &)
- ?clearedCallLogs@CntHistoryModel@@AAEXH@Z @ 34 NONAME ; void CntHistoryModel::clearedCallLogs(int)
- ?logsRowsInserted@CntHistoryModel@@AAEXABVQModelIndex@@HH@Z @ 35 NONAME ; void CntHistoryModel::logsRowsInserted(class QModelIndex const &, int, int)
+ ?initializeModel@CntHistoryModel@@AAEXXZ @ 1 NONAME ; void CntHistoryModel::initializeModel(void)
+ ?rowCount@CntHistoryModel@@UBEHABVQModelIndex@@@Z @ 2 NONAME ; int CntHistoryModel::rowCount(class QModelIndex const &) const
+ ?clearHistory@CntHistoryModel@@QAEXXZ @ 3 NONAME ; void CntHistoryModel::clearHistory(void)
+ ?logsRowsRemoved@CntHistoryModel@@AAEXABVQModelIndex@@HH@Z @ 4 NONAME ; void CntHistoryModel::logsRowsRemoved(class QModelIndex const &, int, int)
+ ??1CntHistoryModel@@UAE@XZ @ 5 NONAME ; CntHistoryModel::~CntHistoryModel(void)
+ ?messageAdded@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 6 NONAME ; void CntHistoryModel::messageAdded(class MsgItem &)
+ ?qt_metacast@CntHistoryModel@@UAEPAXPBD@Z @ 7 NONAME ; void * CntHistoryModel::qt_metacast(char const *)
+ ?validateRowIndex@CntHistoryModel@@ABE_NH@Z @ 8 NONAME ; bool CntHistoryModel::validateRowIndex(int) const
+ ?metaObject@CntHistoryModel@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * CntHistoryModel::metaObject(void) const
+ ?messageChanged@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 10 NONAME ; void CntHistoryModel::messageChanged(class MsgItem &)
+ ?readLogEvent@CntHistoryModel@@AAEXPAVLogsEvent@@AAVHistoryItem@@@Z @ 11 NONAME ; void CntHistoryModel::readLogEvent(class LogsEvent *, class HistoryItem &)
+ ?qt_metacall@CntHistoryModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int CntHistoryModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?messagesReady@CntHistoryModel@@AAEXAAV?$QList@VMsgItem@@@@@Z @ 13 NONAME ; void CntHistoryModel::messagesReady(class QList<class MsgItem> &)
+ ?staticMetaObject@CntHistoryModel@@2UQMetaObject@@B @ 14 NONAME ; struct QMetaObject const CntHistoryModel::staticMetaObject
+ ?readMsgEvent@CntHistoryModel@@AAEXAAVMsgItem@@AAVHistoryItem@@@Z @ 15 NONAME ; void CntHistoryModel::readMsgEvent(class MsgItem &, class HistoryItem &)
+ ?decorationRoleData@CntHistoryModel@@ABE?AVQVariant@@ABVHistoryItem@@@Z @ 16 NONAME ; class QVariant CntHistoryModel::decorationRoleData(class HistoryItem const &) const
+ ?sort@CntHistoryModel@@UAEXHW4SortOrder@Qt@@@Z @ 17 NONAME ; void CntHistoryModel::sort(int, enum Qt::SortOrder)
+ ?messageDeleted@CntHistoryModel@@AAEXAAVMsgItem@@@Z @ 18 NONAME ; void CntHistoryModel::messageDeleted(class MsgItem &)
+ ?trUtf8@CntHistoryModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString CntHistoryModel::trUtf8(char const *, char const *)
+ ?backgroundRoleData@CntHistoryModel@@ABE?AVQVariant@@ABVHistoryItem@@@Z @ 20 NONAME ; class QVariant CntHistoryModel::backgroundRoleData(class HistoryItem const &) const
+ ?tr@CntHistoryModel@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString CntHistoryModel::tr(char const *, char const *, int)
+ ?tr@CntHistoryModel@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString CntHistoryModel::tr(char const *, char const *)
+ ?getStaticMetaObject@CntHistoryModel@@SAABUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const & CntHistoryModel::getStaticMetaObject(void)
+ ?initializeLogsModel@CntHistoryModel@@AAEXXZ @ 24 NONAME ; void CntHistoryModel::initializeLogsModel(void)
+ ?trUtf8@CntHistoryModel@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString CntHistoryModel::trUtf8(char const *, char const *, int)
+ ?sortAndRefresh@CntHistoryModel@@QAEXW4SortOrder@Qt@@@Z @ 26 NONAME ; void CntHistoryModel::sortAndRefresh(enum Qt::SortOrder)
+ ?logsDataChanged@CntHistoryModel@@AAEXABVQModelIndex@@0@Z @ 27 NONAME ; void CntHistoryModel::logsDataChanged(class QModelIndex const &, class QModelIndex const &)
+ ?markAllAsSeen@CntHistoryModel@@QAEXXZ @ 28 NONAME ; void CntHistoryModel::markAllAsSeen(void)
+ ??0CntHistoryModel@@QAE@IPAVQContactManager@QtMobility@@PAVQObject@@@Z @ 29 NONAME ; CntHistoryModel::CntHistoryModel(unsigned int, class QtMobility::QContactManager *, class QObject *)
+ ?data@CntHistoryModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 30 NONAME ; class QVariant CntHistoryModel::data(class QModelIndex const &, int) const
+ ?logsRowsInserted@CntHistoryModel@@AAEXABVQModelIndex@@HH@Z @ 31 NONAME ; void CntHistoryModel::logsRowsInserted(class QModelIndex const &, int, int)
+ ?initializeMsgModel@CntHistoryModel@@AAEXXZ @ 32 NONAME ; void CntHistoryModel::initializeMsgModel(void)
+ ?findIndices@CntHistoryModel@@AAE?AV?$QList@V?$QList@H@@@@ABV?$QList@H@@@Z @ 33 NONAME ; class QList<class QList<int> > CntHistoryModel::findIndices(class QList<int> const &)
+ ??_ECntHistoryModel@@UAE@I@Z @ 34 NONAME ; CntHistoryModel::~CntHistoryModel(unsigned int)
+ ?displayRoleData@CntHistoryModel@@ABE?AVQVariant@@ABVHistoryItem@@@Z @ 35 NONAME ; class QVariant CntHistoryModel::displayRoleData(class HistoryItem const &) const
--- a/phonebookui/bwins/pbkcommonuiu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/bwins/pbkcommonuiu.def Fri May 14 15:42:23 2010 +0300
@@ -30,92 +30,92 @@
?trUtf8@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *, int)
?trUtf8@CntEditView@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString CntEditView::trUtf8(char const *, char const *, int)
??1CntEditView@@UAE@XZ @ 31 NONAME ; CntEditView::~CntEditView(void)
- ?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 32 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *)
- ?deactivate@CntBaseSelectionView@@UAEXXZ @ 33 NONAME ; void CntBaseSelectionView::deactivate(void)
- ?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 34 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const
- ?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 35 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *)
- ?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 36 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const
- ?backPressed@CntContactCardView@@IAEXXZ @ 37 NONAME ; void CntContactCardView::backPressed(void)
- ?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 38 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 39 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
- ?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 40 NONAME ; class QString CntViewNavigator::tr(char const *, char const *)
- ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int)
- ?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void)
- ?viewId@CntEditView@@UBEHXZ @ 43 NONAME ; int CntEditView::viewId(void) const
- ?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int)
- ?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 45 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *)
- ?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 46 NONAME ; void * CntContactCardView::qt_metacast(char const *)
- ?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 47 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
- ?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 48 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?viewClosed@CntBaseSelectionView@@IAEXXZ @ 49 NONAME ; void CntBaseSelectionView::viewClosed(void)
- ?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 50 NONAME ; void * CntViewNavigator::qt_metacast(char const *)
- ??0CntEditView@@QAE@XZ @ 51 NONAME ; CntEditView::CntEditView(void)
- ?view@CntContactCardView@@UBEPAVHbView@@XZ @ 52 NONAME ; class HbView * CntContactCardView::view(void) const
- ?keyPressed@CntMainWindow@@IAEXPAVQKeyEvent@@@Z @ 53 NONAME ; void CntMainWindow::keyPressed(class QKeyEvent *)
- ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 54 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int)
- ?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const
- ?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 56 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int)
- ?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString CntContactCardView::tr(char const *, char const *)
- ?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString CntEditView::tr(char const *, char const *)
- ??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 59 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *)
- ?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 60 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void)
- ?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const
- ?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 62 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject
- ?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 63 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const
- ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int)
- ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 65 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *)
- ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 66 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *)
- ?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 67 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void)
- ??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 68 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *)
- ?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 69 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int)
- ?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 70 NONAME ; void CntViewNavigator::next(int const &, class QFlags<enum Hb::ViewSwitchFlag> &)
- ?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 71 NONAME ; void * CntEditView::qt_metacast(char const *)
- ?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 72 NONAME ; void CntDefaultViewManager::switchView(class QMap<int, class QVariant>, class QFlags<enum Hb::ViewSwitchFlag>)
- ?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 73 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &)
- ?contactUpdated@CntEditView@@IAEXXZ @ 74 NONAME ; void CntEditView::contactUpdated(void)
- ?deactivate@CntEditView@@UAEXXZ @ 75 NONAME ; void CntEditView::deactivate(void)
- ?addEffect@CntViewNavigator@@QAEXABH0@Z @ 76 NONAME ; void CntViewNavigator::addEffect(int const &, int const &)
- ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 77 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *)
- ?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 78 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject
- ?removeException@CntViewNavigator@@QAEXABH@Z @ 79 NONAME ; void CntViewNavigator::removeException(int const &)
- ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *)
- ?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 81 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const
- ?viewOpened@CntBaseSelectionView@@IAEXV?$QMap@HVQVariant@@@@@Z @ 82 NONAME ; void CntBaseSelectionView::viewOpened(class QMap<int, class QVariant>)
- ??_ECntMainWindow@@UAE@I@Z @ 83 NONAME ; CntMainWindow::~CntMainWindow(unsigned int)
- ??1CntDefaultViewManager@@UAE@XZ @ 84 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void)
- ?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 85 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const
- ?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 86 NONAME ; int const & CntViewNavigator::back(class QFlags<enum Hb::ViewSwitchFlag> &)
- ??0CntContactCardView@@QAE@XZ @ 87 NONAME ; CntContactCardView::CntContactCardView(void)
- ?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 88 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const
- ?deactivate@CntContactCardView@@UAEXXZ @ 89 NONAME ; void CntContactCardView::deactivate(void)
- ?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 90 NONAME ; void CntDefaultViewManager::changeView(class QMap<int, class QVariant>)
- ?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void)
- ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 92 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int)
- ??_ECntContactCardView@@UAE@I@Z @ 93 NONAME ; CntContactCardView::~CntContactCardView(unsigned int)
- ?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString CntEditView::tr(char const *, char const *, int)
- ?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 95 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject
- ?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 96 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 97 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void)
- ?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 98 NONAME ; class QString CntEditView::trUtf8(char const *, char const *)
- ?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 99 NONAME ; void * CntMainWindow::qt_metacast(char const *)
- ??1CntViewNavigator@@UAE@XZ @ 100 NONAME ; CntViewNavigator::~CntViewNavigator(void)
- ?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 101 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 102 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *)
- ?isDefault@CntBaseSelectionView@@UBE_NXZ @ 104 NONAME ; bool CntBaseSelectionView::isDefault(void) const
- ?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 105 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject
- ??1CntBaseSelectionView@@UAE@XZ @ 106 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void)
- ??1CntContactCardView@@UAE@XZ @ 107 NONAME ; CntContactCardView::~CntContactCardView(void)
- ?isDefault@CntContactCardView@@UBE_NXZ @ 108 NONAME ; bool CntContactCardView::isDefault(void) const
- ?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int)
- ?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 110 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int)
- ??_ECntEditView@@UAE@I@Z @ 111 NONAME ; CntEditView::~CntEditView(unsigned int)
- ??0CntBaseSelectionView@@QAE@XZ @ 112 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void)
- ??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 113 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int)
- ?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 114 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void)
- ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *)
- ?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 116 NONAME ; void CntDefaultViewManager::removeCurrentView(void)
- ?contactRemoved@CntEditView@@IAEXXZ @ 117 NONAME ; void CntEditView::contactRemoved(void)
+ ?contactUpdated@CntEditView@@IAEX_N@Z @ 32 NONAME ; void CntEditView::contactUpdated(bool)
+ ?qt_metacast@CntBaseSelectionView@@UAEPAXPBD@Z @ 33 NONAME ; void * CntBaseSelectionView::qt_metacast(char const *)
+ ?deactivate@CntBaseSelectionView@@UAEXXZ @ 34 NONAME ; void CntBaseSelectionView::deactivate(void)
+ ?metaObject@CntBaseSelectionView@@UBEPBUQMetaObject@@XZ @ 35 NONAME ; struct QMetaObject const * CntBaseSelectionView::metaObject(void) const
+ ?setViewFactory@CntDefaultViewManager@@QAEXPAVCntAbstractViewFactory@@@Z @ 36 NONAME ; void CntDefaultViewManager::setViewFactory(class CntAbstractViewFactory *)
+ ?d_func@CntEditView@@ABEPBVCntEditViewPrivate@@XZ @ 37 NONAME ; class CntEditViewPrivate const * CntEditView::d_func(void) const
+ ?backPressed@CntContactCardView@@IAEXXZ @ 38 NONAME ; void CntContactCardView::backPressed(void)
+ ?qt_metacall@CntViewNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int CntViewNavigator::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?activate@CntBaseSelectionView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 40 NONAME ; void CntBaseSelectionView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+ ?tr@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 41 NONAME ; class QString CntViewNavigator::tr(char const *, char const *)
+ ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0H@Z @ 42 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *, int)
+ ?getStaticMetaObject@CntViewNavigator@@SAABUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const & CntViewNavigator::getStaticMetaObject(void)
+ ?viewId@CntEditView@@UBEHXZ @ 44 NONAME ; int CntEditView::viewId(void) const
+ ?tr@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString CntViewNavigator::tr(char const *, char const *, int)
+ ?qt_metacast@CntDefaultViewManager@@UAEPAXPBD@Z @ 46 NONAME ; void * CntDefaultViewManager::qt_metacast(char const *)
+ ?qt_metacast@CntContactCardView@@UAEPAXPBD@Z @ 47 NONAME ; void * CntContactCardView::qt_metacast(char const *)
+ ?activate@CntEditView@@UAEXPAVCntAbstractViewManager@@V?$QMap@HVQVariant@@@@@Z @ 48 NONAME ; void CntEditView::activate(class CntAbstractViewManager *, class QMap<int, class QVariant>)
+ ?qt_metacall@CntDefaultViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 49 NONAME ; int CntDefaultViewManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?viewClosed@CntBaseSelectionView@@IAEXXZ @ 50 NONAME ; void CntBaseSelectionView::viewClosed(void)
+ ?qt_metacast@CntViewNavigator@@UAEPAXPBD@Z @ 51 NONAME ; void * CntViewNavigator::qt_metacast(char const *)
+ ??0CntEditView@@QAE@XZ @ 52 NONAME ; CntEditView::CntEditView(void)
+ ?view@CntContactCardView@@UBEPAVHbView@@XZ @ 53 NONAME ; class HbView * CntContactCardView::view(void) const
+ ?keyPressed@CntMainWindow@@IAEXPAVQKeyEvent@@@Z @ 54 NONAME ; void CntMainWindow::keyPressed(class QKeyEvent *)
+ ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 55 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *, int)
+ ?metaObject@CntContactCardView@@UBEPBUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const * CntContactCardView::metaObject(void) const
+ ?tr@CntContactCardView@@SA?AVQString@@PBD0H@Z @ 57 NONAME ; class QString CntContactCardView::tr(char const *, char const *, int)
+ ?tr@CntContactCardView@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString CntContactCardView::tr(char const *, char const *)
+ ?tr@CntEditView@@SA?AVQString@@PBD0@Z @ 59 NONAME ; class QString CntEditView::tr(char const *, char const *)
+ ??0CntViewNavigator@@QAE@PAVQObject@@@Z @ 60 NONAME ; CntViewNavigator::CntViewNavigator(class QObject *)
+ ?d_func@CntContactCardView@@AAEPAVCntContactCardViewPrivate@@XZ @ 61 NONAME ; class CntContactCardViewPrivate * CntContactCardView::d_func(void)
+ ?metaObject@CntViewNavigator@@UBEPBUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const * CntViewNavigator::metaObject(void) const
+ ?staticMetaObject@CntContactCardView@@2UQMetaObject@@B @ 63 NONAME ; struct QMetaObject const CntContactCardView::staticMetaObject
+ ?d_func@CntContactCardView@@ABEPBVCntContactCardViewPrivate@@XZ @ 64 NONAME ; class CntContactCardViewPrivate const * CntContactCardView::d_func(void) const
+ ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *, int)
+ ?trUtf8@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 66 NONAME ; class QString CntBaseSelectionView::trUtf8(char const *, char const *)
+ ?tr@CntBaseSelectionView@@SA?AVQString@@PBD0@Z @ 67 NONAME ; class QString CntBaseSelectionView::tr(char const *, char const *)
+ ?getStaticMetaObject@CntBaseSelectionView@@SAABUQMetaObject@@XZ @ 68 NONAME ; struct QMetaObject const & CntBaseSelectionView::getStaticMetaObject(void)
+ ??0CntDefaultViewManager@@QAE@PAVHbMainWindow@@@Z @ 69 NONAME ; CntDefaultViewManager::CntDefaultViewManager(class HbMainWindow *)
+ ?createView@CntDefaultViewFactory@@UAEPAVCntAbstractView@@H@Z @ 70 NONAME ; class CntAbstractView * CntDefaultViewFactory::createView(int)
+ ?next@CntViewNavigator@@QAEXABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 71 NONAME ; void CntViewNavigator::next(int const &, class QFlags<enum Hb::ViewSwitchFlag> &)
+ ?qt_metacast@CntEditView@@UAEPAXPBD@Z @ 72 NONAME ; void * CntEditView::qt_metacast(char const *)
+ ?switchView@CntDefaultViewManager@@AAEXV?$QMap@HVQVariant@@@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 73 NONAME ; void CntDefaultViewManager::switchView(class QMap<int, class QVariant>, class QFlags<enum Hb::ViewSwitchFlag>)
+ ?contactRemoved@CntEditView@@IAEX_N@Z @ 74 NONAME ; void CntEditView::contactRemoved(bool)
+ ?contactManager@CntDefaultViewManager@@UAEPAVQContactManager@QtMobility@@ABVQString@@@Z @ 75 NONAME ; class QtMobility::QContactManager * CntDefaultViewManager::contactManager(class QString const &)
+ ?deactivate@CntEditView@@UAEXXZ @ 76 NONAME ; void CntEditView::deactivate(void)
+ ?addEffect@CntViewNavigator@@QAEXABH0@Z @ 77 NONAME ; void CntViewNavigator::addEffect(int const &, int const &)
+ ?trUtf8@CntContactCardView@@SA?AVQString@@PBD0@Z @ 78 NONAME ; class QString CntContactCardView::trUtf8(char const *, char const *)
+ ?staticMetaObject@CntDefaultViewManager@@2UQMetaObject@@B @ 79 NONAME ; struct QMetaObject const CntDefaultViewManager::staticMetaObject
+ ?removeException@CntViewNavigator@@QAEXABH@Z @ 80 NONAME ; void CntViewNavigator::removeException(int const &)
+ ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *)
+ ?metaObject@CntEditView@@UBEPBUQMetaObject@@XZ @ 82 NONAME ; struct QMetaObject const * CntEditView::metaObject(void) const
+ ?viewOpened@CntBaseSelectionView@@IAEXV?$QMap@HVQVariant@@@@@Z @ 83 NONAME ; void CntBaseSelectionView::viewOpened(class QMap<int, class QVariant>)
+ ??_ECntMainWindow@@UAE@I@Z @ 84 NONAME ; CntMainWindow::~CntMainWindow(unsigned int)
+ ??1CntDefaultViewManager@@UAE@XZ @ 85 NONAME ; CntDefaultViewManager::~CntDefaultViewManager(void)
+ ?metaObject@CntMainWindow@@UBEPBUQMetaObject@@XZ @ 86 NONAME ; struct QMetaObject const * CntMainWindow::metaObject(void) const
+ ?back@CntViewNavigator@@QAEABHAAV?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 87 NONAME ; int const & CntViewNavigator::back(class QFlags<enum Hb::ViewSwitchFlag> &)
+ ??0CntContactCardView@@QAE@XZ @ 88 NONAME ; CntContactCardView::CntContactCardView(void)
+ ?metaObject@CntDefaultViewManager@@UBEPBUQMetaObject@@XZ @ 89 NONAME ; struct QMetaObject const * CntDefaultViewManager::metaObject(void) const
+ ?deactivate@CntContactCardView@@UAEXXZ @ 90 NONAME ; void CntContactCardView::deactivate(void)
+ ?changeView@CntDefaultViewManager@@UAEXV?$QMap@HVQVariant@@@@@Z @ 91 NONAME ; void CntDefaultViewManager::changeView(class QMap<int, class QVariant>)
+ ?getStaticMetaObject@CntDefaultViewManager@@SAABUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const & CntDefaultViewManager::getStaticMetaObject(void)
+ ?trUtf8@CntViewNavigator@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString CntViewNavigator::trUtf8(char const *, char const *, int)
+ ??_ECntContactCardView@@UAE@I@Z @ 94 NONAME ; CntContactCardView::~CntContactCardView(unsigned int)
+ ?tr@CntEditView@@SA?AVQString@@PBD0H@Z @ 95 NONAME ; class QString CntEditView::tr(char const *, char const *, int)
+ ?staticMetaObject@CntViewNavigator@@2UQMetaObject@@B @ 96 NONAME ; struct QMetaObject const CntViewNavigator::staticMetaObject
+ ?qt_metacall@CntEditView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 97 NONAME ; int CntEditView::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?getStaticMetaObject@CntEditView@@SAABUQMetaObject@@XZ @ 98 NONAME ; struct QMetaObject const & CntEditView::getStaticMetaObject(void)
+ ?trUtf8@CntEditView@@SA?AVQString@@PBD0@Z @ 99 NONAME ; class QString CntEditView::trUtf8(char const *, char const *)
+ ?qt_metacast@CntMainWindow@@UAEPAXPBD@Z @ 100 NONAME ; void * CntMainWindow::qt_metacast(char const *)
+ ??1CntViewNavigator@@UAE@XZ @ 101 NONAME ; CntViewNavigator::~CntViewNavigator(void)
+ ?qt_metacall@CntContactCardView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 102 NONAME ; int CntContactCardView::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?qt_metacall@CntMainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 103 NONAME ; int CntMainWindow::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?trUtf8@CntMainWindow@@SA?AVQString@@PBD0@Z @ 104 NONAME ; class QString CntMainWindow::trUtf8(char const *, char const *)
+ ?isDefault@CntBaseSelectionView@@UBE_NXZ @ 105 NONAME ; bool CntBaseSelectionView::isDefault(void) const
+ ?staticMetaObject@CntMainWindow@@2UQMetaObject@@B @ 106 NONAME ; struct QMetaObject const CntMainWindow::staticMetaObject
+ ??1CntBaseSelectionView@@UAE@XZ @ 107 NONAME ; CntBaseSelectionView::~CntBaseSelectionView(void)
+ ??1CntContactCardView@@UAE@XZ @ 108 NONAME ; CntContactCardView::~CntContactCardView(void)
+ ?isDefault@CntContactCardView@@UBE_NXZ @ 109 NONAME ; bool CntContactCardView::isDefault(void) const
+ ?tr@CntMainWindow@@SA?AVQString@@PBD0H@Z @ 110 NONAME ; class QString CntMainWindow::tr(char const *, char const *, int)
+ ?createPluginView@CntDefaultViewFactory@@AAEPAVCntAbstractView@@H@Z @ 111 NONAME ; class CntAbstractView * CntDefaultViewFactory::createPluginView(int)
+ ??_ECntEditView@@UAE@I@Z @ 112 NONAME ; CntEditView::~CntEditView(unsigned int)
+ ??0CntBaseSelectionView@@QAE@XZ @ 113 NONAME ; CntBaseSelectionView::CntBaseSelectionView(void)
+ ??0CntMainWindow@@QAE@PAVQWidget@@H@Z @ 114 NONAME ; CntMainWindow::CntMainWindow(class QWidget *, int)
+ ?getStaticMetaObject@CntMainWindow@@SAABUQMetaObject@@XZ @ 115 NONAME ; struct QMetaObject const & CntMainWindow::getStaticMetaObject(void)
+ ?tr@CntDefaultViewManager@@SA?AVQString@@PBD0@Z @ 116 NONAME ; class QString CntDefaultViewManager::tr(char const *, char const *)
+ ?removeCurrentView@CntDefaultViewManager@@AAEXXZ @ 117 NONAME ; void CntDefaultViewManager::removeCurrentView(void)
?viewId@CntContactCardView@@UBEHXZ @ 118 NONAME ; int CntContactCardView::viewId(void) const
?removeEffect@CntViewNavigator@@QAEXABH@Z @ 119 NONAME ; void CntViewNavigator::removeEffect(int const &)
--- a/phonebookui/cnthistorymodel/inc/cnthistorymodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/inc/cnthistorymodel.h Fri May 14 15:42:23 2010 +0300
@@ -44,30 +44,30 @@
Q_OBJECT
public:
- enum ConversationDirection
+ enum Attributes
{
- Incoming = 0,
- Outgoing,
- Missed
- };
-
- enum ReadStatus
- {
- Unseen = 3,
- Seen
+ Incoming = 1,
+ Outgoing = 2,
+ Unseen = 4,
+ Seen = 8,
+ Attachment = 16
};
enum ItemType
{
- CallLog = 5,
- Message
+ CallLog = 32,
+ Message = 64
+ };
+ enum Icon
+ {
+ MissedCall = 128,
+ ReceivedCall = 256,
+ DialledCall = 512
};
enum CustomRoles
{
- SeenStatusRole = Qt::UserRole + 1,
- DirectionRole,
- ItemTypeRole,
+ FlagsRole = Qt::UserRole + 1,
PhoneNumberRole
};
@@ -88,6 +88,8 @@
private:
void initializeModel();
QVariant displayRoleData(const HistoryItem& item) const;
+ QVariant decorationRoleData(const HistoryItem& item) const;
+ QVariant backgroundRoleData(const HistoryItem& item) const;
// Utility finctions
void readLogEvent(LogsEvent* event, HistoryItem& item);
@@ -102,8 +104,7 @@
void logsRowsInserted(const QModelIndex& parent, int first, int last);
void logsRowsRemoved(const QModelIndex& parent, int first, int last);
void logsDataChanged(const QModelIndex& first, const QModelIndex& last);
- void clearedCallLogs(int err);
- void markingCompleted(int err);
+
// Messaging model slots
void messagesReady(QList<MsgItem>& msgs);
void messageAdded(MsgItem& msg);
@@ -112,5 +113,8 @@
private:
QSharedDataPointer<CntHistoryModelData> d;
+
+ // Testing related friend definitions
+ friend class TestCntHistoryModel;
};
#endif
--- a/phonebookui/cnthistorymodel/inc/cnthistorymodel_p.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/inc/cnthistorymodel_p.h Fri May 14 15:42:23 2010 +0300
@@ -24,27 +24,36 @@
#include <QDateTime>
#include <qcontactmanager.h>
-QTM_USE_NAMESPACE
-
+#ifdef PBK_UNIT_TEST
+#include "stub_classes.h"
+#else
#include <logsevent.h>
#include <logsmodel.h>
#include <logscustomfilter.h>
+#endif
#include <msghistory.h>
+#include <msgitem.h>
+
+QTM_USE_NAMESPACE
-class HistoryItem
+// Constants
+#define MISSED_CALL_ICON "qtg_small_missed_call"
+#define DAILED_CALL_ICON "qtg_small_sent"
+#define RECEIVED_CALL_ICON "qtg_small_received"
+#define MESSAGE_ICON "qtg_small_message"
+const QString DATE_FORMAT("dd/MM"); // Date format.
+const QString TIME_FORMAT("hh:mm"); // Time format.
+
+class HistoryItem
{
public:
- HistoryItem() :
- seenStatus(4)
+ HistoryItem() : flags(0)
{};
inline const HistoryItem& operator=(const HistoryItem& other)
{
- direction = other.direction;
- seenStatus = other.seenStatus;
- msgType = other.msgType;
+ flags = other.flags;
number = other.number;
- iconPath = other.iconPath;
title = other.title;
message = other.message;
timeStamp = other.timeStamp;
@@ -57,11 +66,8 @@
}
public:
- int direction; // 0 - incoming, 1 - outgoing, 2 - missed
- int seenStatus; // 3 = unseen, 4 = seen
- int msgType; // 5 = call log, 6 = message
- QString number;
- QString iconPath;
+ int flags;
+ QString number;
QString title;
QString message;
QDateTime timeStamp;
@@ -80,7 +86,9 @@
m_msgHistory(NULL),
m_contactId(contactId),
m_contactManager(manager),
- m_isMarkedAsSeen(false)
+ m_isMyCard(false),
+ m_isMarkedAsSeen(false),
+ m_initLogs(false)
{}
~CntHistoryModelData()
{
@@ -107,6 +115,7 @@
QContactManager* m_contactManager;
bool m_isMyCard;
bool m_isMarkedAsSeen;
+ bool m_initLogs;
//this contains merged calls and messages history
QList<HItemPointer> m_List;
QMap<int, HItemPointer> m_logsMap;
--- a/phonebookui/cnthistorymodel/inc/cnthistorymodelglobal.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/inc/cnthistorymodelglobal.h Fri May 14 15:42:23 2010 +0300
@@ -21,6 +21,7 @@
#include <QtGlobal>
#include <QString>
#include <QList>
+#include <qdebug.h>
#ifdef CNTHISTORYMODEL_NO_EXPORT
#define CNTHISTORYMODEL_EXPORT
--- a/phonebookui/cnthistorymodel/src/cnthistorymodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/src/cnthistorymodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -17,8 +17,9 @@
#include <QStringList>
#include <QtAlgorithms>
-#include <HbGlobal>
-#include <msgitem.h>
+#include <hbglobal.h>
+#include <hbicon.h>
+#include <hbframebackground.h>
#include "cnthistorymodel_p.h"
#include "cnthistorymodel.h"
@@ -28,12 +29,12 @@
{
bool greaterThan(const HItemPointer& t1, const HItemPointer& t2)
{
- return t1.data()->timeStamp > t2.data()->timeStamp;
+ return ((*t1).timeStamp > (*t2).timeStamp);
}
bool lessThan(const HItemPointer& t1, const HItemPointer& t2)
{
- return t1.data()->timeStamp < t2.data()->timeStamp;
+ return ((*t1).timeStamp < (*t2).timeStamp);
}
}
@@ -54,16 +55,8 @@
{
d = new CntHistoryModelData(contactId, manager);
- // Check if the contact is my card
- if (d->m_contactId == d->m_contactManager->selfContactId()) {
- d->m_isMyCard = true;
- }
- else {
- d->m_isMyCard = false;
- }
// Create the model structure and cache history data from the databases
initializeModel();
-
}
CntHistoryModel::~CntHistoryModel()
@@ -95,13 +88,11 @@
case Qt::DisplayRole:
return displayRoleData(*p);
case Qt::DecorationRole:
- return QVariant((*p).iconPath);
- case SeenStatusRole:
- return QVariant((*p).seenStatus);
- case DirectionRole:
- return QVariant((*p).direction);
- case ItemTypeRole:
- return QVariant((*p).msgType);
+ return decorationRoleData(*p);
+ case Qt::BackgroundRole:
+ return backgroundRoleData(*p);
+ case FlagsRole:
+ return QVariant((*p).flags);
case PhoneNumberRole:
return QVariant((*p).number);
default:
@@ -112,7 +103,7 @@
/*!
* Return the data to be used by the view for a display role.
*
- * \param column The column of the item to return data about.
+ * \param item The History item to return data about.
* return QVariant List of strings to be displayed on the view.
* The stings can also be NULL
* index 0 Title of the conversation item.
@@ -123,12 +114,58 @@
{
QStringList list;
- list << item.title << item.message << item.timeStamp.toString();
+ if (item.timeStamp.date() == QDateTime::currentDateTime().date())
+ {
+ list << item.title << item.message << item.timeStamp.toString(TIME_FORMAT);
+ }
+ else
+ {
+ list << item.title << item.message << item.timeStamp.toString(DATE_FORMAT);
+ }
return QVariant(list);
}
/*!
+ * Return the data to be used by the view for a decoration role.
+ *
+ * \param item The History item to return data about.
+ * return QVariant String of the icon path.
+ */
+QVariant CntHistoryModel::decorationRoleData(const HistoryItem& item) const
+{
+ // Messages
+ if (item.flags & Message)
+ return QVariant(HbIcon(MESSAGE_ICON));
+
+ // Call logs
+ if (item.flags & CallLog) {
+ if (item.flags & MissedCall)
+ return QVariant(HbIcon(MISSED_CALL_ICON));
+ if (item.flags & DialledCall)
+ return QVariant(HbIcon(DAILED_CALL_ICON));
+ if (item.flags & ReceivedCall)
+ return QVariant(HbIcon(RECEIVED_CALL_ICON));
+ }
+
+ return QVariant();
+}
+
+/*!
+ * Return the data to be used to draw the background of list items
+ *
+ * \param item The History item to return data about.
+ * return QVariant HbFrameBackground of the list item.
+ */
+QVariant CntHistoryModel::backgroundRoleData(const HistoryItem& item) const
+{
+ if (item.flags & Incoming)
+ return QVariant(HbFrameBackground("qtg_fr_convlist_received_normal", HbFrameDrawer::NinePieces));
+ else
+ return QVariant(HbFrameBackground("qtg_fr_convlist_sent_normal", HbFrameDrawer::NinePieces));
+}
+
+/*!
* Get the number of rows (conversations) in this model.
*
* \param parent Optional parent index value.
@@ -159,25 +196,27 @@
*
*/
void CntHistoryModel::clearHistory()
-{
+{
if ( d->m_List.isEmpty() )
return;
// Call logs
- if ( !d->m_isMyCard && d->m_logsFilter ) {
- if ( !d->m_logsFilter->clearEvents() ) {
- // Operation not async
- clearedCallLogs( 0 );
- }
- } else if ( d->m_logsModel ) {
- if ( !d->m_logsModel->clearList(LogsModel::TypeLogsClearAll) ) {
- // Operation not async
- clearedCallLogs( 0 );
- }
- }
+ if ( !d->m_isMyCard && d->m_logsFilter )
+ d->m_logsFilter->clearEvents();
+ else if ( d->m_logsModel )
+ d->m_logsModel->clearList(LogsModel::TypeLogsClearAll);
// Messages
- d->m_msgHistory->clearMessages( (int)d->m_contactId );
+ if (d->m_msgHistory)
+ d->m_msgHistory->clearMessages( (int)d->m_contactId );
+
+ // Clear all data from the history model.
+ int count = rowCount();
+ d->m_List.clear();
+ d->m_msgMap.clear();
+ d->m_logsMap.clear();
+ beginRemoveRows( QModelIndex(), 0, count );
+ endRemoveRows();
}
/*!
@@ -189,17 +228,9 @@
if ( d->m_isMarkedAsSeen )
return;
- // Call logs
- if ( !d->m_isMyCard && d->m_logsFilter ) {
- d->m_logsFilter->markEventsSeen();
- } else if ( d->m_logsModel ) {
- d->m_logsModel->markEventsSeen(LogsModel::TypeLogsClearMissed);
- }
-
// Messages
- d->m_msgHistory->markRead( (int)d->m_contactId );
-
- d->m_isMarkedAsSeen = true;
+ if (d->m_msgHistory->markRead( d->m_contactId ))
+ d->m_isMarkedAsSeen = true;
}
/*!
@@ -209,7 +240,8 @@
void CntHistoryModel::sortAndRefresh(Qt::SortOrder order)
{
sort(0, order);
- emit layoutChanged();
+ beginInsertRows(QModelIndex(), 0, rowCount());
+ endInsertRows();
}
/*!
@@ -225,25 +257,26 @@
void CntHistoryModel::initializeMsgModel()
{
+ if( d->m_isMyCard )
+ return;
+
+ // Contact centric
MsgHistory* m = new MsgHistory();
+ d->m_msgHistory = m;
+
// Connect to signals emitted by msg model
connect(m, SIGNAL(messagesReady(QList<MsgItem>& )), this, SLOT(messagesReady(QList<MsgItem>& )));
connect(m, SIGNAL(messageAdded(MsgItem& )), this, SLOT(messageAdded(MsgItem& )));
connect(m, SIGNAL(messageChanged(MsgItem& )), this, SLOT(messageChanged(MsgItem& )));
connect(m, SIGNAL(messageDeleted(MsgItem& )), this, SLOT(messageDeleted(MsgItem& )));
- // Contact centric
- if( !d->m_isMyCard ) {
- // Subscribe to get new messages
- // received from this contact
- m->subscribe(d->m_contactId);
-
- // Initial fetch of all messages
- m->getMessages(d->m_contactId);
- }
+ // Subscribe to get new messages
+ // received from this contact
+ m->subscribe(d->m_contactId);
- d->m_msgHistory = m;
+ // Initial fetch of all messages
+ m->getMessages(d->m_contactId);
}
void CntHistoryModel::initializeLogsModel()
@@ -259,19 +292,15 @@
connect(d->m_logsFilter, SIGNAL(clearingCompleted(int)),
this, SLOT(clearedCallLogs(int)));
- connect(d->m_logsFilter, SIGNAL(markingCompleted(int)),
- this, SLOT(markingCompleted(int)));
} else {
//get all call events
d->m_AbstractLogsModel = d->m_logsModel;
connect(d->m_logsModel, SIGNAL(clearingCompleted(int)),
this, SLOT(clearedCallLogs(int)));
- connect(d->m_logsModel, SIGNAL(markingCompleted(int)),
- this, SLOT(markingCompleted(int)));
}
- //read first call events and start listening for more
+ //read first call events if any and start listening for more
for ( int i = 0; i < d->m_AbstractLogsModel->rowCount(); ++i ) {
LogsEvent* event = qVariantValue<LogsEvent*>(
d->m_AbstractLogsModel->data(d->m_AbstractLogsModel->index(i, 0), LogsModel::RoleFullEvent) );
@@ -300,44 +329,40 @@
* \param item Conversation history item
*/
void CntHistoryModel::readLogEvent(LogsEvent* event, HistoryItem& item)
-{
+{
QString bodyText;
- QString icon;
QString title;
if ( d->m_isMyCard ) {
if ( event->remoteParty().length() > 0 ) {
- title = event->remoteParty();
+ title = QString(event->remoteParty());
}
else {
- title = event->number();
+ title = QString(event->number());
}
} else {
if ( event->direction() == LogsEvent::DirIn ) {
bodyText = hbTrId("txt_phob_list_received");
- icon = QString("qtg_small_received");
+ item.flags |= ReceivedCall;
} else if ( event->direction() == LogsEvent::DirOut ) {
bodyText = hbTrId("txt_phob_list_dialled_call");
- icon = QString("qtg_small_sent");
+ item.flags |= DialledCall;
} else if ( event->direction() == LogsEvent::DirMissed ) {
bodyText = hbTrId("txt_phob_list_missed_call");
- icon = QString("qtg_small_missed_call");
- if ( !event->isRead() )
- item.seenStatus = Unseen;
+ item.flags |= MissedCall;
}
}
if ( event->direction() == LogsEvent::DirOut )
- item.direction = Outgoing;
+ item.flags |= Outgoing;
else
- item.direction = Incoming;
+ item.flags |= Incoming;
item.message = bodyText;
- item.iconPath = icon;
item.title = title;
- item.timeStamp = event->time();
- item.msgType = CallLog;
- item.number = event->number();
+ item.timeStamp = event->time().toLocalTime();
+ item.flags |= CallLog;
+ item.number = QString(event->number());
}
/*!
@@ -350,6 +375,7 @@
void CntHistoryModel::logsRowsInserted(const QModelIndex& /*parent*/, int first, int last)
{
int oldRowCount = rowCount();
+ QList<HItemPointer> l;
for ( int i = first; i < d->m_AbstractLogsModel->rowCount() && i <= last; ++i ) {
LogsEvent* event = qVariantValue<LogsEvent*>(
@@ -363,6 +389,14 @@
}
}
+ // Check if this is the first time to receive events
+ // and sort the entire list.
+ if ( !d->m_initLogs ) {
+ sort();
+ oldRowCount = 0;
+ d->m_initLogs = true;
+ }
+
beginInsertRows(QModelIndex(), oldRowCount, rowCount());
endInsertRows();
}
@@ -381,9 +415,11 @@
for ( int i = first; i <= last; ++i ) {
HItemPointer item = d->m_logsMap.value( i );
int index = d->m_List.indexOf( item );
- d->m_List.removeOne( item );
- d->m_logsMap.remove( i );
- indices.append( index );
+ if ( index > -1 ) {
+ d->m_List.removeAt( index );
+ d->m_logsMap.remove( i );
+ indices.append( index );
+ }
}
// Remove list items in batches
@@ -434,45 +470,6 @@
}
/*!
- * Clear logs event slot received from logs model
- *
- * \param err Error of the clear logs request
- */
-void CntHistoryModel::clearedCallLogs(int err)
-{
- if ( err != 0 ) {
- return;
- }
-
- QList< int > indices;
- foreach( HItemPointer p, d->m_logsMap.values() ) {
- d->m_List.removeOne( p );
- }
- d->m_logsMap.clear();
-
- // Remove list items in batches
- if ( !indices.isEmpty() ) {
- QList< QList<int> > batches = findIndices(indices);
- foreach( QList<int> l, batches ) {
- beginRemoveRows( QModelIndex(), l.first(), l.last() );
- endRemoveRows();
- }
- }
-}
-
-/*!
- * Mark events as seen slot received from logs model
- *
- * \param err Error of the marking logs request
- */
-void CntHistoryModel::markingCompleted(int err)
-{
- if ( err == 0 ) {
- d->m_isMarkedAsSeen = true;
- }
-}
-
-/*!
* Check whether an idex is out of bound of our list
*
* \param index Index to be validated
@@ -495,11 +492,9 @@
QList<int> currSequence;
int prevIndex = indices.at(0) - 1;
- for (int i = 0; i < indices.count(); i++)
+ foreach( int currIndex, indices )
{
- int currIndex = indices.at(i);
-
- if (currIndex >= 0)
+ if ( currIndex >= 0 )
{
if ( prevIndex+1 != currIndex && !currSequence.isEmpty() )
{
@@ -511,7 +506,7 @@
}
}
- if (!currSequence.isEmpty())
+ if ( !currSequence.isEmpty() )
{
// Add last sequence if such exist
sequences.append( currSequence );
@@ -529,23 +524,24 @@
void CntHistoryModel::readMsgEvent(MsgItem& event, HistoryItem& item)
{
// Msg direction
- if ( event.direction() == MsgItem::MsgDirectionIncoming )
- item.direction = CntHistoryModel::Incoming;
- if ( event.direction() == MsgItem::MsgDirectionOutgoing )
- item.direction = CntHistoryModel::Outgoing;
+ if ( event.direction() == MsgItem::MsgDirectionIncoming ) {
+ item.flags |= Incoming;
+ // Read status
+ if ( event.isAttributeSet(MsgItem::MsgAttributeUnread) )
+ item.flags |= Unseen;
+ else
+ item.flags &= ~Unseen;
+ } else if ( event.direction() == MsgItem::MsgDirectionOutgoing )
+ item.flags |= Outgoing;
- // Read status
- /* TODO: This API available in the next release
- *if ( event.isAttributeSet(MsgItem::MsgAttributeUnread) )
- item.seenStatus = CntHistoryModel::Unseen;
- else
- item.seenStatus = CntHistoryModel::Seen;*/
+ // Attachment
+ if (event.isAttributeSet(MsgItem::MsgAttributeAttachment))
+ item.flags |= Attachment;
- item.msgType = CntHistoryModel::Message;
- item.number = event.phoneNumber();
- item.iconPath = QString("qtg_small_message");
+ item.flags |= Message;
+ item.number = event.phoneNumber();
item.message = event.body();
- item.timeStamp = event.timeStamp();
+ item.timeStamp = event.timeStamp().toLocalTime();
}
/*!
@@ -557,8 +553,6 @@
*/
void CntHistoryModel::messagesReady(QList<MsgItem>& msgs)
{
- int oldRowCount = rowCount();
-
foreach( MsgItem m, msgs ) {
// Create a new hst item
HItemPointer item(new HistoryItem());
@@ -566,19 +560,17 @@
// Parse the MsgItem and add data into hst item
readMsgEvent( m, *item );
- // Map the hst item to a MsgItem in the msgModel
+ // Map the hist item to a MsgItem in the msgModel
d->m_msgMap.insert( m.id(), item );
// Append the hst item to our list
d->m_List.append( item );
}
- beginInsertRows(QModelIndex(), oldRowCount, rowCount());
- endInsertRows();
+ sort();
- // After all messagas are fetched sort them and
- // refresh the UI.
- sortAndRefresh();
+ beginInsertRows(QModelIndex(), 0, rowCount());
+ endInsertRows();
}
/*!
@@ -597,7 +589,7 @@
// Parse the MsgItem and add data into hst item
readMsgEvent( msg, *item );
- // Map the hst item to a MsgItem in the msgModel
+ // Map the hist item to a MsgItem in the msgModel
d->m_msgMap.insert( msg.id(), item );
// Append the hst item to our list
@@ -647,11 +639,10 @@
return;
// Remove the item in stored containers
- int count = d->m_msgMap.remove( msg.id() );
+ d->m_msgMap.remove( msg.id() );
int index = d->m_List.indexOf( p );
- bool removed = d->m_List.removeOne( p );
-
- if ( removed && count > 0 ) {
+ if ( index > -1 ) {
+ d->m_List.removeAt( index );
beginRemoveRows(QModelIndex(), index, index);
endRemoveRows();
}
--- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -18,238 +18,312 @@
#include <QtTest/QtTest>
#include "mt_cnthistorymodel.h"
+#include "cnthistorymodel_p.h"
#include "cnthistorymodel.h"
-#include "stub_classes.h"
+
+void TestCntHistoryModel::init()
+{
+ cm = new QContactManager("symbian");
+ model = new CntHistoryModel(1, cm);
+ model->d->m_List.clear();
+ model->d->m_logsMap.clear();
+ model->d->m_msgMap.clear();
+}
+
+void TestCntHistoryModel::cleanup()
+{
+ delete cm;
+ delete model;
+}
+
+void TestCntHistoryModel::testLogsInsertions()
+{
+ QSignalSpy spy( model, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
+ model->logsRowsInserted(QModelIndex(), 0, 0);
+
+ QVERIFY(model->rowCount() == 1);
+ QVERIFY(model->d->m_logsMap.count() == 1);
+ QVERIFY(spy.count() == 1);
+}
-void TestCntHistoryModel::initTestCase()
+void TestCntHistoryModel::testLogsRemovals()
+{
+ model->logsRowsInserted(QModelIndex(), 0, 0);
+
+ QSignalSpy spy( model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)));
+ model->logsRowsRemoved(QModelIndex(), 0, 0);
+ QVERIFY(model->rowCount() == 0);
+ QVERIFY(model->d->m_logsMap.count() == 0);
+ QVERIFY(spy.count() == 1);
+
+ // Remove the same item
+ QSignalSpy spy1( model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)));
+ model->logsRowsRemoved(QModelIndex(), 0, 0);
+ QVERIFY(spy1.count() == 0);
+}
+
+void TestCntHistoryModel::testLogsUpdates()
+{
+ model->logsRowsInserted(QModelIndex(), 0, 0);
+
+ QSignalSpy spy( model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QModelIndex in = model->d->m_AbstractLogsModel->index(0,0);
+ model->logsDataChanged(in, in);
+ QVERIFY(spy.count() == 1);
+}
+
+void TestCntHistoryModel::testMsgInsertions()
{
+ QList<MsgItem> msgs;
+ MsgItem msg1;
+ msg1.setId(111);
+ MsgItem msg2;
+ msg2.setId(222);
+ MsgItem msg3;
+ msg3.setId(333);
+ msgs.append(msg1);
+ msgs.append(msg2);
+ msgs.append(msg3);
+
+ QSignalSpy spy( model, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
+ model->messagesReady(msgs);
+
+ QVERIFY(model->rowCount() == 3);
+ QVERIFY(model->d->m_msgMap.count() == 3);
+ QVERIFY(model->d->m_msgMap.contains(111));
+ QVERIFY(model->d->m_msgMap.contains(222));
+ QVERIFY(model->d->m_msgMap.contains(333));
+ QVERIFY(spy.count() == 1);
+
+ MsgItem msg;
+ QSignalSpy spy2( model, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
+ model->messageAdded(msg);
+ QVERIFY(model->rowCount() == 4);
+ QVERIFY(model->d->m_msgMap.count() == 4);
+ QVERIFY(spy2.count() == 1);
+
}
-void TestCntHistoryModel::cleanupTestCase()
+void TestCntHistoryModel::testMsgRemovals()
+{
+ QList<MsgItem> msgs;
+ MsgItem msg1;
+ msg1.setId(111);
+ MsgItem msg2;
+ msg2.setId(222);
+ MsgItem msg3;
+ msg3.setId(333);
+ msgs.append(msg1);
+ msgs.append(msg2);
+ msgs.append(msg3);
+ model->messagesReady(msgs);
+
+ QSignalSpy spy( model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)));
+ model->messageDeleted(msg2);
+ QVERIFY(!model->d->m_msgMap.contains(222));
+ QVERIFY(model->rowCount() == 2);
+ QVERIFY(spy.count() == 1);
+
+ // Increase code coverage
+ HItemPointer p;
+ model->d->m_msgMap.insert(333, p);
+ model->messageDeleted(msg3);
+}
+
+void TestCntHistoryModel::testMsgUpdates()
{
+ QList<MsgItem> msgs;
+ MsgItem msg1;
+ msg1.setId(111);
+ MsgItem msg2;
+ msg2.setId(222);
+ MsgItem msg3;
+ msg3.setId(333);
+ msgs.append(msg1);
+ msgs.append(msg2);
+ msgs.append(msg3);
+ model->messagesReady(msgs);
+
+ QSignalSpy spy( model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QString s("test message");
+ msg2.setBody(s);
+ model->messageChanged(msg2);
+ QVERIFY(model->d->m_msgMap.value(222)->message == s);
+ QVERIFY(spy.count() == 1);
+
+ // Increase code coverage
+ HItemPointer p;
+ model->d->m_msgMap.insert(333, p);
+ model->messageChanged(msg3);
+}
+
+void TestCntHistoryModel::testReadLogEvent()
+{
+ LogsEvent event;
+ HItemPointer item(new HistoryItem);
+ model->readLogEvent(&event, *item);
+
+ QVERIFY(event.time() == item->timeStamp);
+ QVERIFY(item->flags & CntHistoryModel::Incoming);
+ QVERIFY(event.number() == item->number);
+ QVERIFY(item->flags & CntHistoryModel::CallLog);
+ QVERIFY(!item->message.isEmpty());
+
+ // Increase code coverage
+ model->d->m_isMyCard = true;
+ model->readLogEvent(&event, *item);
+}
+
+void TestCntHistoryModel::testReadMsgEvent()
+{
+ MsgItem msg;
+ QString body("Some message");
+ msg.setBody(body);
+ msg.setDirection(MsgItem::MsgDirectionIncoming);
+ msg.setPhoneNumber("123456");
+ QDateTime d = QDateTime(QDate(2012, 12, 12), QTime(12, 23, 10));
+ msg.setTimeStamp(d.toTime_t());
+
+ HItemPointer item(new HistoryItem);
+ model->readMsgEvent(msg, *item);
+
+ QVERIFY(item->timeStamp == d);
+ QVERIFY(item->message == body);
+ QVERIFY(item->flags & CntHistoryModel::Message);
+ QVERIFY(item->number == QString("123456"));
+ QVERIFY(item->flags & CntHistoryModel::Incoming);
}
void TestCntHistoryModel::testRoles()
{
- // Contact centric history data
- QContactManager* cm = new QContactManager("symbian");
- QContact c;
- QVERIFY(cm->saveContact(&c));
- CntHistoryModel* model = new CntHistoryModel(c.localId(), cm);
- QVERIFY(model != 0);
- QVERIFY(model->rowCount() == FILTERED_EVENTS);
+ MsgItem msg;
+ model->messageAdded(msg);
+
+ QModelIndex modelIndex = model->index(0, 0);
+ QVERIFY(modelIndex.isValid());
// Branded icon path
- int index = 1;
- QModelIndex modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- QVariant var = modelIndex.data(Qt::DecorationRole);
- QVERIFY(var.type() == QVariant::String);
+ //QVariant var = modelIndex.data(Qt::DecorationRole);
+ //QVERIFY(var.type() == QVariant::String);
- // Direction
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(DirectionRole);
+ // FlagsRole
+ var = modelIndex.data(CntHistoryModel::FlagsRole);
QVERIFY(var.type() == QVariant::Int);
- QVERIFY(var.toInt() == Incoming ||
- var.toInt() == Outgoing ||
- var.toInt() == Missed);
// Display role
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
var = modelIndex.data(Qt::DisplayRole);
- QString str = QString(cc_msg).arg(index);
- QVERIFY(var.toStringList().at(0) == "");
- QDateTime t = constDateTime.addSecs(5*index);
- str = t.toString();
- QVERIFY(var.toStringList().at(2) == str);
-
- index = 3;
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- str = QString(cc_msg).arg(index);
QVERIFY(var.type() == QVariant::StringList);
- QVERIFY(var.toStringList().at(0) == "");
- t = constDateTime.addSecs(5*index);
- str = t.toString();
- QVERIFY(var.toStringList().at(2) == str);
-
- // decoration role
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(Qt::DecorationRole);
- QVERIFY(var.type() == QVariant::String);
- QVERIFY(var.toString() == QString("qtg_small_missed_call") ||
- var.toString() == QString("qtg_small_sent") ||
- var.toString() == QString("qtg_small_received"));
-
- // SeenStatusRole
- index = 1;
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(SeenStatusRole);
- QVERIFY(var.type() == QVariant::Int);
- QVERIFY(var.toInt() == Unseen ||
- var.toInt() == Seen);
-
- // ItemTypeRole
- index = 1;
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(ItemTypeRole);
- QVERIFY(var.type() == QVariant::Int);
- QVERIFY(var.toInt() == CallLog ||
- var.toInt() == Message);
// PhoneNumberRole
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(PhoneNumberRole);
+ var = modelIndex.data(CntHistoryModel::PhoneNumberRole);
QVERIFY(var.type() == QVariant::String);
- QVERIFY(var.toString() == "1234567");
+
+ // BackgroundRole
+ var = modelIndex.data(Qt::BackgroundRole);
+ QVERIFY(var.type() > (QVariant::UserType - 1));
// Invalid role
- index = 1;
- modelIndex = model->index(index, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(1000);
+ var = modelIndex.data(-10);
QVERIFY(var.type() == QVariant::Invalid);
// Invalid indices
- modelIndex = model->index(-1, 0);
+ modelIndex = model->index(-10, 0);
QVERIFY(!modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- QVERIFY(var.type() == QVariant::Invalid);
-
var = model->data(modelIndex, Qt::DisplayRole);
QVERIFY(var.type() == QVariant::Invalid);
modelIndex = model->index(100, 0);
QVERIFY(!modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- QVERIFY(var.type() == QVariant::Invalid);
+ // Stored history item is null
+ model->d->m_List.first().clear();
+ modelIndex = model->index(0, 0);
var = model->data(modelIndex, Qt::DisplayRole);
QVERIFY(var.type() == QVariant::Invalid);
-
- // Test all conversations
- QVERIFY(cm->setSelfContactId(c.localId()));
- delete model;
- model = new CntHistoryModel(c.localId(), cm);
- QVERIFY(model != 0);
- QVERIFY(model->rowCount() == ALL_EVENTS);
-
- cm->removeContact(c.localId());
-
- delete cm;
- delete model;
}
void TestCntHistoryModel::testSorting()
{
- QContactManager* cm = new QContactManager("symbian");
- QContact c;
- QVERIFY(cm->saveContact(&c));
- CntHistoryModel* model = new CntHistoryModel(c.localId(), cm);
- QVERIFY(model != 0);
- QVERIFY(model->rowCount() == FILTERED_EVENTS);
+ // Create random data
+ QList<int> delta;
+ delta.append(23);
+ delta.append(12);
+ delta.append(45);
+ delta.append(32);
+ delta.append(67);
+ delta.append(45);
+ delta.append(92);
+ delta.append(12);
+
+ QDateTime dt = QDateTime::currentDateTime();
+
+ for(int i=0; i<delta.count(); i++) {
+ HItemPointer p(new HistoryItem());
+ dt = dt.addMSecs(delta.at(i));
+ p.data()->timeStamp = dt.toLocalTime();
+ if ( i % 2 )
+ p.data()->flags |= CntHistoryModel::CallLog;
+ else
+ p.data()->flags |= CntHistoryModel::Message;
+
+ qDebug() << "Flag: " << p.data()->flags;
+ qDebug() << "Delta: " << delta.at(i);
+ model->d->m_List.append(p);
+ }
// Sort ascending
- QSignalSpy spy( model, SIGNAL( layoutChanged()));
+ QSignalSpy spy( model, SIGNAL( rowsInserted(const QModelIndex &, int, int)));
model->sortAndRefresh(Qt::AscendingOrder);
- QModelIndex modelIndex = model->index(1, 0);
- QVERIFY(modelIndex.isValid());
- QVariant var = modelIndex.data(Qt::DisplayRole);
- QDateTime dt1 = QDateTime::fromString(var.toStringList().at(2));
-
- modelIndex = model->index(2, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- QDateTime dt2 = QDateTime::fromString(var.toStringList().at(2));
- QVERIFY(dt1 < dt2);
- QVERIFY(spy.count() == 1);
+ QVERIFY(spy.count() == 1);
+ HItemPointer current = model->d->m_List.first();
+ for(int i=1; i<model->d->m_List.count(); i++) {
+ QVERIFY(current.data()->timeStamp <= model->d->m_List.at(i).data()->timeStamp);
+ current = model->d->m_List.at(i);
+ }
// Sort descending
- QSignalSpy spy1( model, SIGNAL( layoutChanged()));
+ QSignalSpy spy1( model, SIGNAL( rowsInserted(const QModelIndex &, int, int)));
model->sortAndRefresh(Qt::DescendingOrder);
- modelIndex = model->index(1, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- dt1 = QDateTime::fromString(var.toStringList().at(2));
-
- modelIndex = model->index(2, 0);
- QVERIFY(modelIndex.isValid());
- var = modelIndex.data(Qt::DisplayRole);
- dt2 = QDateTime::fromString(var.toStringList().at(2));
- QVERIFY(dt1 > dt2);
- QVERIFY(spy1.count() == 1);
-
- cm->removeContact(c.localId());
- delete model;
- delete cm;
+ QVERIFY(spy1.count() == 1);
+ current = model->d->m_List.last();
+ for(int i=model->d->m_List.count(); i<1; i--) {
+ QVERIFY(current.data()->timeStamp >= model->d->m_List.at(i).data()->timeStamp);
+ current = model->d->m_List.at(i);
+ }
}
void TestCntHistoryModel::testClear()
{
- QContactManager* cm = new QContactManager("symbian");
- QContact c;
- QVERIFY(cm->saveContact(&c));
- CntHistoryModel* model = new CntHistoryModel(c.localId(), cm);
- QVERIFY(model != 0);
- QVERIFY(model->rowCount() == FILTERED_EVENTS);
+ model->logsRowsInserted(QModelIndex(), 0, 0);
- // Clear history
+ // Clear history with log
QSignalSpy spy( model, SIGNAL( rowsRemoved(const QModelIndex &, int, int)));
- int beforeClear = model->rowCount();
model->clearHistory();
- QTest::qWait(1000); // wait clearing completion
QVERIFY( model->rowCount() == 0 );
QVERIFY(spy.count() == 1);
- QList<QVariant> arguments = spy.takeFirst();
- QVERIFY(arguments.at(1).type() == QVariant::Int);
- QVERIFY(arguments.at(2).type() == QVariant::Int);
- QVERIFY(arguments.at(2).toInt() == beforeClear);
-
// Clear already empty history view
QSignalSpy spy1( model, SIGNAL( rowsRemoved(const QModelIndex &, int, int)));
model->clearHistory();
- QTest::qWait(1000); // wait clearing completion
QVERIFY(spy1.count() == 0);
-
- cm->removeContact(c.localId());
- delete model;
- delete cm;
}
void TestCntHistoryModel::testMarkSeen()
{
- QContactManager* cm = new QContactManager("symbian");
- QContact c;
- QVERIFY(cm->saveContact(&c));
- CntHistoryModel* model = new CntHistoryModel(c.localId(), cm);
- QVERIFY(model != 0);
- QVERIFY(model->rowCount() == FILTERED_EVENTS);
-
// Mark history as seen
- QSignalSpy spy( model, SIGNAL( layoutChanged()));
+ QVERIFY(!model->d->m_isMarkedAsSeen);
model->markAllAsSeen();
- QTest::qWait(1000); // wait marking completion
- QVERIFY(spy.count() == 1);
+ QVERIFY(model->d->m_isMarkedAsSeen);
- // Mark already marked history as seen
- QSignalSpy spy1( model, SIGNAL( layoutChanged()));
+ // NOT TESTING! Increasing code coverage
model->markAllAsSeen();
- QTest::qWait(1000); // wait marking completion
- QVERIFY(spy1.count() == 0);
-
- cm->removeContact(c.localId());
- delete model;
- delete cm;
+ model->d->m_isMarkedAsSeen = false;
+ model->d->m_isMyCard = true;
+ model->initializeMsgModel();
+ model->markAllAsSeen();
+ model->clearHistory();
}
QTEST_MAIN(TestCntHistoryModel);
--- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.h Fri May 14 15:42:23 2010 +0300
@@ -16,17 +16,34 @@
*/
#include <QObject>
+#include <qtcontacts.h>
+
+QTM_USE_NAMESPACE
+
+class CntHistoryModel;
class TestCntHistoryModel : public QObject
{
Q_OBJECT
private slots:
- void initTestCase();
- void cleanupTestCase();
+ void init();
+ void cleanup();
+ void testLogsInsertions();
+ void testLogsRemovals();
+ void testLogsUpdates();
+ void testMsgInsertions();
+ void testMsgRemovals();
+ void testMsgUpdates();
+ void testReadLogEvent();
+ void testReadMsgEvent();
void testRoles();
void testSorting();
void testClear();
void testMarkSeen();
+
+private:
+ QContactManager* cm;
+ CntHistoryModel* model;
};
--- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.pro Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/mt_cnthistorymodel.pro Fri May 14 15:42:23 2010 +0300
@@ -36,10 +36,11 @@
../../inc/cnthistorymodel_p.h \
../../inc/cnthistorymodel.h
-SOURCES += mt_cnthistorymodel.cpp \
- stub_classes.cpp \
- ../../src/cnthistorymodel.cpp
+SOURCES += stub_classes.cpp \
+ ../../src/cnthistorymodel.cpp \
+ mt_cnthistorymodel.cpp
-LIBS += -lQtContacts
+LIBS += -lQtContacts \
+ -lmsghistory
TARGET.CAPABILITY = ALL -TCB
--- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/stub_classes.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/stub_classes.cpp Fri May 14 15:42:23 2010 +0300
@@ -15,22 +15,11 @@
*
*/
+#include "cnthistorymodel_p.h"
#include "stub_classes.h"
Q_DECLARE_METATYPE(LogsEvent *)
-namespace {
- void addModelData(HistoryItem &t, int i)
- {
- t.timeStamp = constDateTime.addSecs(5*i);
- t.message = QString(cc_msg).arg(i);
- t.direction = i%2 == 0 ? Incoming : Outgoing;
- t.seenStatus = i%2 == 0 ? Unseen : Seen;
- t.iconPath = QString(icon_path).arg(i);
- t.title = QString(cc_msg).arg(i);
- };
-}
-
QVariant LogsModel::data(const QModelIndex& index, int role) const
{
if (index.row() < 0 && index.row() >= rowCount())
@@ -104,3 +93,12 @@
beginInsertRows(QModelIndex(), 0, m_events.count());
endInsertRows();
}
+
+bool MsgHistory::getMessages(int cntId){}
+
+bool MsgHistory::subscribe(int cntId){}
+
+bool MsgHistory::markRead(int cntId){
+ return true;
+}
+
--- a/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/stub_classes.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/cnthistorymodel/tsrc/mt_cnthistorymodel/stub_classes.h Fri May 14 15:42:23 2010 +0300
@@ -17,11 +17,9 @@
#ifndef STUB_CLASSES_H
#define STUB_CLASSES_H
-#include <QString>
-#include <QDateTime>
#include <QtTest/QtTest>
#include <QAbstractItemModel>
-#include <qcontactmanager.h>
+#include "cnthistorymodel.h"
#define ALL_EVENTS 7
#define FILTERED_EVENTS 5
@@ -31,81 +29,6 @@
const QString icon_path = QString("Icon %1 path");
const QDateTime constDateTime = QDateTime(QDate(2010, 2, 15), QTime(12, 10, 10));
-struct HistoryItem {
- int direction; // 0 - incoming, 1 - outgoing, 2 - missed
- int seenStatus; // 3 = unseen, 4 = seen
- int msgType; // 5 = call log, 6 = message
- QString number;
- QString iconPath;
- QString title;
- QString message;
- QDateTime timeStamp;
- QString mmsMessage;
-
- HistoryItem() :
- direction(0),
- seenStatus(4),
- iconPath(QString()),
- title(QString()),
- message(QString()),
- timeStamp(QDateTime()),
- mmsMessage(QString())
- {};
-
- inline const HistoryItem& operator=(const HistoryItem& other)
- {
- direction = other.direction;
- seenStatus = other.seenStatus;
- msgType = other.msgType;
- number = other.number;
- iconPath = other.iconPath;
- title = other.title;
- message = other.message;
- timeStamp = other.timeStamp;
- return *this;
- }
-
- inline bool operator==(const HistoryItem& other) const
- { return timeStamp == other.timeStamp; }
-};
-
-enum
-{
- TimeStamp,
- Direction,
- BodyText,
- UnReadStatus,
- FirstName,
- LastName
-};
-
-enum
-{
- Incoming,
- Outgoing,
- Missed
-};
-
-enum
-{
- Unseen = 3,
- Seen
-};
-
-enum ItemType
-{
- CallLog = 5,
- Message
-};
-
-enum CustomRoles
-{
- SeenStatusRole = Qt::UserRole + 1,
- DirectionRole,
- ItemTypeRole,
- PhoneNumberRole
-};
-
class LogsEvent
{
public:
--- a/phonebookui/eabi/cnthistorymodelu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/eabi/cnthistorymodelu.def Fri May 14 15:42:23 2010 +0300
@@ -11,25 +11,25 @@
_ZN15CntHistoryModel14messageChangedER7MsgItem @ 10 NONAME
_ZN15CntHistoryModel14messageDeletedER7MsgItem @ 11 NONAME
_ZN15CntHistoryModel14sortAndRefreshEN2Qt9SortOrderE @ 12 NONAME
- _ZN15CntHistoryModel15clearedCallLogsEi @ 13 NONAME
- _ZN15CntHistoryModel15initializeModelEv @ 14 NONAME
- _ZN15CntHistoryModel15logsDataChangedERK11QModelIndexS2_ @ 15 NONAME
- _ZN15CntHistoryModel15logsRowsRemovedERK11QModelIndexii @ 16 NONAME
- _ZN15CntHistoryModel16logsRowsInsertedERK11QModelIndexii @ 17 NONAME
- _ZN15CntHistoryModel16markingCompletedEi @ 18 NONAME
- _ZN15CntHistoryModel16staticMetaObjectE @ 19 NONAME DATA 16
- _ZN15CntHistoryModel18initializeMsgModelEv @ 20 NONAME
- _ZN15CntHistoryModel19getStaticMetaObjectEv @ 21 NONAME
- _ZN15CntHistoryModel19initializeLogsModelEv @ 22 NONAME
- _ZN15CntHistoryModel4sortEiN2Qt9SortOrderE @ 23 NONAME
- _ZN15CntHistoryModelC1EjPN10QtMobility15QContactManagerEP7QObject @ 24 NONAME
- _ZN15CntHistoryModelC2EjPN10QtMobility15QContactManagerEP7QObject @ 25 NONAME
- _ZN15CntHistoryModelD0Ev @ 26 NONAME
- _ZN15CntHistoryModelD1Ev @ 27 NONAME
- _ZN15CntHistoryModelD2Ev @ 28 NONAME
- _ZNK15CntHistoryModel10metaObjectEv @ 29 NONAME
- _ZNK15CntHistoryModel15displayRoleDataERK11HistoryItem @ 30 NONAME
- _ZNK15CntHistoryModel16validateRowIndexEi @ 31 NONAME
+ _ZN15CntHistoryModel15initializeModelEv @ 13 NONAME
+ _ZN15CntHistoryModel15logsDataChangedERK11QModelIndexS2_ @ 14 NONAME
+ _ZN15CntHistoryModel15logsRowsRemovedERK11QModelIndexii @ 15 NONAME
+ _ZN15CntHistoryModel16logsRowsInsertedERK11QModelIndexii @ 16 NONAME
+ _ZN15CntHistoryModel16staticMetaObjectE @ 17 NONAME DATA 16
+ _ZN15CntHistoryModel18initializeMsgModelEv @ 18 NONAME
+ _ZN15CntHistoryModel19getStaticMetaObjectEv @ 19 NONAME
+ _ZN15CntHistoryModel19initializeLogsModelEv @ 20 NONAME
+ _ZN15CntHistoryModel4sortEiN2Qt9SortOrderE @ 21 NONAME
+ _ZN15CntHistoryModelC1EjPN10QtMobility15QContactManagerEP7QObject @ 22 NONAME
+ _ZN15CntHistoryModelC2EjPN10QtMobility15QContactManagerEP7QObject @ 23 NONAME
+ _ZN15CntHistoryModelD0Ev @ 24 NONAME
+ _ZN15CntHistoryModelD1Ev @ 25 NONAME
+ _ZN15CntHistoryModelD2Ev @ 26 NONAME
+ _ZNK15CntHistoryModel10metaObjectEv @ 27 NONAME
+ _ZNK15CntHistoryModel15displayRoleDataERK11HistoryItem @ 28 NONAME
+ _ZNK15CntHistoryModel16validateRowIndexEi @ 29 NONAME
+ _ZNK15CntHistoryModel18backgroundRoleDataERK11HistoryItem @ 30 NONAME
+ _ZNK15CntHistoryModel18decorationRoleDataERK11HistoryItem @ 31 NONAME
_ZNK15CntHistoryModel4dataERK11QModelIndexi @ 32 NONAME
_ZNK15CntHistoryModel8rowCountERK11QModelIndex @ 33 NONAME
_ZTI15CntHistoryModel @ 34 NONAME
--- a/phonebookui/eabi/pbkcommonuiu.def Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/eabi/pbkcommonuiu.def Fri May 14 15:42:23 2010 +0300
@@ -2,8 +2,8 @@
_ZN11CntEditView10deactivateEv @ 1 NONAME
_ZN11CntEditView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
_ZN11CntEditView11qt_metacastEPKc @ 3 NONAME
- _ZN11CntEditView14contactRemovedEv @ 4 NONAME
- _ZN11CntEditView14contactUpdatedEv @ 5 NONAME
+ _ZN11CntEditView14contactRemovedEb @ 4 NONAME
+ _ZN11CntEditView14contactUpdatedEb @ 5 NONAME
_ZN11CntEditView16changesDiscardedEv @ 6 NONAME
_ZN11CntEditView16staticMetaObjectE @ 7 NONAME DATA 16
_ZN11CntEditView19getStaticMetaObjectEv @ 8 NONAME
--- a/phonebookui/pbkcommonui/inc/cntactionmenubuilder.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntactionmenubuilder.h Fri May 14 15:42:23 2010 +0300
@@ -37,7 +37,7 @@
~CntActionMenuBuilder();
public:
- void execActionMenu( QContact& aContact, QPointF aPoint );
+ HbMenu* actionMenu( QContact& aContact );
public:
HbMenu* buildActionMenu( QContact& aContact );
@@ -63,7 +63,7 @@
#endif
void createCallAction( HbMenu& aMenu, QContact& aContact );
- void createSmsAction( HbMenu& aMenu, QContact& aContact );
+ void createMessageAction( HbMenu& aMenu, QContact& aContact );
void createEmailAction( HbMenu& aMenu, QContact& aContact );
private:
QContactLocalId iMyCardId;
--- a/phonebookui/pbkcommonui/inc/cntaddressmodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntaddressmodel.h Fri May 14 15:42:23 2010 +0300
@@ -47,5 +47,12 @@
QContactAddress *mAddress;
QContactAddress *mAddressHome;
QContactAddress *mAddressWork;
+
+#ifdef PBK_UNIT_TEST
+public:
+#else
+protected:
+#endif
+ bool mIsLocationPickerEnabled;
};
#endif /* CNTDETAILADDRESSEDITORMODEL_H_ */
--- a/phonebookui/pbkcommonui/inc/cntaddressviewitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntaddressviewitem.h Fri May 14 15:42:23 2010 +0300
@@ -19,11 +19,8 @@
#define CNTADDRESSVIEWITEM_H_
#include <hbdataformviewitem.h>
-//#include "cntdetailviewitem.h"
#include <hbpushbutton.h>
-#include <xqappmgr.h>
-class XQAiwRequest;
class HbWidget;
class HbAbstractViewItem;
@@ -34,18 +31,27 @@
public:
CntAddressViewItem( QGraphicsItem* aParent = 0 );
~CntAddressViewItem();
-
+
+#ifdef PBK_UNIT_TEST
+public slots:
+#else
private slots:
+#endif
void launchLocationPicker();
- void handleLocationChange(const QVariant& aValue );
public:
HbAbstractViewItem* createItem();
HbWidget* createCustomWidget();
-
- XQAiwRequest* mRequest;
- XQApplicationManager* mAppManager;
- QObject* mSenderButton;
- };
+
+ bool canSetModelIndex( const QModelIndex &index ) const;
+
+#ifdef PBK_UNIT_TEST
+public:
+#else
+private:
+#endif
+ void handleLocationChange(const QVariant& aValue );
+
+};
#endif /* CNTADDRESSVIEWITEM_H_ */
--- a/phonebookui/pbkcommonui/inc/cntcollectionview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcollectionview.h Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,7 @@
#define CNTCOLLECTIONVIEW_H
#include <QObject>
+#include <QSet>
#include <hbdocumentloader.h>
#include <cntabstractview.h>
@@ -27,10 +28,13 @@
class HbView;
class HbListView;
class CntCollectionListModel;
+class CntFetchContacts;
class QModelIndex;
class HbAbstractViewItem;
class CntExtensionManager;
+QTM_USE_NAMESPACE
+
class CntCollectionView : public QObject, public CntAbstractView
{
Q_OBJECT
@@ -50,13 +54,27 @@
private slots:
void showPreviousView();
void openGroup(const QModelIndex &index);
+
void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
+ void handleMenu(HbAction* action);
+
void newGroup();
+ void handleNewGroup(HbAction* action);
+ void handleNewGroupMembers();
+
void refreshDataModel();
+
void deleteGroup(QContact group);
+ void handleDeleteGroup(HbAction* action);
+
void deleteGroups();
+ void handleDeleteGroups(HbAction* action);
-
+private:
+ QContactManager* getContactManager();
+ void saveNewGroup(QContact* aContact);
+
+
private:
CntExtensionManager& mExtensionManager;
HbView* mView; // own
@@ -70,6 +88,10 @@
HbAction* mExtensionAction; // owned by view
HbAction* mNewGroupAction; // owned by view
HbAction* mDeleteGroupsAction; // owned by view
+
+ QContact* mHandledContact; // own, needed for asynchronous popups
+ CntFetchContacts* mFetchView;
+ QSet<QContactLocalId> mSelectedContactsSet;
};
#endif // CNTCOLLECTIONVIEW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntcontactcardcontextmenu.h Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* 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 CNTCONTACTCARDCONTEXTMENU_H_
+#define CNTCONTACTCARDCONTEXTMENU_H_
+
+#include <hbmenu.h>
+
+class CntContactCardDetailItem;
+class CntContactCardContextMenu : public HbMenu
+{
+public:
+ CntContactCardContextMenu( CntContactCardDetailItem* aItem );
+ ~CntContactCardContextMenu();
+
+ CntContactCardDetailItem* item();
+private:
+ CntContactCardDetailItem* mItem;
+};
+#endif /* CNTCONTACTCARDCONTEXTMENU_H_ */
--- a/phonebookui/pbkcommonui/inc/cntcontactcarddatacontainer.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcarddatacontainer.h Fri May 14 15:42:23 2010 +0300
@@ -49,7 +49,8 @@
QList<QContactDetail> actionDetails(const QString &actionName, const QContact &contact);
bool supportsDetail(const QString &actionName, const QContactDetail &contactDetail);
void addSeparator(int index);
-
+ void sortDataItems();
+
#ifdef PBK_UNIT_TEST
public:
#else
--- a/phonebookui/pbkcommonui/inc/cntcontactcarddataitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcarddataitem.h Fri May 14 15:42:23 2010 +0300
@@ -30,7 +30,7 @@
Q_OBJECT
public:
- CntContactCardDataItem(const QString& aTitle, bool aIsFocusable);
+ CntContactCardDataItem(const QString& aTitle, int aPosition, bool aIsFocusable);
virtual ~CntContactCardDataItem();
public:
@@ -50,7 +50,8 @@
QContactDetail detail() { return mDetail; }
Qt::TextElideMode elideMode() { return mValueTextElideMode; }
bool isFocusable() { return mIsFocusable; }
-
+ int position() { return mPosition; }
+
private:
HbIcon mIcon;
HbIcon mSecondaryIcon;
@@ -60,6 +61,9 @@
QContactDetail mDetail;
Qt::TextElideMode mValueTextElideMode;
bool mIsFocusable;
+
+public:
+ int mPosition;
};
#endif /* CNTCONTACTCARDDATAITEM_H */
--- a/phonebookui/pbkcommonui/inc/cntcontactcarddetailitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcarddetailitem.h Fri May 14 15:42:23 2010 +0300
@@ -23,12 +23,12 @@
class HbIconItem;
class HbTextItem;
-class HbRichTextItem;
class QGraphicsGridLayout;
class HbFrameItem;
-class HbGestureSceneFilter;
-class HbGesture;
+class HbTouchArea;
class CntContactCardDataItem;
+class QTapGesture;
+class QTapAndHoldGesture;
class CntContactCardDetailItem : public HbWidget
{
@@ -36,16 +36,22 @@
Q_PROPERTY( QString text READ getText )
Q_PROPERTY( QString valueText READ getValueText )
Q_PROPERTY( HbIcon icon READ getIcon )
+ Q_PROPERTY( HbIcon secondaryIcon READ getSecondaryIcon )
public:
CntContactCardDetailItem(int index, QGraphicsItem *parent = 0, bool isFocusable = true);
~CntContactCardDetailItem();
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
+ //void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ //void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ //void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void gestureEvent(QGestureEvent* event);
+
+private:
+ void tapTriggered(QTapGesture *gesture);
+ void tapAndHoldTriggered(QTapAndHoldGesture *gesture);
+
public:
void initGesture();
void createPrimitives();
@@ -65,6 +71,7 @@
QString getText() const { return text; }
QString getValueText() const { return valueText; }
HbIcon getIcon() const { return icon; }
+ HbIcon getSecondaryIcon() const { return secondaryIcon; }
#ifdef PBK_UNIT_TEST
public:
@@ -72,13 +79,13 @@
private:
#endif
HbIconItem *mIcon;
+ HbIconItem *mSecondaryIcon;
HbTextItem *mFirstLineText;
HbTextItem *mSecondLineText;
HbFrameItem *mFrameItem;
HbFrameItem *mFocusItem;
+ HbTouchArea *mTouchArea;
bool mHasFocus;
- HbGestureSceneFilter *mGestureFilter;
- HbGesture *mGestureLongpressed;
int mIndex;
bool mIsFocusable;
Qt::TextElideMode mValueTextElideMode;
@@ -87,6 +94,7 @@
QString text;
QString valueText;
HbIcon icon;
+ HbIcon secondaryIcon;
};
#endif // CNTCOMMLAUNCHERDETAILITEM_H
--- a/phonebookui/pbkcommonui/inc/cntcontactcardheadingitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcardheadingitem.h Fri May 14 15:42:23 2010 +0300
@@ -21,15 +21,13 @@
#include <QObject>
#include <qmobilityglobal.h>
#include <hbwidget.h>
-#include <hbgesturefilter.h>
-#include <hbgesture.h>
-
class HbTouchArea;
class HbIconItem;
class HbTextItem;
class HbFrameItem;
class HbMarqueeItem;
+class QGestureEvent;
QTM_BEGIN_NAMESPACE
class QContact;
@@ -56,7 +54,7 @@
void createPrimitives();
void recreatePrimitives();
void updatePrimitives();
- void setDetails(const QContact* contact, bool isMyCard);
+ void setDetails(const QContact* contact);
void setIcon(const HbIcon newIcon);
void setGroupDetails(const QContact* contact);
void setSecondaryIcon(bool favoriteContact);
@@ -69,9 +67,7 @@
void processLongPress(const QPointF &point);
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void gestureEvent(QGestureEvent* event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private slots:
@@ -110,8 +106,6 @@
HbTextItem *mSecondaryText;
HbMarqueeItem *mMarqueeItem;
HbFrameItem *mFrameItem;
- HbGestureSceneFilter *mGestureFilter;
- HbGesture *mGestureLongpressed;
HbTouchArea *mPictureArea;
QString firstLineText;
--- a/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntcontactcardview_p.h Fri May 14 15:42:23 2010 +0300
@@ -71,11 +71,17 @@
void sendBusinessCard();
void addToGroup();
void deleteContact();
+ void handleDeleteContact(HbAction *action);
void setAsFavorite();
void removeFromFavorite();
void progress(QContactAction::State status);
void setOrientation(Qt::Orientation orientation);
void showPreviousView();
+ void doChangeImage();
+ void doRemoveImage();
+
+ void handleMenuAction(HbAction* aAction);
+ void handleSendBusinessCard( HbAction* aAction );
public:
CntContactCardView* q_ptr;
@@ -97,11 +103,8 @@
#else
private:
#endif
- void doChangeImage();
- void doRemoveImage();
-
void launchAction(QContact contact, QContactDetail detail, QString action);
- bool createVCard(QString& vCardPath);
+ //bool createVCard(QString& vCardPath);
bool isFavoriteGroupContact();
bool isFavoriteGroupCreated();
@@ -124,6 +127,7 @@
QContactAvatar *mAvatar;
bool mIsGroupMember;
bool mIsHandlingMenu;
+ bool mIsPreviousImageEditorView;
QMap<QString, CntContactCardDetailItem*> mPreferredItems;
int mFavoriteGroupId;
CntDocumentLoader *mLoader;
@@ -132,6 +136,7 @@
CntImageLabel *mImageLabel;
XQServiceRequest *mHighwayService;
HbIcon *mVCardIcon;
+
};
#endif // CNTCOMMLAUNCHERVIEW_H
--- a/phonebookui/pbkcommonui/inc/cntdateeditorviewitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdateeditorviewitem.h Fri May 14 15:42:23 2010 +0300
@@ -23,6 +23,8 @@
#include <QLocale>
#include <hbpushbutton.h>
+class HbAction;
+
class CntDateEditorViewItem : public CntDetailViewItem
{
Q_OBJECT
@@ -39,7 +41,12 @@
HbWidget* createCustomWidget();
private:
- QDate editDate( QDate aCurrent, QString aTitle );
+ void editDate( QDate aCurrent, QString aTitle );
+ void changeDate( QDate aNewDate );
+
+private slots:
+ void handleEditDate( HbAction *aAction );
+
#ifdef PBK_UNIT_TEST
public:
--- a/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdefaultviewmanager.h Fri May 14 15:42:23 2010 +0300
@@ -25,6 +25,7 @@
class CntAbstractViewFactory;
class CntAbstractView;
class CntViewNavigator;
+class SimUtility;
QTM_BEGIN_NAMESPACE
class QContactManager;
@@ -65,6 +66,8 @@
QList<QContactManager*> mBackends;
HbMainWindow* mMainWindow;
- friend class TestCntDefaultViewManager;
+ SimUtility* mSimUtility;
+
+ friend class T_CntDefaultViewManager;
};
#endif /* CNTDEFAULTVIEWMANAGER_H_ */
--- a/phonebookui/pbkcommonui/inc/cntdetaileditor.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdetaileditor.h Fri May 14 15:42:23 2010 +0300
@@ -45,7 +45,7 @@
void saveChanges();
void discardChanges();
void insertField();
- void handleOrientation(Qt::Orientation aOrientation);
+ void handleItemShown(const QModelIndex& aIndex );
public:
void setViewId( int aId );
@@ -74,7 +74,7 @@
#endif
QPointer<HbDataForm> mDataForm;
- QPointer<CntDetailEditorModel> mDataFormModel;
+ CntDetailEditorModel *mDataFormModel;
QPointer<HbGroupBox> mHeader;
int mId;
HbView *mView;
@@ -83,5 +83,6 @@
CntEditorFactory *mEditorFactory;
HbAction *mSoftkey;
HbAction *mCancel;
+ CntViewParameters mArgs;
};
#endif /* CNTDETAILEDITOR_H_ */
--- a/phonebookui/pbkcommonui/inc/cntdetailpopup.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntdetailpopup.h Fri May 14 15:42:23 2010 +0300
@@ -25,11 +25,14 @@
class QStandardItemModel;
class HbListView;
+typedef QList<int> CntViewIdList;
+
class CntDetailPopup : public HbDialog
{
Q_OBJECT
public:
- static int selectDetail();
+ static void selectDetail( CntViewIdList aList, QObject *receiver = 0, const char *member = 0 );
+ int selectedDetail();
#ifdef PBK_UNIT_TEST
public slots:
@@ -43,10 +46,9 @@
#else
private:
#endif
- CntDetailPopup(QGraphicsItem *parent = 0);
+ CntDetailPopup(QGraphicsItem *parent, CntViewIdList aList );
~CntDetailPopup();
- QString selectedDetail();
void addListItem(QString aIcon, QString label, int aId);
#ifdef PBK_UNIT_TEST
@@ -56,7 +58,8 @@
#endif
QStandardItemModel *mListModel;
HbListView *mListView;
- QString mSelectedDetail;
+ int mSelectedDetail;
+ CntViewIdList mViewIdList;
};
#endif // CNTDETAILPOPUP_H
--- a/phonebookui/pbkcommonui/inc/cnteditview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnteditview.h Fri May 14 15:42:23 2010 +0300
@@ -35,8 +35,8 @@
~CntEditView();
signals:
- void contactUpdated();
- void contactRemoved();
+ void contactUpdated(bool aSuccess);
+ void contactRemoved(bool aSuccess);
void changesDiscarded();
--- a/phonebookui/pbkcommonui/inc/cnteditview_p.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnteditview_p.h Fri May 14 15:42:23 2010 +0300
@@ -38,6 +38,7 @@
class HbView;
class HbAction;
class QAction;
+class HbMenu;
QTM_BEGIN_NAMESPACE
class QContactDetail;
@@ -57,8 +58,8 @@
void deactivate();
signals:
- void contactUpdated();
- void contactRemoved();
+ void contactUpdated(bool aSuccess);
+ void contactRemoved(bool aSuccess);
void changesDiscarded();
public:
@@ -69,7 +70,9 @@
void longPressed( HbAbstractViewItem *item, const QPointF &coords );
void addDetailItem();
+ void handleAddDetailItem(HbAction *aAction);
void deleteContact();
+ void handleDeleteContact(HbAction *action);
void discardChanges();
void saveChanges();
@@ -77,10 +80,11 @@
void openImageEditor();
void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
void setOrientation(Qt::Orientation aOrientation);
+ void handleMenuAction( HbAction* aAction );
private:
void loadAvatar();
- QList<QAction*> createPopup( CntEditViewItem* aDetail );
+ HbMenu* createPopup( const QModelIndex aIndex, CntEditViewItem* aDetail );
void addDetail( CntEditViewItem* aDetail );
void editDetail( CntEditViewItem* aDetail );
void removeDetail( CntEditViewItem* aDetail, const QModelIndex& aIndex );
@@ -91,10 +95,12 @@
CntEditViewListModel* mModel;
CntEditViewHeadingItem* mHeading;
CntImageLabel *mImageLabel;
+ CntViewParameters mArgs;
HbDocumentLoader* mDocument;
ThumbnailManager* mThumbnailManager;
QContact* mContact; // own
CntAbstractViewManager* mMgr; // not owned
+ bool mIsMyCard;
HbAction* mSoftkey;
HbAction* mDiscard;
--- a/phonebookui/pbkcommonui/inc/cnteditviewlistmodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnteditviewlistmodel.h Fri May 14 15:42:23 2010 +0300
@@ -24,6 +24,7 @@
#include <cnteditviewitem.h>
#include "cntstringmapper.h"
+#include "cntdetailpopup.h"
class CntExtensionManager;
class CntEditViewItemSupplier;
@@ -82,8 +83,9 @@
CntEditViewItem* itemAt( const QModelIndex& aIndex ) const;
void removeItem( CntEditViewItem* aItem, const QModelIndex& aIndex );
bool isEmptyItem( CntEditViewItem* aItem );
+ void refreshExtensionItems( const QModelIndex& aIndex );
+ void allInUseFields( CntViewIdList& aList );
- void refreshExtensionItems( const QModelIndex& aIndex );
private:
void refresh();
void loadPluginItems( CntEditViewItemSupplier* aSupplier );
--- a/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntfavoritesmemberview.h Fri May 14 15:42:23 2010 +0300
@@ -56,7 +56,11 @@
#endif
void manageFavorites();
+ void handleManageFavorites(HbAction *action);
+
void onLongPressed (HbAbstractViewItem *item, const QPointF &coords);
+ void handleMenu(HbAction* action);
+
void openContact(const QModelIndex &index);
void editContact(const QModelIndex &index);
void removeFromFavorites(const QModelIndex &index);
@@ -77,7 +81,6 @@
HbView* mView; // own
HbAction* mSoftkey; // owned by view
-
};
#endif /* CNTFAVORITESMEMBERVIEW_H */
--- a/phonebookui/pbkcommonui/inc/cntfavoritesview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntfavoritesview.h Fri May 14 15:42:23 2010 +0300
@@ -34,6 +34,7 @@
class CntFavoritesView : public QObject, public CntAbstractView
{
+ friend class TestCntFavoritesView;
Q_OBJECT
public:
@@ -50,6 +51,7 @@
private slots:
void showPreviousView();
void openSelectionPopup();
+ void handleMemberSelection(HbAction *action);
void setOrientation(Qt::Orientation orientation);
#ifdef PBK_UNIT_TEST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntfetchcontactsview.h Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* 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 MobCntModel;
+class QGraphicsLinearLayout;
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+QTM_END_NAMESPACE
+
+QTM_USE_NAMESPACE
+
+class CntFetchContacts : public QObject
+ {
+ Q_OBJECT
+
+public:
+ CntFetchContacts(QContactManager *aManager);
+ ~CntFetchContacts();
+
+ enum DisplayType {
+ view,
+ popup
+ };
+
+private slots:
+ void memberSelectionChanged(const QModelIndex &index);
+
+ void closeFind();
+ void setFilter(const QString &filterString);
+
+ void handleKeypadOpen();
+ void handleKeypadClose();
+
+ void handleUserResponse(HbAction* action);
+
+public:
+ void displayContacts(DisplayType aType, 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 connectSignal();
+ void showPopup();
+ void markMembersInView();
+
+signals:
+ void clicked();
+
+private:
+ HbDialog* mPopup;
+ HbSearchPanel* mSearchPanel;
+ MobCntModel* 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;
+ };
+
+#endif /* CntFetchContacts_H_ */
--- a/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupdeletepopup.h Fri May 14 15:42:23 2010 +0300
@@ -20,8 +20,8 @@
#include <QObject>
#include <hbdialog.h>
-#include <hblistview.h>
-#include "qmobilityglobal.h"
+#include <qmobilityglobal.h>
+#include <qcontactid.h>
#include "cntgroupdeletepopupmodel.h"
class HbListView;
@@ -41,16 +41,16 @@
~CntGroupDeletePopup();
void populateListOfGroup();
- void deleteGroup();
+ QList<QContactLocalId> deleteGroup() const;
#ifdef PBK_UNIT_TEST
public:
#else
private:
#endif
- HbListView *mListView;
- QContactManager *mContactManager;
- CntGroupDeletePopupModel * mModel;
+ HbListView *mListView;
+ QContactManager *mContactManager;
+ CntGroupDeletePopupModel *mModel;
};
#endif // CNTGROUPDELETEPOPUP_H
--- a/phonebookui/pbkcommonui/inc/cntgroupeditormodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupeditormodel.h Fri May 14 15:42:23 2010 +0300
@@ -21,6 +21,7 @@
#include <qtcontacts.h>
#include "qtpbkglobal.h"
+class HbDataFormModelItem;
QTM_BEGIN_NAMESPACE
class QContact;
QTM_END_NAMESPACE
@@ -37,9 +38,13 @@
void saveContactDetails();
+ bool isConferenceNumber( const QModelIndex& aIndex );
private:
QContactName iGroupName;
QContactPhoneNumber iGroupConfCallNumber;
+
+ HbDataFormModelItem* iNameItem;
+ HbDataFormModelItem* iNumberItem;
};
#endif /* CNTGROUPEDITORMODEL_H_ */
--- a/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupmemberview.h Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,7 @@
#define CNTGROUPMEMBERVIEW_H
#include <QObject>
+#include <QList>
#include <hbdocumentloader.h>
#include <cntabstractview.h>
@@ -26,6 +27,7 @@
class MobCntModel;
class CntAbstractViewManager;
class CntContactCardHeadingItem;
+class CntFetchContacts;
class HbView;
class HbAction;
class HbListView;
@@ -65,15 +67,31 @@
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);
+
+
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 handleImageMenu(HbAction* action);
+
+private:
+ void changeImage();
+ void removeImage();
+
+private:
+ QContactManager* getContactManager();
+
private:
QContact* mGroupContact; // own
CntAbstractViewManager* mViewManager;
@@ -90,6 +108,10 @@
CntImageLabel* mImageLabel;
HbListView* mListView; // owned by layout
HbDocumentLoader* mDocument;
+ CntFetchContacts* mFetchView;
+ QList<QContactLocalId> mOriginalGroupMembers;
+ bool mIsPreviousImageEditorView;
+ QContactAvatar* mAvatar;
};
#endif // CNTGROUPMEMBERVIEW_H
--- a/phonebookui/pbkcommonui/inc/cntgroupselectionpopup.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntgroupselectionpopup.h Fri May 14 15:42:23 2010 +0300
@@ -45,8 +45,8 @@
CntGroupSelectionPopup(QContactManager *manager, QContact *contact, QGraphicsItem *parent = 0);
~CntGroupSelectionPopup();
- void saveNewGroup();
- void saveOldGroup();
+ bool saveNewGroup();
+ bool saveOldGroup();
void populateListOfContact();
#ifdef PBK_UNIT_TEST
@@ -54,9 +54,8 @@
#else
private slots:
#endif
-
-void closeFind();
-void setFilter(const QString &filterString);
+ void closeFind();
+ void setFilter(const QString &filterString);
#ifdef PBK_UNIT_TEST
public:
--- a/phonebookui/pbkcommonui/inc/cnthistoryview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnthistoryview.h Fri May 14 15:42:23 2010 +0300
@@ -50,8 +50,11 @@
public slots:
void updateScrollingPosition();
void clearHistory();
+ void handleClearHistory(HbAction *action);
void itemActivated(const QModelIndex &index);
void showPreviousView();
+ void showClearHistoryMenu();
+
private:
@@ -67,8 +70,9 @@
HbView* mView; // not own
HbDocumentLoader* mDocumentLoader; // own
CntAbstractViewManager* mViewMgr; // not own
- HbAction* mBackKey; // own
+ HbAction* mBackKey; // not own
QContact* mContact; // own
+ HbAction* mClearHistory; // not own
};
--- a/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cnthistoryviewitem.h Fri May 14 15:42:23 2010 +0300
@@ -19,18 +19,20 @@
#define CNTHISTORYVIEWITEM_H
// INCLUDES
-#include "cnthistoryviewitemwidget.h"
-#include <hbtextitem.h>
-#include <hbiconitem.h>
-#include <hbabstractviewitem.h>
-#include <QGraphicsLinearLayout>
+#include <hblistviewitem.h>
+
+class HbFrameItem;
/**
* This class represents the item decorator of
* the comm history view.
*/
-class CntHistoryViewItem : public HbAbstractViewItem
- {
+class CntHistoryViewItem : public HbListViewItem
+{
+ Q_OBJECT
+ Q_PROPERTY( bool incoming READ getIncoming )
+ Q_PROPERTY( bool newmessage READ isNewMessage )
+
public:
/*
* Constructor
@@ -38,29 +40,25 @@
* default set to 0
*/
CntHistoryViewItem(QGraphicsItem* parent=0);
-
+
/*
* Factory method to the items
*/
HbAbstractViewItem* createItem();
-
- /*
- * Overriden method to postprocess custom item
- */
- void polish(HbStyleParameters& params);
-
+
/*
* Overriden method to draw the custom item in the list view
*/
void updateChildItems();
-private:
+ bool getIncoming() const { return mIncoming; }
+ bool isNewMessage() const { return mNewMessage; }
- /*
- * Custom widget containing text fields and icon
- * Not owned
- */
- CntHistoryViewItemWidget* itemWidget;
- };
+private:
+ bool mIncoming;
+ bool mNewMessage;
+
+ HbFrameItem* mNewItem;
+};
#endif // CNTHISTORYVIEWITEM_H
--- a/phonebookui/pbkcommonui/inc/cnthistoryviewitemwidget.h Mon May 03 12:24:20 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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 CNTHISTORYVIEWITEMWIDGET_H
-#define CNTHISTORYVIEWITEMWIDGET_H
-
-#include <QObject>
-#include <hbwidget.h>
-
-class HbIconItem;
-class HbTextItem;
-class HbFrameItem;
-
-class CntHistoryViewItemWidget : public HbWidget
-{
- Q_OBJECT
- Q_PROPERTY( bool titleExist READ isTitleExist )
- Q_PROPERTY( bool bodyTextExist READ isBodyTextExist )
- Q_PROPERTY( bool incoming READ getIncoming )
-
-public:
- CntHistoryViewItemWidget(QGraphicsItem *parent = 0);
- ~CntHistoryViewItemWidget();
-
-public:
- void createPrimitives();
- void recreatePrimitives();
- void updatePrimitives();
- void setDetails(QString title, QString bodyText, QString timeStamp, QString iconName, bool incoming, bool newMessage);
-
- bool isTitleExist() const { return !mTitle.isNull(); }
- bool isBodyTextExist() const { return !mBodyText.isNull(); }
- bool getIncoming() const { return mIncoming; }
-
-private:
-
- HbIconItem *mIconLabel;
- HbTextItem *mTitleLabel;
- HbTextItem *mBodyTextLabel;
- HbTextItem *mTimeStampLabel;
- HbFrameItem *mFrameLabel;
- HbFrameItem *mNewItemLabel;
-
- QString mTitle;
- QString mBodyText;
- QString mTimeStamp;
- HbIcon mIcon;
- bool mIncoming;
- bool mNewMessage;
-};
-
-#endif // CNTHISTORYVIEWITEMWIDGET_H
--- a/phonebookui/pbkcommonui/inc/cntimageeditorview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntimageeditorview.h Fri May 14 15:42:23 2010 +0300
@@ -93,6 +93,8 @@
HbDocumentLoader mDocumentLoader;
HbListView *mListView; // owned by layout
QStandardItemModel *mModel; // own
+
+ CntViewParameters mArgs;
};
#endif // CNTIMAGEEDITORVIEW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/inc/cntimportsview.h Fri May 14 15:42:23 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 CNTIMPORTSVIEW_H_
+#define CNTIMPORTSVIEW_H_
+
+#include <QObject>
+#include <hbpushbutton.h>
+#include <hblistview.h>
+
+//#include "cntabstractview.h"
+#include "cntactionmenubuilder.h"
+#include <hbdocumentloader.h>
+#include "simutility.h"
+
+#include <cntabstractview.h>
+
+class CntAbstractViewManager;
+class HbView;
+class HbAction;
+class QStandardItemModel;
+class SimUtility;
+class HbDialog;
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+QTM_END_NAMESPACE
+
+QTM_USE_NAMESPACE
+
+class CntImportsView : public QObject, public CntAbstractView
+{
+
+Q_OBJECT
+
+public slots:
+
+ void onListViewActivated(const QModelIndex &index);
+ void stopSimImport();
+ void importFetchResultReceivedADN();
+ void importFetchResultReceivedSDN();
+ void adnCacheStatusReady(SimUtility::CacheStatus& cacheStatus, int error);
+
+public:
+CntImportsView();
+ ~CntImportsView();
+
+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 importsView; }
+ void simInfoErrorMessage(int infoError);
+ bool startSimImport();
+ void fetchSDNContacts();
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ void showWaitNote();
+ void showSimImportResults() const;
+
+#ifdef PBK_UNIT_TEST
+public slots:
+#else
+private slots:
+#endif
+ void showPreviousView();
+
+#ifdef PBK_UNIT_TEST
+public :
+#else
+private :
+#endif
+ // QContact* mContact;
+ CntAbstractViewManager* mViewManager;
+ QContactManager *mContactSimManagerADN;
+ QContactManager *mContactSimManagerSDN;
+ QContactManager *mContactSymbianManager;
+ QContactFetchRequest *mFetchRequestADN;
+ QContactFetchRequest *mFetchRequestSDN;
+ HbListView *mListView;
+ HbDocumentLoader mDocumentLoader;
+ HbView* mView; // own
+ HbAction* mSoftkey;
+ QStandardItemModel* mModel;
+ SimUtility *mSimUtility;
+ bool mAdnEntriesPresent;
+ HbDialog *mImportSimPopup;
+ int mSaveCount;
+ QList<QContact> mSaveSimContactsList;
+ QList<QContact> mSaveSimContactsListSDN;
+ QTimer *mTimer;
+ bool mFetchIsDone;
+ int mTimerId;
+ bool mAdnStorePresent;
+ bool mSdnStorePresent;
+ bool mSimPresent;
+ int mAdnStoreEntries;
+ bool mSimError;
+ bool mWaitingForAdnCache;
+};
+
+#endif /* CNTIMPORTSVIEW_H_ */
--- a/phonebookui/pbkcommonui/inc/cntmycardview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntmycardview.h Fri May 14 15:42:23 2010 +0300
@@ -24,6 +24,7 @@
#include <cntabstractview.h>
class CntAbstractViewManager;
+class CntFetchContacts;
class HbView;
class HbAction;
@@ -57,14 +58,16 @@
void showPreviousView();
void openNameEditor();
void openMyCardSelectionView();
+ void handleMultiCardSelection();
void setOrientation(Qt::Orientation orientation);
private:
- QContact* mContact; // own
- CntAbstractViewManager* mViewManager;
- HbDocumentLoader mDocumentLoader;
- HbView* mView; // own
- HbAction* mSoftkey;
+ QContact* mContact; // own
+ CntAbstractViewManager* mViewManager;
+ HbDocumentLoader mDocumentLoader;
+ HbView* mView; // own
+ HbAction* mSoftkey;
+ CntFetchContacts* mFetchView;
};
#endif /* CNTMYCARDVIEW_H_ */
--- a/phonebookui/pbkcommonui/inc/cntnamesview_p.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntnamesview_p.h Fri May 14 15:42:23 2010 +0300
@@ -38,6 +38,7 @@
class HbStaticVkbHost;
class QGraphicsLinearLayout;
class CntExtensionManager;
+class CntFetchContacts;
class CntNamesViewPrivate : public QObject
{
@@ -62,6 +63,11 @@
void handleExtensionAction();
void createNewContact();
+ void deleteContact( QContact& aContact );
+ void deleteMultipleContacts();
+
+ void handleDeleteMultipleContacts();
+
void showPreviousView();
void showCollectionView();
void showContactView( QContact& aContact );
@@ -71,26 +77,25 @@
void executeAction( QContact& aContact, QString aAction );
void actionExecuted( CntAction* aAction );
- void deleteContact( QContact& aContact );
+ void handleDeleteContact( HbAction* aAction );
void importSim();
-
+
public:
bool isFinderVisible();
void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs );
void deactivate();
- void scrollTo(const QContact &aContact);
public:
- CntNamesView* q_ptr;
+ CntNamesView *q_ptr;
-public: // lazy initializations
- HbListView* list();
- HbTextItem* emptyLabel();
- HbGroupBox* groupBox();
- HbSearchPanel* search();
- QGraphicsLinearLayout* layout();
- HbDocumentLoader* document();
-
+public: // lazy initializations
+ HbListView *list();
+ HbTextItem *emptyLabel();
+ HbGroupBox *groupBox();
+ HbSearchPanel *search();
+ QGraphicsLinearLayout *layout();
+ HbDocumentLoader *document();
+
private:
CntExtensionManager& mExtensionManager;
CntAbstractViewManager* mViewManager;
@@ -103,10 +108,15 @@
HbDocumentLoader* mLoader;
QGraphicsLinearLayout* mLayout;
HbStaticVkbHost* mVirtualKeyboard;
- HbAction* mSoftkey; // own
- CntActionMenuBuilder* mMenuBuilder; // own
-
- bool mIsDefault;
- int mId;
+ HbAction* mSoftkey;
+ CntActionMenuBuilder* mMenuBuilder;
+ HbAction* mImportSim;
+ HbAction* mNewContact;
+ QContactLocalId mHandledContactId;
+ HbAction* mMultipleDeleter;
+ CntFetchContacts* mFetchView;
+ bool mIsDefault;
+ int mId;
+ bool mMenuVisible;
};
#endif /* CNTABSTRACTLISTVIEW_H_ */
--- a/phonebookui/pbkcommonui/inc/cntphonenumbermodel.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntphonenumbermodel.h Fri May 14 15:42:23 2010 +0300
@@ -36,7 +36,7 @@
public:
// takes ownership of aContact
- CntPhoneNumberModel( QContact* aContact, QObject* aParent=0 );
+ CntPhoneNumberModel( QContact* aContact, QObject* aParent = 0 );
~CntPhoneNumberModel();
void saveContactDetails();
--- a/phonebookui/pbkcommonui/inc/cntphonenumberviewitem.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntphonenumberviewitem.h Fri May 14 15:42:23 2010 +0300
@@ -57,7 +57,6 @@
#endif
HbComboBox* mBox;
HbLineEdit* mEdit;
- HbEditorInterface* mFilter;
QGraphicsLinearLayout* mLayout;
};
#endif /* CNTPHONENUMBERVIEWITEM_H_ */
--- a/phonebookui/pbkcommonui/inc/cntstringmapper.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/inc/cntstringmapper.h Fri May 14 15:42:23 2010 +0300
@@ -45,107 +45,160 @@
public:
void initMappings()
{
- // init stringmap for string localization
- mStringMap.insert(QContactPhoneNumber::DefinitionName, hbTrId("Phone number"));
- mStringMap.insert(QContactPhoneNumber::SubTypeAssistant, hbTrId("Assistant number"));
- mStringMap.insert(QContactPhoneNumber::SubTypeCar, hbTrId("Car phone"));
- mStringMap.insert(QContactPhoneNumber::SubTypeMobile, hbTrId("Mobile"));
- mStringMap.insert(QContactPhoneNumber::SubTypeLandline, hbTrId("Phone"));
- mStringMap.insert(QContactPhoneNumber::SubTypeDtmfMenu, hbTrId("DTMF"));
- mStringMap.insert(QContactPhoneNumber::SubTypeFacsimile, hbTrId("Fax"));
- mStringMap.insert(QContactPhoneNumber::SubTypePager, hbTrId("Pager number"));
-
- mStringMap.insert(QContactEmailAddress::DefinitionName, hbTrId("Email"));
-
- mStringMap.insert(QContactAddress::DefinitionName, hbTrId("Address"));
-
- mStringMap.insert(QContactOnlineAccount::DefinitionName, hbTrId("Chat"));
- mStringMap.insert(QContactOnlineAccount::SubTypeSipVoip, hbTrId("Internet call"));
- mStringMap.insert(QContactOnlineAccount::SubTypeSip, hbTrId("SIP"));
- mStringMap.insert(QContactOnlineAccount::SubTypeVideoShare, hbTrId("Share Video"));
-
- mStringMap.insert(QContactUrl::DefinitionName, hbTrId("URL"));
-
- mStringMap.insert(QContactOrganization::DefinitionName, hbTrId("Company details"));
- mStringMap.insert(QContactOrganization::FieldAssistantName, hbTrId("Assistant name"));
-
- mStringMap.insert(QContactBirthday::DefinitionName, hbTrId("Birthday"));
- mStringMap.insert(QContactAnniversary::DefinitionName, hbTrId("Anniversary"));
-
- mStringMap.insert(QContactAvatar::SubTypeAudioRingtone, hbTrId("Ringtone"));
-
- mStringMap.insert(QContactNote::DefinitionName, hbTrId("Note"));
-
- mStringMap.insert(QContactFamily::FieldSpouse, hbTrId("Spouse"));
- mStringMap.insert(QContactFamily::FieldChildren, hbTrId("Children"));
-
- mStringMap.insert(QContactDetail::ContextHome, hbTrId("(home)"));
- mStringMap.insert(QContactDetail::ContextWork, hbTrId("(work)"));
-
- // init mapping of editor icons
- mEditorIconMap.insert(QContactPhoneNumber::DefinitionName, "qtg_small_mobile");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeAssistant, "qtg_small_assistant");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeCar, "qtg_small_car");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeMobile, "qtg_small_mobile");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeLandline, "qtg_small_landline");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeDtmfMenu, "qgn_prop_empty");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypeFacsimile, "qtg_small_fax");
- mEditorIconMap.insert(QContactPhoneNumber::SubTypePager, "qtg_small_pagerg");
-
- mEditorIconMap.insert(QContactEmailAddress::DefinitionName, "qtg_small_email");
-
- mEditorIconMap.insert(QContactAddress::DefinitionName, "qtg_small_location");
+ //editor icons
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::DefinitionName, "", "qtg_small_mobile"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, "qtg_small_mobile_home"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, "qtg_small_mobile_work"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", "qtg_small_mobile"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome, "qtg_small_mobile_home"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork, "qtg_small_mobile_work"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeLandline, "", "qtg_small_landline"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, "qtg_small_landline_home"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, "qtg_small_landline_work"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", "qtg_small_fax"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, "qtg_small_fax_home"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, "qtg_small_fax_work"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypePager, "", "qtg_small_pager"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeCar, "", "qtg_small_car"));
+ mContactEditorIconList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", "qtg_small_assistant"));
+ mContactEditorIconList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", "qtg_small_voip"));
+ mContactEditorIconList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, "qtg_small_voip_home"));
+ mContactEditorIconList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, "qtg_small_voip_work"));
+ mContactEditorIconList.append(Loc(QContactOnlineAccount::SubTypeSip, "", "qtg_small_internet"));
+ mContactEditorIconList.append(Loc(QContactEmailAddress::DefinitionName, "", "qtg_small_email"));
+ mContactEditorIconList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, "qtg_small_email_home"));
+ mContactEditorIconList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, "qtg_small_email_work"));
+ mContactEditorIconList.append(Loc(QContactUrl::DefinitionName, "", "qtg_small_url_address"));
+ mContactEditorIconList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, "qtg_small_url_address_home"));
+ mContactEditorIconList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, "qtg_small_url_address_work"));
+ mContactEditorIconList.append(Loc(QContactAddress::DefinitionName, "", "qtg_small_location"));
+
+ //editor list items
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_dblist_mobile")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_mobile_home")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_mobile_work")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "", hbTrId("txt_phob_dblist_phone")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_phone_home")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_phone_work")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_dblist_pager")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_dblist_assistant")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_dblist_car")));
+ mContactEditorLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_dblist_internet_telephone")));
+ mContactEditorLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_internet_telephone_home")));
+ mContactEditorLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_internet_telephone_work")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_dblist_fax")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_fax_home")));
+ mContactEditorLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_fax_work")));
+ mContactEditorLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_dblist_ptt")));
- mEditorIconMap.insert(QContactOnlineAccount::DefinitionName, "qtg_small_internet");
- mEditorIconMap.insert(QContactOnlineAccount::SubTypeSipVoip, "qtg_small_internet");
- mEditorIconMap.insert(QContactOnlineAccount::SubTypeSip, "qtg_small_internet");
- mEditorIconMap.insert(QContactOnlineAccount::SubTypeVideoShare, "qtg_small_internet");
- mEditorIconMap.insert(QContactUrl::DefinitionName, "qtg_small_url_address.svg");
+ //editor list item specific menu items
+ mContactEditorAddLocList.append(Loc(QContactAddress::DefinitionName, "", hbTrId("txt_phob_menu_add_address")));
+ mContactEditorAddLocList.append(Loc(QContactOrganization::DefinitionName, "", hbTrId("txt_phob_menu_add_company_details")));
+ mContactEditorAddLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_add_email")));
+ mContactEditorAddLocList.append(Loc(QContactFamily::DefinitionName, "", hbTrId("txt_phob_menu_add_family_details")));
+ mContactEditorAddLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_add_number")));
+ mContactEditorAddLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_menu_add_url")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_dblist_mobile")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_dblist_mobile_home")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_dblist_mobile_work")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_dblist_phone")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_phone_home")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_phone_work")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_dblist_pager")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_dblist_assistant")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_dblist_car")));
- mLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_dblist_internet_telephone")));
- mLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_internet_telephone_home")));
- mLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_internet_telephone_work")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_dblist_fax")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_fax_home")));
- mLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_fax_work")));
- mLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_dblist_ptt")));
-
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_call_mobile")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_mobile_home")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_mobile_work")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_assistant")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_assistant")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_call_car_phone")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_car_phone")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_car_phone")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_menu_call_mobile_home")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_menu_call_mobile_work")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_call_mobile")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_menu_call_phone")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_phone_home")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_phone_work")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_menu_fax")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_menu_fax_home")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_menu_fax_work")));
- mContactCardMenuLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_menu_call_pager")));
- mContactCardMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_menu_call_internet_call")));
- mContactCardMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_internet_call_home")));
- mContactCardMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_internet_call_work")));
- mContactCardMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_menu_sip")));
- mContactCardMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_email")));
- mContactCardMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_email_home")));
- mContactCardMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_email_work")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_edit_mobile")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_mobile_home")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_mobile_work")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_assistant")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_assistant")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_edit_car")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_car")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_car")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_menu_edit_mobile")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_menu_edit_mobile_home")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_edit_mobile_work")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_menu_edit_phone")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_phone_home")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_phone_work")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_menu_edit_fax")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_fax_home")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_fax_work")));
+ mContactEditorEditLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_menu_edit_pager")));
+ mContactEditorEditLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_menu_edit_internet_telephone")));
+ mContactEditorEditLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_internet_telephone_home")));
+ mContactEditorEditLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_internet_telephone_work")));
+ mContactEditorEditLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_menu_edit_sip")));
+ mContactEditorEditLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_edit_email")));
+ mContactEditorEditLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_email_home")));
+ mContactEditorEditLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_email_work")));
+ mContactEditorEditLocList.append(Loc(QContactAddress::DefinitionName, "", hbTrId("txt_phob_menu_edit_address")));
+ mContactEditorEditLocList.append(Loc(QContactAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_edit_address_home")));
+ mContactEditorEditLocList.append(Loc(QContactAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_edit_address_work")));
+ mContactEditorEditLocList.append(Loc(QContactAnniversary::DefinitionName, "", hbTrId("txt_phob_menu_edit_anniversary")));
+ mContactEditorEditLocList.append(Loc(QContactBirthday::DefinitionName, "", hbTrId("txt_phob_menu_edit_birthday")));
+ mContactEditorEditLocList.append(Loc(QContactNote::DefinitionName, "", hbTrId("txt_phob_menu_edit_note")));
+ mContactEditorEditLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_edit_children")));
+ mContactEditorEditLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_edit_spouse")));
+
+
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_delete_mobile")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_mobile_home")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_mobile_work")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_assistant")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_assistant")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_delete_car")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_car")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_car")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_menu_delete_mobile")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_menu_delete_mobile_home")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_delete_mobile_work")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_menu_delete_phone")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_phone_home")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_phone_work")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_menu_delete_fax")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_fax_home")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_fax_work")));
+ mContactEditorDelLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_menu_delete_pager")));
+ mContactEditorDelLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_menu_delete_internet_telephone")));
+ mContactEditorDelLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_internet_telephone_home")));
+ mContactEditorDelLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_internet_telephone_work")));
+ mContactEditorDelLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_menu_delete_sip")));
+ mContactEditorDelLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_delete_email")));
+ mContactEditorDelLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_email_home")));
+ mContactEditorDelLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_email_work")));
+ mContactEditorDelLocList.append(Loc(QContactAddress::DefinitionName, "", hbTrId("txt_phob_menu_delete_address")));
+ mContactEditorDelLocList.append(Loc(QContactAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_delete_address_home")));
+ mContactEditorDelLocList.append(Loc(QContactAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_delete_address_work")));
+ mContactEditorDelLocList.append(Loc(QContactAnniversary::DefinitionName, "", hbTrId("txt_phob_menu_delete_anniversary")));
+ mContactEditorDelLocList.append(Loc(QContactBirthday::DefinitionName, "", hbTrId("txt_phob_menu_delete_birthday")));
+ mContactEditorDelLocList.append(Loc(QContactNote::DefinitionName, "", hbTrId("txt_phob_menu_delete_note")));
+ mContactEditorDelLocList.append(Loc(QContactFamily::FieldSpouse, "", hbTrId("txt_phob_menu_delete_children")));
+ mContactEditorDelLocList.append(Loc(QContactFamily::FieldChildren, "", hbTrId("txt_phob_menu_delete_spouse")));
+
+ //contact card item specific menu
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_menu_call_mobile")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_mobile_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_mobile_work")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, "", hbTrId("txt_phob_menu_call_assistant")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_assistant")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeAssistant, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_assistant")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, "", hbTrId("txt_phob_menu_call_car_phone")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_car_phone")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeCar, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_car_phone")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextHome,hbTrId("txt_phob_menu_call_mobile_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, QContactDetail::ContextWork,hbTrId("txt_phob_menu_call_mobile_work")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeMobile, "", hbTrId("txt_phob_menu_call_mobile")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, "",hbTrId("txt_phob_menu_call_phone")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_phone_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeLandline, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_phone_work")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, "", hbTrId("txt_phob_menu_fax")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_menu_fax_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_menu_fax_work")));
+ mItemSpecificMenuLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_menu_call_pager")));
+ mItemSpecificMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_menu_call_internet_call")));
+ mItemSpecificMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_menu_call_internet_call_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_menu_call_internet_call_work")));
+ mItemSpecificMenuLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_menu_sip")));
+ mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_menu_email")));
+ mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_menu_email_home")));
+ mItemSpecificMenuLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_menu_email_work")));
+ //contact card list items
mContactCardLocList.append(Loc(QContactPhoneNumber::DefinitionName, "", hbTrId("txt_phob_dblist_call_mobile")));
mContactCardLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_call_mobile_home")));
mContactCardLocList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_call_mobile_work")));
@@ -165,15 +218,18 @@
mContactCardLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_fax_home")));
mContactCardLocList.append(Loc(QContactPhoneNumber::SubTypeFacsimile, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_fax_work")));
mContactCardLocList.append(Loc(QContactPhoneNumber::SubTypePager, "", hbTrId("txt_phob_dblist_call_pager")));
- mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_dblist_call_internet_call")));
- mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_call_internet_call_home")));
- mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_call_internet_call_work")));
- mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_dblist_sip")));
+ mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, "", hbTrId("txt_phob_formlabel_internet_telephone")));
+ mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextHome, hbTrId("txt_phob_formlabel_internet_telephone_home")));
+ mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSipVoip, QContactDetail::ContextWork, hbTrId("txt_phob_formlabel_internet_telephone_work")));
+ mContactCardLocList.append(Loc(QContactOnlineAccount::SubTypeSip, "", hbTrId("txt_phob_formlabel_sip")));
mContactCardLocList.append(Loc(QContactEmailAddress::DefinitionName, "", hbTrId("txt_phob_dblist_email")));
mContactCardLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_email_home")));
mContactCardLocList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_email_work")));
+ mContactCardLocList.append(Loc(QContactUrl::DefinitionName, "", hbTrId("txt_phob_dblist_url")));
+ mContactCardLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, hbTrId("txt_phob_dblist_url_home")));
+ mContactCardLocList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, hbTrId("txt_phob_dblist_url_work")));
- // init mapping of contact card icons
+ //contact card icons
mContactCardIconList.append(Loc(QContactPhoneNumber::DefinitionName, "", "qtg_large_call_mobile"));
mContactCardIconList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextHome, "qtg_large_call_mobile_home"));
mContactCardIconList.append(Loc(QContactPhoneNumber::DefinitionName, QContactDetail::ContextWork, "qtg_large_call_mobile_work"));
@@ -197,29 +253,16 @@
mContactCardIconList.append(Loc(QContactEmailAddress::DefinitionName, "", "qtg_large_email"));
mContactCardIconList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextHome, "qtg_large_email_home"));
mContactCardIconList.append(Loc(QContactEmailAddress::DefinitionName, QContactDetail::ContextWork, "qtg_large_email_work"));
+ mContactCardIconList.append(Loc(QContactUrl::DefinitionName, "", "qtg_large_url_address"));
+ mContactCardIconList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextHome, "qtg_large_url_address_home"));
+ mContactCardIconList.append(Loc(QContactUrl::DefinitionName, QContactDetail::ContextWork, "qtg_large_url_address_work"));
}
- QString getMappedDetail(const QString &string) { return mStringMap.value(string); }
- QString getMappedIcon(const QString &string) { return mEditorIconMap.value(string); }
-
- QString getLocString( QString aDefId, QString aContext )
- {
- QString str = aDefId;
- foreach ( Loc loc, mLocList )
- {
- if ( loc.mId == aDefId && loc.mContext == aContext )
- {
- str = loc.mLoc;
- break;
- }
- }
- return str;
- }
-
- QString getContactCardMenuLocString( QString aDefId, QString aContext )
+ //helper function to get string from list
+ QString getLocString( QString aDefId, QString aContext, QList<Loc> list)
{
QString str;
- foreach ( Loc loc, mContactCardMenuLocList )
+ foreach ( Loc loc, list )
{
if ( loc.mId == aDefId && loc.mContext == aContext )
{
@@ -229,40 +272,63 @@
}
return str;
}
+
+ //get string of editor view item
+ QString getContactEditorLocString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mContactEditorLocList );
+ }
+
+ //get add string of contect editor
+ QString getContactEditorAddLocString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mContactEditorAddLocList );
+ }
+
+ //get edit string of contect editor
+ QString getContactEditorEditLocString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mContactEditorEditLocList );
+ }
+
+
+ //get delete string of contect editor
+ QString getContactEditorDelLocString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mContactEditorDelLocList );
+ }
+
+ //get string of item specific menu of contact card and editor view
+ QString getItemSpecificMenuLocString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mItemSpecificMenuLocList );
+ }
+
+ //get string of contact card list item
QString getContactCardListLocString( QString aDefId, QString aContext )
{
- QString str;
- foreach ( Loc loc, mContactCardLocList )
- {
- if ( loc.mId == aDefId && loc.mContext == aContext )
- {
- str = loc.mLoc;
- break;
- }
- }
- return str;
+ return getLocString( aDefId, aContext, mContactCardLocList );
}
+
+ //get string of editor view icon
+ QString getContactEditorIconString( QString aDefId, QString aContext )
+ {
+ return getLocString( aDefId, aContext, mContactEditorIconList );
+ }
+
+ //get string of contact card icon
QString getContactCardIconString( QString aDefId, QString aContext )
{
- QString str;
- foreach ( Loc loc, mContactCardIconList )
- {
- if ( loc.mId == aDefId && loc.mContext == aContext )
- {
- str = loc.mLoc;
- break;
- }
- }
- return str;
+ return getLocString( aDefId, aContext, mContactCardIconList );
}
-
+
private:
- QMap<QString, QString> mStringMap;
- QMap<QString, QString> mEditorIconMap;
- QMap<QString, QString> mLauncherIconMap;
-
- QList<Loc> mLocList;
- QList<Loc> mContactCardMenuLocList;
+ QList<Loc> mContactEditorIconList;
+ QList<Loc> mContactEditorLocList;
+ QList<Loc> mContactEditorAddLocList;
+ QList<Loc> mContactEditorEditLocList;
+ QList<Loc> mContactEditorDelLocList;
+ QList<Loc> mItemSpecificMenuLocList;
QList<Loc> mContactCardLocList;
QList<Loc> mContactCardIconList;
};
--- a/phonebookui/pbkcommonui/pbkcommonui.pro Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/pbkcommonui.pro Fri May 14 15:42:23 2010 +0300
@@ -77,6 +77,7 @@
inc/cntcontactcardheadingitem.h \
inc/cntcontactcarddatacontainer.h \
inc/cntcontactcarddataitem.h \
+ inc/cntcontactcardcontextmenu.h \
inc/cntcontactcardview.h \
inc/cntcontactcardview_p.h \
inc/cntcontactcarddetailitem.h \
@@ -94,7 +95,6 @@
inc/cntgroupeditormodel.h \
inc/cnthistoryview.h \
inc/cnthistoryviewitem.h \
- inc/cnthistoryviewitemwidget.h \
inc/cntgroupselectionpopup.h \
inc/cntgroupdeletepopupmodel.h \
inc/cntdetailconst.h \
@@ -120,7 +120,9 @@
inc/cntdetailviewitem.h \
inc/cntgroupdeletepopup.h \
inc/cntextensionmanager.h \
- inc/cntimagelabel.h
+ inc/cntimagelabel.h \
+ inc/cntfetchcontactsview.h \
+ inc/cntimportsview.h
SOURCES += \
src/cntviewnavigator.cpp \
@@ -144,6 +146,7 @@
src/cntcontactcardview.cpp \
src/cntcontactcardview_p.cpp \
src/cntcontactcardheadingitem.cpp \
+ src/cntcontactcardcontextmenu.cpp \
src/cntdocumentloader.cpp \
src/cnteditview.cpp \
src/cnteditview_p.cpp \
@@ -159,7 +162,6 @@
src/cntgroupeditormodel.cpp \
src/cnthistoryview.cpp \
src/cnthistoryviewitem.cpp \
- src/cnthistoryviewitemwidget.cpp \
src/cntgroupselectionpopup.cpp \
src/cntgroupdeletepopupmodel.cpp \
src/cntaddressmodel.cpp \
@@ -182,7 +184,9 @@
src/cnturleditorviewitem.cpp \
src/cntgroupdeletepopup.cpp \
src/cntextensionmanager.cpp \
- src/cntimagelabel.cpp
+ src/cntimagelabel.cpp \
+ src/cntimportsview.cpp \
+ src/cntfetchcontactsview.cpp
RESOURCES += resources\pbkcommonui.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_actions.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,180 @@
+<?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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_collections.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:names" type="HbAction">
+ <icon iconName="qtg_mono_contact_all" name="icon"/>
+ </object>
+ <object name="cnt:groups" type="HbAction">
+ <icon iconName="qtg_mono_group" name="icon"/>
+ <bool name="enabled" value="FALSE"/>
+ </object>
+ <object name="cnt:find" type="HbAction">
+ <icon iconName="qtg_mono_search" name="icon"/>
+ </object>
+ <object name="cnt:activity" type="HbAction">
+ <icon iconName="qtg_mono_activitystream" name="icon"/>
+ </object>
+ <object name="cnt:newgroup" type="HbAction">
+ <string locid="txt_phob_opt_new_group" name="text"/>
+ </object>
+ <object name="cnt:deletegroups" type="HbAction">
+ <string locid="txt_phob_opt_delete_groups" name="text"/>
+ </object>
+
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <string locid="txt_phob_subtitle_groups" name="heading"/>
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <string name="scrollingStyle" value="PanOrFlick"/>
+ <string name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0.0un" type="linear">
+ <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+ <enums name="orientation" value="Horizontal"/>
+ <contentsmargins bottom="0" left="0" right="0" top="0"/>
+ <ref object="cnt:names" role="HbToolBar:addAction"/>
+ <ref object="cnt:groups" role="HbToolBar:addAction"/>
+ <ref object="cnt:find" role="HbToolBar:addAction"/>
+ <ref object="cnt:activity" role="HbToolBar:addAction"/>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:newgroup" role="HbMenu:addAction"/>
+ <ref object="cnt:deletegroups" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_contactcard.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <object name="cnt:edit" type="HbAction">
+ <icon iconName="qtg_mono_add_field" name="icon"/>
+ </object>
+ <object name="cnt:history" type="HbAction">
+ <icon iconName="qtg_mono_person_history" name="icon"/>
+ </object>
+ <object name="cnt:sendMyCard" type="HbAction">
+ <icon iconName="qtg_mono_send" name="icon"/>
+ </object>
+ <object name="cnt:activityStream" type="HbAction">
+ <icon iconName="qtg_mono_person_activitystream" name="icon"/>
+ </object>
+ <object name="cnt:sendbusinesscard" type="HbAction">
+ <string locid="txt_phob_opt_send_as_a_business_card" name="text"/>
+ </object>
+ <object name="cnt:deletecontact" type="HbAction">
+ <string locid="txt_phob_opt_delete_contact" name="text"/>
+ </object>
+ <object name="cnt:setasfavorite" type="HbAction">
+ <string locid="txt_phob_opt_set_as_favorite" name="text"/>
+ </object>
+ <object name="cnt:removefromfavorite" type="HbAction">
+ <string locid="txt_phob_opt_remove_from_favorites" name="text"/>
+ </object>
+ <object name="cnt:placecontacttohs" type="HbAction">
+ <string locid="txt_phob_opt_send_to_homescreen_as_widget" name="text"/>
+ </object>
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="cnt_contactcard_heading" type="CntContactCardHeadingItem"/>
+ <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">
+ <enums name="scrollingStyle" value="PanWithFollowOn"/>
+ <enums name="verticalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+ <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <enums name="focusPolicy" value="ClickFocus"/>
+ <enums name="clampingStyle" value="BounceBackClamping"/>
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="separator" type="HbLabel">
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+ <sizehint height="expr(var(hb-param-margin-gene-middle-vertical) +var(hb-param-text-height-secondary) +var(hb-param-margin-gene-middle-vertical) )" type="PREFERRED"/>
+ <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="var(hb-param-margin-gene-middle-vertical)"/>
+ <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+ </widget>
+ </widget>
+ <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+ <ref object="cnt:edit" role="HbToolBar:addAction"/>
+ <ref object="cnt:history" role="HbToolBar:addAction"/>
+ <ref object="cnt:sendMyCard" role="HbToolBar:addAction"/>
+ <ref object="cnt:activityStream" role="HbToolBar:addAction"/>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:sendbusinesscard" role="HbMenu:addAction"/>
+ <ref object="cnt:deletecontact" role="HbMenu:addAction"/>
+ <ref object="cnt:setasfavorite" role="HbMenu:addAction"/>
+ <ref object="cnt:removefromfavorite" role="HbMenu:addAction"/>
+ <ref object="cnt:placecontacttohs" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <section name="portrait">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="cnt_contactcard_image" type="CntImageLabel">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="cnt_contactcard_heading"/>
+ <linearitem itemname="scrollArea"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="cnt_contactcard_image" type="CntImageLabel">
+ <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="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"/>
+ <anchoritem dst="cnt_contactcard_heading" dstEdge="LEFT" spacing="0un" src="scrollArea" srcEdge="LEFT"/>
+ <anchoritem dst="cnt_contactcard_heading" dstEdge="RIGHT" spacing="0un" src="scrollArea" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="BOTTOM" spacing="0un" src="scrollArea" srcEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_detail_editor.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <object name="cnt:Insert" type="HbAction">
+ <string name="text" value="Insert"/>
+ </object>
+ <object name="cnt:discardchanges" type="HbAction">
+ <string locid="txt_phob_opt_discard_changes" name="text" value="Discard Changes"/>
+ </object>
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="headerBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ <string locid="txt_phob_subtitle_groups" name="heading"/>
+ </widget>
+ <widget name="dataForm" type="HbDataForm">
+ <real name="z" value="1"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="headerBox"/>
+ <linearitem itemname="dataForm"/>
+ </layout>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="landscape" sections="#common"/>
+ <uistate name="portrait" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_editor.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.8">
+ <object name="cnt:discardchanges" type="HbAction">
+ <string name="text" locid="txt_phob_opt_discard_changes"/>
+ </object>
+
+ <widget name="content" type="HbWidget">
+ <widget name="dataForm" type="HbDataForm">
+ <enums name="scrollingStyle" value="PanWithFollowOn"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <sizehint height="1un" type="PREFERRED" width="1un"/>
+ <enums name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ <widget name="headerBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="headerBox"/>
+ <linearitem itemname="dataForm"/>
+ </layout>
+ </widget>
+ <metadata display="QHD portrait" unit="un"/>
+</hbdocument>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_ev.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:adddetail_options" type="HbAction">
+ <string locid="txt_phob_opt_add_detail" name="text" value="Add detail"/>
+ </object>
+
+ <object name="cnt:discard" type="HbAction">
+ <string locid="txt_phob_opt_discard_changes" name="text" value="Discard changes"/>
+ </object>
+
+ <object name="cnt:savecontact" type="HbAction">
+ <string locid="txt_phob_opt_save_contact" name="text" value="Save contact"/>
+ </object>
+
+ <object name="cnt:deletecontact" type="HbAction">
+ <string locid="txt_common_menu_delete_contact" name="text" value="Delete contact"/>
+ </object>
+
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <string locid="txt_phob_subtitle_edit_contact_details" name="heading" value="Edit details"/>
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+
+ <widget name="editViewHeading" type="CntEditViewHeadingItem"/>
+
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <string name="scrollingStyle" value="PanOrFlick"/>
+ <string name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+
+ <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"/>
+ </widget>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:adddetail_options" role="HbMenu:addAction"/>
+ <ref object="cnt:discard" role="HbMenu:addAction"/>
+ <ref object="cnt:savecontact" role="HbMenu:addAction"/>
+ <ref object="cnt:deletecontact" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <section name="portrait">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="editViewImage" type="CntImageLabel">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="editViewHeading"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="editViewImage" type="CntImageLabel">
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <layout type="anchor">
+ <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="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"/>
+ <anchoritem src="listView" srcEdge="LEFT" dst="editViewHeading" dstEdge="LEFT"/>
+ <anchoritem src="listView" srcEdge="RIGHT" dst="editViewHeading" dstEdge="RIGHT"/>
+ <anchoritem src="listView" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="portrait" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_favmember.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:manageFavorite" type="HbAction">
+ <string name="text" locid="txt_phob_opt_manage_favorites" value="Manage favorites"/>
+ </object>
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <string locid="txt_phob_subtitle_favorites" name="heading" value="Favorites"/>
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <string name="scrollingStyle" value="PanOrFlick"/>
+ <string name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0.0un" type="linear">
+ <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:manageFavorite" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_favorite.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <widget name="favoritesView" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <string locid="txt_phob_subtitle_favorites" name="heading"/>
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="cnt_label_text" type="HbLabel">
+ <enums name="textWrapping" value="TextWordWrap"/>
+ <enums name="elideMode" value="ElideNone"/>
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <string name="plainText" locid="txt_phob_info_no_favorites_selected_select_your_p"/>
+ <contentsmargins bottom="var(hb-param-margin-gene-bottom)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0.0un"/>
+ <fontspec name="fontSpec" role="Primary"/>
+ </widget>
+ <widget name="cnt_button_add" type="HbPushButton">
+ <string name="text" locid="txt_phob_button_add_favorites"/>
+ <sizehint type="FIXED" width="expr(var(hb-param-screen-width)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right))"/>
+ </widget>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <section name="portrait">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem src="groupBox" srcEdge="LEFT" spacing="0un" dst="" dstEdge="LEFT"/>
+ <anchoritem src="groupBox" srcEdge="TOP" spacing="0un" dst="" dstEdge="TOP"/>
+ <anchoritem src="groupBox" srcEdge="RIGHT" spacing="0un" dst="" dstEdge="RIGHT"/>
+ <anchoritem src="cnt_label_text" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
+ <anchoritem src="cnt_label_text" srcEdge="TOP" spacing="-6.0un" dst="groupBox" dstEdge="BOTTOM"/>
+ <anchoritem src="cnt_label_text" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
+ <anchoritem src="cnt_button_add" srcEdge="TOP" spacing="-var(hb-param-margin-gene-bottom)" dst="cnt_label_text" dstEdge="BOTTOM"/>
+ <anchoritem src="cnt_button_add" srcEdge="CENTERH" spacing="0.0un" dst="" dstEdge="CENTERH"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem src="groupBox" srcEdge="LEFT" spacing="0un" dst="" dstEdge="LEFT"/>
+ <anchoritem src="groupBox" srcEdge="TOP" spacing="0un" dst="" dstEdge="TOP"/>
+ <anchoritem src="groupBox" srcEdge="RIGHT" spacing="0un" dst="" dstEdge="RIGHT"/>
+ <anchoritem src="cnt_label_text" srcEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" dst="" dstEdge="LEFT"/>
+ <anchoritem src="cnt_label_text" srcEdge="TOP" spacing="-4.0un" dst="groupBox" dstEdge="BOTTOM"/>
+ <anchoritem src="cnt_label_text" srcEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" dst="" dstEdge="RIGHT"/>
+ <anchoritem src="cnt_button_add" srcEdge="TOP" spacing="-var(hb-param-margin-gene-bottom)" dst="cnt_label_text" dstEdge="BOTTOM"/>
+ <anchoritem src="cnt_button_add" srcEdge="CENTERH" spacing="0.0un" dst="" dstEdge="CENTERH"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="portrait" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_groupactions.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:editgroupdetail" type="HbAction">
+ <string name="text" locid="txt_phob_opt_edit_group_details" value="Edit group details"/>
+ </object>
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <string name="scrollingStyle" value="PanOrFlick"/>
+ <string name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0.0un" type="linear">
+ <contentsmargins bottom="0.0un" left="0.0un" right="0.0un" top="0.0un"/>
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:editgroupdetail" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_groupmembers.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:managemembers" type="HbAction">
+ <icon iconName="qtg_mono_edit" name="icon"/>
+ </object>
+ <object name="cnt:deletegroup" type="HbAction">
+ <icon iconName="qtg_mono_delete" name="icon"/>
+ </object>
+ <object name="cnt:groupactions" type="HbAction">
+ <icon iconName="qtg_mono_communication" name="icon"/>
+ </object>
+ <object name="cnt:editgroupdetails" type="HbAction">
+ <string name="text" locid="txt_phob_opt_edit_group_details"/>
+ </object>
+
+
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="listView" type="HbListView">
+ <widget name="listItemPrototype" role="HbListView:prototype" type="HbListViewItem">
+ <enums name="graphicsSize" value="Image"/>
+ <string name="state" value="normal"/>
+ </widget>
+ <sizehint height="47.7612un" type="PREFERRED" width="35.8209un"/>
+ </widget>
+ <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"/>
+ </widget>
+
+ <widget name="editViewHeading" type="CntContactCardHeadingItem"/>
+
+ </widget>
+
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:editgroupdetails" role="HbMenu:addAction"/>
+ </widget>
+ <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+ <enums name="orientation" value="Horizontal"/>
+ <contentsmargins bottom="0" left="0" right="0" top="0"/>
+ <ref object="cnt:managemembers" role="HbToolBar:addAction"/>
+ <ref object="cnt:deletegroup" role="HbToolBar:addAction"/>
+ <ref object="cnt:groupactions" role="HbToolBar:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <section name="portrait">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="editViewImage" type="CntImageLabel">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="editViewHeading"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="editViewImage" type="CntImageLabel">
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <layout type="anchor">
+ <anchoritem src="editViewImage" srcEdge="LEFT" spacing="0.0un" dst="" dstEdge="LEFT"/>
+ <anchoritem src="editViewImage" srcEdge="TOP" spacing="0.0un" dst="" dstEdge="TOP"/>
+ <anchoritem src="editViewImage" srcEdge="RIGHT" spacing="0.0un" dst="editViewHeading" dstEdge="LEFT"/>
+ <anchoritem src="editViewHeading" srcEdge="TOP" spacing="0.0un" dst="" dstEdge="TOP"/>
+ <anchoritem src="editViewHeading" srcEdge="BOTTOM" spacing="0.0un" dst="listView" dstEdge="TOP"/>
+ <anchoritem src="editViewHeading" srcEdge="RIGHT" spacing="0.0un" dst="" dstEdge="RIGHT"/>
+ <anchoritem src="listView" srcEdge="LEFT" dst="editViewHeading" dstEdge="LEFT"/>
+ <anchoritem src="listView" srcEdge="RIGHT" dst="editViewHeading" dstEdge="RIGHT"/>
+ <anchoritem src="listView" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="portrait" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_history.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <object name="cnt:clearhistory" type="HbAction">
+ <string locid="txt_phob_opt_clear_history" name="text" value="Delete history"/>
+ </object>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:clearhistory" role="HbMenu:addAction"/>
+ </widget>
+ <widget name="view" type="HbView">
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:clearhistory" role="HbMenu:addAction"/>
+ </widget>
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="listView" type="HbListView">
+ <enums name="scrollingStyle" value="PanWithFollowOn"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <sizehint height="1un" type="PREFERRED" width="1un"/>
+ <enums name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_if.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <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"/>
+ </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"/>
+ <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"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ <string name="scrollingStyle" value="PanOrFlick"/>
+ <string name="clampingStyle" value="BounceBackClamping"/>
+ </widget>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:removeimage" role="HbMenu: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>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <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_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"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="portrait" display="QHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_list.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.8">
+ <object name="cnt:cancel" type="HbAction">
+ <string name="text" locid="txt_common_button_cancel"/>
+ </object>
+
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <resource location="pbkcommonui.qrc"/>
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_mc.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ <string locid="txt_phob_subtitle_my_card" name="heading"/>
+ </widget>
+ <widget name="cnt_label_text" type="HbLabel">
+ <enums name="textWrapping" value="TextWordWrap"/>
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <contentsmargins bottom="var(hb-param-margin-gene-bottom)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+ <enums name="elideMode" value="ElideNone"/>
+ <string locid="txt_phob_info_create_own_card_to_share_it_with_fri" name="plainText"/>
+ <fontspec name="fontSpec" role="Primary" textheight="0"/>
+ </widget>
+ <widget name="cnt_button_new" type="HbPushButton">
+ <string locid="txt_phob_button_create_new" name="text"/>
+ </widget>
+ <widget name="cnt_button_choose" type="HbPushButton">
+ <string locid="txt_phob_button_choose_from_my_contacts" name="text"/>
+ </widget>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <section name="portrait">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem dst="" dstEdge="LEFT" spacing="0un" src="groupBox" srcEdge="LEFT"/>
+ <anchoritem dst="" dstEdge="TOP" spacing="0un" src="groupBox" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="0un" src="groupBox" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="LEFT" spacing="0un" src="cnt_label_text" srcEdge="LEFT"/>
+ <anchoritem dst="groupBox" dstEdge="BOTTOM" spacing="-6un" src="cnt_label_text" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="0un" src="cnt_label_text" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" src="cnt_button_choose" srcEdge="LEFT"/>
+ <anchoritem dst="cnt_label_text" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-top)" src="cnt_button_choose" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" src="cnt_button_choose" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" src="cnt_button_new" srcEdge="LEFT"/>
+ <anchoritem dst="cnt_button_choose" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-bottom)" src="cnt_button_new" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" src="cnt_button_new" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem dst="" dstEdge="LEFT" spacing="0un" src="groupBox" srcEdge="LEFT"/>
+ <anchoritem dst="" dstEdge="TOP" spacing="0un" src="groupBox" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="0un" src="groupBox" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="LEFT" spacing="0un" src="cnt_label_text" srcEdge="LEFT"/>
+ <anchoritem dst="groupBox" dstEdge="BOTTOM" spacing="-4un" src="cnt_label_text" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="CENTERH" spacing="0un" src="cnt_label_text" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="CENTERH" spacing="-var(hb-param-margin-gene-left)" src="cnt_button_choose" srcEdge="LEFT"/>
+ <anchoritem dst="groupBox" dstEdge="BOTTOM" spacing="-4un" src="cnt_button_choose" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" src="cnt_button_choose" srcEdge="RIGHT"/>
+ <anchoritem dst="" dstEdge="CENTERH" spacing="-var(hb-param-margin-gene-left)" src="cnt_button_new" srcEdge="LEFT"/>
+ <anchoritem dst="cnt_button_choose" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-top)" src="cnt_button_new" srcEdge="TOP"/>
+ <anchoritem dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" src="cnt_button_new" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="portrait" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_namelist.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+ <object name="cnt:names" type="HbAction">
+ <icon iconName="qtg_mono_contact_all" name="icon"/>
+ </object>
+ <object name="cnt:groups" type="HbAction">
+ <icon iconName="qtg_mono_group" name="icon"/>
+ </object>
+ <object name="cnt:find" type="HbAction">
+ <icon iconName="qtg_mono_search" name="icon"/>
+ </object>
+ <object name="cnt:activity" type="HbAction">
+ <icon iconName="qtg_mono_activitystream" name="icon"/>
+ </object>
+ <object name="cnt:newcontact" type="HbAction">
+ <string name="iconText" value="New contact"/>
+ <string locid="txt_phob_opt_new_contact" name="text" value="New contact"/>
+ </object>
+ <object name="cnt:delete" type="HbAction">
+ <string name="text" value="Delete"/>
+ </object>
+ <object name="cnt:refresh" type="HbAction">
+ <string locid="txt_phob_opt_refresh" name="text" value="Refresh"/>
+ </object>
+ <object name="cnt:filter" type="HbAction">
+ <string locid="txt_phob_opt_filter" name="text" value="Filter"/>
+ </object>
+
+ <object name="cnt:importsim" type="HbAction">
+ <string locid="txt_phob_opt_import_contacts" name="text" value="Import contacts"/>
+ </object>
+
+ <object name="cnt:manage" type="HbAction">
+ <string name="text" value="Manage"/>
+ </object>
+ <object name="cnt:settings" type="HbAction">
+ <string name="text" value="Settings"/>
+ </object>
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="listView" type="HbListView">
+ <sizehint height="1.0un" type="PREFERRED" width="1.0un"/>
+ <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+ </widget>
+ <layout orientation="Vertical" spacing="0un" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+ <enums name="orientation" value="Horizontal"/>
+ <contentsmargins bottom="0" left="0" right="0" top="0"/>
+ <ref object="cnt:names" role="HbToolBar:addAction"/>
+ <ref object="cnt:groups" role="HbToolBar:addAction"/>
+ <ref object="cnt:find" role="HbToolBar:addAction"/>
+ <ref object="cnt:activity" role="HbToolBar:addAction"/>
+ </widget>
+ <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+ <ref object="cnt:newcontact" role="HbMenu:addAction"/>
+ <ref object="cnt:delete" role="HbMenu:addAction"/>
+ <ref object="cnt:importsim" role="HbMenu:addAction"/>
+ </widget>
+ <string locid="txt_phob_title_contacts" name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <resource location="pbkcommonui.qrc"/>
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/contacts_sim.docml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <widget name="view" type="HbView">
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <widget name="groupBox" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ <string locid="txt_phob_subtitle_import_contacts" name="heading" value="Group Box"/>
+ </widget>
+ <widget name="listView" type="HbListView">
+ <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/>
+ </widget>
+ <real name="z" value="0"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="groupBox"/>
+ <linearitem itemname="listView"/>
+ </layout>
+ </widget>
+ <string name="title" value="Contacts"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <dummydata objectName="listView" section="#common" value="app_list_template5"/>
+ </metadata>
+</hbdocument>
--- a/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/pbkcommonui.qrc Fri May 14 15:42:23 2010 +0300
@@ -13,6 +13,7 @@
<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>
@@ -33,8 +34,8 @@
<file alias="cntcontactcarddetailitem.css">style/cntcontactcarddetailitem.css</file>
<file alias="cntcontactcardheadingitem.widgetml">style/cntcontactcardheadingitem.widgetml</file>
<file alias="cntcontactcardheadingitem.css">style/cntcontactcardheadingitem.css</file>
- <file alias="cnthistoryviewitemwidget.widgetml">style/cnthistoryviewitemwidget.widgetml</file>
- <file alias="cnthistoryviewitemwidget.css">style/cnthistoryviewitemwidget.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>
</qresource>
--- a/phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem.css Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem.css Fri May 14 15:42:23 2010 +0300
@@ -7,6 +7,12 @@
fixed-height:var(hb-param-graphic-size-primary-large);
}
+CntContactCardDetailItem::secondaryIcon{
+ fixed-width:var(hb-param-graphic-size-secondary);
+ fixed-height:var(hb-param-graphic-size-secondary);
+}
+
+
CntContactCardDetailItem::text{
text-height:var(hb-param-text-height-primary);
font-variant:primary;
--- a/phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem.widgetml Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/resources/style/cntcontactcarddetailitem.widgetml Fri May 14 15:42:23 2010 +0300
@@ -3,9 +3,12 @@
<meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
<meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)" />
+ <meshitem src="secondaryIcon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+ <meshitem src="secondaryIcon" srcEdge="CENTERV" dst="text" dstEdge="CENTERV" />
+
<meshitem src="text" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" />
<meshitem src="text" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)" />
- <meshitem src="text" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+ <meshitem src="text" srcEdge="RIGHT" dst="secondaryIcon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
<meshitem src="valueText" srcEdge="TOP" dst="text" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)" />
<meshitem src="valueText" srcEdge="LEFT" dst="text" dstEdge="LEFT" />
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.css Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,22 @@
+CntHistoryViewItem[layoutName="history"][modelItemType="StandardItem"][incoming]{
+ layout:custom-history-incoming;
+}
+
+CntHistoryViewItem[layoutName="history"][modelItemType="StandardItem"][!incoming]{
+ layout:custom-history-outgoing;
+}
+
+CntHistoryViewItem::text-3[layoutName="history"]{
+ text-height:var(hb-param-text-height-tiny);
+ font-variant:secondary;
+ text-align: left;
+}
+
+CntHistoryViewItem::frame[layoutName="history"]{
+ border-width: 0.0un;
+}
+
+CntHistoryViewItem::newitem[layoutName="history"]{
+ top:-1.0un;
+ bottom:1.0un;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/resources/style/cnthistoryviewitem.widgetml Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,50 @@
+<hbwidget version="0.1" type="CntHistoryViewItem">
+ <layout name="custom-history-incoming" type="mesh">
+ <meshitem src="text-2" srcEdge="TOP" dst="text-1" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)" />
+ <meshitem src="text-2" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="expr(-2*var(hb-param-margin-gene-left))" />
+ <meshitem src="text-2" srcEdge="RIGHT" dst="icon-1" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal)+1.0un)" />
+ <meshitem src="text-2" srcEdge="BOTTOM" dst="text-3" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" />
+
+ <meshitem src="text-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+ <meshitem src="text-1" srcEdge="LEFT" dst="text-2" dstEdge="LEFT" />
+ <meshitem src="text-1" srcEdge="RIGHT" dst="text-2" dstEdge="RIGHT" />
+
+ <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="icon-1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+ <meshitem src="icon-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
+
+ <meshitem src="newitem" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
+ <meshitem src="newitem" srcEdge="RIGHT" dst="text-2" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
+ <meshitem src="newitem" srcEdge="TOP" dst="" dstEdge="TOP"/>
+ <meshitem src="newitem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+
+ <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
+ <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
+ <meshitem src="frame" srcEdge="RIGHT" dst="icon-1" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
+ <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+ </layout>
+
+ <layout name="custom-history-outgoing" type="mesh">
+ <meshitem src="text-2" srcEdge="TOP" dst="text-1" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)" />
+ <meshitem src="text-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="expr(2*var(hb-param-margin-gene-left))" />
+ <meshitem src="text-2" srcEdge="LEFT" dst="icon-1" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-middle-horizontal)-1.0un)" />
+ <meshitem src="text-2" srcEdge="BOTTOM" dst="text-3" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" />
+
+ <meshitem src="text-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+ <meshitem src="text-1" srcEdge="LEFT" dst="text-2" dstEdge="LEFT" />
+ <meshitem src="text-1" srcEdge="RIGHT" dst="text-2" dstEdge="RIGHT" />
+
+ <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="icon-1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+ <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-right)"/>
+
+ <meshitem src="frame" srcEdge="LEFT" dst="icon-1" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" />
+ <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
+ <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-left)" />
+ <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+ </layout>
+</hbwidget>
--- a/phonebookui/pbkcommonui/resources/style/cnthistoryviewitemwidget.css Mon May 03 12:24:20 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-CntHistoryViewItemWidget[incoming][titleExist][bodyTextExist]{
- layout:layout_incoming_title_bodytext_timestamp;
-}
-
-CntHistoryViewItemWidget[!incoming][titleExist][bodyTextExist]{
- layout:layout_outgoing_title_bodytext_timestamp;
-}
-
-CntHistoryViewItemWidget[incoming][!titleExist][bodyTextExist]{
- layout:layout_incoming_bodytext_timestamp;
-}
-
-CntHistoryViewItemWidget[!incoming][!titleExist][bodyTextExist]{
- layout:layout_outgoing_bodytext_timestamp;
-}
-
-CntHistoryViewItemWidget[incoming][titleExist][!bodyTextExist]{
- layout:layout_incoming_title_timestamp;
-}
-
-CntHistoryViewItemWidget[!incoming][titleExist][!bodyTextExist]{
- layout:layout_outgoing_title_timestamp;
-}
-
-CntHistoryViewItemWidget::title{
- text-height:var(hb-param-text-height-primary);
- font-variant:primary;
-}
-
-CntHistoryViewItemWidget::bodyText{
- text-height:var(hb-param-text-height-secondary);
- text-line-count-max:3;
- font-variant:secondary;
-}
-
-CntHistoryViewItemWidget::timeStamp{
- text-height:var(hb-param-text-height-secondary);
- font-variant:secondary;
- text-height:var(hb-param-text-height-tiny);
-}
-
-CntHistoryViewItemWidget::icon{
- fixed-width:var(hb-param-graphic-size-primary-small);
- fixed-height:var(hb-param-graphic-size-primary-small);
-}
-
-CntHistoryViewItemWidget::frame{
- border-width: var(hb-param-background-list-main);
-}
-
-CntHistoryViewItemWidget::newItem{
- left:-0.25un;
- top:-1.0un;
- bottom:0.5un;
- size-policy:fixed preferred;
-}
--- a/phonebookui/pbkcommonui/resources/style/cnthistoryviewitemwidget.widgetml Mon May 03 12:24:20 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-<hbwidget version="0.1" type="cnthistoryviewitemwidget">
- <layout name="layout_incoming_title_bodytext_timestamp" type="mesh">
- <meshitem src="title" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="expr(-2*var(hb-param-margin-gene-left))"/>
- <meshitem src="title" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="title" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal)+1.0un)"/>
-
- <meshitem src="bodyText" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
- <meshitem src="bodyText" srcEdge="TOP" dst="title" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="bodyText" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
-
- <meshitem src="timeStamp" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="bodyText" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
-
- <meshitem src="newItem" srcEdge="LEFT" dst="frame" dstEdge="LEFT"/>
- <meshitem src="newItem" srcEdge="TOP" dst="frame" dstEdge="TOP"/>
- <meshitem src="newItem" srcEdge="BOTTOM" dst="frame" dstEdge="BOTTOM"/>
- </layout>
-
- <layout name="layout_outgoing_title_bodytext_timestamp" type="mesh">
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
-
- <meshitem src="title" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="expr(var(hb-param-margin-gene-right)+1.0un)"/>
- <meshitem src="title" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="title" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-middle-horizontal))"/>
-
- <meshitem src="bodyText" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
- <meshitem src="bodyText" srcEdge="TOP" dst="title" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="bodyText" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
-
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="bodyText" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
- </layout>
-
- <layout name="layout_incoming_bodytext_timestamp" type="mesh">
- <meshitem src="bodyText" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="expr(-2*var(hb-param-margin-gene-left))"/>
- <meshitem src="bodyText" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="bodyText" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal)+1.0un)"/>
-
- <meshitem src="timeStamp" srcEdge="LEFT" dst="bodyText" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="bodyText" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="bodyText" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
-
- <meshitem src="newItem" srcEdge="LEFT" dst="frame" dstEdge="LEFT"/>
- <meshitem src="newItem" srcEdge="TOP" dst="frame" dstEdge="TOP"/>
- <meshitem src="newItem" srcEdge="BOTTOM" dst="frame" dstEdge="BOTTOM"/>
- </layout>
-
- <layout name="layout_outgoing_bodytext_timestamp" type="mesh">
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
-
- <meshitem src="bodyText" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="expr(var(hb-param-margin-gene-right)+1.0un)"/>
- <meshitem src="bodyText" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="bodyText" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-middle-horizontal))"/>
-
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="bodyText" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="bodyText" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="LEFT" dst="bodyText" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
- </layout>
-
- <layout name="layout_incoming_title_timestamp" type="mesh">
- <meshitem src="title" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="expr(-2*var(hb-param-margin-gene-left))"/>
- <meshitem src="title" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="title" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal)+1.0un)"/>
-
- <meshitem src="timeStamp" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="title" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="icon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
- </layout>
-
- <layout name="layout_outgoing_title_timestamp" type="mesh">
- <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV" spacing="0.0un"/>
- <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
-
- <meshitem src="title" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="expr(var(hb-param-margin-gene-right)+1.0un)"/>
- <meshitem src="title" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
- <meshitem src="title" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-middle-horizontal))"/>
-
- <meshitem src="timeStamp" srcEdge="RIGHT" dst="title" dstEdge="RIGHT"/>
- <meshitem src="timeStamp" srcEdge="TOP" dst="title" dstEdge="BOTTOM" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
- <meshitem src="timeStamp" srcEdge="LEFT" dst="title" dstEdge="LEFT"/>
- <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
-
- <meshitem src="frame" srcEdge="LEFT" dst="icon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)"/>
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP"/>
- <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
- </layout>
-</hbwidget>
--- a/phonebookui/pbkcommonui/src/cntactionmenubuilder.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntactionmenubuilder.cpp Fri May 14 15:42:23 2010 +0300
@@ -58,7 +58,7 @@
if ( actions.contains("message", Qt::CaseInsensitive) )
{
- createSmsAction( *menu, aContact );
+ createMessageAction( *menu, aContact );
}
if ( actions.contains("email", Qt::CaseInsensitive) )
@@ -80,12 +80,10 @@
return menu;
}
-void CntActionMenuBuilder::execActionMenu( QContact& aContact, QPointF aPoint )
+HbMenu* CntActionMenuBuilder::actionMenu( QContact& aContact )
{
mContact = new QContact( aContact );
- HbMenu* menu = buildActionMenu( aContact );
- menu->exec( aPoint );
- delete menu;
+ return buildActionMenu( aContact );
}
void CntActionMenuBuilder::emitOpenContact()
@@ -123,31 +121,26 @@
// Create call action
QContactDetail detail = aContact.preferredDetail("call");
QContactPhoneNumber number = detail.isEmpty() ? aContact.detail<QContactPhoneNumber>() : detail;
-
- QString detailName = mMap->getMappedDetail( number.subTypes().first() );
- if (!number.contexts().isEmpty())
- {
- detailName += hbTrId(" %1").arg(mMap->getMappedDetail( number.contexts().first()) );
- }
- aMenu.addAction( hbTrId("Call %1").arg(detailName), this, SLOT(emitCallContact()) );
+ QString context = number.contexts().isEmpty() ? QString() : number.contexts().first();
+ QString subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first();
+
+ aMenu.addAction( mMap->getItemSpecificMenuLocString( subtype, context ), this, SLOT(emitCallContact()) );
}
void CntActionMenuBuilder::createEmailAction( HbMenu& aMenu, QContact& aContact )
{
+ // Create email action
QContactDetail detail = aContact.preferredDetail("email");
QContactEmailAddress email = detail.isEmpty() ? aContact.detail<QContactEmailAddress>() : detail;
-
- QString detailName = hbTrId("txt_phob_menu_email");
- if (!email.contexts().isEmpty())
- {
- detailName += hbTrId(" %1").arg(mMap->getMappedDetail(email.contexts().first()));
- }
- aMenu.addAction(hbTrId("Mail %1").arg(detailName), this, SLOT(emitMailContact()));
+ QString context = email.contexts().isEmpty() ? QString() : email.contexts().first();
+
+ aMenu.addAction( mMap->getItemSpecificMenuLocString( email.definitionName(), context), this, SLOT(emitMailContact()) );
}
-void CntActionMenuBuilder::createSmsAction( HbMenu& aMenu, QContact& aContact )
+void CntActionMenuBuilder::createMessageAction( HbMenu& aMenu, QContact& aContact )
{
- Q_UNUSED( aContact )
+ Q_UNUSED( aContact );
+
aMenu.addAction(hbTrId("txt_phob_menu_send_message"), this, SLOT(emitSmsContact()));
}
--- a/phonebookui/pbkcommonui/src/cntaddressmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntaddressmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -18,12 +18,14 @@
#include "cntaddressmodel.h"
#include "cntdetailmodelitem.h"
#include "cntdetailconst.h"
+#include <cntmaptileservice.h>
CntAddressModel::CntAddressModel( QContact* aContact ):
CntDetailEditorModel( aContact ),
mAddress(NULL),
mAddressHome(NULL),
-mAddressWork(NULL)
+mAddressWork(NULL),
+mIsLocationPickerEnabled( false )
{
HbDataFormModelItem* address = appendDataFormGroup(qtTrId("Address"), invisibleRootItem());
HbDataFormModelItem* addressHome = appendDataFormGroup(qtTrId("Address (home)"), invisibleRootItem());
@@ -86,8 +88,14 @@
void CntAddressModel::createAddressItems( HbDataFormModelItem* aGroup, QContactAddress* aAddress )
{
- // custom item for map button
- // HbDataFormModelItem* mapButton = new HbDataFormModelItem( HbDataFormModelItem::CustomItemBase );
+ //Show the location picker button only if location feature enabled
+ if( CntMapTileService::isLocationFeatureEnabled() )
+ {
+ // custom item for map button
+ HbDataFormModelItem* mapButton = new HbDataFormModelItem( HbDataFormModelItem::CustomItemBase );
+ appendDataFormItem( mapButton, aGroup );
+ mIsLocationPickerEnabled = true;
+ }
// default items for rest of fields
HbDataFormModelItem* street = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Street"));
@@ -110,7 +118,6 @@
country->setContentWidgetData( "text", aAddress->country() );
country->setContentWidgetData( "maxLength", CNT_COUNTRY_MAXLENGTH );
- //appendDataFormItem( mapButton, aGroup );
appendDataFormItem( street, aGroup );
appendDataFormItem( postal, aGroup );
appendDataFormItem( city, aGroup );
@@ -155,12 +162,18 @@
void CntAddressModel::saveAddressItems( HbDataFormModelItem* aGroup, QContactAddress* aAddress )
{
+ int offset = 0;
+ if( CntMapTileService::isLocationFeatureEnabled() )
+ {
+ offset = 1;
+ }
+
// first item (0) is the map button
- aAddress->setStreet( aGroup->childAt( 0 )->contentWidgetData("text").toString().trimmed() );
- aAddress->setPostcode( aGroup->childAt( 1 )->contentWidgetData("text").toString().trimmed() );
- aAddress->setLocality( aGroup->childAt( 2 )->contentWidgetData("text").toString().trimmed() );
- aAddress->setRegion( aGroup->childAt( 3 )->contentWidgetData("text").toString().trimmed() );
- aAddress->setCountry( aGroup->childAt( 4 )->contentWidgetData("text").toString().trimmed() );
+ aAddress->setStreet( aGroup->childAt( 0 + offset )->contentWidgetData("text").toString().trimmed() );
+ aAddress->setPostcode( aGroup->childAt( 1 + offset )->contentWidgetData("text").toString().trimmed() );
+ aAddress->setLocality( aGroup->childAt( 2 + offset )->contentWidgetData("text").toString().trimmed() );
+ aAddress->setRegion( aGroup->childAt( 3 + offset )->contentWidgetData("text").toString().trimmed() );
+ aAddress->setCountry( aGroup->childAt( 4 + offset )->contentWidgetData("text").toString().trimmed() );
}
bool CntAddressModel::isAddressEmpty( QContactAddress* aAddress )
--- a/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntaddressviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -29,23 +29,18 @@
#include <hbwidget.h>
#include <hbtextitem.h>
-//#include "qlocationpickeritem_temp.h"
+#include "qlocationpickeritem.h"
#include <xqaiwrequest.h>
#include <xqservicerequest.h>
#include <xqappmgr.h>
CntAddressViewItem::CntAddressViewItem(QGraphicsItem* aParent) :
/*CntDetailViewItem(aParent),*/
- HbDataFormViewItem(aParent),
- mRequest(NULL),
- mAppManager(NULL),
- mSenderButton(NULL)
+ HbDataFormViewItem(aParent)
{
}
CntAddressViewItem::~CntAddressViewItem()
{
- delete mRequest;
- delete mAppManager;
}
HbAbstractViewItem* CntAddressViewItem::createItem()
@@ -53,52 +48,109 @@
return new CntAddressViewItem(*this);
}
+bool CntAddressViewItem::canSetModelIndex( const QModelIndex &index ) const
+{
+ HbDataFormModelItem::DataItemType itemType =
+ static_cast<HbDataFormModelItem::DataItemType>(
+ index.data(HbDataFormModelItem::ItemTypeRole).toInt() );
+
+ if( itemType == HbDataFormModelItem::CustomItemBase )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+
+}
+
HbWidget* CntAddressViewItem::createCustomWidget()
{
- QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Horizontal);
-
+ HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>(
+ modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
+
HbWidget* widget = new HbWidget();
- 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* mLocationButton = new HbPushButton(this);
- mLocationButton->setObjectName("cntlocationbutton");
- mLocationButton->setIcon(HbIcon(":/icons/pickerIcon.jpg"));
- mLocationButton->setText(qtTrId("Select location from map"));
- mLocationButton->setOrientation(Qt::Horizontal);
-
- connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
-
- layout->addItem(mLocationButton);
+ 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* mLocationButton = new HbPushButton(this);
+ mLocationButton->setObjectName("cntlocationbutton");
+ mLocationButton->setIcon(HbIcon("qtg_mono_location"));
+ mLocationButton->setText( hbTrId("txt_phob_button_select_location") );
+
+ connect(mLocationButton, SIGNAL(clicked()), this, SLOT(launchLocationPicker()));
+
+ layout->addItem(mLocationButton);
+
+ }
return widget;
}
void CntAddressViewItem::launchLocationPicker()
{
- mAppManager = new XQApplicationManager();
- if (mRequest) {
- delete mRequest;
- mRequest = 0;
+ XQApplicationManager *appManager = new XQApplicationManager();
+ XQAiwRequest* request = appManager->create("com.nokia.symbian", "ILocationPick", "pick()", true);
+ if( request )
+ {
+ QVariant retValue;
+ if( request->send( retValue ) )
+ {
+ handleLocationChange( retValue );
+ }
+
+ delete request;
}
-
- mSenderButton = sender();
- mRequest = mAppManager->create("com.nokia.symbian", "ILocationPick", "pick()", false);
- if (mRequest) {
- connect(mRequest, SIGNAL(requestOk(const QVariant&)), this,
- SLOT(handleLocationChange(const QVariant&)));
- mRequest->send();
- }
+ delete appManager;
}
void CntAddressViewItem::handleLocationChange(const QVariant& aValue)
{
- Q_UNUSED( aValue );
+ QLocationPickerItem selectedLocation = aValue.value<QLocationPickerItem>();
+ if( selectedLocation.mIsValid )
+ {
+ HbDataForm* form = static_cast<HbDataForm*>(itemView());
+ HbDataFormModel* model = static_cast<HbDataFormModel*>(form->model());
+ HbDataFormModelItem* item = model->itemFromIndex( modelIndex() );
+
+ QModelIndex nextIndex = modelIndex().sibling( modelIndex().row() + 1 , modelIndex().column() );
+ HbDataFormModelItem* street = model->itemFromIndex( nextIndex );
+ street->setContentWidgetData( "text", selectedLocation.mStreet );
+ street->setContentWidgetData( "maxLength", CNT_STREET_MAXLENGTH );
+
+ nextIndex = modelIndex().sibling( modelIndex().row() + 2 , modelIndex().column() );
+
+ HbDataFormModelItem* postal = model->itemFromIndex( nextIndex );
+ postal->setContentWidgetData( "text", selectedLocation.mPostalCode );
+ postal->setContentWidgetData( "maxLength", CNT_POSTCODE_MAXLENGTH );
+
+ nextIndex = modelIndex().sibling( modelIndex().row() + 3 , modelIndex().column() );
+ HbDataFormModelItem* locality = model->itemFromIndex( nextIndex );
+ locality->setContentWidgetData( "text", selectedLocation.mCity );
+ locality->setContentWidgetData( "maxLength", CNT_LOCALITY_MAXLENGTH );
+
+ nextIndex = modelIndex().sibling( modelIndex().row() + 4 , modelIndex().column() );
+ HbDataFormModelItem* province = model->itemFromIndex( nextIndex );
+ province->setContentWidgetData( "text", selectedLocation.mState );
+ province->setContentWidgetData( "maxLength", CNT_REGION_MAXLENGTH );
+
+ nextIndex = modelIndex().sibling( modelIndex().row() + 5 , modelIndex().column() );
+ HbDataFormModelItem* country = model->itemFromIndex( nextIndex );
+ country->setContentWidgetData( "text", selectedLocation.mCountry );
+ country->setContentWidgetData( "maxLength", CNT_COUNTRY_MAXLENGTH );
+
+
+ }
+
}
-//Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
+ Q_IMPLEMENT_USER_METATYPE(QLocationPickerItem)
// End of File
--- a/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntbaseselectionview.cpp Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,8 @@
#include <hbview.h>
#include <hblistview.h>
+#include <hbindexfeedback.h>
+#include <hbscrollbar.h>
#include <hbdocumentloader.h>
#include <hbaction.h>
#include <mobcntmodel.h>
@@ -37,6 +39,15 @@
}
mView = static_cast<HbView*>( mDocument->findWidget("view") );
mListView = static_cast<HbListView*>( mDocument->findWidget("listView") );
+
+ mListView->setFrictionEnabled(true);
+ mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+ mListView->verticalScrollBar()->setInteractive(true);
+ mListView->setUniformItemSizes(true);
+
+ HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView);
+ indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+ indexFeedback->setItemView(mListView);
mSoftkey = new HbAction(Hb::BackNaviAction, mView);
connect( mSoftkey, SIGNAL(triggered()), this, SLOT(closeView()) );
--- a/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcollectionlistmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -109,22 +109,6 @@
beginRemoveRows(parent, row, row);
mDataPointer->mDataList.removeAt(row);
- if (mDataPointer->mExtensions.remove(row) > 0)
- {
- // if extension group was deleted, refresh the indices of extension group map
- QList<int> keyList = mDataPointer->mExtensions.keys();
- qSort(keyList);
-
- for (int i = 0;i < keyList.count();i++)
- {
- if (keyList.at(i) > row)
- {
- CntUiGroupSupplier* groupSupplier = mDataPointer->mExtensions.take(keyList.at(i));
- mDataPointer->mExtensions.insert(keyList.at(i) - 1, groupSupplier);
- }
- }
- }
-
endRemoveRows();
return true;
@@ -137,7 +121,8 @@
{
for (int i = 0;i < rowCount();i++)
{
- if (mDataPointer->mDataList.at(i)[2] == localId)
+ // extension items have 4 items in the list, we don't allow those to be deleted from here
+ if (mDataPointer->mDataList.at(i)[2] == localId && mDataPointer->mDataList.at(i).count() < 4)
{
removeRow(i);
break;
@@ -221,13 +206,13 @@
}
else
{
- displayList.append(hbTrId("txt_phob_dblist_favorites_val_no_favorites_selecte")); // as this isn't supported yet
+ displayList.append(hbTrId("txt_phob_dblist_favorites_val_no_favorites_selecte"));
}
}
dataList.append(displayList);
dataList.append(QStringList("qtg_large_favourites"));
- dataList.append(mFavoriteGroupId); // as favorites doesn't really have a contact Id, -1 is used
+ dataList.append(mFavoriteGroupId);
mDataPointer->mDataList.append(dataList);
}
@@ -358,9 +343,23 @@
}
dataList.append(displayList);
- // icon, default for now always
- dataList.append(QStringList("qtg_large_custom"));
-
+ // Default if no image for group
+ bool icon = false;
+ QList<QContactAvatar> details = contact.details<QContactAvatar>();
+ for (int i = 0;i < details.count();i++)
+ {
+ if (details.at(i).imageUrl().isValid())
+ {
+ dataList.append(QStringList(details.at(i).imageUrl().toString()));
+ icon = true;
+ break;
+ }
+ }
+ if(!icon)
+ {
+ dataList.append(QStringList("qtg_large_custom"));
+ }
+
// contact Id for identification
dataList.append(groupContactIds.at(i));
--- a/phonebookui/pbkcommonui/src/cntcollectionview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcollectionview.cpp Fri May 14 15:42:23 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "cntcollectionview.h"
+#include "cntfetchcontactsview.h"
#include "cntgroupselectionpopup.h"
#include "cntgroupdeletepopup.h"
#include "cntcollectionlistmodel.h"
@@ -36,6 +37,9 @@
#include <hbframebackground.h>
#include <hbgroupbox.h>
#include <hbmessagebox.h>
+#include <hbparameterlengthlimiter.h>
+
+#include <QList>
const char *CNT_COLLECTIONVIEW_XML = ":/xml/contacts_collections.docml";
@@ -53,7 +57,9 @@
mFindAction(NULL),
mExtensionAction(NULL),
mNewGroupAction(NULL),
- mDeleteGroupsAction(NULL)
+ mDeleteGroupsAction(NULL),
+ mHandledContact(NULL),
+ mFetchView(NULL)
{
bool ok = false;
mDocumentLoader.load(CNT_COLLECTIONVIEW_XML, &ok);
@@ -91,6 +97,12 @@
CntCollectionView::~CntCollectionView()
{
mView->deleteLater();
+
+ delete mHandledContact;
+ mHandledContact = NULL;
+
+ delete mFetchView;
+ mFetchView = NULL;
}
/*!
@@ -109,7 +121,7 @@
QContactDetailFilter groupFilter;
groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
- QList<QContactLocalId> groupContactIds = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(groupFilter);
+ QList<QContactLocalId> groupContactIds = getContactManager()->contactIds(groupFilter);
if (groupContactIds.count() < 2)
{
mDeleteGroupsAction->setEnabled(false);
@@ -131,8 +143,11 @@
mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon);
mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
- mModel = new CntCollectionListModel(mViewManager->contactManager(SYMBIAN_BACKEND), mExtensionManager, this);
+ mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this);
mListView->setModel(mModel);
+
+ mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND ));
+ connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleNewGroupMembers()));
}
void CntCollectionView::deactivate()
@@ -169,13 +184,13 @@
if (id == favoriteGrpId )
{
- QContact favoriteGroup = mViewManager->contactManager(SYMBIAN_BACKEND)->contact(favoriteGrpId);
+ QContact favoriteGroup = getContactManager()->contact(favoriteGrpId);
QContactRelationshipFilter rFilter;
rFilter.setRelationshipType(QContactRelationship::HasMember);
rFilter.setRelatedContactRole(QContactRelationship::First);
rFilter.setRelatedContactId(favoriteGroup.id());
// group members and their count
- QList<QContactLocalId> groupMemberIds = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(rFilter);
+ QList<QContactLocalId> groupMemberIds = getContactManager()->contactIds(rFilter);
if (groupMemberIds.isEmpty())
{
@@ -198,7 +213,7 @@
}
else
{
- QContact groupContact = mViewManager->contactManager(SYMBIAN_BACKEND)->contact(id);
+ QContact groupContact = getContactManager()->contact(id);
CntViewParameters viewParameters;
viewParameters.insert(EViewId, groupMemberView);
@@ -223,158 +238,217 @@
else
{
int id = item->modelIndex().data(Qt::UserRole).toInt();
+ QVariant data( item->modelIndex().row() );
+
int favoriteGrpId = mModel->favoriteGroupId();
-
+
HbMenu *menu = new HbMenu();
- HbAction *openAction = 0;
- HbAction *deleteAction = 0;
-
- openAction = menu->addAction(hbTrId("txt_common_menu_open"));
+ menu->setAttribute(Qt::WA_DeleteOnClose);
+ menu->setPreferredPos( coords );
+
+ HbAction* openAction = menu->addAction(hbTrId("txt_common_menu_open"));
+ openAction->setData( data );
if (id != favoriteGrpId)
{
- deleteAction = menu->addAction(hbTrId("txt_phob_menu_delete_group"));
+ HbAction* deleteAction = menu->addAction(hbTrId("txt_phob_menu_delete_group"));
+ deleteAction->setData( data );
}
-
- HbAction *selectedAction = menu->exec(coords);
+ menu->open(this, SLOT(handleMenu(HbAction*)));
- if (selectedAction)
- {
- if (selectedAction == openAction)
- {
- openGroup(item->modelIndex());
- }
- else if (selectedAction == deleteAction)
- {
- QContact groupContact = mViewManager->contactManager(SYMBIAN_BACKEND)->contact(id);
- deleteGroup(groupContact);
- }
- }
- menu->deleteLater();
}
}
+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() )
+ {
+ openGroup(index);
+ }
+ else if (action == menuItem->actions().at(1))
+ {
+
+ QContact groupContact = getContactManager()->contact(id);
+ deleteGroup(groupContact);
+ }
+}
+
+
+
void CntCollectionView::newGroup()
{
- QString mTextOfNewItem("");
-
- HbInputDialog popup;
+ HbInputDialog *popup = new HbInputDialog();
+ popup->setAttribute(Qt::WA_DeleteOnClose, true);
- HbGroupBox *headingLabel = new HbGroupBox(&popup);
- headingLabel->setHeading("txt_phob_title_new_group_name");
- popup.setHeadingWidget(headingLabel);
- popup.setPrimaryAction(new HbAction(hbTrId("txt_phob_button_create"),&popup));
- popup.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"),&popup));
- popup.setInputMode(HbInputDialog::TextInput);
- popup.setPromptText("");
- popup.setBackgroundFaded(true);
- HbAction* action = popup.exec();
- QString text = popup.value().toString();
+ popup->setPromptText(hbTrId("txt_phob_title_new_group_name"));
+ popup->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_create"), popup));
+ popup->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), popup));
+ popup->setInputMode(HbInputDialog::TextInput);
+
+ popup->open(this, SLOT(handleNewGroup(HbAction*)));
+}
+
+void CntCollectionView::handleNewGroup(HbAction* action)
+{
+ HbInputDialog *popup = static_cast<HbInputDialog*>(sender());
- if (action == popup.primaryAction())
+ if (popup && action == popup->actions().first())
{
- mTextOfNewItem = text;
+ QString text = popup->value().toString();
- QContact groupContact;
- groupContact.setType(QContactType::TypeGroup);
+ mHandledContact = new QContact();
+ mHandledContact->setType(QContactType::TypeGroup);
QContactName groupName;
- groupName.setCustomLabel(mTextOfNewItem);
+ groupName.setCustomLabel(text);
- groupContact.saveDetail(&groupName);
- mViewManager->contactManager(SYMBIAN_BACKEND)->saveContact(&groupContact);
-
- // call a dialog to display the contacts
+ mHandledContact->saveDetail(&groupName);
+ getContactManager()->saveContact(mHandledContact);
- CntGroupSelectionPopup *groupSelectionPopup =
- new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), &groupContact);
- groupSelectionPopup->populateListOfContact();
- HbAction* action = groupSelectionPopup->exec();
- if (action == groupSelectionPopup->primaryAction())
- {
- groupSelectionPopup->saveNewGroup();
-
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, groupMemberView);
- QVariant var;
- var.setValue(groupContact);
- viewParameters.insert(ESelectedContact, var);
- mViewManager->changeView(viewParameters);
-
- delete groupSelectionPopup;
- }
- else if (action == groupSelectionPopup->secondaryAction())
- {
- delete groupSelectionPopup;
- QString groupNameCreated(groupName.customLabel());
- HbNotificationDialog::launchDialog(hbTrId("txt_phob_dpophead_new_group_1_created").arg(groupNameCreated));
- //refresh the page
- refreshDataModel();
- mDeleteGroupsAction->setEnabled(true);
- }
-
+ QContactDetailFilter filter;
+ QList<QContactLocalId> contactsList = getContactManager()->contactIds(filter);
+ QSet<QContactLocalId> contactsSet = contactsList.toSet();
+
+ // Select some contact(s) to add to the group
+ QString groupNameCreated(mHandledContact->displayLabel());
+ mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_subtitle_1_group")).arg(groupNameCreated),
+ hbTrId("Save"));
+ mFetchView->displayContacts(CntFetchContacts::popup,
+ HbAbstractItemView::MultiSelection,
+ contactsSet);
}
}
+void CntCollectionView::handleNewGroupMembers()
+{
+ mSelectedContactsSet = mFetchView->getSelectedContacts();
+ if ( !mFetchView->wasCanceled() && mSelectedContactsSet.size() ) {
+ saveNewGroup(mHandledContact);
+
+ CntViewParameters viewParameters;
+ viewParameters.insert(EViewId, groupMemberView);
+ QVariant var;
+ var.setValue(*mHandledContact);
+ viewParameters.insert(ESelectedContact, var);
+ mViewManager->changeView(viewParameters);
+ }
+
+ QString groupNameCreated(mHandledContact->displayLabel());
+ HbNotificationDialog::launchDialog(HbParameterLengthLimiter(hbTrId("txt_phob_dpophead_new_group_1_created")).arg(groupNameCreated));
+
+ // Refresh the page
+ refreshDataModel();
+ mDeleteGroupsAction->setEnabled(true);
+
+ delete mHandledContact;
+ mHandledContact = NULL;
+}
+
void CntCollectionView::refreshDataModel()
{
mListView->setModel(0);
delete mModel;
mModel = 0;
- mModel = new CntCollectionListModel(mViewManager->contactManager(SYMBIAN_BACKEND), mExtensionManager, this);
+ mModel = new CntCollectionListModel(getContactManager(), mExtensionManager, this);
mListView->setModel(mModel);
}
void CntCollectionView::deleteGroup(QContact group)
{
- QString name = group.displayLabel();
+ mHandledContact = new QContact(group);
+ QString name = mHandledContact->displayLabel();
+
+ HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_dialog_delete_1_group")).arg(name), this, SLOT(handleDeleteGroup(HbAction*)),
+ hbTrId("txt_phob_button_delete"), hbTrId("txt_common_button_cancel"));
+}
- HbMessageBox *note = new HbMessageBox(hbTrId("txt_phob_info_delete_1").arg(name), HbMessageBox::MessageTypeQuestion);
- note->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
- HbAction *selected = note->exec();
- if (selected == note->primaryAction())
+void CntCollectionView::handleDeleteGroup(HbAction* action)
+{
+ HbMessageBox *note = static_cast<HbMessageBox*>(sender());
+
+ if (note && action == note->actions().first())
{
- mViewManager->contactManager(SYMBIAN_BACKEND)->removeContact(group.localId());
- mModel->removeGroup(group.localId());
+ getContactManager()->removeContact(mHandledContact->localId());
+ mModel->removeGroup(mHandledContact->localId());
// disable delete group(s) button if only favorites group is present
QContactDetailFilter groupFilter;
groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
- QList<QContactLocalId> groupContactIds = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(groupFilter);
+ QList<QContactLocalId> groupContactIds = getContactManager()->contactIds(groupFilter);
if (groupContactIds.count() < 2)
{
mDeleteGroupsAction->setEnabled(false);
}
}
- delete note;
+
+ delete mHandledContact;
+ mHandledContact = NULL;
}
void CntCollectionView::deleteGroups()
{
// save the group here
- CntGroupDeletePopup *groupDeletePopup = new CntGroupDeletePopup(mViewManager->contactManager(SYMBIAN_BACKEND));
+ CntGroupDeletePopup *groupDeletePopup = new CntGroupDeletePopup(getContactManager());
groupDeletePopup->populateListOfGroup();
- HbAction* action = groupDeletePopup->exec();
- if (action == groupDeletePopup->primaryAction())
- {
- groupDeletePopup->deleteGroup();
- }
+ groupDeletePopup->open(this, SLOT(handleDeleteGroups(HbAction*)));
+
+}
+
+void CntCollectionView::handleDeleteGroups(HbAction* action)
+{
+ CntGroupDeletePopup *groupDeletePopup = static_cast<CntGroupDeletePopup*>(sender());
- delete groupDeletePopup;
- //refresh the page
- refreshDataModel();
-
- // disable delete group(s) button if only favorites group is present
- QContactDetailFilter groupFilter;
- groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
- groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
- QList<QContactLocalId> groupContactIds = mViewManager->contactManager(SYMBIAN_BACKEND)->contactIds(groupFilter);
- if (groupContactIds.count() < 2)
+ if (groupDeletePopup && action == groupDeletePopup->actions().first())
{
- mDeleteGroupsAction->setEnabled(false);
+ QList<QContactLocalId> deletedList = groupDeletePopup->deleteGroup();
+ foreach (QContactLocalId id, deletedList)
+ {
+ mModel->removeGroup(id);
+ }
+
+ // disable delete group(s) button if only favorites group is present
+ QContactDetailFilter groupFilter;
+ groupFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
+ groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
+ QList<QContactLocalId> groupContactIds = getContactManager()->contactIds(groupFilter);
+ if (groupContactIds.count() < 2)
+ {
+ mDeleteGroupsAction->setEnabled(false);
+ }
}
}
+
+QContactManager* CntCollectionView::getContactManager()
+{
+ if (!mViewManager) return NULL;
+
+ return mViewManager->contactManager(SYMBIAN_BACKEND);
+}
+
+void CntCollectionView::saveNewGroup(QContact* aContact)
+{
+ if (!aContact) return;
+
+ // Save the relationship from the selection model of the member selection list
+ QList<QContactLocalId> selectedList = mSelectedContactsSet.toList();
+ for (int i = 0; i < selectedList.size(); i++ ) {
+ QContact contact = getContactManager()->contact(selectedList.at(i));
+ QContactRelationship relationship;
+ relationship.setRelationshipType(QContactRelationship::HasMember);
+ relationship.setFirst(aContact->id());
+ relationship.setSecond(contact.id());
+
+ // Save relationship
+ getContactManager()->saveRelationship(&relationship);
+ }
+}
+
// EOF
--- a/phonebookui/pbkcommonui/src/cntcompanyeditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcompanyeditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -80,8 +80,14 @@
else
mCompany.setAssistantName(QString());
- if ( !mCompany.isEmpty() ) {
- mContact->saveDetail( &mCompany );
+ mContact->saveDetail( &mCompany );
+
+ if ( mCompany.name().isEmpty() &&
+ mCompany.title().isEmpty() &&
+ mCompany.department().isEmpty() &&
+ mCompany.assistantName().isEmpty() )
+ {
+ mContact->removeDetail( &mCompany );
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntcontactcardcontextmenu.cpp Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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 "cntcontactcardcontextmenu.h"
+#include "cntcontactcarddetailitem.h"
+
+CntContactCardContextMenu::CntContactCardContextMenu( CntContactCardDetailItem* aItem ) :
+HbMenu(),
+mItem( aItem )
+{
+}
+
+CntContactCardContextMenu::~CntContactCardContextMenu()
+{
+}
+
+CntContactCardDetailItem* CntContactCardContextMenu::item()
+{
+ return mItem;
+}
--- a/phonebookui/pbkcommonui/src/cntcontactcarddatacontainer.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcarddatacontainer.cpp Fri May 14 15:42:23 2010 +0300
@@ -20,6 +20,7 @@
#include <cntmaptileservice.h> //For fetching maptile
#include <QPainter>
+#include <QList>
#include <qtcontacts.h>
#include <hbicon.h>
#include <cntviewparams.h>
@@ -27,6 +28,17 @@
#include "cntstringmapper.h"
/*!
+Compare function for CntContactCardDataItem
+*/
+namespace
+{
+ bool compareObjects(const CntContactCardDataItem *d1, const CntContactCardDataItem *d2)
+ {
+ return d1->mPosition < d2->mPosition;
+ }
+}
+
+/*!
Constructor
*/
CntContactCardDataContainer::CntContactCardDataContainer(QContact* contact, QObject *parent) : mContact(contact), mSeparatorIndex(-1)
@@ -72,31 +84,22 @@
if (availableActions.contains("call", Qt::CaseInsensitive) && supportsDetail("call", details[i]) && details[i].definitionName() == QContactPhoneNumber::DefinitionName)
{
QContactPhoneNumber number(details.at(i));
- QString title;
- QString icon;
- if (!number.contexts().isEmpty())
- {
- title = mStringMapper.getContactCardListLocString(number.subTypes().first(), number.contexts().first());
- icon = mStringMapper.getContactCardIconString(number.subTypes().first(), number.contexts().first());
- }
- else
- {
- title = mStringMapper.getContactCardListLocString(number.subTypes().first(), QString());
- icon = mStringMapper.getContactCardIconString(number.subTypes().first(), QString());
- }
+
+ QString context = number.contexts().isEmpty() ? QString() : number.contexts().first();
+ QString subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first();
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, true);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), itemCount(), true);
dataItem->setAction("call");
dataItem->setValueText(number.number());
- dataItem->setIcon(HbIcon(icon));
+ dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(subtype, context)));
dataItem->setContactDetail(number);
mDataItemList.insert(itemCount(), dataItem);
}
- if (availableActions.contains("message", Qt::CaseInsensitive) && supportsDetail("message", details[i]) && details[i].definitionName() == QContactPhoneNumber::DefinitionName)
- {
+ if (availableActions.contains("message", Qt::CaseInsensitive) && supportsDetail("message", details[i]) && details[i].definitionName() == QContactPhoneNumber::DefinitionName)
+ {
QContactPhoneNumber number(details.at(i));
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_message"), true);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_message"), itemCount(), true);
dataItem->setAction("message");
dataItem->setValueText(number.number());
QString icon;
@@ -119,40 +122,39 @@
dataItem->setIcon(HbIcon(icon));
dataItem->setContactDetail(number);
mDataItemList.insert(itemCount(), dataItem);
- }
+ }
}
-
//email
if (availableActions.contains("email", Qt::CaseInsensitive))
{
QList<QContactDetail> details = actionDetails("email", *mContact);
for (int i = 0; i < details.count(); i++)
- {
- if (details[i].definitionName() == QContactEmailAddress::DefinitionName)
- {
- QContactEmailAddress email(details.at(i));
- QString title;
- QString icon;
- if (!email.contexts().isEmpty())
- {
- title = mStringMapper.getContactCardListLocString(email.definitionName(), email.contexts().first());
- icon = mStringMapper.getContactCardIconString(email.definitionName(), email.contexts().first());
- }
- else
- {
- title = mStringMapper.getContactCardListLocString(email.definitionName(), QString());
- icon = mStringMapper.getContactCardIconString(email.definitionName(), QString());
- }
-
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, true);
- dataItem->setAction("email");
- dataItem->setValueText(email.emailAddress(), Qt::ElideLeft);
- dataItem->setIcon(HbIcon(icon));
- dataItem->setContactDetail(email);
- mDataItemList.insert(itemCount(), dataItem);
- }
+ {
+ QContactEmailAddress email(details.at(i));
+ QString context = email.contexts().isEmpty() ? QString() : email.contexts().first();
+
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(email.definitionName(), context), itemCount(), true);
+ dataItem->setAction("email");
+ dataItem->setValueText(email.emailAddress(), Qt::ElideLeft);
+ dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(email.definitionName(), context)));
+ dataItem->setContactDetail(email);
+ mDataItemList.insert(itemCount(), dataItem);
}
}
+ //url
+ QList<QContactUrl> urlDetails = mContact->details<QContactUrl>();
+ for (int i = 0; i < urlDetails.count(); i++)
+ {
+ QContactUrl url(urlDetails.at(i));
+ QString context = url.contexts().isEmpty() ? QString() : url.contexts().first();
+
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(url.definitionName(), context), itemCount(), true);
+ dataItem->setAction("url");
+ dataItem->setValueText(url.url());
+ dataItem->setIcon(HbIcon(mStringMapper.getContactCardIconString(url.definitionName(), context)));
+ dataItem->setContactDetail(url);
+ mDataItemList.insert(itemCount(), dataItem);
+ }
}
/*!
@@ -166,7 +168,7 @@
//call
if (confCallNumber.number() != NULL)
{
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_conference_call"), true);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_conference_call"), itemCount(), true);
dataItem->setAction("call");
dataItem->setValueText(confCallNumber.number());
dataItem->setIcon(HbIcon("qtg_large_call_group"));
@@ -175,7 +177,7 @@
}
//message
- CntContactCardDataItem* dataMessageItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_val_members"), true);
+ CntContactCardDataItem* dataMessageItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_send_val_members"), itemCount(), true);
dataMessageItem->setAction("message");
dataMessageItem->setValueText(confCallNumber.number());
dataMessageItem->setIcon(HbIcon("qtg_large_message"));
@@ -183,7 +185,7 @@
mDataItemList.insert(itemCount(), dataMessageItem);
//email
- CntContactCardDataItem* dataEmailItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_email"), true);
+ CntContactCardDataItem* dataEmailItem = new CntContactCardDataItem(hbTrId("txt_phob_dblist_email"), itemCount(), true);
dataEmailItem->setAction("email");
dataEmailItem->setValueText(confCallNumber.number());
dataEmailItem->setIcon(HbIcon("qtg_large_email"));
@@ -196,11 +198,27 @@
*/
void CntContactCardDataContainer::initializeDetailsData()
{
+ //sip & internet call
+ QList<QContactOnlineAccount> onlinedDetails = mContact->details<QContactOnlineAccount>();
+ for (int i = 0; i < onlinedDetails.count(); i++)
+ {
+ QContactOnlineAccount online(onlinedDetails.at(i));
+ QString context = online.contexts().isEmpty() ? QString() : online.contexts().first();
+ QString subtype = online.subTypes().isEmpty() ? online.definitionName() : online.subTypes().first();
+
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(mStringMapper.getContactCardListLocString(subtype, context), itemCount(), false);
+ dataItem->setValueText(online.accountUri());
+ dataItem->setContactDetail(online);
+ addSeparator(itemCount());
+ mDataItemList.insert(itemCount(), dataItem);
+ }
+
+ //address
QString contextHome(QContactAddress::ContextHome.operator QString());
QString contextWork(QContactAddress::ContextWork.operator QString());
CntMapTileService::ContactAddressType sourceAddressType;
mLocationFeatureEnabled = CntMapTileService::isLocationFeatureEnabled() ;
- //address
+
QList<QContactAddress> addressDetails = mContact->details<QContactAddress>();
for (int i = 0; i < addressDetails.count(); i++)
{
@@ -225,7 +243,7 @@
title = hbTrId("txt_phob_formlabel_address_work");
}
}
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(title, itemCount(), false);
QStringList address;
if (!addressDetails[i].street().isEmpty())
@@ -265,30 +283,44 @@
QIcon mapTileIcon;
QPainter painter;
- QPixmap baloon(":/icons/pin.png");
+ QPixmap baloon( HbIcon("qtg_small_location").pixmap() );
QPixmap map(icon.pixmap());
//Display pin image in the center of maptile image
painter.begin(&map);
- painter.drawPixmap((map.width()/2),
- ((map.height()/2)-(baloon.height())), baloon);
+ painter.drawPixmap( ( map.width()/2 ) - ( baloon.width()/ 2 ),
+ (( map.height()/2 )-( baloon.height())), baloon );
+
painter.end();
mapTileIcon.addPixmap(map);
addSeparator(itemCount());
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(QString(), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(QString(), itemCount(), false);
dataItem->setIcon(HbIcon(mapTileIcon));
mDataItemList.insert(itemCount(), dataItem);
}
}
}
+ //company
+ QList<QContactOrganization> organizationDetails = mContact->details<QContactOrganization>();
+ for (int i = 0; i < organizationDetails.count(); i++)
+ {
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_company_details"), itemCount(), false);
+ QStringList companyList;
+ companyList << organizationDetails[i].title() << organizationDetails[i].name() << organizationDetails[i].department();
+ dataItem->setValueText(companyList.join(" ").trimmed());
+ dataItem->setContactDetail(organizationDetails[i]);
+ addSeparator(itemCount());
+ mDataItemList.insert(itemCount(), dataItem);
+ }
+
//birthday
QList<QContactBirthday> birthdayDetails = mContact->details<QContactBirthday>();
for (int i = 0; i < birthdayDetails.count(); i++)
{
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_birthday"), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_birthday"), itemCount(), false);
dataItem->setValueText(birthdayDetails[i].date().toString("dd MMMM yyyy"));
dataItem->setContactDetail(birthdayDetails[i]);
addSeparator(itemCount());
@@ -299,7 +331,7 @@
QList<QContactAnniversary> anniversaryDetails = mContact->details<QContactAnniversary>();
for (int i = 0; i < anniversaryDetails.count(); i++)
{
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_anniversary"), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_anniversary"), itemCount(), false);
dataItem->setValueText(anniversaryDetails[i].originalDate().toString("dd MMMM yyyy"));
dataItem->setContactDetail(anniversaryDetails[i]);
addSeparator(itemCount());
@@ -312,7 +344,7 @@
{
if (!ringtoneDetails.at(i).audioRingtoneUrl().isEmpty())
{
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_ringing_tone"), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_ringing_tone"), itemCount(), false);
dataItem->setValueText(ringtoneDetails[i].audioRingtoneUrl().toString());
dataItem->setContactDetail(ringtoneDetails[i]);
addSeparator(itemCount());
@@ -325,7 +357,7 @@
QList<QContactNote> noteDetails = mContact->details<QContactNote>();
for (int i = 0; i < noteDetails.count(); i++)
{
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_note"), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_note"), itemCount(), false);
dataItem->setValueText(noteDetails[i].note());
dataItem->setContactDetail(noteDetails[i]);
addSeparator(itemCount());
@@ -336,13 +368,13 @@
QList<QContactFamily> familyDetails = mContact->details<QContactFamily>();
for (int i = 0; i < familyDetails.count(); i++)
{
- CntContactCardDataItem* dataSpouseItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_spouse"), false);
+ CntContactCardDataItem* dataSpouseItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_spouse"), itemCount(), false);
dataSpouseItem->setValueText(familyDetails[i].spouse());
dataSpouseItem->setContactDetail(familyDetails[i]);
addSeparator(itemCount());
mDataItemList.insert(itemCount(), dataSpouseItem);
- CntContactCardDataItem* dataChildrenItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_children"), false);
+ CntContactCardDataItem* dataChildrenItem = new CntContactCardDataItem(hbTrId("txt_phob_formlabel_children"), itemCount(), false);
dataChildrenItem->setValueText(familyDetails[i].children().join(", "));
dataChildrenItem->setContactDetail(familyDetails[i]);
addSeparator(itemCount());
@@ -356,8 +388,12 @@
bool CntContactCardDataContainer::supportsDetail(const QString &actionName, const QContactDetail &contactDetail)
{
QList<QContactActionDescriptor> actionDescriptors = QContactAction::actionDescriptors(actionName, "symbian");
+ if (actionDescriptors.isEmpty())
+ {
+ return false;
+ }
+
QContactAction* contactAction = QContactAction::action(actionDescriptors.first());
-
bool isSupportDetail = contactAction->isDetailSupported(contactDetail);
delete contactAction;
@@ -371,8 +407,12 @@
QList<QContactDetail> CntContactCardDataContainer::actionDetails(const QString &actionName, const QContact &contact)
{
QList<QContactActionDescriptor> actionDescriptors = QContactAction::actionDescriptors(actionName, "symbian");
- QContactAction* contactAction = QContactAction::action(actionDescriptors.first());
-
+ if (actionDescriptors.isEmpty())
+ {
+ return QList<QContactDetail>();
+ }
+
+ QContactAction* contactAction = QContactAction::action(actionDescriptors.first());
QList<QContactDetail> details = contactAction->supportedDetails(contact);
delete contactAction;
@@ -403,7 +443,7 @@
if (mSeparatorIndex == -1)
{
mSeparatorIndex = index;
- CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_subtitle_details"), false);
+ CntContactCardDataItem* dataItem = new CntContactCardDataItem(hbTrId("txt_phob_subtitle_details"), itemCount(), false);
mDataItemList.insert(itemCount(), dataItem);
}
}
@@ -416,3 +456,13 @@
return mDataItemList.count();
}
+/*!
+Sort data item list by position number
+*/
+void CntContactCardDataContainer::sortDataItems()
+{
+ qStableSort(mDataItemList.begin(), mDataItemList.end(), compareObjects);
+}
+
+
+
--- a/phonebookui/pbkcommonui/src/cntcontactcarddataitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcarddataitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -17,14 +17,15 @@
#include "cntcontactcarddataitem.h"
-CntContactCardDataItem::CntContactCardDataItem(const QString& aTitle, bool aIsFocusable) :
+CntContactCardDataItem::CntContactCardDataItem(const QString& aTitle, int aPosition, bool aIsFocusable) :
mIcon(HbIcon()),
mSecondaryIcon(HbIcon()),
mTitle(aTitle),
mValueText(QString("")),
mAction(QString("")),
mValueTextElideMode(Qt::ElideRight),
- mIsFocusable(aIsFocusable)
+ mIsFocusable(aIsFocusable),
+ mPosition(aPosition)
{
}
--- a/phonebookui/pbkcommonui/src/cntcontactcarddetailitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcarddetailitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -15,6 +15,9 @@
*
*/
+#include <QGraphicsLayout>
+#include <QDebug>
+
#include "cntcontactcarddetailitem.h"
#include "cntcontactcarddataitem.h"
#include <hbiconitem.h>
@@ -23,22 +26,24 @@
#include <hbframedrawer.h>
#include <hbframeitem.h>
#include <hbeffect.h>
-#include <hbgesturefilter.h>
-#include <hbgesture.h>
#include <hbstyleloader.h>
#include <QGraphicsSceneMouseEvent>
#include <hbinstantfeedback.h>
+#include <hbcolorscheme.h>
+#include <QGestureEvent>
+#include <QTapGesture>
+#include <hbtoucharea.h>
+
CntContactCardDetailItem::CntContactCardDetailItem(int index, QGraphicsItem *parent, bool isFocusable) :
HbWidget(parent),
mIcon(NULL),
+ mSecondaryIcon(NULL),
mFirstLineText(NULL),
mSecondLineText(NULL),
mFrameItem(NULL),
mFocusItem(NULL),
mHasFocus(false),
- mGestureFilter(NULL),
- mGestureLongpressed(NULL),
mIndex(index),
mIsFocusable(isFocusable),
mValueTextElideMode(Qt::ElideRight),
@@ -64,9 +69,9 @@
if (!mIcon)
{
mIcon = new HbIconItem(this);
- mIcon->setIcon(icon);
style()->setItemName(mIcon, "icon");
}
+ mIcon->setIcon(icon);
}
else
{
@@ -77,12 +82,24 @@
mIcon = 0;
}
+ if (!mSecondaryIcon)
+ {
+ mSecondaryIcon = new HbIconItem(this);
+ mSecondaryIcon->setFlags(HbIcon::Colorized);
+ style()->setItemName(mSecondaryIcon, "secondaryIcon");
+ }
+ mSecondaryIcon->setIcon(secondaryIcon);
+ mSecondaryIcon->setColor(HbColorScheme::color("foreground"));
+
if (!text.isNull())
{
- mFirstLineText = new HbTextItem(this);
+ if (!mFirstLineText)
+ {
+ mFirstLineText = new HbTextItem(this);
+ mFirstLineText->setTextWrapping(Hb::TextWordWrap);
+ style()->setItemName(mFirstLineText, "text");
+ }
mFirstLineText->setText(text);
- mFirstLineText->setTextWrapping(Hb::TextWordWrap);
- style()->setItemName(mFirstLineText, "text");
}
else
{
@@ -92,16 +109,16 @@
}
mFirstLineText = 0;
}
-
+
if (!valueText.isNull())
{
if (!mSecondLineText)
{
mSecondLineText = new HbTextItem(this);
- mSecondLineText->setText(valueText);
mSecondLineText->setElideMode(mValueTextElideMode);
style()->setItemName(mSecondLineText, "valueText");
}
+ mSecondLineText->setText(valueText);
}
else
{
@@ -130,41 +147,87 @@
mFocusItem->setVisible(false);
style()->setItemName(mFocusItem, "highlight");
}
+
+ updatePrimitives();
+ updateGeometry();
+ repolish();
}
void CntContactCardDetailItem::recreatePrimitives()
{
HbWidget::recreatePrimitives();
-
- delete mIcon;
- mIcon = 0;
-
- delete mFirstLineText;
- mFirstLineText = 0;
-
- delete mSecondLineText;
- mSecondLineText = 0;
-
- delete mFrameItem;
- mFrameItem = 0;
-
- delete mFocusItem;
- mFocusItem = 0;
-
+
createPrimitives();
}
void CntContactCardDetailItem::initGesture()
{
- mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this);
- mGestureLongpressed = new HbGesture(HbGesture::longpress, 5);
- mGestureFilter->addGesture(mGestureLongpressed);
- mGestureFilter->setLongpressAnimation(true);
- installSceneEventFilter(mGestureFilter);
+ grabGesture(Qt::TapAndHoldGesture, Qt::ReceivePartialGestures);
+ grabGesture(Qt::TapGesture, Qt::ReceivePartialGestures);
+}
+
+void CntContactCardDetailItem::gestureEvent(QGestureEvent* event)
+{
+ qDebug() << "CntContactCardDetailItem::gestureEvent - IN";
+ event->accept( Qt::TapAndHoldGesture );
+
+ if (QGesture *tap = event->gesture(Qt::TapGesture))
+ {
+ tapTriggered(static_cast<QTapGesture *>(tap));
+ event->accept( tap );
+ }
+
+ if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture))
+ {
+ tapAndHoldTriggered(static_cast<QTapAndHoldGesture *>(tapAndHold));
+ event->accept( tapAndHold );
+ }
+ qDebug() << "CntContactCardDetailItem::gestureEvent - OUT";
+}
- connect(mGestureLongpressed, SIGNAL(longPress(QPointF)), this, SLOT(onLongPress(QPointF)));
+void CntContactCardDetailItem::tapTriggered(QTapGesture *gesture)
+{
+ qDebug() << "CntContactdDetailItem::tagTriggered - IN";
+
+ Qt::GestureState state = gesture->state();
+ qDebug() << "CntContactdDetailItem::tagTriggered, state: " << state;
+ switch ( state )
+ {
+ case Qt::GestureStarted:
+ {
+ if (mIsFocusable)
+ {
+ HbInstantFeedback::play(HbFeedback::Basic);
+ }
+ mHasFocus = true;
+ updatePrimitives();
+ break;
+ }
+ case Qt::GestureFinished:
+ case Qt::GestureCanceled:
+ {
+ mHasFocus = false;
+ updatePrimitives();
+ emit clicked(); // also in GestureCancelled?
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ qDebug() << "CntContactdDetailItem::tagTriggered - OUT";
}
+void CntContactCardDetailItem::tapAndHoldTriggered(QTapAndHoldGesture *gesture)
+{
+ if (gesture->state() == Qt::GestureFinished)
+ {
+ onLongPress(gesture->position());
+ }
+}
+
+
void CntContactCardDetailItem::onLongPress(const QPointF &point)
{
mHasFocus = false;
@@ -186,6 +249,7 @@
}
}
+/*
void CntContactCardDetailItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (mIsFocusable)
@@ -196,7 +260,8 @@
mHasFocus = true;
updatePrimitives();
}
-
+*/
+/*
void CntContactCardDetailItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (!rect().contains(event->pos()) && mHasFocus)
@@ -219,20 +284,32 @@
}
event->accept();
}
+*/
void CntContactCardDetailItem::setDetails(CntContactCardDataItem* aDataItem)
{
- text.clear();
- valueText.clear();
- icon.clear();
mValueTextElideMode = aDataItem->elideMode();
- if (!aDataItem->icon().isNull())
+ if (aDataItem->icon() != icon)
+ {
+ icon.clear();
icon = aDataItem->icon();
- if (!aDataItem->titleText().isEmpty())
+ }
+ if (aDataItem->secondaryIcon() != secondaryIcon)
+ {
+ secondaryIcon.clear();
+ secondaryIcon = aDataItem->secondaryIcon();
+ }
+ if (aDataItem->titleText() != text)
+ {
+ text.clear();
text = aDataItem->titleText();
- if (!aDataItem->valueText().isEmpty())
+ }
+ if (aDataItem->valueText() != valueText)
+ {
+ valueText.clear();
valueText = aDataItem->valueText();
+ }
recreatePrimitives();
}
--- a/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -19,6 +19,7 @@
#include <qtcontacts.h>
#include <QGraphicsSceneMouseEvent>
+#include <QTapAndHoldGesture>
#include <hbiconitem.h>
#include <hbtextitem.h>
@@ -40,11 +41,8 @@
mSecondaryText(NULL),
mMarqueeItem(NULL),
mFrameItem(NULL),
- mGestureFilter(NULL),
- mGestureLongpressed(NULL),
mPictureArea(NULL)
{
-
}
CntContactCardHeadingItem::~CntContactCardHeadingItem()
@@ -192,7 +190,7 @@
if (!mFrameItem)
{
mFrameItem = new HbFrameItem(this);
- mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_list_parent_normal");
+ mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox");
mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
mFrameItem->setZValue(-2);
style()->setItemName(mFrameItem, "background");
@@ -291,7 +289,7 @@
|| !(contact->detail<QContactOrganization>().department().isEmpty()));
}
-void CntContactCardHeadingItem::setDetails(const QContact* contact, bool isMyCard)
+void CntContactCardHeadingItem::setDetails(const QContact* contact)
{
primaryText.clear();
firstLineText.clear();
@@ -300,14 +298,7 @@
tinyMarqueeText.clear();
// icon label
- if (isMyCard)
- {
- icon = HbIcon("qtg_large_mycard");
- }
- else
- {
- icon = HbIcon("qtg_large_avatar");
- }
+ icon = HbIcon("qtg_large_add_contact_picture");
QContactName name = contact->detail<QContactName>();
@@ -392,37 +383,17 @@
emit passLongPressed(point);
}
-void CntContactCardHeadingItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
+void CntContactCardHeadingItem::gestureEvent(QGestureEvent* event)
{
- event->accept();
-}
-
-void CntContactCardHeadingItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- event->accept();
+ QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture);
+ if (tapAndHold && tapAndHold->state() == Qt::GestureFinished) {
+ processLongPress(static_cast<QTapAndHoldGesture *>(tapAndHold)->position());
+ }
}
-void CntContactCardHeadingItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if (rect().contains(event->pos())) {
- emit clicked();
- }
- event->accept();
-}
-
void CntContactCardHeadingItem::initGesture()
{
- mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this);
-
- // Orbit documentation states that added gestures will be deleted
- // when the filter is deleted (filter takes ownership). So no
- // need to worry about deleting the gesture.
- mGestureLongpressed = new HbGesture(HbGesture::longpress, 5);
- mGestureFilter->addGesture(mGestureLongpressed);
- mGestureFilter->setLongpressAnimation(true);
-
- mIcon->installSceneEventFilter(mGestureFilter);
- connect(mGestureLongpressed, SIGNAL(longPress(QPointF)), this, SLOT(processLongPress(QPointF)));
+ grabGesture(Qt::TapAndHoldGesture);
}
QVariant CntContactCardHeadingItem::itemChange(GraphicsItemChange change, const QVariant &value)
--- a/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntcontactcardview_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -10,7 +10,6 @@
* Nokia Corporation - initial contribution.
*
* Contributors:
-*
* Description:
*
*/
@@ -30,6 +29,9 @@
#include <hbaction.h>
#include <hbmessagebox.h>
#include <hbicon.h>
+#include <hbparameterlengthlimiter.h>
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
#include <shareui.h>
#include <thumbnailmanager_qt.h>
#include <cntmaptileservice.h> //For maptile processing
@@ -40,10 +42,12 @@
#include "cntcontactcarddetailitem.h"
#include "cntcontactcardheadingitem.h"
#include "cntcontactcarddataitem.h"
+#include "cntcontactcardcontextmenu.h"
#include "cntmainwindow.h"
#include "cntstringmapper.h"
#include "cntdocumentloader.h"
#include "cntimagelabel.h"
+#include "cntimageutility.h"
const char *CNT_CONTACTCARDVIEW_XML = ":/xml/contacts_contactcard.docml";
@@ -65,6 +69,7 @@
mAvatar(NULL),
mIsGroupMember(false),
mIsHandlingMenu(false),
+ mIsPreviousImageEditorView(false),
mFavoriteGroupId(-1),
mLoader(NULL),
mContactAction(NULL),
@@ -126,6 +131,20 @@
{
emit backPressed();
+ //save an avatar
+ if (mIsPreviousImageEditorView)
+ {
+ QList<QContactAvatar> details = mContact->details<QContactAvatar>();
+ for (int i = 0; i < details.count(); i++)
+ {
+ if (!details.at(i).imageUrl().isEmpty())
+ {
+ contactManager()->saveContact(mContact);
+ break;
+ }
+ }
+ }
+
CntViewParameters viewParameters;
if (mIsGroupMember)
{
@@ -148,6 +167,11 @@
HbMainWindow* window = mView->mainWindow();
connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
setOrientation(window->orientation());
+
+ if (aArgs.value(ECustomParam).toInt() == imageEditorView)
+ {
+ mIsPreviousImageEditorView = true;
+ }
QContact contact = aArgs.value(ESelectedContact).value<QContact>();
mContact = new QContact(contact);
@@ -174,7 +198,7 @@
QGraphicsLinearLayout* l = static_cast<QGraphicsLinearLayout*>(c->layout());
mHeadingItem = static_cast<CntContactCardHeadingItem*>(document()->findWidget(QString("cnt_contactcard_heading")));
- mHeadingItem->setDetails(mContact, mContact->localId() == contactManager()->selfContactId());
+ mHeadingItem->setDetails(mContact);
mHeadingItem->setSecondaryIcon(isFavoriteGroupContact());
connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawMenu(const QPointF&)));
@@ -187,11 +211,11 @@
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;
- }
+ }
}
// data
@@ -235,9 +259,11 @@
// separator
else if (index == mDataContainer->separatorIndex())
{
- HbGroupBox* details = new HbGroupBox(mView);
- details->setHeading(mDataContainer->dataItem(index)->titleText());
- mContainerLayout->addItem(details);
+ HbFrameItem* frameItem = new HbFrameItem(QString("qtg_fr_list_separator"), HbFrameDrawer::NinePieces);
+ HbLabel* label = static_cast<HbLabel*>(document()->findWidget(QString("separator")));
+ label->setPlainText(mDataContainer->dataItem(index)->titleText());
+ label->setBackgroundItem(frameItem);
+ mContainerLayout->addItem(label);
}
// details
@@ -248,7 +274,17 @@
{
HbLabel* iconLabel = new HbLabel(mView);
iconLabel->setIcon(dataItem->icon());
- iconLabel->setPreferredSize(dataItem->icon().width(), dataItem->icon().height());
+
+ int width = dataItem->icon().width();
+ int height = dataItem->icon().height();
+
+ //HbLabel setPreferredSize is not working properly,
+ //so added minimum , maximum size to fix the issue
+ iconLabel->setPreferredSize(QSizeF(width,height));
+ iconLabel->setMinimumSize(QSizeF(width, height));
+ iconLabel->setMaximumSize(QSizeF(width, height));
+ iconLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
+ QSizePolicy::Fixed));
mContainerLayout->addItem(iconLabel);
}
else
@@ -276,7 +312,7 @@
{
for (int i = 0 ; i < count ; i++)
{
- if (mContactsList.at(i) == mContact->localId() )
+ if (mContactsList.at(i) == mContact->localId())
{
setAsFavorite = true;
}
@@ -286,11 +322,11 @@
if (setAsFavorite)
{
- mView->menu()->removeAction(qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite")));
+ qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite"))->setVisible(false);
}
else
{
- mView->menu()->removeAction(qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite")));
+ qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite"))->setVisible(false);
}
// Menu items
@@ -390,24 +426,24 @@
// save relationship
contactManager()->saveRelationship(&relationship);
- mView->menu()->removeAction(qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite")));
- mView->menu()->addAction(qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite")));
+ qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite"))->setVisible(false);
+ qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite"))->setVisible(true);
mHeadingItem->setSecondaryIcon(true);
}
void CntContactCardViewPrivate::removeFromFavorite()
- {
+{
QContact favoriteGroup = contactManager()->contact(mFavoriteGroupId);
QContactRelationship relationship;
relationship.setRelationshipType(QContactRelationship::HasMember);
relationship.setFirst(favoriteGroup.id());
relationship.setSecond(mContact->id());
contactManager()->removeRelationship(relationship);
-
- mView->menu()->removeAction(qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite")));
- mView->menu()->addAction(qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite")));
+
+ qobject_cast<HbAction *>(document()->findObject("cnt:removefromfavorite"))->setVisible(false);
+ qobject_cast<HbAction *>(document()->findObject("cnt:setasfavorite"))->setVisible(true);
mHeadingItem->setSecondaryIcon(false);
- }
+}
/*!
Delete contact
@@ -415,23 +451,25 @@
void CntContactCardViewPrivate::deleteContact()
{
QString name = contactManager()->synthesizedDisplayLabel(*mContact);
+
+ HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)),
+ hbTrId("txt_phob_button_delete"), hbTrId("txt_common_button_cancel"));
+}
- HbMessageBox *note = new HbMessageBox(hbTrId("txt_phob_info_delete_1").arg(name), HbMessageBox::MessageTypeQuestion);
- note->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
- HbAction *selected = note->exec();
- if (selected == note->primaryAction())
+/*!
+Handle action for deleting a contact
+*/
+void CntContactCardViewPrivate::handleDeleteContact(HbAction *action)
+{
+ HbMessageBox *note = static_cast<HbMessageBox*>(sender());
+
+ if (note && action == note->actions().first())
{
contactManager()->removeContact(mContact->localId());
CntViewParameters viewParameters;
viewParameters.insert(EViewId, namesView);
- QVariant var;
- var.setValue(*mContact);
- viewParameters.insert(ESelectedContact, var);
- viewParameters.insert(ESelectedAction, "delete");
mViewManager->changeView(viewParameters);
}
- delete note;
}
/*!
@@ -460,44 +498,38 @@
*/
void CntContactCardViewPrivate::sendBusinessCard()
{
- QString tempDir = QDir::tempPath().append("/tempcntvcard");
-
- QDir dir(tempDir);
-
- // Temporary directory to store the vCard file
- if (!dir.exists())
+ // Check if the contact has an image.
+ QList<QContactAvatar> avatars = mContact->details<QContactAvatar>();
+ bool imageExists( false );
+ foreach(QContactAvatar a, mContact->details<QContactAvatar>())
{
- // Create a temp directory
- QDir::temp().mkdir("tempcntvcard");
- }
- else
- {
- // Empty the temp directory since the other vCards are not required
- QStringList l = dir.entryList();
- foreach(QString s, l)
+ if (!a.imageUrl().isEmpty())
{
- if (dir.exists(s))
- {
- dir.remove(s);
- }
+ imageExists = true;
+ HbMessageBox *note = new HbMessageBox(
+ hbTrId("txt_phob_info_add_contact_card_image_to_business_c"),
+ HbMessageBox::MessageTypeQuestion);
+ note->setIcon(*mVCardIcon);
+
+ HbAction* ok = new HbAction(hbTrId("txt_common_button_ok"), note);
+ HbAction* cancel = new HbAction(hbTrId("txt_common_button_cancel"), note);
+
+ ok->setObjectName( "ok" );
+ cancel->setObjectName( "cancel" );
+
+ note->addAction( ok );
+ note->addAction( cancel );
+
+ note->setModal( true );
+ note->setAttribute(Qt::WA_DeleteOnClose, true );
+ note->open( this, SLOT(handleSendBusinessCard(HbAction*)));
+ break;
}
}
- QString vCardName = QString(mContact->displayLabel().append(".vcf"));
- QString vCardPath = dir.absolutePath().append(QDir::separator());
- vCardPath.append(vCardName);
- vCardPath = QDir::toNativeSeparators(vCardPath);
-
- QString service("com.nokia.services.hbserviceprovider.conversationview");
- QString type("send(QVariant)");
-
- // Create the vCard and send it to messaging service
- if (createVCard(vCardPath))
+ if ( !imageExists )
{
- ShareUi s;
- QStringList l;
- l << vCardPath;
- s.send(l,false);
+ handleSendBusinessCard( NULL ); // no image
}
}
@@ -534,8 +566,12 @@
void CntContactCardViewPrivate::launchAction(QContact contact, QContactDetail detail, QString action)
{
// detail might be empty -> in that case engine uses the preferred detail for the selected action
- QList<QContactActionDescriptor> callActionDescriptors = QContactAction::actionDescriptors(action, "symbian");
- mContactAction = QContactAction::action(callActionDescriptors.at(0));
+ QList<QContactActionDescriptor> actionDescriptors = QContactAction::actionDescriptors(action, "symbian");
+ if (actionDescriptors.isEmpty())
+ {
+ return;
+ }
+ mContactAction = QContactAction::action(actionDescriptors.first());
connect(mContactAction, SIGNAL(stateChanged(QContactAction::State)),
this, SLOT(progress(QContactAction::State)));
mContactAction->invokeAction(contact, detail);
@@ -562,7 +598,6 @@
{
mContact->setPreferredDetail(aAction, aDetail);
contactManager()->saveContact(mContact);
- emit preferredUpdated();
}
/*!
@@ -573,8 +608,9 @@
CntContactCardDetailItem *item = qobject_cast<CntContactCardDetailItem*>(sender());
int index = item->index();
- HbMenu *menu = new HbMenu();
+ CntContactCardContextMenu *menu = new CntContactCardContextMenu( item );
HbAction *communicationAction = 0;
+ HbAction *videoCommunicationAction = 0;
HbAction *preferredAction = 0;
CntStringMapper stringMapper;
@@ -584,14 +620,17 @@
if (action.compare("call", Qt::CaseInsensitive) == 0)
{
QContactDetail detail = mDataContainer->dataItem(index)->detail();
- if (!detail.contexts().isEmpty())
+ if (detail.definitionName() == QContactPhoneNumber::DefinitionName)
{
- communicationAction = menu->addAction(stringMapper.getContactCardMenuLocString(detail.definitionName(), detail.contexts().first()));
- }
- else
- {
- communicationAction = menu->addAction(stringMapper.getContactCardMenuLocString(detail.definitionName(), QString()));
- }
+ QContactPhoneNumber number = static_cast<QContactPhoneNumber>(detail);
+ QString context = number.contexts().isEmpty() ? QString() : number.contexts().first();
+ QString subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first();
+
+ communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(subtype, context));
+
+ // TODO : uncomment next line when videotelephony is released
+ //videoCommunicationAction = menu->addAction(QString("VideoCall"));
+ }
}
else if (action.compare("message", Qt::CaseInsensitive) == 0)
{
@@ -601,11 +640,11 @@
{
if (!detail.contexts().isEmpty())
{
- communicationAction = menu->addAction(stringMapper.getContactCardMenuLocString(detail.definitionName(), detail.contexts().first()));
+ communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(detail.definitionName(), detail.contexts().first()));
}
else
{
- communicationAction = menu->addAction(stringMapper.getContactCardMenuLocString(detail.definitionName(), QString()));
+ communicationAction = menu->addAction(stringMapper.getItemSpecificMenuLocString(detail.definitionName(), QString()));
}
}
@@ -613,6 +652,10 @@
{
preferredAction = menu->addAction(hbTrId("txt_phob_menu_set_as_default_number"));
}
+ else if (action.compare("message", Qt::CaseInsensitive) == 0)
+ {
+ preferredAction = menu->addAction(hbTrId("txt_phob_menu_set_as_default_number"));
+ }
else if (action.compare("email", Qt::CaseInsensitive) == 0)
{
preferredAction = menu->addAction(hbTrId("txt_phob_menu_set_as_default_email"));
@@ -622,33 +665,124 @@
{
preferredAction->setEnabled(false);
}
+
+ if ( communicationAction )
+ {
+ communicationAction->setObjectName( "communicationAction" );
+ }
- if (preferredAction)
+ if ( preferredAction )
{
+ preferredAction->setObjectName( "preferredAction" );
menu->insertSeparator(preferredAction);
}
-
- HbAction *selectedAction = menu->exec(aCoords);
+
+ menu->setPreferredPos( aCoords );
+ menu->setAttribute( Qt::WA_DeleteOnClose, true );
+ menu->open( this, SLOT(handleMenuAction(HbAction*)) );
+}
- if (selectedAction)
+void CntContactCardViewPrivate::handleMenuAction(HbAction* aAction)
+{
+ CntContactCardContextMenu* menu = static_cast<CntContactCardContextMenu*>(sender());
+ CntContactCardDetailItem *item = menu->item();
+ int index = item->index();
+
+ QString action = mDataContainer->dataItem(index)->action();
+ QContactDetail detail = mDataContainer->dataItem(index)->detail();
+
+ QString name = aAction->objectName();
+
+ if ( name == "communicationAction" )
+ {
+ launchAction( *mContact, detail, action );
+ }
+
+ if ( name == "preferredAction" )
{
- if (selectedAction == communicationAction)
+ setPreferredAction(action, detail);
+
+ if (mPreferredItems.contains(action))
{
- launchAction(*mContact, detail, action);
+ CntContactCardDetailItem *oldItem = mPreferredItems.value(action);
+ mDataContainer->dataItem(oldItem->index())->setSecondaryIcon(HbIcon());
+ oldItem->setDetails(mDataContainer->dataItem(oldItem->index()));
+ }
+
+ mDataContainer->dataItem(item->index())->setSecondaryIcon(HbIcon("qtg_mono_favourites"));
+ item->setDetails(mDataContainer->dataItem(item->index()));
+
+ mPreferredItems.insert(action, item);
+ }
+}
+
+void CntContactCardViewPrivate::handleSendBusinessCard( HbAction* aAction )
+{
+ QList<QContact> list;
+ if ( aAction && aAction->objectName() == "cancel" )
+ {
+ QContact tmpContact( *mContact );
+ foreach ( QContactAvatar a, tmpContact.details<QContactAvatar>() )
+ {
+ tmpContact.removeDetail( &a );
}
- else if (selectedAction == preferredAction)
+ list.append( tmpContact );
+ }
+ else
+ {
+ list.append( *mContact );
+ }
+
+ QString tempDir = QDir::tempPath().append("/tempcntvcard");
+ QDir dir(tempDir);
+
+ // Temporary directory to store the vCard file
+ if (!dir.exists())
+ {
+ // Create a temp directory
+ QDir::temp().mkdir("tempcntvcard");
+ }
+ else
+ {
+ // Empty the temp directory since the other vCards are not required
+ QStringList l = dir.entryList();
+ foreach(QString s, l)
{
- setPreferredAction(action, detail);
- //item->setUnderLine(true);
-
- if (mPreferredItems.contains(action))
+ if (dir.exists(s))
{
- //mPreferredItems.value(action)->setUnderLine(false);
- }
- mPreferredItems.insert(action, item);
+ dir.remove(s);
+ }
+ }
+ }
+
+ QString vCardName = QString(mContact->displayLabel().append(".vcf"));
+ QString vCardPath = dir.absolutePath().append(QDir::separator());
+ vCardPath.append(vCardName);
+ vCardPath = QDir::toNativeSeparators(vCardPath);
+
+ QVersitContactExporter exporter;
+ // The vCard version needs to be 2.1 due to backward compatiblity when sending
+ if (!exporter.exportContacts(list, QVersitDocument::VCard21Type))
+ {
+
+ QList<QVersitDocument> docs = exporter.documents();
+ QFile f(vCardPath);
+ if ( f.open(QIODevice::WriteOnly) )
+ {
+ // Start creating the vCard
+ QVersitWriter writer;
+ writer.setDevice(&f);
+
+ bool ret = writer.startWriting(docs);
+ ret = writer.waitForFinished();
+
+ // Create the vCard and send it to messaging service
+ ShareUi s;
+ QStringList l;
+ l << vCardPath;
+ s.send(l,false);
}
}
- menu->deleteLater();
}
/*!
@@ -703,9 +837,21 @@
{
if (mAvatar)
{
+ CntImageUtility imageUtility;
+ QString filePath=mAvatar->imageUrl().toString();
+
bool success = mContact->removeDetail(mAvatar);
if (success)
{
+ if (!filePath.isEmpty())
+ {
+ // Check if image removable.
+ CntImageUtility imageUtility;
+ if(imageUtility.isImageRemovable(filePath))
+ {
+ imageUtility.removeImage(filePath);
+ }
+ }
mHeadingItem->setIcon(HbIcon("qtg_large_avatar"));
contactManager()->saveContact(mContact);
}
@@ -724,27 +870,14 @@
mIsHandlingMenu = true;
HbMenu *menu = new HbMenu();
- HbAction *changeImageAction = menu->addAction(hbTrId("txt_phob_menu_change_picture"));
- HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"));
-
- HbAction *selectedAction = menu->exec(aCoords);
-
- if (selectedAction)
- {
- if (selectedAction == changeImageAction)
- {
- doChangeImage();
- }
- else if (selectedAction == removeAction)
- {
- doRemoveImage();
- }
+ menu->addAction(hbTrId("txt_phob_menu_change_picture"), this, SLOT(doChangeImage()) );
+ menu->addAction(hbTrId("txt_phob_menu_remove_image"), this, SLOT(doRemoveImage()) );
+
+ menu->setAttribute( Qt::WA_DeleteOnClose );
+ menu->setPreferredPos( aCoords );
+ menu->open();
}
- mIsHandlingMenu = false;
- menu->deleteLater();
-}
-
/*!
Check if the favourite group created
*/
@@ -807,83 +940,6 @@
}
/*!
-Creates the v-card
-*/
-bool CntContactCardViewPrivate::createVCard(QString& vCardPath)
-{
- QList<QContact> list;
- QContact tempContact(*mContact);
- bool createVCard( false );
-
- // Check if the contact has an image.
- QList<QContactAvatar> avatars = tempContact.details<QContactAvatar>();
-
- foreach(QContactAvatar a, avatars)
- {
- if (!a.imageUrl().isEmpty())
- {
- // If true and query the user if they want to add it to
- // the business card
-
- // TODO: Missing translation
- HbMessageBox *note = new HbMessageBox(hbTrId("txt_phob_info_add_contact_card_image_to_business_c"),
- HbMessageBox::MessageTypeQuestion);
- note->setIcon(*mVCardIcon);
-
- note->setPrimaryAction(new HbAction(hbTrId("txt_common_button_ok"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
- HbAction *selected = note->exec();
- if (selected == note->secondaryAction())
- {
- // Remove the avatar detail from the temp contact
- createVCard = tempContact.removeDetail(&a);
- }
- else if (selected == note->primaryAction())
- {
- createVCard = true;
- }
- delete note;
- break;
- }
- else
- {
- // Contact does not have an image
- createVCard = true;
- }
- }
-
- // False = User clicked outside the popup, dismissing it
- // = User prompted the removal of the avatar but it failed
- if (!createVCard)
- {
- return false;
- }
-
- list.append(tempContact);
- QVersitContactExporter exporter;
- // The vCard version needs to be 2.1 due to backward compatiblity when sending
- if (!exporter.exportContacts(list, QVersitDocument::VCard21Type))
- return false;
-
- QList<QVersitDocument> docs = exporter.documents();
-
- QFile f(vCardPath);
- if (!f.open(QIODevice::WriteOnly))
- {
- return false;
- }
-
- // Start creating the vCard
- QVersitWriter writer;
- writer.setDevice(&f);
-
- bool ret = writer.startWriting(docs);
- ret = writer.waitForFinished();
-
- return ret;
-}
-
-/*!
Return the pointer to the document loader
*/
CntDocumentLoader* CntContactCardViewPrivate::document()
--- a/phonebookui/pbkcommonui/src/cntdateeditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdateeditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -41,8 +41,8 @@
mAnniversary = anniversaryList.first();
HbDataFormModelItem* root = invisibleRootItem();
- appendDataFormItem( new CntDetailModelItem( mBirthday, qtTrId("Birthday")), root );
- appendDataFormItem( new CntDetailModelItem( mAnniversary, qtTrId("Anniversary")), root );
+ appendDataFormItem( new CntDetailModelItem( mBirthday, hbTrId("txt_phob_formlabel_birthday")), root );
+ appendDataFormItem( new CntDetailModelItem( mAnniversary, hbTrId("txt_phob_formlabel_anniversary")), root );
}
CntDateEditorModel::~CntDateEditorModel()
--- a/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdateeditorviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -30,118 +30,141 @@
#include <hbpushbutton.h>
#include <hbdialog.h>
#include <hbdatetimepicker.h>
-#include <hbtextitem.h>
+#include <hblabel.h>
#include <hbaction.h>
-#include <QPointer>
-
CntDateEditorViewItem::CntDateEditorViewItem( QGraphicsItem* aParent ) :
-CntDetailViewItem( aParent ),
-mButton(NULL)
- {
+ CntDetailViewItem( aParent ),
+ mButton(NULL)
+{
mLocale = QLocale::system();
- }
+}
CntDateEditorViewItem::~CntDateEditorViewItem()
- {
- }
+{
+}
HbAbstractViewItem* CntDateEditorViewItem::createItem()
- {
+{
return new CntDateEditorViewItem( *this );
- }
+}
void CntDateEditorViewItem::clicked()
- {
+{
HbDataFormModel* model = static_cast<HbDataFormModel*>(itemView()->model());
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( model->itemFromIndex(modelIndex()) );
QContactDetail detail = item->detail();
-
- QString buttonText = qtTrId( "No date set" );
+
if ( detail.definitionName() == QContactBirthday::DefinitionName )
- {
+ {
QContactBirthday bd = detail;
- QDate date = editDate( bd.date(), qtTrId("Birthday") );
- if ( date != bd.date() )
- {
- bd.setDate( date );
- item->setDetail( bd );
- }
- buttonText = mLocale.toString( date );
- }
-
- if ( detail.definitionName() == QContactAnniversary::DefinitionName )
- {
- QContactAnniversary anniversary = detail;
- QDate date = editDate( anniversary.originalDate(), qtTrId("Anniversary") );
- if ( date != anniversary.originalDate() )
- {
- anniversary.setOriginalDate( date );
- item->setDetail( anniversary );
- }
- buttonText = mLocale.toString( date );
- }
-
- mButton->setText( buttonText );
+ editDate( bd.date(), hbTrId("txt_phob_formlabel_birthday") );
}
+ if ( detail.definitionName() == QContactAnniversary::DefinitionName )
+ {
+ QContactAnniversary anniversary = detail;
+ editDate( anniversary.originalDate(), hbTrId("txt_phob_formlabel_anniversary") );
+ }
+}
+
HbWidget* CntDateEditorViewItem::createCustomWidget()
- {
+{
mButton = new HbPushButton();
connect( mButton, SIGNAL(clicked(bool)), this, SLOT(clicked()) );
-
+
HbDataFormModel* model = static_cast<HbDataFormModel*>(itemView()->model());
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( model->itemFromIndex(modelIndex()) );
-
+
QContactDetail detail = item->detail();
- QString text( qtTrId("No date set") );
-
+ QString text("No date set"); // loc missing
+
if ( detail.definitionName() == QContactBirthday::DefinitionName )
- {
+ {
QContactBirthday birthday = detail;
if ( !birthday.isEmpty() )
- {
+ {
text = mLocale.toString( birthday.date() );
- }
}
-
+ }
+
if ( detail.definitionName() == QContactAnniversary::DefinitionName )
- {
+ {
QContactAnniversary anniversary = detail;
if ( !anniversary.isEmpty() )
- {
+ {
text = mLocale.toString( anniversary.originalDate() );
- }
}
+ }
mButton->setText( text );
return mButton;
- }
+}
-QDate CntDateEditorViewItem::editDate( QDate aCurrent, QString aTitle )
- {
- QPointer<HbDialog> popup = new HbDialog();
+void CntDateEditorViewItem::editDate( QDate aCurrent, QString aTitle )
+{
+ HbDialog *popup = new HbDialog();
popup->setDismissPolicy(HbDialog::NoDismiss);
popup->setTimeout(HbPopup::NoTimeout);
+ popup->setAttribute(Qt::WA_DeleteOnClose, true);
HbDateTimePicker *picker = new HbDateTimePicker( popup );
picker->setDisplayFormat( mLocale.dateFormat() );
picker->setDateRange(CNT_DATEPICKER_FROM, CNT_DATEPICKER_TO );
picker->setDate( aCurrent );
-
- HbTextItem *headingText = new HbTextItem( popup );
- headingText->setFontSpec( HbFontSpec(HbFontSpec::Title) );
- headingText->setText( aTitle );
-
+
+ HbLabel *headingText = new HbLabel( popup );
+ headingText->setPlainText( aTitle );
+
popup->setHeadingWidget(headingText);
popup->setContentWidget(picker);
- popup->setPrimaryAction(new HbAction(qtTrId("Ok"), popup));
- popup->setSecondaryAction(new HbAction(qtTrId("Cancel"), popup));
+ popup->addAction(new HbAction(hbTrId("txt_common_button_ok"), popup));
+ popup->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popup));
+
+ popup->open(this, SLOT(handleEditDate(HbAction*)));
+}
- HbAction *selected = popup->exec();
- QDate date = (selected == popup->primaryAction()) ? picker->date() : aCurrent;
- delete popup;
-
- return date;
+void CntDateEditorViewItem::changeDate( QDate aNewDate )
+{
+ HbDataFormModel* model = static_cast<HbDataFormModel*>(itemView()->model());
+ CntDetailModelItem* item = static_cast<CntDetailModelItem*>( model->itemFromIndex(modelIndex()) );
+ QContactDetail detail = item->detail();
+
+ QString buttonText("No date set"); // loc missing
+ if ( detail.definitionName() == QContactBirthday::DefinitionName )
+ {
+ QContactBirthday bd = detail;
+ if ( aNewDate != bd.date() )
+ {
+ bd.setDate( aNewDate );
+ item->setDetail( bd );
+ }
+ buttonText = mLocale.toString( aNewDate );
}
+ if ( detail.definitionName() == QContactAnniversary::DefinitionName )
+ {
+ QContactAnniversary anniversary = detail;
+ if ( aNewDate != anniversary.originalDate() )
+ {
+ anniversary.setOriginalDate( aNewDate );
+ item->setDetail( anniversary );
+ }
+ buttonText = mLocale.toString( aNewDate );
+ }
+
+ mButton->setText( buttonText );
+}
+
+void CntDateEditorViewItem::handleEditDate( HbAction *aAction )
+{
+ HbDialog *popup = static_cast<HbDialog*>(sender());
+
+ if (popup && aAction == popup->actions().first())
+ {
+ QDate date = static_cast<HbDateTimePicker*>(popup->contentWidget())->date();
+ changeDate(date);
+ }
+
+}
+
// End of File
--- a/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp Fri May 14 15:42:23 2010 +0300
@@ -35,6 +35,7 @@
#include "cnthistoryview.h"
#include "cnteditview.h"
#include "cntmycardselectionview.h"
+#include "cntimportsview.h"
#include "cntextensionmanager.h"
CntDefaultViewFactory::CntDefaultViewFactory():
@@ -102,6 +103,8 @@
return new CntGroupActionsView();
case historyView:
return new CntHistoryView();
+ case importsView:
+ return new CntImportsView();
default:
return createPluginView(aId);
}
--- a/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdefaultviewmanager.cpp Fri May 14 15:42:23 2010 +0300
@@ -23,38 +23,34 @@
#include <hbmainwindow.h>
#include <qtcontacts.h>
#include "cntviewnavigator.h"
-#include <simutility.h>
+#include "simutility.h"
CntDefaultViewManager::CntDefaultViewManager( HbMainWindow* aWindow ) : QObject(),
mFactory(NULL),
mCurrent(NULL),
mOldView(NULL),
mNavigator(NULL),
- mMainWindow( aWindow )
+ mMainWindow( aWindow ),
+ mSimUtility(NULL)
{
setViewFactory(new CntDefaultViewFactory());
setViewNavigator(new CntViewNavigator(this));
-#ifndef __WINS__
int error = -1;
- SimUtility simUtility = SimUtility(SimUtility::AdnStore, error);
- if (error == 0)
+ mSimUtility = new SimUtility(SimUtility::AdnStore, error);
+ if (error != 0)
{
- SimUtility::AvailableStores store = simUtility.getAvailableStores(error);
- if (error == 0 && store.AdnStorePresent)
- {
- QContactManager* manager = QContactManager::fromUri(SIM_BACKEND_ADN);
- mBackends.append( manager );
- }
+ delete mSimUtility;
+ mSimUtility = 0;
}
-#endif
}
CntDefaultViewManager::~CntDefaultViewManager()
{
qDeleteAll(mDefaults.values());
delete mFactory;
+ delete mSimUtility;
}
void CntDefaultViewManager::setViewFactory( CntAbstractViewFactory* aFactory )
@@ -79,12 +75,16 @@
QFlags<Hb::ViewSwitchFlag> flags;
int back = mNavigator->back( flags );
-
+
+ foreach( int k, aArgs.keys() )
+ {
+ mArgs.insert( k, aArgs.value(k) );
+ }
mArgs.insert(EViewId, back );
- mArgs.insert(ESelectedAction, aArgs.value(ESelectedAction));
- mArgs.insert(ESelectedContact, aArgs.value(ESelectedContact));
- mArgs.insert(ESelectedGroupContact, aArgs.value(ESelectedGroupContact));
- mArgs.insert(ESelectedDetail, aArgs.value(ESelectedDetail));
+// mArgs.insert(ESelectedAction, aArgs.value(ESelectedAction));
+// mArgs.insert(ESelectedContact, aArgs.value(ESelectedContact));
+// mArgs.insert(ESelectedGroupContact, aArgs.value(ESelectedGroupContact));
+// mArgs.insert(ESelectedDetail, aArgs.value(ESelectedDetail));
if (mArgs.value(EViewId).toInt() != noView)
{
@@ -110,6 +110,7 @@
}
}
QContactManager* manager = QContactManager::fromUri( aType );
+
if ( manager )
{
mBackends.append( manager );
@@ -143,6 +144,13 @@
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);
}
}
--- a/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdetaileditor.cpp Fri May 14 15:42:23 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "cntdetaileditor.h"
#include "cnteditorfactory.h"
+#include "cntgroupeditormodel.h"
#include <cntviewparams.h>
#include <hbmenu.h>
#include <hbaction.h>
@@ -23,11 +24,15 @@
#include <hbview.h>
#include <hbdocumentloader.h>
#include <hbaction.h>
+#include <hblineedit.h>
+#include <hbinputeditorinterface.h>
+#include <hbinputstandardfilters.h>
const char *CNT_DETAILEDITOR_XML = ":/xml/contacts_detail_editor.docml";
CntDetailEditor::CntDetailEditor( int aId ) :
QObject(),
+ mDataFormModel(NULL),
mId(aId),
mView(NULL),
mLoader(NULL),
@@ -42,7 +47,6 @@
}
else {
mView = static_cast<HbView*> (document()->findWidget(QString("view")));
-
mDataForm = static_cast<HbDataForm*> (document()->findWidget(QString("dataForm")));
}
@@ -76,6 +80,7 @@
void CntDetailEditor::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
{
mViewManager = aMgr;
+ mArgs = aArgs; //don't loose the params while swiching between editview and editorviews.
mCancel = static_cast<HbAction*>(document()->findObject("cnt:discardchanges"));
mView->menu()->addAction( mCancel );
@@ -94,11 +99,10 @@
if ( aArgs.value(ESelectedAction).toString() == "add" ) {
mDataFormModel->insertDetailField();
}
-
- HbMainWindow* window = mView->mainWindow();
- if ( window ) {
- connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(handleOrientation(Qt::Orientation)));
- handleOrientation(window->orientation());
+
+ if ( mId == groupEditorView )
+ {
+ connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) );
}
}
@@ -134,19 +138,27 @@
mDataFormModel->insertDetailField();
}
-void CntDetailEditor::handleOrientation(Qt::Orientation aOrientation)
+void CntDetailEditor::handleItemShown(const QModelIndex& aIndex )
{
- Q_UNUSED(aOrientation);
+ 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 );
+ }
+ }
}
void CntDetailEditor::discardChanges()
{
QContact selected( *mDataFormModel->contact() );
- CntViewParameters args;
QVariant var;
var.setValue(selected);
- args.insert(ESelectedContact, var);
- mViewManager->back( args );
+ mArgs.insert(ESelectedContact, var);
+ mViewManager->back( mArgs );
}
void CntDetailEditor::saveChanges()
@@ -154,11 +166,10 @@
mDataFormModel->saveContactDetails();
QContact selected( *mDataFormModel->contact() );
- CntViewParameters args;
QVariant var;
var.setValue(selected);
- args.insert(ESelectedContact, var);
- mViewManager->back( args );
+ mArgs.insert(ESelectedContact, var);
+ mViewManager->back( mArgs );
}
void CntDetailEditor::setHeader(QString aHeader)
@@ -171,8 +182,17 @@
void CntDetailEditor::setDetails(CntDetailEditorModel* aModel, HbAbstractViewItem* aPrototype)
{
+ //Append custom view item prototype
+ if ( aPrototype )
+ {
+ QList <HbAbstractViewItem*> protos = mDataForm->itemPrototypes();
+ protos.append( aPrototype );
+ mDataForm->setItemPrototypes( protos );
+ }
+
mDataFormModel = aModel;
- mDataForm->setModel(mDataFormModel, aPrototype);
+ mDataForm->setModel( mDataFormModel );
+
}
int CntDetailEditor::viewId() const
--- a/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntdetailpopup.cpp Fri May 14 15:42:23 2010 +0300
@@ -27,10 +27,12 @@
QTM_USE_NAMESPACE
-CntDetailPopup::CntDetailPopup(QGraphicsItem *parent):
+CntDetailPopup::CntDetailPopup(QGraphicsItem *parent, CntViewIdList aList ):
HbDialog(parent),
mListModel(NULL),
- mListView(NULL)
+ mListView(NULL),
+ mSelectedDetail(0),
+ mViewIdList( aList )
{
mListView = new HbListView(this);
mListModel = new QStandardItemModel(this);
@@ -39,11 +41,11 @@
addListItem("qtg_small_email", hbTrId("txt_phob_list_email"), emailEditorView );
addListItem("qtg_small_url_address", hbTrId("txt_phob_list_url"), urlEditorView);
addListItem("qtg_small_location", hbTrId("txt_phob_list_address"), addressEditorView );
- addListItem("qtg_small_note", hbTrId("txt_phob_formlabel_note"), noteEditorView);
- addListItem("qtg_small_sound", hbTrId("txt_phob_formlabel_personal_ringing_tone"), noView );
- addListItem("qtg_small_calendar", hbTrId("txt_phob_formlabel_date"), dateEditorView);
- addListItem("qtg_small_company_details", hbTrId("txt_phob_formlabel_company_details"), companyEditorView);
- addListItem("qtg_small_family", hbTrId("txt_phob_formlabel_family"), familyDetailEditorView);
+ addListItem("qtg_small_note", hbTrId("txt_phob_list_note"), noteEditorView);
+ addListItem("qtg_small_sound", hbTrId("txt_phob_list_personal_ringing_tone"), noView );
+ addListItem("qtg_small_calendar", hbTrId("txt_phob_list_date"), dateEditorView);
+ 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);
@@ -51,16 +53,17 @@
HbListViewItem* prototype = mListView->listItemPrototype();
prototype->setGraphicsSize( HbListViewItem::SmallIcon );
- HbGroupBox *headingLabel = new HbGroupBox();
- HbLabel *label = new HbLabel(hbTrId("txt_phob_title_add_field"));
- headingLabel->setContentWidget(label);
+ HbLabel *label = new HbLabel(this);
+ label->setPlainText(hbTrId("txt_phob_title_add_field"));
- setHeadingWidget(headingLabel);
+ setHeadingWidget(label);
setContentWidget(mListView);
- HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
- setSecondaryAction(mSecondaryAction);
- setTimeout(0);
+ 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)));
@@ -72,38 +75,30 @@
void CntDetailPopup::listItemSelected(QModelIndex index)
{
- mSelectedDetail = mListModel->item(index.row(), 1)->text();
+ mSelectedDetail = mListModel->item(index.row())->data(Qt::UserRole).toInt();
close();
}
-QString CntDetailPopup::selectedDetail()
+int CntDetailPopup::selectedDetail()
{
return mSelectedDetail;
}
-int CntDetailPopup::selectDetail()
+void CntDetailPopup::selectDetail( CntViewIdList aList, QObject *receiver, const char *member )
{
- CntDetailPopup *popup = new CntDetailPopup();
- QString result;
-
- HbAction *action = popup->exec();
-
- if (action != popup->secondaryAction() && !popup->selectedDetail().isEmpty())
- {
- result = popup->selectedDetail();
- }
- delete popup;
-
- return result.toInt();
+ CntDetailPopup *popup = new CntDetailPopup( NULL, aList );
+
+ popup->open(receiver, member);
}
void CntDetailPopup::addListItem(QString aIcon, QString label, int aId )
{
- QList<QStandardItem*> items;
- QStandardItem *labelItem = new QStandardItem(HbIcon(aIcon).qicon(), label);
- QString id;
- QStandardItem *idItem = new QStandardItem( id.number(aId) );
+ if ( !mViewIdList.contains(aId) )
+ {
+ QStandardItem *labelItem = new QStandardItem(label);
+ labelItem->setData(HbIcon(aIcon), Qt::DecorationRole);
+ labelItem->setData(aId, Qt::UserRole);
- items << labelItem << idItem;
- mListModel->appendRow(items);
+ mListModel->appendRow(labelItem);
+ }
}
--- a/phonebookui/pbkcommonui/src/cnteditorfactory.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditorfactory.cpp Fri May 14 15:42:23 2010 +0300
@@ -109,7 +109,7 @@
case addressEditorView:
{
- aEditor.setDetails(new CntAddressModel(new QContact(aContact)), NULL);
+ aEditor.setDetails(new CntAddressModel(new QContact(aContact)), new CntAddressViewItem() );
aEditor.setHeader(hbTrId("txt_phob_subtitle_edit_address_details"));
break;
}
--- a/phonebookui/pbkcommonui/src/cnteditview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditview.cpp Fri May 14 15:42:23 2010 +0300
@@ -20,7 +20,7 @@
#include "cntabstractviewmanager.h"
#include <hbview.h>
-
+#include "qtpbkglobal.h"
#include "cntdetailpopup.h"
#include "cnteditviewdetailitem.h"
#include "cnteditviewheadingitem.h"
@@ -36,8 +36,8 @@
CntEditView::CntEditView() : d_ptr(new CntEditViewPrivate())
{
Q_D( CntEditView );
- connect( d_ptr, SIGNAL(contactUpdated()), this, SIGNAL(contactUpdated()) );
- connect( d_ptr, SIGNAL(contactRemoved()), this, SIGNAL(contactRemoved()) );
+ connect( d_ptr, SIGNAL(contactUpdated(bool)), this, SIGNAL(contactUpdated(bool)) );
+ connect( d_ptr, SIGNAL(contactRemoved(bool)), this, SIGNAL(contactRemoved(bool)) );
connect( d_ptr, SIGNAL(changesDiscarded()), this, SIGNAL(changesDiscarded()) );
}
--- a/phonebookui/pbkcommonui/src/cnteditview_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditview_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -26,19 +26,22 @@
#include <thumbnailmanager_qt.h>
#include <hbabstractviewitem.h>
#include <hbmessagebox.h>
+#include <hbgroupbox.h>
#include <hbmainwindow.h>
#include <hbview.h>
#include <hblistview.h>
#include <hbaction.h>
#include <hbmenu.h>
#include <hbframebackground.h>
+#include <hbparameterlengthlimiter.h>
const char *CNT_EDIT_XML = ":/xml/contacts_ev.docml";
CntEditViewPrivate::CntEditViewPrivate() :
mModel( NULL ),
mImageLabel( NULL ),
-mThumbnailManager( NULL )
+mThumbnailManager( NULL ),
+mContact( NULL )
{
mDocument = new CntDocumentLoader;
@@ -64,8 +67,7 @@
mDelete = static_cast<HbAction*>( mDocument->findObject("cnt:deletecontact") );
HbAction* add = static_cast<HbAction*>( mDocument->findObject("cnt:adddetail_options") );
- HbAction* removeContact = static_cast<HbAction*>( mDocument->findObject("cnt:deletecontact") );
-
+
connect( add, SIGNAL(triggered()), this, SLOT(addDetailItem()) );
connect( mDelete, SIGNAL(triggered()), this, SLOT(deleteContact()) );
connect( mDiscard, SIGNAL(triggered()), this, SLOT(discardChanges()) );
@@ -86,6 +88,7 @@
delete mListView;
delete mModel;
delete mContact;
+
delete mThumbnailManager;
}
@@ -106,6 +109,8 @@
void CntEditViewPrivate::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
{
mMgr = aMgr;
+ mArgs = aArgs;
+
if ( mView->navigationAction() != mSoftkey)
{
mView->setNavigationAction(mSoftkey);
@@ -117,19 +122,41 @@
setOrientation(window->orientation());
}
+ QVariant selectedAction = mArgs.value( EMyCard );
+ QString myCard = selectedAction.toString();
+
QVariant contact = aArgs.value( ESelectedContact );
mContact = new QContact( contact.value<QContact>() );
QContactLocalId localId = mContact->localId();
QContactManager* cm = mMgr->contactManager(SYMBIAN_BACKEND);
QContactLocalId selfContactId = cm->selfContactId();
+ mIsMyCard = ( localId == selfContactId && localId != 0 ) || myCard == "myCard";
+
+ // if "MyCard", set slightly different heading and options menu
+ if ( mIsMyCard )
+ {
+ mSave->setText(hbTrId("txt_phob_opt_save_my_card"));
+ mDelete->setText(hbTrId("txt_phob_opt_clear_my_card"));
+ HbGroupBox* groupBox = static_cast<HbGroupBox*>( mDocument->findWidget("groupBox") );
+ if ( groupBox )
+ {
+ groupBox->setHeading(hbTrId("txt_phob_subtitle_edit_my_details"));
+ }
+ }
+
+ if ( localId == 0 && !mIsMyCard )
+ {
+ HbMenu* menu = mView->menu();
+ menu->removeAction( mDelete );
+ }
- HbMenu* menu = mView->menu();
// don't delete contact which is "MyCard" or not saved yet or both.
- if ( localId == selfContactId && selfContactId != 0 && mContact->details().count() <= 4 || localId == 0 )
+ if ( mIsMyCard && (mContact->details().count() <= 4 || localId == 0) )
{
mDelete->setEnabled( false );
}
+
// save and discard disabled if no changes found
if ( (*mContact) == cm->contact( mContact->localId()) )
{
@@ -169,13 +196,13 @@
{
// open editor view
QVariant id = item->data( ERoleEditorViewId );
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, id.toInt());
+ mArgs.insert(EViewId, id.toInt());
+
QVariant var;
var.setValue(*mContact);
- viewParameters.insert(ESelectedContact, var);
-
- mMgr->changeView( viewParameters );
+ mArgs.insert(ESelectedContact, var);
+ mArgs.insert(ESelectedAction, QString() );
+ mMgr->changeView( mArgs );
}
}
@@ -193,92 +220,129 @@
// only detail items are able to show context specific menu
else
{
- QVariant cd = item->data( ERoleContactDetail );
-
- HbMenu* menu = new HbMenu();
- menu->addActions( createPopup(item) );
- HbAction* selected = menu->exec( aCoords );
-
- if ( selected )
+ HbMenu* menu = createPopup( aItem->modelIndex(), item );
+ menu->setAttribute( Qt::WA_DeleteOnClose, true );
+ menu->setPreferredPos( aCoords );
+ menu->setModal( true );
+ menu->open( this, SLOT(handleMenuAction(HbAction*)) );
+ }
+}
+
+void CntEditViewPrivate::handleMenuAction( HbAction* aAction )
+{
+ int row = aAction->data().toInt();
+ QModelIndex index = mModel->index(row, 0);
+ CntEditViewItem* item = mModel->itemAt( index );
+ if ( aAction )
+ {
+ switch ( aAction->commandRole() )
+ {
+ case HbAction::EditRole:
{
- switch ( selected->commandRole() )
- {
- case HbAction::EditRole:
- {
- editDetail( item );
- }
- break;
-
- case HbAction::NewRole:
- {
- addDetail( item );
- }
- break;
-
- case HbAction::DeleteRole:
- {
- removeDetail( item, aItem->modelIndex() );
- }
- break;
-
- default:
- break;
- }
+ editDetail( item );
+ }
+ break;
+
+ case HbAction::NewRole:
+ {
+ addDetail( item );
}
+ break;
- delete menu;
+ case HbAction::DeleteRole:
+ {
+ removeDetail( item, index );
+ }
+ break;
+
+ default:
+ break;
+ }
}
}
void CntEditViewPrivate::addDetailItem()
{
- int detailEditorId = CntDetailPopup::selectDetail();
- if (detailEditorId != noView )
+ CntViewIdList list;
+ mModel->allInUseFields( list );
+
+ CntDetailPopup::selectDetail( list, this, SLOT(handleAddDetailItem(HbAction*)) );
+}
+
+void CntEditViewPrivate::handleAddDetailItem(HbAction *aAction)
+{
+ CntDetailPopup *popup = static_cast<CntDetailPopup*>(sender());
+
+ if (popup && aAction != popup->actions().first())
{
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, detailEditorId );
- switch ( detailEditorId )
+ int id = popup->selectedDetail();
+
+ if (id != noView )
{
- case phoneNumberEditorView:
- case emailEditorView:
- case urlEditorView:
- case noteEditorView:
- viewParameters.insert( ESelectedAction, "add" );
- break;
- case addressEditorView:
- case dateEditorView:
- case companyEditorView:
- case familyDetailEditorView:
- viewParameters.insert( ESelectedAction, "focus" );
- break;
- default:
- break;
+ mArgs.insert(EViewId, id );
+
+ switch ( id )
+ {
+ case phoneNumberEditorView:
+ case emailEditorView:
+ case urlEditorView:
+ case noteEditorView:
+ mArgs.insert( ESelectedAction, "add" );
+ break;
+ case addressEditorView:
+ case dateEditorView:
+ case companyEditorView:
+ case familyDetailEditorView:
+ mArgs.insert( ESelectedAction, "focus" );
+ break;
+ default:
+ break;
+ }
+ QVariant var;
+ var.setValue(*mContact);
+ mArgs.insert(ESelectedContact, var);
+ mMgr->changeView( mArgs );
}
- QVariant var;
- var.setValue(*mContact);
- viewParameters.insert(ESelectedContact, var);
- mMgr->changeView(viewParameters);
}
}
void CntEditViewPrivate::deleteContact()
{
- QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND );
- QString name = cm->synthesizedDisplayLabel( *mContact );
+ if ( mIsMyCard )
+ {
+ HbMessageBox::question(hbTrId("txt_phob_info_clear_my_card"), this,
+ SLOT(handleDeleteContact(HbAction*)),
+ hbTrId("txt_phob_button_clear"),
+ hbTrId("txt_common_button_cancel"));
+ }
+ 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_phob_button_delete"), hbTrId("txt_common_button_cancel"));
+ }
+}
- HbMessageBox *note = new HbMessageBox(hbTrId("txt_phob_info_delete_1").arg(name), HbMessageBox::MessageTypeQuestion);
- note->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
- HbAction *selected = note->exec();
- if (selected == note->primaryAction())
+void CntEditViewPrivate::handleDeleteContact(HbAction *action)
+{
+ HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+ if(dlg && action == dlg->actions().first())
{
- cm->removeContact( mContact->localId() );
- emit contactRemoved();
+ QContactManager* cm = mMgr->contactManager( SYMBIAN_BACKEND );
+
+ if ( mIsMyCard )
+ {
+ mContact->clearDetails();
+ emit contactUpdated(cm->saveContact(mContact));
+ }
+ else
+ {
+ emit contactRemoved(cm->removeContact( mContact->localId() ));
+ }
- CntViewParameters viewParameters;
- mMgr->back( viewParameters );
+ mMgr->back( mArgs );
}
- delete note;
}
void CntEditViewPrivate::discardChanges()
@@ -301,17 +365,68 @@
void CntEditViewPrivate::saveChanges()
{
QContactManager* mgr = mMgr->contactManager( SYMBIAN_BACKEND );
- mgr->saveContact( mContact );
- emit contactUpdated();
+ bool isSavedContact = mContact->localId() > 0;
- QVariant var;
- var.setValue(*mContact);
-
- CntViewParameters viewParameters;
- viewParameters.insert(ESelectedContact, var);
- viewParameters.insert( ESelectedAction, "save" );
+ // if the contact is really changed or a new one
+ if ( (*mContact) != mgr->contact(mContact->localId()) || !isSavedContact )
+ {
+ int detailCount = mContact->details().count();
+
+ // If its a new contact
+ if ( !isSavedContact )
+ {
+ if ( detailCount > 2 )
+ {
+ bool success = mgr->saveContact( mContact );
+ if ( success && mIsMyCard )
+ {
+ mgr->setSelfContactId( mContact->localId() );
+ }
+ QVariant var;
+ var.setValue(*mContact);
+ mArgs.insert(ESelectedContact, var);
+ mArgs.insert( ESelectedAction, success ? "save" : "failed" );
+ emit contactUpdated(success);
+ }
+ }
+ 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 contactRemoved(success);
+ if ( success )
+ {
+ mArgs.insert( ESelectedAction, "delete" );
+ QVariant contact;
+ contact.setValue( c );
+ mArgs.insert( ESelectedContact, contact );
+ }
+ }
+ else
+ {
+ bool success = mgr->saveContact(mContact);
+ mArgs.insert( ESelectedAction, success ? "save" : "failed");
+
+ QVariant var;
+ var.setValue(*mContact);
+ mArgs.insert(ESelectedContact, var);
+
+ emit contactUpdated( success );
+ }
+ }
+ }
+ else
+ {
+ emit changesDiscarded();
+ }
- mMgr->back( viewParameters );
+ mMgr->back( mArgs );
}
void CntEditViewPrivate::openNameEditor()
@@ -319,11 +434,11 @@
QVariant var;
var.setValue(*mContact);
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, namesEditorView);
- viewParameters.insert(ESelectedContact, var);
+ mArgs.insert(EViewId, namesEditorView);
+ mArgs.insert(ESelectedAction, QString());
+ mArgs.insert(ESelectedContact, var);
- mMgr->changeView( viewParameters );
+ mMgr->changeView( mArgs );
}
void CntEditViewPrivate::openImageEditor()
@@ -331,11 +446,11 @@
QVariant var;
var.setValue(*mContact);
- CntViewParameters viewParameters;
- viewParameters.insert(ESelectedContact, var);
- viewParameters.insert(EViewId, imageEditorView );
+ mArgs.insert(ESelectedContact, var);
+ mArgs.insert(ESelectedAction, QString());
+ mArgs.insert(EViewId, imageEditorView );
- mMgr->changeView( viewParameters );
+ mMgr->changeView( mArgs );
}
void CntEditViewPrivate::loadAvatar()
@@ -367,27 +482,15 @@
}
}
-QList<QAction*> CntEditViewPrivate::createPopup( CntEditViewItem* aDetail )
+HbMenu* CntEditViewPrivate::createPopup( const QModelIndex aIndex, CntEditViewItem* aDetail )
{
- QList<QAction*> actions;
+ HbMenu* menu = new HbMenu();
CntStringMapper* map = new CntStringMapper();
QVariant cd = aDetail->data( ERoleContactDetail );
QContactDetail detail = cd.value<QContactDetail>();
- HbAction* edit = static_cast<HbAction*>(mDocument->findObject("cnt:editdetail"));
-
- HbAction* add = static_cast<HbAction*>(mDocument->findObject("cnt:adddetail_popup"));
- QString text = add->text();
- add->setText( text.arg( "%1", map->getMappedDetail(detail.definitionName())) );
-
- HbAction* del = static_cast<HbAction*>(mDocument->findObject("cnt:deletedetail"));
- text = edit->text();
- del->setText( text.arg("%1", map->getMappedDetail(detail.definitionName())) );
-
- add->setCommandRole( HbAction::NewRole );
- edit->setCommandRole( HbAction::EditRole );
- del->setCommandRole( HbAction::DeleteRole );
-
+ QVariant data( aIndex.row() );
+
if ( !mModel->isEmptyItem(aDetail) )
{
// add is supported only on these items:
@@ -399,17 +502,51 @@
def == QContactUrl::DefinitionName ||
def == QContactNote::DefinitionName )
{
- actions.append( add );
+ HbAction* add = menu->addAction(HbParameterLengthLimiter(
+ map->getContactEditorAddLocString(detail.definitionName(), "")));
+ add->setCommandRole( HbAction::NewRole );
+ add->setData( data );
+ }
+
+ QString context;
+ QString subtype;
+ if ( def == QContactPhoneNumber::DefinitionName )
+ {
+ QContactPhoneNumber number(detail);
+ context = number.contexts().isEmpty() ? QString() : number.contexts().first();
+ subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first();
}
- actions.append( edit );
- actions.append( del );
+ else if ( def == QContactOnlineAccount::DefinitionName )
+ {
+ QContactOnlineAccount number(detail);
+ context = number.contexts().isEmpty() ? QString() : number.contexts().first();
+ subtype = number.subTypes().isEmpty() ? number.definitionName() : number.subTypes().first();
+ }
+ else if ( def == QContactFamily::DefinitionName )
+ {
+ QStringList fields = aDetail->data(ERoleContactDetailFields).toStringList();
+ subtype = fields.first();
+ }
+ else
+ {
+ context = QString();
+ subtype = detail.definitionName();
+ }
+ HbAction* edit = menu->addAction(HbParameterLengthLimiter(map->getContactEditorEditLocString(subtype, context)));
+ HbAction* del = menu->addAction(HbParameterLengthLimiter(map->getContactEditorDelLocString(subtype, context)));
+ edit->setCommandRole( HbAction::EditRole );
+ del->setCommandRole( HbAction::DeleteRole );
+ edit->setData( data );
+ del->setData( data );
}
else
{
- actions.append( edit );
+ HbAction* edit = menu->addAction(HbParameterLengthLimiter(map->getContactEditorEditLocString(detail.definitionName(), "")));
+ edit->setCommandRole( HbAction::EditRole );
+ edit->setData( data );
}
- delete map;
- return actions;
+
+ return menu;
}
void CntEditViewPrivate::addDetail( CntEditViewItem* aDetail )
@@ -428,14 +565,15 @@
void CntEditViewPrivate::editDetail( CntEditViewItem* aDetail )
{
QVariant id = aDetail->data( ERoleEditorViewId );
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, id.toInt());
+
+ mArgs.insert(EViewId, id.toInt());
+ mArgs.insert(ESelectedAction, QString() );
QVariant var;
var.setValue(*mContact);
- viewParameters.insert(ESelectedContact, var);
+ mArgs.insert(ESelectedContact, var);
- mMgr->changeView( viewParameters );
+ mMgr->changeView( mArgs );
}
void CntEditViewPrivate::removeDetail( CntEditViewItem* aDetail, const QModelIndex& aIndex )
--- a/phonebookui/pbkcommonui/src/cnteditviewdetailitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditviewdetailitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -24,8 +24,6 @@
#include <hbframedrawer.h>
#include <hbframeitem.h>
#include <hbeffect.h>
-#include <hbgesturefilter.h>
-#include <hbgesture.h>
#include <hbinstantfeedback.h>
#include <QGraphicsSceneMouseEvent>
@@ -102,400 +100,4 @@
{
Q_UNUSED( coords );
}
-//
-//void CntEditViewDetailItem::createPrimitives()
-//{
-//// if (!icon.isNull())
-//// {
-//// if (!mIcon)
-//// {
-//// mIcon = new HbIconItem(this);
-//// mIcon->setIcon(icon);
-//// //style()->setItemName(mIcon, "icon");
-//// }
-//// }
-//// else
-//// {
-//// if (mIcon)
-//// {
-//// delete mIcon;
-//// }
-//// mIcon = 0;
-//// }
-////
-//// if (!text.isNull())
-//// {
-//// if (!mLabel)
-//// {
-//// mLabel = new HbTextItem(this);
-//// mLabel->setText(text);
-//// //style()->setItemName(mLabel, "text");
-//// }
-//// }
-//// else
-//// {
-//// if (mLabel)
-//// {
-//// delete mLabel;
-//// }
-//// mLabel = 0;
-//// }
-////
-//// if (!valueText.isNull())
-//// {
-//// if (!mContent)
-//// {
-//// mContent = new HbTextItem(this);
-//// mContent->setText(valueText);
-//// mContent->setTextWrapping(Hb::TextNoWrap);
-//// // style()->setItemName(mContent, "valueText");
-////
-//// // make sure phone number truncation characters are placed
-//// // on left side of the phone number.
-//// if ( mDetail.definitionName() == QContactPhoneNumber::DefinitionName )
-//// {
-//// mContent->setElideMode( Qt::ElideLeft );
-//// }
-//// }
-//// }
-//// else
-//// {
-//// if (mContent)
-//// {
-//// delete mContent;
-//// }
-//// mContent = 0;
-//// }
-////
-//// if (!mFrameItem)
-//// {
-//// mFrameItem = new HbFrameItem(this);
-//// mFrameItem->frameDrawer().setFrameGraphicsName("qtg_fr_list_normal");
-//// mFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
-//// mFrameItem->setZValue(-2);
-//// //style()->setItemName(mFrameItem, "background");
-//// }
-////
-//// if (!mFocusItem)
-//// {
-//// mFocusItem = new HbFrameItem(this);
-//// mFocusItem->frameDrawer().setFrameGraphicsName("qtg_fr_list_pressed");
-//// mFocusItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
-//// mFocusItem->setZValue(-1);
-//// mFocusItem->setVisible(false);
-//// //style()->setItemName(mFocusItem, "highlight");
-//// }
-//}
-//
-//void CntEditViewDetailItem::recreatePrimitives()
-//{
-//// HbWidget::recreatePrimitives();
-////
-//// delete mIcon;
-//// mIcon = 0;
-////
-//// delete mLabel;
-//// mLabel = 0;
-////
-//// delete mContent;
-//// mContent = 0;
-////
-//// delete mFrameItem;
-//// mFrameItem = 0;
-////
-//// delete mFocusItem;
-//// mFocusItem = 0;
-////
-//// createPrimitives();
-//}
-//
-//void CntEditViewDetailItem::initGesture()
-//{
-//// mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this);
-//// mGestureLongpressed = new HbGesture(HbGesture::longpress, 5);
-//// mGestureFilter->addGesture(mGestureLongpressed);
-//// mGestureFilter->setLongpressAnimation(true);
-//// installSceneEventFilter(mGestureFilter);
-////
-//// connect(mGestureLongpressed, SIGNAL(longPress(QPointF)), this, SLOT(onLongPress(QPointF)));
-//}
-//
-//void CntEditViewDetailItem::onLongPress(const QPointF &point)
-//{
-// mHasFocus = false;
-// updatePrimitives();
-// emit longPressed(point);
-//}
-//
-//void CntEditViewDetailItem::setDetail(const QContactDetail &detail, const QString &type)
-//{
-//// bool doPolish = false;
-//// if (!mDetail.isEmpty() && detail != mDetail)
-//// {
-//// text.clear();
-//// valueText.clear();
-//// icon.clear();
-//// doPolish = true;
-//// }
-//// mDetail = detail;
-//// mType = type;
-////
-//// QString context;
-//// if (mDetail.contexts().count())
-//// {
-//// context = mStringMapper.getMappedDetail(detail.contexts().at(0));
-//// }
-////
-//// // phone number
-//// if (mDetail.definitionName() == QContactPhoneNumber::DefinitionName)
-//// {
-//// QContactPhoneNumber number = mDetail;
-//// if (number.isEmpty())
-//// {
-//// text = hbTrId("txt_phob_list_add_phone_number");
-//// icon = HbIcon(mStringMapper.getMappedIcon(number.definitionName()));
-//// }
-//// else if ( !number.subTypes().isEmpty() )
-//// {
-//// QStringList list;
-//// list << mStringMapper.getMappedDetail(number.subTypes().at(0)) << context;
-//// text = list.join(" ");
-//// valueText = number.number();
-//// icon = HbIcon(mStringMapper.getMappedIcon(number.subTypes().at(0)));
-//// }
-//// }
-////
-//// // email address
-//// if (mDetail.definitionName() == QContactEmailAddress::DefinitionName)
-//// {
-//// QContactEmailAddress email = mDetail;
-//// if (email.isEmpty())
-//// {
-//// text = hbTrId("txt_phob_list_add_email_address");
-//// icon = HbIcon(mStringMapper.getMappedIcon(email.definitionName()));
-//// }
-//// else
-//// {
-//// QStringList list;
-//// list << mStringMapper.getMappedDetail(email.definitionName()) << context;
-//// text = list.join(" ");
-//// valueText = email.emailAddress();
-//// icon = HbIcon(mStringMapper.getMappedIcon(email.definitionName()));
-//// }
-//// }
-////
-//// // postal address
-//// if (mDetail.definitionName() == QContactAddress::DefinitionName)
-//// {
-//// QContactAddress address = mDetail;
-//// if (address.isEmpty())
-//// {
-//// text = qtTrId("Add postal address");
-//// icon = HbIcon(mStringMapper.getMappedIcon(address.definitionName()));
-//// }
-//// else
-//// {
-//// QStringList nameList;
-//// nameList << mStringMapper.getMappedDetail(address.definitionName()) << context;
-//// text = nameList.join(" ");
-//// QStringList list;
-//// if (!address.street().isEmpty())
-//// list << address.street();
-//// if (!address.postcode().isEmpty())
-//// list << address.postcode();
-//// if (!address.postOfficeBox().isEmpty())
-//// list << address.postOfficeBox();
-//// if (!address.locality().isEmpty())
-//// list << address.locality();
-//// if (!address.region().isEmpty())
-//// list << address.region();
-//// if (!address.country().isEmpty())
-//// list << address.country();
-////
-//// QString data = list.join(", ");
-//// valueText = data;
-//// }
-//// }
-////
-//// // online account
-//// if (mDetail.definitionName() == QContactOnlineAccount::DefinitionName)
-//// {
-//// QContactOnlineAccount account = mDetail;
-//// if (account.isEmpty())
-//// {
-//// text = hbTrId("Add IM address");
-//// icon = HbIcon(mStringMapper.getMappedIcon(account.definitionName()));
-//// }
-//// else if ( !account.subTypes().isEmpty() )
-//// {
-//// QStringList list;
-//// list << mStringMapper.getMappedDetail(account.subTypes().at(0)) << context;
-//// text = list.join(" ");
-//// valueText = account.accountUri();
-//// icon = HbIcon(mStringMapper.getMappedIcon(account.subTypes().at(0)));
-//// }
-//// }
-////
-//// // url address
-//// if (mDetail.definitionName() == QContactUrl::DefinitionName)
-//// {
-//// QContactUrl url = mDetail;
-//// if (url.isEmpty())
-//// {
-//// text = hbTrId("txt_phob_list_add_url_address");
-//// icon = HbIcon(mStringMapper.getMappedIcon(url.definitionName()));
-//// }
-//// else
-//// {
-//// QStringList list;
-//// list << mStringMapper.getMappedDetail(url.definitionName()) << context;
-//// text = list.join(" ");
-//// valueText = url.url();
-//// icon = HbIcon(mStringMapper.getMappedIcon(url.definitionName()));
-//// }
-//// }
-////
-//// // company details
-//// if (mDetail.definitionName() == QContactOrganization::DefinitionName)
-//// {
-//// QContactOrganization org = mDetail;
-////
-//// // general details
-//// if (mType == QContactOrganization::DefinitionName)
-//// {
-//// text = mStringMapper.getMappedDetail(org.definitionName());
-//// QStringList list;
-//// if(!org.title().isEmpty())
-//// list << org.title();
-//// if(!org.name().isEmpty())
-//// list << org.name();
-//// if(!org.department().isEmpty())
-//// list << org.department().join(" ");
-//// valueText = list.join(", ");
-////
-//// }
-//// // assistant name
-//// else if (mType == QContactOrganization::FieldAssistantName)
-//// {
-//// text = mStringMapper.getMappedDetail(QContactOrganization::FieldAssistantName);
-//// valueText = org.assistantName();
-//// }
-//// }
-////
-//// // birthday
-//// if (mDetail.definitionName() == QContactBirthday::DefinitionName)
-//// {
-//// QContactBirthday bDay = mDetail;
-////
-//// text = mStringMapper.getMappedDetail(bDay.definitionName());
-//// valueText = bDay.date().toString("dd MMMM yyyy");
-//// }
-////
-//// // anniversary
-//// if (mDetail.definitionName() == QContactAnniversary::DefinitionName)
-//// {
-//// QContactAnniversary anniversary = mDetail;
-////
-//// text = mStringMapper.getMappedDetail(anniversary.definitionName());
-//// valueText = anniversary.originalDate().toString("dd MMMM yyyy");
-//// }
-////
-//// // ringing tone
-//// if (mDetail.definitionName() == QContactAvatar::DefinitionName)
-//// {
-//// QContactAvatar avatar = mDetail;
-////
-//// text = mStringMapper.getMappedDetail(QContactAvatar::SubTypeAudioRingtone);
-//// valueText = avatar.avatar();
-//// }
-////
-//// // note
-//// if (mDetail.definitionName() == QContactNote::DefinitionName)
-//// {
-//// QContactNote note = mDetail;
-////
-//// text = mStringMapper.getMappedDetail(note.definitionName());
-//// valueText = note.note();
-//// }
-////
-//// // family details
-//// if (mDetail.definitionName() == QContactFamily::DefinitionName)
-//// {
-//// QContactFamily family = mDetail;
-////
-//// // spouse
-//// if (mType == QContactFamily::FieldSpouse)
-//// {
-//// text = mStringMapper.getMappedDetail(QContactFamily::FieldSpouse);
-//// valueText = family.spouse();
-////
-//// }
-//// // children
-//// else if (mType == QContactFamily::FieldChildren)
-//// {
-//// text = mStringMapper.getMappedDetail(QContactFamily::FieldChildren);
-//// valueText = family.children().join(", ");
-//// }
-//// }
-////
-//// recreatePrimitives();
-//// if (doPolish)
-//// {
-//// repolish();
-//// }
-//}
-//
-//QContactDetail CntEditViewDetailItem::detail()
-//{
-// return mDetail;
-//}
-//
-//QString CntEditViewDetailItem::fieldType()
-//{
-// return mType;
-//}
-//
-//void CntEditViewDetailItem::updatePrimitives()
-//{
-// //HbWidget::updatePrimitives();
-// if (mHasFocus)
-// {
-// mFocusItem->setVisible(true);
-// HbEffect::start(mFocusItem, QString("frameitem"), QString("pressed"));
-// }
-// else
-// {
-// HbEffect::start(mFocusItem, QString("frameitem"), QString("released"));
-// }
-//}
-//
-//void CntEditViewDetailItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
-//{
-// HbInstantFeedback::play(HbFeedback::Basic);
-// event->accept();
-// mHasFocus = true;
-// updatePrimitives();
-//}
-//
-//void CntEditViewDetailItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-//{
-//// if (!rect().contains(event->pos()) && mHasFocus)
-//// {
-//// mHasFocus = false;
-//// updatePrimitives();
-//// }
-//// event->accept();
-//}
-//
-//
-//void CntEditViewDetailItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-//{
-// bool hadFocus = mHasFocus;
-// mHasFocus = false;
-//// if (rect().contains(event->pos()) && hadFocus)
-//// {
-//// updatePrimitives();
-//// emit clicked();
-//// }
-//// event->accept();
-//}
+
--- a/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditviewheadingitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -156,7 +156,7 @@
icon.clear();
// icon label shows default icon first
- icon = HbIcon("qtg_large_avatar");
+ icon = HbIcon("qtg_large_add_contact_picture");
QContactName name = contact->detail<QContactName>();
--- a/phonebookui/pbkcommonui/src/cnteditviewitembuilder.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditviewitembuilder.cpp Fri May 14 15:42:23 2010 +0300
@@ -43,7 +43,7 @@
QContactPhoneNumber::FieldNumber,
phoneNumberEditorView );
detailItem->addText( hbTrId("txt_phob_list_add_phone_number") );
- detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactPhoneNumber::DefinitionName)) );
+ detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactPhoneNumber::DefinitionName, "")) );
list.append( detailItem );
}
// existing phonenumber(s)
@@ -61,8 +61,8 @@
QContactPhoneNumber::FieldNumber,
phoneNumberEditorView);
- detailItem->addIcon( mMap->getMappedIcon(subtype) );
- detailItem->addText( mMap->getLocString(subtype, context) );
+ detailItem->addIcon( mMap->getContactEditorIconString(subtype, context) );
+ detailItem->addText( mMap->getContactEditorLocString(subtype, context) );
detailItem->addText( number.number() );
list.append( detailItem );
}
@@ -84,13 +84,15 @@
number,
QContactOnlineAccount::FieldAccountUri,
phoneNumberEditorView);
- detailItem->addIcon( mMap->getMappedIcon(subtype) );
+ detailItem->addIcon( mMap->getContactEditorIconString(subtype, context) );
if ( subtype == QContactOnlineAccount::SubTypeSip )
{
detailItem->addText( hbTrId("txt_phob_formlabel_val_sip") );
+ detailItem->addText( number.accountUri() );
+ list.append( detailItem );
}
- else
+ else if ( subtype == QContactOnlineAccount::SubTypeSipVoip )
{
if ( context == QContactOnlineAccount::ContextHome )
detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_home") );
@@ -98,9 +100,14 @@
detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_work") );
else
detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone") );
+
+ detailItem->addText( number.accountUri() );
+ list.append( detailItem );
}
- detailItem->addText( number.accountUri() );
- list.append( detailItem );
+ else
+ {
+ /* Other subtypes of QContactOnlineAccount are not supported by UI */
+ }
}
}
}
@@ -121,7 +128,7 @@
QContactEmailAddress::FieldEmailAddress,
emailEditorView);
detailItem->addText( hbTrId("txt_phob_list_add_email_address") );
- detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactEmailAddress::DefinitionName)) );
+ detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactEmailAddress::DefinitionName, "")) );
list.append( detailItem );
}
// existing email(s)
@@ -135,7 +142,7 @@
address,
QContactEmailAddress::FieldEmailAddress,
emailEditorView);
- detailItem->addIcon( mMap->getMappedIcon(QContactEmailAddress::DefinitionName) );
+ detailItem->addIcon( mMap->getContactEditorIconString(QContactEmailAddress::DefinitionName, context) );
if ( context == QContactEmailAddress::ContextHome )
detailItem->addText(hbTrId("txt_phob_formlabel_email_home"));
@@ -168,7 +175,7 @@
fieldList,
addressEditorView);
detailItem->addText( hbTrId("txt_phob_list_add_address") );
- detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactAddress::DefinitionName)) );
+ detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactAddress::DefinitionName, "")) );
list.append( detailItem );
}
return list;
@@ -187,7 +194,7 @@
QContactUrl::FieldUrl,
urlEditorView );
detailItem->addText( hbTrId("txt_phob_list_add_url_address") );
- detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactUrl::DefinitionName)) );
+ detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactUrl::DefinitionName, "")) );
list.append( detailItem );
}
// existing url(s)
@@ -201,12 +208,12 @@
url,
QContactUrl::FieldUrl,
urlEditorView );
- detailItem->addIcon( mMap->getMappedIcon(QContactUrl::DefinitionName) );
+ detailItem->addIcon( mMap->getContactEditorIconString(QContactUrl::DefinitionName, context) );
if ( context == QContactUrl::ContextHome )
- detailItem->addText( hbTrId("txt_phob_dblist_url_home") );
+ detailItem->addText( hbTrId("txt_phob_formlabel_address_home") );
else if ( context == QContactUrl::ContextWork )
- detailItem->addText( hbTrId("txt_phob_dblist_url_work") );
+ detailItem->addText( hbTrId("txt_phob_formlabel_address_work") );
else
detailItem->addText( hbTrId("txt_phob_list_url") );
@@ -236,16 +243,16 @@
QString address = valueList.join(" ").trimmed();
if ( !address.isEmpty() )
{
- QString context = addr.contexts().isEmpty() ? "" : mMap->getMappedDetail(addr.contexts().first() );
+ QString context = addr.contexts().isEmpty() ? "" : addr.contexts().first();
CntEditViewDetailItem* detailItem = new CntEditViewDetailItem(
addr,
fieldList,
addressEditorView);
if ( context == QContactAddress::ContextHome )
- detailItem->addText(hbTrId("txt_phob_dblist_url_home"));
+ detailItem->addText(hbTrId("txt_phob_formlabel_address_home"));
else if ( context == QContactAddress::ContextWork )
- detailItem->addText(hbTrId("txt_phob_dblist_url_work"));
+ detailItem->addText(hbTrId("txt_phob_formlabel_address_work"));
else
detailItem->addText(hbTrId("txt_phob_list_address"));
@@ -408,14 +415,15 @@
org.setName( QString() );
org.setDepartment( QStringList() );
}
+ aContact.saveDetail(&org);
if ( org.assistantName().isEmpty() &&
org.title().isEmpty() &&
org.name().isEmpty() &&
org.department().isEmpty() )
+ {
aContact.removeDetail(&org);
- else
- aContact.saveDetail(&org);
+ }
}
else if ( aDetail.definitionName() == QContactFamily::DefinitionName )
@@ -430,10 +438,12 @@
family.setChildren( QStringList() );
}
+ aContact.saveDetail( &family );
+
if ( family.spouse().isEmpty() && family.children().isEmpty() )
+ {
aContact.removeDetail( &family );
- else
- aContact.saveDetail( &family );
+ }
}
else
{
--- a/phonebookui/pbkcommonui/src/cnteditviewlistmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnteditviewlistmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -160,6 +160,7 @@
void CntEditViewListModel::refreshExtensionItems( const QModelIndex& aIndex )
{
+ Q_UNUSED( aIndex );
beginResetModel();
// remove all extension items
for( int i(mItemList.count()-1); i >= 0; i-- )
@@ -185,6 +186,69 @@
endResetModel();
}
+void CntEditViewListModel::allInUseFields( CntViewIdList& aList )
+{
+ foreach ( KLookupKey key, mLookupTable.keys() )
+ {
+ int index = mLookupTable.value( key );
+ if ( index != -1 )
+ {
+ switch (key)
+ {
+ case EAddressDetail:
+ {
+ // Considered to be in use if all address contexts have been added
+ QList<QContactAddress> addrList = mContact->details<QContactAddress>();
+ if ( addrList.count() >= 3 ) // no context, context home, context work
+ aList.append( addressEditorView );
+ }
+ break;
+
+ case ECompany:
+ {
+ // Considered in use if some details and assistant exists
+ QContactOrganization org = mContact->detail( QContactOrganization::DefinitionName );
+ if ( !org.assistantName().isEmpty() &&
+ (!org.name().isEmpty() || !org.department().isEmpty() || !org.title().isEmpty()) )
+ aList.append( companyEditorView );
+ }
+ break;
+
+ case EDate:
+ {
+ QContactBirthday bd = mContact->detail( QContactBirthday::DefinitionName );
+ QContactAnniversary anniversary = mContact->detail( QContactAnniversary::DefinitionName );
+ // considered as in use when both birthday and anniversary has a valid date
+ if ( bd.date().isValid() && anniversary.originalDate().isValid() )
+ aList.append( dateEditorView );
+ }
+ break;
+
+ case EFamily:
+ {
+ QContactFamily family = mContact->detail( QContactFamily::DefinitionName );
+ if ( !family.children().isEmpty() && !family.spouse().isEmpty() )
+ aList.append( familyDetailEditorView );
+ }
+ break;
+
+ case ERingingTone:
+ {
+ /*
+ QContactRingtone tone = mContact->detail( QContactRingtone::DefinitionName );
+ if ( !tone.audioRingtoneUrl().isEmpty() )
+ aList.append( ringingToneEditor );
+ */
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
void CntEditViewListModel::refresh()
{
beginResetModel();
--- a/phonebookui/pbkcommonui/src/cntemaileditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntemaileditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -42,7 +42,6 @@
void CntEmailEditorModel::insertDetailField()
{
QContactEmailAddress newAddr;
-
CntDetailModelItem* item = new CntDetailModelItem( newAddr );
appendDataFormItem( item, invisibleRootItem() );
}
@@ -53,10 +52,11 @@
int count( root->childCount() );
for ( int i(0); i < count; i++ ) {
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( root->childAt(i) );
- QContactEmailAddress address = item->detail();
- QString email = address.emailAddress();
- if ( email.length() > 0 ) {
- mContact->saveDetail( &address );
+ QContactDetail address = item->detail();
+ mContact->saveDetail( &address );
+
+ if ( address.value(QContactEmailAddress::FieldEmailAddress).isEmpty() ) {
+ mContact->removeDetail( &address );
}
}
}
--- a/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntemaileditorviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -76,8 +76,7 @@
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( model->itemFromIndex(modelIndex()) );
QContactDetail detail = item->detail();
- HbEditorInterface editorInterface( mEdit );
- editorInterface.setFilter( HbEmailAddressFilter::instance() );
+ mEdit->setInputMethodHints( Qt::ImhEmailCharactersOnly );
constructSubTypeModel( detail.contexts() );
--- a/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntfavoritesmemberview.cpp Fri May 14 15:42:23 2010 +0300
@@ -24,6 +24,8 @@
#include <hbaction.h>
#include <hblistview.h>
#include <hblistviewitem.h>
+#include <hbindexfeedback.h>
+#include <hbscrollbar.h>
#include <hbview.h>
#include <hbaction.h>
#include <hblabel.h>
@@ -92,8 +94,15 @@
mFavoriteListView = static_cast<HbListView*> (mDocumentLoader.findWidget("listView"));
mFavoriteListView->setUniformItemSizes(true);
+ mFavoriteListView->setFrictionEnabled(true);
+ mFavoriteListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+ mFavoriteListView->verticalScrollBar()->setInteractive(true);
connect(mFavoriteListView, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
this, SLOT(onLongPressed(HbAbstractViewItem *, const QPointF &)));
+
+ HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView);
+ indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+ indexFeedback->setItemView(mFavoriteListView);
HbFrameBackground frame;
frame.setFrameGraphicsName("qtg_fr_list_normal");
@@ -141,17 +150,20 @@
{
// call a dialog to display the contacts
CntGroupSelectionPopup *groupSelectionPopup = new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), mContact);
- mFavoriteListView->setModel(0);
+
groupSelectionPopup->populateListOfContact();
- HbAction* action = groupSelectionPopup->exec();
- if (action == groupSelectionPopup->primaryAction())
+ groupSelectionPopup->open(this, SLOT(handleManageFavorites(HbAction*)));
+}
+
+void CntFavoritesMemberView::handleManageFavorites(HbAction *action)
+{
+ CntGroupSelectionPopup *groupSelectionPopup = static_cast<CntGroupSelectionPopup*>(sender());
+
+ if (groupSelectionPopup && action == groupSelectionPopup->actions().first())
{
groupSelectionPopup->saveOldGroup();
}
- delete groupSelectionPopup;
-
- mFavoriteListView->setModel(mModel);
}
@@ -160,11 +172,15 @@
*/
void CntFavoritesMemberView::onLongPressed (HbAbstractViewItem *aItem, const QPointF &aCoords)
{
+ QVariant data( aItem->modelIndex().row() );
+
QModelIndex index = aItem->modelIndex();
QVariant variant = index.data(Qt::UserRole+1);
const QMap<QString, QVariant> map = variant.toMap();
HbMenu *menu = new HbMenu();
+ menu->setAttribute(Qt::WA_DeleteOnClose);
+ menu->setPreferredPos( aCoords );
HbAction *openContactAction = 0;
HbAction *editContactAction = 0;
@@ -177,30 +193,40 @@
editContactAction = menu->addAction(hbTrId("txt_common_menu_edit"));
removeFromFavoritesAction = menu->addAction(hbTrId("txt_phob_menu_remove_from_favorites"));
sendToHsAction = menu->addAction(hbTrId("Send to HS"));
+
+ openContactAction->setData( data );
+ editContactAction->setData( data );
+ removeFromFavoritesAction->setData( data );
+ sendToHsAction->setData( data );
- HbAction *selectedAction = menu->exec(aCoords);
+ menu->open(this, SLOT(handleMenu(HbAction*)));
+}
- if (selectedAction)
+void CntFavoritesMemberView::handleMenu(HbAction* action)
{
- if (selectedAction == openContactAction)
+ 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() )
{
openContact(index);
}
- else if (selectedAction == editContactAction)
+ else if (action == menuItem->actions().at(1))
{
editContact(index);
}
- else if (selectedAction == removeFromFavoritesAction)
- {
- removeFromFavorites(index);
- }
- else if (selectedAction == sendToHsAction)
+ else if (action == menuItem->actions().at(2))
{
-// sendToHs(index);
+ removeFromFavorites(index);
}
+ else if (action == menuItem->actions().at(3))
+ {
+ // sendToHs(index);
+ }
}
- menu->deleteLater();
-}
void CntFavoritesMemberView::openContact(const QModelIndex &index)
{
@@ -236,11 +262,11 @@
void CntFavoritesMemberView::removeFromFavorites(const QModelIndex &index)
{
// get contact id using index
- QContact selectedContact = mModel->contact(index);
- QContactRelationship relationship;
- relationship.setRelationshipType(QContactRelationship::HasMember);
- relationship.setFirst(mContact->id());
- relationship.setSecond(selectedContact.id());
- mViewManager->contactManager(SYMBIAN_BACKEND)->removeRelationship(relationship);
+ QContact selectedContact = mModel->contact(index);
+ QContactRelationship relationship;
+ relationship.setRelationshipType(QContactRelationship::HasMember);
+ relationship.setFirst(mContact->id());
+ relationship.setSecond(selectedContact.id());
+ mViewManager->contactManager(SYMBIAN_BACKEND)->removeRelationship(relationship);
}
--- a/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntfavoritesview.cpp Fri May 14 15:42:23 2010 +0300
@@ -84,25 +84,35 @@
// call a dialog to display the contacts
CntGroupSelectionPopup *groupSelectionPopup = new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), mContact);
groupSelectionPopup->populateListOfContact();
- HbAction* action = groupSelectionPopup->exec();
-
- if (action == groupSelectionPopup->primaryAction())
- {
- groupSelectionPopup->saveOldGroup();
- delete groupSelectionPopup;
-
- CntViewParameters viewParameters;
- viewParameters.insert(EViewId, FavoritesMemberView);
- QVariant var;
- var.setValue(*mContact);
- viewParameters.insert(ESelectedContact, var);
- mViewManager->changeView(viewParameters);
- }
- else if (action == groupSelectionPopup->secondaryAction())
- {
- delete groupSelectionPopup;
- showPreviousView();
- }
+ groupSelectionPopup->open(this, SLOT(handleMemberSelection(HbAction*)));
+}
+
+void CntFavoritesView::handleMemberSelection(HbAction *action)
+{
+ CntGroupSelectionPopup *groupSelectionPopup = static_cast<CntGroupSelectionPopup*>(sender());
+
+ if (groupSelectionPopup && action == groupSelectionPopup->actions().first())
+ {
+ bool membersSaved = groupSelectionPopup->saveOldGroup();
+
+ if (membersSaved)
+ {
+ CntViewParameters viewParameters;
+ viewParameters.insert(EViewId, FavoritesMemberView);
+ QVariant var;
+ var.setValue(*mContact);
+ viewParameters.insert(ESelectedContact, var);
+ mViewManager->changeView(viewParameters);
+ }
+ else
+ {
+ showPreviousView();
+ }
+ }
+ else if (groupSelectionPopup && action == groupSelectionPopup->actions().at(1))
+ {
+ showPreviousView();
+ }
}
void CntFavoritesView::setOrientation(Qt::Orientation orientation)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntfetchcontactsview.cpp Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,363 @@
+/*
+* 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 <hbmainwindow.h>
+#include <hblistviewitem.h>
+#include <hblistview.h>
+#include <hbsearchpanel.h>
+#include <hbstaticvkbhost.h>
+#include <QGraphicsLinearLayout>
+#include <QContactId.h>
+#include <QDebug>
+#include <mobcntmodel.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);
+ connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(closeFind()));
+ connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this, SLOT(setFilter(QString)));
+
+ mLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+ mContainerWidget = new HbWidget();
+
+ // set up the list with all contacts
+ QList<QContactSortOrder> sortOrders;
+ QContactSortOrder sortOrderFirstName;
+ sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldFirst);
+ sortOrderFirstName.setCaseSensitivity(Qt::CaseInsensitive);
+ sortOrders.append(sortOrderFirstName);
+
+ QContactSortOrder sortOrderLastName;
+ sortOrderLastName.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldLast);
+ sortOrderLastName.setCaseSensitivity(Qt::CaseInsensitive);
+ sortOrders.append(sortOrderLastName);
+
+ QContactDetailFilter contactsFilter;
+ contactsFilter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
+ contactsFilter.setValue(QString(QLatin1String(QContactType::TypeContact)));
+ mCntModel = new MobCntModel(mManager, contactsFilter, sortOrders, false);
+}
+
+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(DisplayType aType, HbAbstractItemView::SelectionMode aMode, QSet<QContactLocalId> aContacts)
+{
+ switch (aType) {
+ case view:
+ {
+ // TODO Currently only services will need a view
+ break;
+ }
+
+ case popup:
+ {
+ doInitialize(aMode,aContacts);
+ markMembersInView();
+ connectSignal();
+ showPopup();
+
+ mLayout->addItem(mSearchPanel);
+ mContainerWidget->setLayout(mLayout);
+ mContainerWidget->setPreferredHeight(mListView->mainWindow()->size().height());
+ mContainerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+QSet<QContactLocalId> CntFetchContacts::getSelectedContacts() const
+{
+ return mCurrentlySelected;
+}
+
+void CntFetchContacts::closeFind()
+{
+ if (mSearchPanel) {
+ QContactDetailFilter filter;
+ filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
+ QString typeContact = QContactType::TypeContact;
+ filter.setValue(typeContact);
+
+ mSearchPanel->deleteLater();
+ }
+}
+
+void CntFetchContacts::setFilter(const QString &filterString)
+{
+ QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts);
+
+ QContactDetailFilter detailfilter;
+ detailfilter.setDetailDefinitionName(QContactDisplayLabel::DefinitionName, QContactDisplayLabel::FieldLabel);
+ detailfilter.setMatchFlags(QContactFilter::MatchStartsWith);
+ detailfilter.setValue(searchList);
+
+ mCntModel->setFilterAndSortOrder(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());
+ }
+}
+
+void CntFetchContacts::handleUserResponse(HbAction* action)
+{
+ HbDialog *popup = static_cast<HbDialog*>(sender());
+
+ bool userCanceled = (action == mSecondaryAction);
+ if (popup && userCanceled) {
+ mCurrentlySelected.clear();
+
+ // Notify that the user canceled.
+ mWasCanceled = true;
+ }
+ else {
+ mWasCanceled = false;
+ }
+
+ 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);
+ }
+ }
+}
+
+void CntFetchContacts::doInitialize(HbAbstractItemView::SelectionMode aMode,
+ QSet<QContactLocalId> aContacts)
+{
+ mSelectionMode = aMode;
+ mCurrentlySelected = aContacts;
+
+ mSearchPanel->setVisible(true);
+
+ mPopup = new HbDialog;
+ mListView = new HbListView(mPopup);
+ mListView->setModel(mCntModel);
+ mListView->setSelectionMode(mSelectionMode);
+ mListView->setFrictionEnabled(true);
+ mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+ mListView->verticalScrollBar()->setInteractive(true);
+
+ HbListViewItem *prototype = mListView->listItemPrototype();
+ prototype->setGraphicsSize(HbListViewItem::Thumbnail);
+ prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
+
+ mIndexFeedback = new HbIndexFeedback(mPopup);
+ mIndexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+ mIndexFeedback->setItemView(mListView);
+
+ // Note that the layout takes ownership of the item(s) it contains.
+ if (!mCntModel->rowCount()) {
+ mListView->setVisible(false);
+ if (!mEmptyListLabel) {
+ mEmptyListLabel = new HbTextItem(hbTrId("(no matching contacts)"));
+ mEmptyListLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ mEmptyListLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary));
+ mEmptyListLabel->setAlignment(Qt::AlignCenter);
+ mLayout->insertItem(0, mEmptyListLabel);
+ }
+ }
+ else {
+ mLayout->addItem(mListView);
+ }
+
+ mCntModel->showMyCard(false);
+}
+
+void CntFetchContacts::connectSignal()
+{
+ connect(mListView, SIGNAL(activated(const QModelIndex&)),
+ this, SLOT(memberSelectionChanged(const QModelIndex&)));
+}
+
+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 = new HbAction(hbTrId(mButtonText.toAscii()));
+ mPopup->addAction(mPrimaryAction);
+ }
+
+ 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("(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
--- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp Fri May 14 15:42:23 2010 +0300
@@ -137,6 +137,7 @@
mListView->itemPrototypes().first()->setDefaultFrame(frame);
mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon);
+ mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
mModel = new QStandardItemModel();
--- a/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupdeletepopup.cpp Fri May 14 15:42:23 2010 +0300
@@ -17,16 +17,10 @@
#include "cntgroupdeletepopup.h"
-#include <hblabel.h>
#include <hbgroupbox.h>
#include <hbaction.h>
-#include <hbsearchpanel.h>
-#include <hbtextitem.h>
+#include <hblistview.h>
#include <qtcontacts.h>
-#include <QStringListModel>
-#include <QGraphicsWidget>
-#include <mobcntmodel.h>
-
CntGroupDeletePopup::CntGroupDeletePopup(QContactManager *manager, QGraphicsItem *parent):
HbDialog(parent),
@@ -45,15 +39,13 @@
void CntGroupDeletePopup::populateListOfGroup()
{
- HbGroupBox *headingLabel = new HbGroupBox();
- HbLabel *label = new HbLabel(hbTrId("txt_phob_opt_delete_groups"));
- headingLabel->setContentWidget(label);
+ HbGroupBox *headingLabel = new HbGroupBox(this);
+ headingLabel->setHeading(hbTrId("txt_phob_opt_delete_groups"));
setHeadingWidget(headingLabel);
mListView = new HbListView(this);
-
mModel->initializeGroupsList();
//Get the index of the contacts
@@ -66,20 +58,22 @@
setContentWidget(mListView);
- setTimeout(0);
+ setTimeout(HbDialog::NoTimeout);
+ setDismissPolicy(HbDialog::NoDismiss);
setModal(true);
+ setAttribute(Qt::WA_DeleteOnClose, true);
- HbAction *mPrimaryAction = new HbAction(hbTrId("Delete selected"));
- setPrimaryAction(mPrimaryAction);
+ HbAction *mPrimaryAction = new HbAction(hbTrId("Delete selected"), this);
+ addAction(mPrimaryAction);
- HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
- setSecondaryAction(mSecondaryAction);
+ HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), this);
+ addAction(mSecondaryAction);
}
-void CntGroupDeletePopup::deleteGroup()
+QList<QContactLocalId> CntGroupDeletePopup::deleteGroup() const
{
QModelIndexList indexes = mListView->selectionModel()->selection().indexes();
- QList<QContactLocalId> selectionList;
+ QList<QContactLocalId> selectionList;
for (int i = 0; i < indexes.count(); i++)
{
QContact contact = mModel->contact(indexes[i]);
@@ -88,5 +82,7 @@
}
QMap<int, QContactManager::Error> errors;
- bool result = mContactManager->removeContacts(selectionList, &errors);
+ mContactManager->removeContacts(selectionList, &errors);
+
+ return selectionList;
}
--- a/phonebookui/pbkcommonui/src/cntgroupdeletepopupmodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupdeletepopupmodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -48,8 +48,17 @@
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<QContactLocalId> groupContactIds = mContactManager->contactIds(groupFilter);
+ QList<QContactSortOrder> groupsOrder;
+ groupsOrder.append(sortOrderGroupName);
+
+ QList<QContactLocalId> groupContactIds = mContactManager->contactIds(groupFilter, groupsOrder);
+
if (!groupContactIds.isEmpty())
{
for(int i = 0;i < groupContactIds.count();i++)
--- a/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupeditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -39,28 +39,33 @@
iGroupName = nameDetails.first();
iGroupConfCallNumber = numberDetails.first();
- HbDataFormModelItem::DataItemType text = HbDataFormModelItem::TextItem;
- HbDataFormModelItem* groupname = new HbDataFormModelItem(text, hbTrId("txt_phob_formlabel_group_name"));
- HbDataFormModelItem* conferenceNumber = new HbDataFormModelItem(text, hbTrId("Conference Call number"));
+ HbDataFormModelItem::DataItemType type = HbDataFormModelItem::TextItem;
+ iNameItem = new HbDataFormModelItem(type, hbTrId("txt_phob_formlabel_group_name"));
+ iNumberItem = new HbDataFormModelItem(type, hbTrId("txt_phob_formlabel_conference_number"));
- groupname->setContentWidgetData("text", iGroupName.customLabel());
- conferenceNumber->setContentWidgetData("text", iGroupConfCallNumber.number());
+ iNameItem->setContentWidgetData("text", iGroupName.customLabel());
+ iNumberItem->setContentWidgetData("text", iGroupConfCallNumber.number() );
HbDataFormModelItem* root = invisibleRootItem();
- appendDataFormItem(groupname, root);
- appendDataFormItem(conferenceNumber, root);
+ appendDataFormItem( iNameItem, root);
+ appendDataFormItem( iNumberItem, root);
}
CntGroupEditorModel::~CntGroupEditorModel()
{
}
+bool CntGroupEditorModel::isConferenceNumber( const QModelIndex& aIndex )
+{
+ return ( itemFromIndex( aIndex ) == iNumberItem );
+}
+
void CntGroupEditorModel::saveContactDetails()
{
HbDataFormModelItem* root = invisibleRootItem();
- iGroupName.setCustomLabel(root->childAt( 0 )->contentWidgetData("text").toString().trimmed());
- iGroupConfCallNumber.setNumber(root->childAt( 1 )->contentWidgetData("text").toString().trimmed());
+ iGroupName.setCustomLabel( iNameItem->contentWidgetData("text").toString().trimmed());
+ iGroupConfCallNumber.setNumber( iNumberItem->contentWidgetData("text").toString().trimmed());
mContact->saveDetail( &iGroupName );
mContact->saveDetail( &iGroupConfCallNumber );
@@ -73,7 +78,7 @@
if(iGroupConfCallNumber.number().isEmpty())
{
- mContact->removeDetail( &iGroupConfCallNumber );
+ mContact->removeDetail( &iGroupConfCallNumber );
}
}
--- a/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupmemberview.cpp Fri May 14 15:42:23 2010 +0300
@@ -16,26 +16,27 @@
*/
#include "cntgroupmemberview.h"
+#include "cntfetchcontactsview.h"
#include "cntcontactcardheadingitem.h"
-#include "cntgroupselectionpopup.h"
#include "qtpbkglobal.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 <mobcntmodel.h>
#include <hbmainwindow.h>
-
-#include <QGraphicsLinearLayout>
-
-#include <hbdocumentloader.h>
#include "cntdocumentloader.h"
const char *CNT_GROUPMEMBERVIEW_XML = ":/xml/contacts_groupmembers.docml";
@@ -60,8 +61,11 @@
mViewManager(NULL),
mHeadingItem(NULL),
mModel(NULL),
+ mImageLabel(NULL),
mListView(NULL),
- mImageLabel(NULL)
+ mFetchView(NULL),
+ mIsPreviousImageEditorView(false),
+ mAvatar(NULL)
{
mDocument = new CntDocumentLoader;
@@ -88,6 +92,7 @@
SLOT(showContactView(const QModelIndex&)));
mHeadingItem = static_cast<CntContactCardHeadingItem*>( mDocument->findWidget("editViewHeading") );
+ connect(mHeadingItem, SIGNAL(passLongPressed(const QPointF&)), this, SLOT(drawImageMenu(const QPointF&)));
// menu actions
mEditGroupAction = static_cast<HbAction*>( mDocument->findObject("cnt:editgroupdetails"));
@@ -105,7 +110,7 @@
mThumbnailManager = new ThumbnailManager(this);
mThumbnailManager->setMode(ThumbnailManager::Default);
mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality);
- mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailMedium);
+ mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge);
connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)),
this, SLOT(thumbnailReady(QPixmap, void*, int, int)));
@@ -123,6 +128,12 @@
delete mModel;
mModel = 0;
+
+ delete mFetchView;
+ mFetchView = 0;
+
+ delete mAvatar;
+ mAvatar = NULL;
}
void CntGroupMemberView::setOrientation(Qt::Orientation orientation)
@@ -151,6 +162,11 @@
QVariant contact = aArgs.value( ESelectedContact );
mGroupContact = new QContact( contact.value<QContact>() );
+ if (aArgs.value(ECustomParam).toInt() == imageEditorView)
+ {
+ mIsPreviousImageEditorView = true;
+ }
+
HbMainWindow* window = mView->mainWindow();
if ( window )
{
@@ -166,16 +182,21 @@
{
if (details.at(i).imageUrl().isValid())
{
- mThumbnailManager->getThumbnail(details.at(i).imageUrl().toString());
+ mAvatar = new QContactAvatar(details.at(i));
+ mThumbnailManager->getThumbnail(mAvatar->imageUrl().toString());
break;
}
}
// create list & model
mListView->setFrictionEnabled(true);
- mListView->setScrollingStyle(HbScrollArea::PanOrFlick);
+ 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");
@@ -201,14 +222,17 @@
sortOrders.append(sortOrderFirstName);
sortOrders.append(sortOrderLastName);
- mModel = new MobCntModel(mViewManager->contactManager(SYMBIAN_BACKEND), rFilter, sortOrders, false);
+ mModel = new MobCntModel(getContactManager(), rFilter, sortOrders, false);
mListView->setModel(mModel);
if (aArgs.value(ESelectedAction).toString() == "save")
{
- QString name = mViewManager->contactManager(SYMBIAN_BACKEND)->synthesizedDisplayLabel(*mGroupContact);
+ QString name = getContactManager()->synthesizedDisplayLabel(*mGroupContact);
HbNotificationDialog::launchDialog(hbTrId("Group \"%1\" saved").arg(name));
}
+
+ mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND ));
+ connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleManageMembers()));
}
void CntGroupMemberView::deactivate()
@@ -218,6 +242,15 @@
void CntGroupMemberView::showPreviousView()
{
+ //save an avatar
+ if (mIsPreviousImageEditorView)
+ {
+ if (!mAvatar->imageUrl().isEmpty())
+ {
+ mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact);
+ }
+ }
+
CntViewParameters viewParameters;
mViewManager->back(viewParameters);
}
@@ -234,19 +267,68 @@
void CntGroupMemberView::manageMembers()
{
- // save the group here
- CntGroupSelectionPopup *groupSelectionPopup =
- new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), mGroupContact);
- mListView->setModel(0);
- groupSelectionPopup->populateListOfContact();
+ QContactRelationshipFilter membersFilter;
+ membersFilter.setRelationshipType(QContactRelationship::HasMember);
+ membersFilter.setRelatedContactRole(QContactRelationshipFilter::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 ));
+ mFetchView->setDetails(HbParameterLengthLimiter(hbTrId("txt_phob_subtitle_1_group")).arg(groupName),
+ hbTrId("Save"));
+ mFetchView->displayContacts(CntFetchContacts::popup,
+ HbAbstractItemView::MultiSelection,
+ contactsSet);
+}
+
+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;
- HbAction* action = groupSelectionPopup->exec();
- if (action == groupSelectionPopup->primaryAction())
- {
- groupSelectionPopup->saveOldGroup();
+ // TODO Notice the duplication with these loops. Refactor to use one only
+ foreach (QContactLocalId id, removedMembers) {
+ QContact contact = getContactManager()->contact(id);
+
+ // new contact added to the group
+ QContactRelationship membership;
+ membership.setRelationshipType(QContactRelationship::HasMember);
+ membership.setFirst(mGroupContact->id());
+ membership.setSecond(contact.id());
+ removedMemberships.append(membership);
}
- delete groupSelectionPopup;
- mListView->setModel(mModel);
+
+ QSet<QContactLocalId> addedMembers = selectedContacts - mOriginalGroupMembers.toSet();
+ foreach (QContactLocalId id, addedMembers) {
+ QContact contact = getContactManager()->contact(id);
+
+ // new contact added to the group
+ QContactRelationship membership;
+ membership.setRelationshipType(QContactRelationship::HasMember);
+ membership.setFirst(mGroupContact->id());
+ membership.setSecond(contact.id());
+ addedMemberships.append(membership);
+ }
+
+ if (!addedMemberships.isEmpty()) {
+ getContactManager()->saveRelationships(&addedMemberships);
+ }
+
+ if (!removedMemberships.isEmpty()) {
+ getContactManager()->removeRelationships(removedMemberships);
+ }
}
void CntGroupMemberView::editGroup()
@@ -261,36 +343,23 @@
void CntGroupMemberView::deleteGroup()
{
- // the delete command
- HbDialog popup;
-
- // disable dismissing & timout
- popup.setDismissPolicy(HbDialog::NoDismiss);
- popup.setTimeout(HbDialog::NoTimeout);
-
- QString groupName = mGroupContact->displayLabel();
- HbLabel *headingLabel = new HbLabel(hbTrId("Delete %1 group?").arg(groupName), &popup);
- headingLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary));
- popup.setHeadingWidget(headingLabel);
+ 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_phob_button_delete"), hbTrId("txt_common_button_cancel"), headingLabel);
+}
- // Set a label widget as content widget in the dialog
- HbLabel *label = new HbLabel(&popup);
- label->setPlainText("Only group will be removed, contacts can be found from All contacts list");
- label->setTextWrapping(Hb::TextWordWrap);
- label->setElideMode(Qt::ElideNone);
- label->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
- popup.setContentWidget(label);
-
- // Sets the primary action and secondary action
- popup.setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"),&popup));
- popup.setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"),&popup));
-
- HbAction* action = popup.exec();
- if (action == popup.primaryAction())
- {
- mViewManager->contactManager(SYMBIAN_BACKEND)->removeContact(mGroupContact->localId());
- showPreviousView();
- }
+void CntGroupMemberView::handleDeleteGroup(HbAction *action)
+{
+ HbDialog *popup = static_cast<HbDialog*>(sender());
+
+ if (popup && action == popup->actions().first())
+ {
+ getContactManager()->removeContact(mGroupContact->localId());
+ showPreviousView();
+ }
}
/*!
@@ -298,9 +367,14 @@
*/
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;
@@ -309,27 +383,36 @@
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 );
- HbAction *selectedAction = menu->exec(aCoords);
+ menu->open(this, SLOT(handleMenu(HbAction*)));
+}
- if (selectedAction)
- {
- if (selectedAction == removeFromGroupAction)
+void CntGroupMemberView::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() )
{
- removeFromGroup(index);
+ showContactView(index);
}
- else if (selectedAction == editContactAction)
- {
- editContact(index);
- }
- else if (selectedAction == openContactAction)
+ else if (action == menuItem->actions().at(1))
{
- showContactView(index);
+ editContact(index);
}
- }
- menu->deleteLater();
+ else if (action == menuItem->actions().at(2))
+ {
+ removeFromGroup(index);
+ }
}
+
/*!
Called after user clicked on the listview.
*/
@@ -356,7 +439,7 @@
relationship.setRelationshipType(QContactRelationship::HasMember);
relationship.setFirst(mGroupContact->id());
relationship.setSecond(selectedContact.id());
- mViewManager->contactManager(SYMBIAN_BACKEND)->removeRelationship(relationship);
+ getContactManager()->removeRelationship(relationship);
}
void CntGroupMemberView::editContact(const QModelIndex &index)
@@ -397,6 +480,66 @@
mViewManager->changeView( viewParameters );
}
+QContactManager* CntGroupMemberView::getContactManager()
+{
+ if (!mViewManager) return NULL;
+
+ return mViewManager->contactManager(SYMBIAN_BACKEND);
+}
+
+/*!
+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"));
+ HbAction *removeAction = menu->addAction(hbTrId("txt_phob_menu_remove_image"));
+ menu->setPreferredPos(aCoords);
+ menu->open(this, SLOT(handleImageMenu(HbAction*)));
+}
+
+void CntGroupMemberView::handleImageMenu(HbAction* action)
+{
+ HbMenu *menuItem = static_cast<HbMenu*>(sender());
+ if ( action == menuItem->actions().first() ) {
+ changeImage();
+ }
+ else if (action == menuItem->actions().at(1)) {
+ removeImage();
+ }
+}
+
+void CntGroupMemberView::changeImage()
+{
+ CntViewParameters viewParameters;
+ viewParameters.insert(EViewId, imageEditorView);
+ QVariant var;
+ var.setValue(*mGroupContact);
+ viewParameters.insert(ESelectedContact, var);
+ mViewManager->changeView(viewParameters);
+}
+
+void CntGroupMemberView::removeImage()
+{
+if (mAvatar)
+ {
+ if (!mAvatar->imageUrl().isEmpty())
+ {
+ mGroupContact->removeDetail(mAvatar);
+ // Check if image removable.
+ CntImageUtility imageUtility;
+ if(imageUtility.isImageRemovable(mAvatar->imageUrl().toString()))
+ {
+ imageUtility.removeImage(mAvatar->imageUrl().toString());
+ }
+ mViewManager->contactManager( SYMBIAN_BACKEND )->saveContact(mGroupContact);
+ mHeadingItem->setIcon(HbIcon("qtg_large_avatar"));
+
+ }
+ }
+}
+
// end of file
--- a/phonebookui/pbkcommonui/src/cntgroupselectionpopup.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupselectionpopup.cpp Fri May 14 15:42:23 2010 +0300
@@ -17,17 +17,18 @@
#include "cntgroupselectionpopup.h"
-#include <hblabel.h>
#include <hbgroupbox.h>
#include <hbaction.h>
#include <hbsearchpanel.h>
#include <hblistviewitem.h>
+#include <hbindexfeedback.h>
+#include <hbscrollbar.h>
#include <hbtextitem.h>
#include <qtcontacts.h>
-#include <QStringListModel>
#include <QGraphicsWidget>
#include <mobcntmodel.h>
#include <hbmainwindow.h>
+#include <hbparameterlengthlimiter.h>
CntGroupSelectionPopup::CntGroupSelectionPopup(QContactManager *manager, QContact *contact, QGraphicsItem *parent):
@@ -36,7 +37,7 @@
mEmptyListLabel(NULL),
mContactManager(manager),
mContact(contact)
-{
+{
QList<QContactSortOrder> sortOrders;
QContactSortOrder sortOrderFirstName;
sortOrderFirstName.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldFirst);
@@ -76,7 +77,7 @@
QString groupName(groupContactName.value( QContactName::FieldCustomLabel ));
HbGroupBox *headingLabel = new HbGroupBox(this);
- headingLabel->setHeading(hbTrId("txt_phob_title_members_of_1_group").arg(groupName));
+ headingLabel->setHeading(HbParameterLengthLimiter(hbTrId("txt_phob_title_members_of_1_group")).arg(groupName));
setHeadingWidget(headingLabel);
@@ -101,9 +102,13 @@
// set the listview to multiSelection mode, this will bring MarkAll functionality (from Orbit)
mListView->setSelectionMode(HbAbstractItemView::MultiSelection);
mListView->setFrictionEnabled(true);
- mListView->setScrollingStyle(HbScrollArea::PanOrFlick);
+ mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+ mListView->verticalScrollBar()->setInteractive(true);
HbListViewItem *prototype = mListView->listItemPrototype();
prototype->setGraphicsSize(HbListViewItem::Thumbnail);
+ HbIndexFeedback *indexFeedback = new HbIndexFeedback(this);
+ indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
+ indexFeedback->setItemView(mListView);
for (int i=0; i < countContacts; i++ )
{
@@ -116,6 +121,7 @@
setTimeout(HbPopup::NoTimeout);
setDismissPolicy(HbPopup::NoDismiss);
setModal(true);
+ setAttribute(Qt::WA_DeleteOnClose, true);
// Note that the layout takes ownership of the item(s) it contains.
if (!mCntModel->rowCount())
@@ -136,19 +142,23 @@
}
mContainerLayout->addItem(mSearchPanel);
mContainerWidget->setLayout(mContainerLayout);
- mContainerWidget->setPreferredHeight(mainWindow()->size().height());
+ HbMainWindow* window = mainWindow();
+ if ( window )
+ {
+ mContainerWidget->setPreferredHeight(window->size().height());
+ }
mContainerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setContentWidget(mContainerWidget);
- HbAction *mPrimaryAction = new HbAction(hbTrId("Save"));
- setPrimaryAction(mPrimaryAction);
+ HbAction *mPrimaryAction = new HbAction(hbTrId("Save"), this);
+ addAction(mPrimaryAction);
- HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
- setSecondaryAction(mSecondaryAction);
+ HbAction *mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), this);
+ addAction(mSecondaryAction);
}
-void CntGroupSelectionPopup::saveNewGroup()
+bool CntGroupSelectionPopup::saveNewGroup()
{
// Save the relationship from the selection model of the member selection list
QModelIndexList indexes = mListView->selectionModel()->selection().indexes();
@@ -167,9 +177,11 @@
// save relationship
mContactManager->saveRelationship(&relationship);
}
+
+ return indexes.count() > 0;
}
-void CntGroupSelectionPopup::saveOldGroup()
+bool CntGroupSelectionPopup::saveOldGroup()
{
// Use relationship filter to get list of contacts in the relationship (if any)
QContactRelationshipFilter rFilter;
@@ -228,6 +240,8 @@
QMap<int, QContactManager::Error> errors;
mContactManager->removeRelationships(removedRelationships, &errors);
mContactManager->saveRelationships(&addedRelationships, &errors);
+
+ return (removedRelationships.count() > 0 || addedRelationships.count() > 0);
}
void CntGroupSelectionPopup::closeFind()
--- a/phonebookui/pbkcommonui/src/cnthistoryview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnthistoryview.cpp Fri May 14 15:42:23 2010 +0300
@@ -26,6 +26,9 @@
#include <hbaction.h>
#include <xqservicerequest.h>
#include <cnthistorymodel.h>
+#include <hbparameterlengthlimiter.h>
+#include <hbmainwindow.h>
+#include <hbframebackground.h>
#include "cnthistoryviewitem.h"
#include "qtpbkglobal.h"
@@ -102,9 +105,11 @@
//construct listview
mHistoryListView = static_cast<HbListView*>(docLoader()->findWidget(QString("listView")));
+ mHistoryListView->setLayoutName("history");
CntHistoryViewItem *item = new CntHistoryViewItem;
+ item->setSecondaryTextRowCount(1, 3);
+ item->setGraphicsSize(HbListViewItem::SmallIcon);
mHistoryListView->setItemPrototype(item); //ownership is taken
- mHistoryListView->setUniformItemSizes(true);
// Connect listview items to respective slots
connect(mHistoryListView, SIGNAL(activated(const QModelIndex &)),
@@ -116,14 +121,23 @@
//start listening to the events amount changing in the model
connect(mHistoryModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
this, SLOT(updateScrollingPosition()));
+ connect(mHistoryModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
+ this, SLOT(showClearHistoryMenu()));
connect(mHistoryModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
this, SLOT(updateScrollingPosition()));
+ connect(mHistoryModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),
+ this, SLOT(showClearHistoryMenu()));
connect(mHistoryModel, SIGNAL(layoutChanged()),
this, SLOT(updateScrollingPosition()));
// Connect the menu options to respective slots
- HbAction* clearHistory = static_cast<HbAction*>(docLoader()->findObject("cnt:clearhistory"));
- connect(clearHistory, SIGNAL(triggered()), this, SLOT(clearHistory()));
+ mClearHistory = static_cast<HbAction*>(docLoader()->findObject("cnt:clearhistory"));
+ connect(mClearHistory, SIGNAL(triggered()), this, SLOT(clearHistory()));
+ showClearHistoryMenu();
+
+ HbMainWindow* mainWindow = mView->mainWindow();
+ connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)),
+ this, SLOT(updateScrollingPosition()));
}
/*!
@@ -139,23 +153,28 @@
}
/*
-Clear communications history
+Query the user for clearing communications history
*/
void CntHistoryView::clearHistory()
{
// Ask the use if they want to clear the history
- HbMessageBox *note = new HbMessageBox(hbTrId("txt_phob_info_clear_communications_history_with_1"),
- HbMessageBox::MessageTypeQuestion);
+ QString name = mContact->displayLabel();
- note->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
- HbAction *selected = note->exec();
- if (selected == note->primaryAction())
+ HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_clear_communications_history_with_1")).arg(name), this,
+ SLOT(handleClearHistory(HbAction*)), hbTrId("txt_phob_button_delete"), hbTrId("txt_common_button_cancel"));
+}
+
+/*
+Handle the selected action for clearing history
+*/
+void CntHistoryView::handleClearHistory(HbAction *action)
+{
+ HbMessageBox *note = static_cast<HbMessageBox*>(sender());
+
+ if (note && action == note->actions().first())
{
- // Clear comm history
mHistoryModel->clearHistory();
}
- delete note;
}
/*!
@@ -164,13 +183,10 @@
*/
void CntHistoryView::itemActivated(const QModelIndex &index)
{
- QVariant itemType = index.data(CntHistoryModel::ItemTypeRole);
-
- if (!itemType.isValid())
- return;
+ int flags = index.data(CntHistoryModel::FlagsRole).toInt();
// If the list item is a call log a call is made to that item
- if (itemType.toInt() == CntHistoryModel::CallLog) {
+ if (flags & CntHistoryModel::CallLog) {
// Make a call
QVariant v = index.data(CntHistoryModel::PhoneNumberRole);
if (!v.isValid())
@@ -182,6 +198,18 @@
snd << v.toString();
snd.send();
}
+ else if (flags & CntHistoryModel::Message) {
+ // Open conversation view
+ QVariant v = index.data(CntHistoryModel::PhoneNumberRole);
+ if (!v.isValid())
+ return;
+
+ QString service("com.nokia.services.hbserviceprovider.conversationview");
+ QString type("send(QString,qint32,QString)");
+ XQServiceRequest snd(service, type, false);
+ snd << v.toString() << mContact->localId() << mContact->displayLabel();
+ snd.send();
+ }
}
/*!
@@ -197,6 +225,18 @@
}
/*!
+Show or hide the clear history menu
+*/
+void CntHistoryView::showClearHistoryMenu()
+{
+ if (mHistoryModel->rowCount() > 0) {
+ mClearHistory->setEnabled(true);
+ } else {
+ mClearHistory->setEnabled(false);
+ }
+}
+
+/*!
* Document loader
*/
HbDocumentLoader* CntHistoryView::docLoader()
--- a/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -18,14 +18,20 @@
#include "cnthistoryviewitem.h"
#include <cnthistorymodel.h>
+#include <hbframedrawer.h>
+#include <hbframeitem.h>
+
+#define NEW_EVENT_FRAME "qtg_fr_list_new_item"
//---------------------------------------------------------------
// HbListViewItem::HbListViewItem
// Constructor
//---------------------------------------------------------------
CntHistoryViewItem::CntHistoryViewItem(QGraphicsItem* parent)
-: HbAbstractViewItem(parent),
-itemWidget(NULL)
+: HbListViewItem(parent),
+ mIncoming(false),
+ mNewMessage(false),
+ mNewItem(NULL)
{
}
@@ -35,15 +41,7 @@
//---------------------------------------------------------------
HbAbstractViewItem* CntHistoryViewItem::createItem()
{
- return new CntHistoryViewItem(*this);
-}
-
-//---------------------------------------------------------------
-// HbListViewItem::polish
-//
-//---------------------------------------------------------------
-void CntHistoryViewItem::polish(HbStyleParameters& /*params*/)
-{
+ return new CntHistoryViewItem(*this);
}
//---------------------------------------------------------------
@@ -52,55 +50,27 @@
//---------------------------------------------------------------
void CntHistoryViewItem::updateChildItems()
{
- QStringList data = modelIndex().data(Qt::DisplayRole).toStringList();
- QString iconName = modelIndex().data(Qt::DecorationRole).toString();
- bool incoming = false;
- bool newMessage = false;
- bool status = false;
- if (modelIndex().data(CntHistoryModel::DirectionRole).toInt(&status) == CntHistoryModel::Incoming) {
- incoming = true;
- }
- // This indication applies to smses only
- if (modelIndex().data(CntHistoryModel::ItemTypeRole).toInt(&status) == CntHistoryModel::Message &&
- modelIndex().data(CntHistoryModel::SeenStatusRole).toInt(&status) == CntHistoryModel::Unseen) {
- newMessage = true;
- }
-
- QGraphicsLinearLayout* currentLayout = static_cast<QGraphicsLinearLayout*>(layout());
-
- if (currentLayout == NULL) {
+ int flags = modelIndex().data(CntHistoryModel::FlagsRole).toInt();
+ mIncoming = flags & CntHistoryModel::Incoming ? true : false;
+ mNewMessage = flags & CntHistoryModel::Unseen ? true : false;
- currentLayout = new QGraphicsLinearLayout(this);
- currentLayout->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- currentLayout->setOrientation(Qt::Horizontal);
- currentLayout->setContentsMargins(0,0,0,0);
-
- //Create item widget
- itemWidget = new CntHistoryViewItemWidget(this);
- currentLayout->addItem(itemWidget);
-
- //Update item widget contents
- itemWidget->setDetails(data.at(0), data.at(1), data.at(2), iconName, incoming, newMessage);
-
- setLayout(currentLayout);
-
- } else {
- // Find the itemWidget item from the layout and remove it
- int i = 0;
- while( itemWidget != static_cast<CntHistoryViewItemWidget*>(currentLayout->itemAt(i)) ) {
- i++;
+ if (mNewMessage)
+ {
+ if (!mNewItem)
+ {
+ mNewItem = new HbFrameItem(NEW_EVENT_FRAME, HbFrameDrawer::ThreePiecesVertical, this);
+ style()->setItemName(mNewItem, "newitem");
}
- currentLayout->removeAt(i);
- delete itemWidget;
-
- //Create new item widget
- itemWidget = new CntHistoryViewItemWidget(this);
- currentLayout->addItem(itemWidget);
-
- //Update item widget contents
- itemWidget->setDetails(data.at(0), data.at(1), data.at(2), iconName, incoming, newMessage);
-
- updateGeometry();
}
+ else
+ {
+ if (mNewItem)
+ {
+ delete mNewItem;
+ mNewItem = NULL;
+ }
+ }
+
+ HbListViewItem::updateChildItems();
}
// EOF
--- a/phonebookui/pbkcommonui/src/cnthistoryviewitemwidget.cpp Mon May 03 12:24:20 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +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 "cnthistoryviewitemwidget.h"
-
-#include <hbiconitem.h>
-#include <hbtextitem.h>
-#include <hbframedrawer.h>
-#include <hbframeitem.h>
-
-#define INCOMING_EVENT_FRAME "qtg_fr_convlist_received_normal"
-#define OUTGOING_EVENT_FRAME "qtg_fr_convlist_sent_normal"
-#define NEW_EVENT_FRAME "qtg_fr_list_new_item"
-
-CntHistoryViewItemWidget::CntHistoryViewItemWidget(QGraphicsItem *parent) :
- HbWidget(parent),
- mIconLabel(NULL),
- mTitleLabel(NULL),
- mBodyTextLabel(NULL),
- mTimeStampLabel(NULL),
- mFrameLabel(NULL),
- mNewItemLabel(NULL),
- mIncoming(false),
- mNewMessage(false)
-{
-}
-
-CntHistoryViewItemWidget::~CntHistoryViewItemWidget()
-{
-}
-
-void CntHistoryViewItemWidget::createPrimitives()
-{
- //create frame first so it's painted below text labels
- if (!mFrameLabel) {
- HbFrameDrawer* frameDrawer = NULL;
- if (mIncoming) {
- frameDrawer = new HbFrameDrawer(INCOMING_EVENT_FRAME, HbFrameDrawer::NinePieces);
- } else {
- frameDrawer = new HbFrameDrawer(OUTGOING_EVENT_FRAME, HbFrameDrawer::NinePieces);
- }
- mFrameLabel = new HbFrameItem(frameDrawer, this);
- style()->setItemName(mFrameLabel, "frame");
- }
-
- if (mNewMessage && !mNewItemLabel) {
- HbFrameDrawer* frameDrawer = new HbFrameDrawer(NEW_EVENT_FRAME, HbFrameDrawer::ThreePiecesVertical);
- mNewItemLabel = new HbFrameItem(frameDrawer, this);
- style()->setItemName(mNewItemLabel, "newItem");
- }
-
- //create icon
- if (!mIcon.isNull()) {
- if (!mIconLabel) {
- mIconLabel = new HbIconItem(this);
- mIconLabel->setIcon(mIcon);
- style()->setItemName(mIconLabel, "icon");
- }
- } else {
- if (mIconLabel) {
- delete mIconLabel;
- }
- mIconLabel = NULL;
- }
-
- //create title
- if (!mTitle.isNull()) {
- if (!mTitleLabel) {
- mTitleLabel = new HbTextItem(this);
- mTitleLabel->setText(mTitle);
- mTitleLabel->setTextWrapping(Hb::TextWordWrap);
- style()->setItemName(mTitleLabel, "title");
- }
- } else {
- if (mTitleLabel) {
- delete mTitleLabel;
- }
- mTitleLabel = NULL;
- }
-
- //create body text
- if (!mBodyText.isNull()) {
- if (!mBodyTextLabel) {
- mBodyTextLabel = new HbTextItem(this);
- mBodyTextLabel->setText(mBodyText);
- style()->setItemName(mBodyTextLabel, "bodyText");
- }
- } else {
- if (mBodyTextLabel) {
- delete mBodyTextLabel;
- }
- mBodyTextLabel = NULL;
- }
-
- //create timestamp
- if (!mTimeStamp.isNull()) {
- if (!mTimeStampLabel) {
- mTimeStampLabel = new HbTextItem(this);
- mTimeStampLabel->setText(mTimeStamp);
- style()->setItemName(mTimeStampLabel, "timeStamp");
- }
- } else {
- if (mTimeStampLabel) {
- delete mTimeStampLabel;
- }
- mTimeStampLabel = NULL;
- }
-}
-
-void CntHistoryViewItemWidget::recreatePrimitives()
-{
- HbWidget::recreatePrimitives();
-
- delete mIconLabel;
- mIconLabel = NULL;
-
- delete mTitleLabel;
- mTitleLabel = NULL;
-
- delete mBodyTextLabel;
- mBodyTextLabel = NULL;
-
- delete mTimeStampLabel;
- mTimeStampLabel = NULL;
-
- createPrimitives();
-}
-
-
-void CntHistoryViewItemWidget::updatePrimitives()
-{
- HbWidget::updatePrimitives();
-}
-
-void CntHistoryViewItemWidget::setDetails(QString title, QString bodyText,
- QString timeStamp, QString iconName, bool incoming, bool newMessage)
-{
- mIcon.clear();
- mTitle.clear();
- mBodyText.clear();
- mTimeStamp.clear();
-
- mIcon.setIconName(iconName);
- mTitle = title;
- mBodyText = bodyText;
- mTimeStamp = timeStamp;
- mIncoming = incoming;
- mNewMessage = newMessage;
-
- recreatePrimitives();
-}
--- a/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntimageeditorview.cpp Fri May 14 15:42:23 2010 +0300
@@ -102,16 +102,21 @@
*/
void CntImageEditorView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs )
{
+ mViewManager = aMgr;
+ mArgs = aArgs;
+
if (mView->navigationAction() != mSoftkey)
mView->setNavigationAction(mSoftkey);
HbMainWindow* window = mView->mainWindow();
+ if ( window )
+ {
connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
- setOrientation(window->orientation());
+ setOrientation(window->orientation());
+ }
- mContact = new QContact(aArgs.value(ESelectedContact).value<QContact>());
- mViewManager = aMgr;
-
+ mContact = new QContact(mArgs.value(ESelectedContact).value<QContact>());
+
// set the correct image if the contact already has an image set
mImageLabel = static_cast<HbLabel*>(mDocumentLoader.findWidget(QString("cnt_image_label")));
QList<QContactAvatar> details = mContact->details<QContactAvatar>();
@@ -209,20 +214,26 @@
mContact->removeDetail(mAvatar);
}
- CntViewParameters args;
QVariant var;
var.setValue(*mContact);
- args.insert(ESelectedContact, var);
- mViewManager->back( args );
+
+ mArgs.insert(ESelectedContact, var);
+ mArgs.insert(ECustomParam, viewId());
+ mViewManager->back( mArgs );
}
void CntImageEditorView::removeImage()
{
- int err;
- CntImageUtility imageUtility;
- if(!mAvatar->imageUrl().isEmpty()
- && imageUtility.removeImage(mAvatar->imageUrl().toString(),err))
+ QString filePath=mAvatar->imageUrl().toString();
+ if(!filePath.isEmpty())
{
+ // Check if image removable.
+ CntImageUtility imageUtility;
+ if(imageUtility.isImageRemovable(filePath))
+ {
+ imageUtility.removeImage(filePath);
+ }
+
mAvatar->setImageUrl(QUrl());
mImageLabel->clear();
mImageLabel->setIcon(HbIcon("qtg_large_avatar"));
@@ -238,17 +249,30 @@
if(value.canConvert<QString>())
{
CntImageUtility imageUtility;
- int err;
- QString imagepath;
-
- if(imageUtility.createImage(value.toString(),imagepath,err))
+ if(imageUtility.isMassStorageAvailable())
{
- // If image exists, delete
- if(!mAvatar->imageUrl().isEmpty())
- imageUtility.removeImage(mAvatar->imageUrl().toString(),err);
+ /* Copy image and create thumbnail
+ * When contact image removed only copy is deleted
+ */
+ QString imagepath;
+ if(imageUtility.createImage(value.toString(),imagepath))
+ {
+ // If image already assigned, delete
+ QString filePath=mAvatar->imageUrl().toString();
+ if(!filePath.isEmpty()
+ && imageUtility.isImageRemovable(filePath))
+ imageUtility.removeImage(filePath);
- mAvatar->setImageUrl(QUrl(imagepath));
- mThumbnailManager->getThumbnail(imagepath);
+ mAvatar->setImageUrl(QUrl(imagepath));
+ mThumbnailManager->getThumbnail(imagepath);
+ mRemoveImage->setEnabled(true);
+ }
+ }
+ else
+ {
+ // No mass memory, use the orginal image
+ mAvatar->setImageUrl(QUrl(value.toString()));
+ mThumbnailManager->getThumbnail(value.toString());
mRemoveImage->setEnabled(true);
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookui/pbkcommonui/src/cntimportsview.cpp Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,632 @@
+/*
+* 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 "cntimportsview.h"
+#include "qtpbkglobal.h"
+#include <hbpushbutton.h>
+#include <hbaction.h>
+#include <hbview.h>
+#include <hbmenu.h>
+#include <hbframebackground.h>
+#include <QStandardItemModel>
+#include <hbmainwindow.h>
+#include <hblabel.h>
+#include <hblistview.h>
+#include <hbgroupbox.h>
+#include <QTimer.h>
+#include <hbnotificationdialog.h>
+#include <hbmessagebox.h>
+#include <hbprogressbar.h>
+#include <QGraphicsLinearLayout>
+#include <hbframebackground.h>
+#include <hbabstractviewitem.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
+
+CntImportsView::CntImportsView() : mContactSimManagerADN(0),
+ mContactSimManagerSDN(0),
+ mFetchRequestADN(0),
+ mFetchRequestSDN(0),
+ mListView(0),
+ mSimUtility(0),
+ mAdnEntriesPresent(0),
+ mImportSimPopup(0),
+ mSaveCount(0),
+ mFetchIsDone(0),
+ mTimerId(0),
+ mAdnStorePresent(0),
+ mSdnStorePresent(0),
+ mSimPresent(0),
+ mAdnStoreEntries(0),
+ mSimError(0),
+ mWaitingForAdnCache(0)
+{
+ bool ok = false;
+ mDocumentLoader.load(CNT_IMPORT_UI_XML, &ok);
+
+ if (ok)
+ {
+ mView = static_cast<HbView*>(mDocumentLoader.findWidget(QString("view")));
+ }
+ else
+ {
+ qFatal("Unable to read :/xml/contacts_sim.docml");
+ }
+
+ //back button
+ mSoftkey = new HbAction(Hb::BackNaviAction, mView);
+ connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView()));
+
+}
+
+void CntImportsView::deactivate()
+{
+}
+
+
+CntImportsView::~CntImportsView()
+{
+ mView->deleteLater();
+ delete mFetchRequestADN;
+ delete mFetchRequestSDN;
+ delete mModel;
+ delete mSimUtility;
+}
+
+/*!
+Activates a previous view
+*/
+void CntImportsView::showPreviousView()
+{
+ CntViewParameters args;
+ mViewManager->back(args);
+}
+
+/*
+Activates a default view
+*/
+void CntImportsView::activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs)
+{
+ Q_UNUSED(aArgs);
+ //back button
+ HbMainWindow* window = mView->mainWindow();
+ if (mView->navigationAction() != mSoftkey)
+ {
+ mView->setNavigationAction(mSoftkey);
+ }
+
+ mViewManager = aMgr;
+ mContactSymbianManager = mViewManager->contactManager(SYMBIAN_BACKEND);
+
+ // Sim Utility info fetch
+ int getSimInfoError(0);
+ int storesError(0);
+
+ int error = -1;
+ mSimUtility = new SimUtility(SimUtility::AdnStore, error);
+ if (error != 0)
+ {
+ delete mSimUtility;
+ mSimUtility = 0;
+ mSimError = true;
+ }
+ else
+ {
+ // check what stores are there
+ SimUtility::AvailableStores stores = mSimUtility->getAvailableStores(storesError);
+ if(!storesError)
+ {
+ mSimPresent = stores.SimPresent;
+ mAdnStorePresent = stores.AdnStorePresent;
+ mSdnStorePresent = stores.SdnStorePresent;
+ }
+
+ //check there are ADN contacts
+ if (mAdnStorePresent)
+ {
+ SimUtility::SimInfo simInfo = mSimUtility->getSimInfo(getSimInfoError);
+ if (!getSimInfoError)
+ {
+ // sim entries are present
+ mAdnStoreEntries = simInfo.usedEntries;
+ if (mAdnStoreEntries > 0)
+ {
+ mAdnEntriesPresent = true;
+ }
+ }
+ else
+ {
+ if (getSimInfoError == KErrNotReady)
+ {
+ //ADN store is not accessible, e.g. because of active FDN
+ //Or ADN cache is not ready yet, so wait for this
+ mAdnStorePresent = true;
+ mAdnEntriesPresent = true;
+ mWaitingForAdnCache = true;
+ connect(mSimUtility, SIGNAL(adnCacheStatusReady(SimUtility::CacheStatus&, int)), this, SLOT(adnCacheStatusReady(SimUtility::CacheStatus&, int)));
+ if (!mSimUtility->notifyAdnCacheStatus()) {
+ mAdnStorePresent = false;
+ mAdnEntriesPresent = false;
+ mWaitingForAdnCache = false;
+ }
+ }
+ else
+ {
+ simInfoErrorMessage(getSimInfoError);
+ }
+ }
+ }
+ }
+
+ mListView = static_cast<HbListView*>(mDocumentLoader.findWidget(QString("listView")));
+
+ HbFrameBackground frame;
+ frame.setFrameGraphicsName("qtg_fr_list_normal");
+ frame.setFrameType(HbFrameDrawer::NinePieces);
+ mListView->itemPrototypes().first()->setDefaultFrame(frame);
+
+ mListView->setUniformItemSizes(true);
+
+ connect(mListView, SIGNAL(activated (const QModelIndex&)),
+ this, SLOT(onListViewActivated(const QModelIndex&)));
+
+ mModel = new QStandardItemModel();
+
+ QStandardItem *importSimItem = new QStandardItem();
+ QStringList simList;
+
+ QString simImport(hbTrId("txt_phob_dblist_import_from_sim"));
+ QString simNoContacts(hbTrId("txt_phob_dblist_import_from_1_val_no_sim_contacts"));
+ QString simNoCard(hbTrId("txt_phob_dblist_import_from_ovi_val_no_sim_card"));
+
+ // check if SIM card is there
+ if (mSimError)
+ {
+ simList << simImport;
+ importSimItem->setEnabled(false);
+ }
+ else if (!(mAdnStorePresent || mSdnStorePresent))
+ {
+ // Both stores are not present
+ // disable the QStandardItem
+ if (!mSimPresent)
+ {
+ simList << simImport << simNoCard;
+ }
+ else
+ {
+ simList << simImport << simNoContacts;
+ }
+ importSimItem->setEnabled(false);
+ }
+ else if (!(mAdnEntriesPresent || mSdnStorePresent))
+ {
+ // Sim card is present
+ // No ADN entries are there
+ // no SDN entries are there
+ simList << simImport << simNoContacts;
+ importSimItem->setEnabled(false);
+ }
+ else
+ {
+ // SIM card is present
+ //ADN entries or SDN entries are there
+ simList << simImport ;
+ }
+ importSimItem->setData(simList, Qt::DisplayRole);
+ importSimItem->setData(HbIcon("qtg_large_sim"), Qt::DecorationRole);
+
+ mModel->insertRow(0,importSimItem);
+
+ QStandardItem *importDeviceItem = new QStandardItem();
+ QStringList deviceList;
+ QString deviceImport(hbTrId("txt_phob_dblist_import_from_device"));
+ deviceList << deviceImport;
+ importDeviceItem->setData(deviceList, Qt::DisplayRole);
+ importDeviceItem->setData(HbIcon("qtg_large_data_import"), Qt::DecorationRole);
+ importDeviceItem->setEnabled(false);
+
+ mModel->insertRow(1,importDeviceItem);
+
+ mListView->setModel(mModel);
+ mListView->setSelectionMode(HbAbstractItemView::NoSelection);
+}
+
+void CntImportsView::simInfoErrorMessage(int infoError)
+{
+ Q_UNUSED(infoError);
+ QString errorMessage;
+ errorMessage.append(hbTrId("sim_card_not_accessable"));
+ HbNotificationDialog::launchDialog(errorMessage);
+ mSimError = true;
+}
+
+void CntImportsView::onListViewActivated(const QModelIndex &index)
+{
+ int row = index.row();
+ if ( row == 0 ) // row 0 has "Imports from SIM"
+ {
+ if (!startSimImport())
+ {
+ //show error note
+ simInfoErrorMessage(KErrAccessDenied);
+ }
+ else
+ {
+ //start popup and progress
+ showWaitNote();
+ }
+ }
+}
+
+
+bool CntImportsView::startSimImport()
+{
+ bool started = false;
+
+ delete mFetchRequestADN;
+ mFetchRequestADN = 0;
+ delete mFetchRequestSDN;
+ mFetchRequestSDN = 0;
+
+ if (mWaitingForAdnCache)
+ {
+ //show progress dialog and wait when ADN cache is ready
+ started = true;
+ }
+ else
+ {
+ if(mAdnStorePresent)
+ {
+ mContactSimManagerADN = mViewManager->contactManager(SIM_BACKEND_ADN);
+ mFetchRequestADN = new QContactFetchRequest;
+ mFetchRequestADN->setManager(mContactSimManagerADN);
+ connect(mFetchRequestADN, SIGNAL(resultsAvailable()), this, SLOT(importFetchResultReceivedADN()));
+ }
+
+ if(mSdnStorePresent)
+ {
+ mContactSimManagerSDN = mViewManager->contactManager(SIM_BACKEND_SDN);
+ // SDN store fetch request
+ mFetchRequestSDN = new QContactFetchRequest;
+ mFetchRequestSDN->setManager(mContactSimManagerSDN);
+ connect(mFetchRequestSDN, SIGNAL(resultsAvailable()), this, SLOT(importFetchResultReceivedSDN()));
+ }
+
+ if(mAdnEntriesPresent > 0 && mContactSimManagerADN->error() == QContactManager::NoError)
+ {
+ // ADN contacts are there, start fetch
+ mFetchRequestADN->start();
+ started = true;
+ }
+ else if (mSdnStorePresent && mContactSimManagerSDN->error() == QContactManager::NoError)
+ {
+ //start fetch of SDN contacts since ADN contacts are not there
+ mFetchRequestSDN->start();
+ started = true;
+ }
+ }
+ return started;
+}
+
+void CntImportsView::stopSimImport()
+{
+ mImportSimPopup->close();
+ if (mFetchIsDone)
+ {
+ // indicates that timer has been started
+ killTimer(mTimerId);
+ }
+ mSaveSimContactsList.clear();
+ mSaveSimContactsListSDN.clear();
+
+ showSimImportResults();
+
+ if (mFetchRequestADN != NULL)
+ {
+ mFetchRequestADN->cancel();
+ }
+ if (mFetchRequestSDN != NULL)
+ {
+ mFetchRequestSDN->cancel();
+ }
+
+}
+
+void CntImportsView::importFetchResultReceivedADN()
+{
+ QList<QContact> simContactsList = mFetchRequestADN->contacts();
+ if (simContactsList.isEmpty())
+ {
+ // No sim contacts, jump to fetching SDN contacts
+ fetchSDNContacts();
+ }
+ else
+ {
+ // save ADN contacts
+
+ int count = simContactsList.count();
+ foreach(QContact contact, simContactsList)
+ {
+ if (contact.localId() > 0)
+ {
+ //delete local id before saving to different storage
+ QScopedPointer<QContactId> contactId(new QContactId());
+ contactId->setLocalId(0);
+ contactId->setManagerUri(QString());
+ contact.setId(*contactId);
+
+ // custom label contains name information, save it to the first name
+ QList<QContactDetail> names = contact.details(QContactName::DefinitionName);
+ if (names.count() > 0)
+ {
+ QContactName name = static_cast<QContactName>(names.at(0));
+ name.setFirstName(name.customLabel());
+ name.setCustomLabel(QString());
+ contact.saveDetail(&name);
+ }
+
+ //update phone numbers to contain default subtype
+ QList<QContactDetail> numbers = contact.details(QContactPhoneNumber::DefinitionName);
+ for (int i = 0; i < numbers.count(); i++)
+ {
+ QContactPhoneNumber number = static_cast<QContactPhoneNumber>(numbers.at(i));
+ number.setSubTypes(QContactPhoneNumber::SubTypeMobile);
+ contact.saveDetail(&number);
+ }
+
+ //remove sync target details, it's read-only.
+ QList<QContactDetail> syncTargets = contact.details(QContactSyncTarget::DefinitionName);
+ for (int j = 0; j < syncTargets.count(); j++)
+ {
+ QContactSyncTarget syncTarget = static_cast<QContactSyncTarget>(syncTargets.at(j));
+ contact.removeDetail(&syncTarget);
+ }
+
+ contact.setType(QContactType::TypeContact);
+ mSaveSimContactsList.append(contact);
+
+ }
+ }
+ // save the list synchronously because async cancelling of save request is
+ // not supported in symbian backend at the time of this implementation
+
+ if (!(mSaveSimContactsList.isEmpty()))
+ {
+ // indicates that there is one or more sim contact that has been fetched
+ // create a timer and start saving synchronously one by one
+ // when cancel is pressed, kill the timer
+
+ mTimerId = startTimer(KTimerValue); // starting a 1 msec timer
+ mFetchIsDone = true;
+ mSaveCount = 0;
+ }
+
+ }
+}
+
+void CntImportsView::timerEvent(QTimerEvent *event)
+{
+ Q_UNUSED(event);
+ if (!(mSaveCount >= mSaveSimContactsList.count())) // while mSaveCount is less than or equal to mSaveSimContactsList.count()
+ {
+ QContact unSavedContact = mSaveSimContactsList.at(mSaveCount);
+ mContactSymbianManager->saveContact(&unSavedContact);
+ mSaveCount++;
+ //use another counter to check number of actual saved if saveContact() fails
+ }
+ else
+ {
+ // saving complete
+ killTimer(mTimerId);
+ mSaveSimContactsList.clear();
+
+ // ADN contacts fetching and saving is done
+ // Now start SDN fetching and save
+ fetchSDNContacts();
+ }
+}
+
+void CntImportsView::showWaitNote()
+{
+ mImportSimPopup = new HbDialog();
+ mImportSimPopup->setDismissPolicy(HbDialog::NoDismiss);
+ mImportSimPopup->setTimeout(0);
+ mImportSimPopup->setBackgroundFaded(true);
+ mImportSimPopup->setAttribute(Qt::WA_DeleteOnClose, true);
+
+ HbGroupBox *groupBox = new HbGroupBox;
+ groupBox->setHeading(hbTrId("txt_phob_title_import_contacts"));
+ mImportSimPopup->setHeadingWidget(groupBox);
+
+ QGraphicsLinearLayout *containerLayout = new QGraphicsLinearLayout(Qt::Vertical);
+ containerLayout->setContentsMargins(0, 0, 0, 0);
+ containerLayout->setSpacing(10);
+
+ HbLabel *icon = new HbLabel();
+ icon->setIcon(HbIcon("qtg_large_sim"));
+
+ HbLabel *simText= new HbLabel();
+ simText->setPlainText(hbTrId("txt_phob_info_importing_contacts_from_sim"));
+ simText->setTextWrapping(Hb::TextWordWrap);
+ simText->setElideMode(Qt::ElideNone);
+
+ HbProgressBar *progressBar = new HbProgressBar;
+ progressBar->setRange(0,0);
+
+ HbPushButton *stopButton = new HbPushButton;
+ stopButton->setText(hbTrId("txt_phob_button_cancel"));
+ connect(stopButton, SIGNAL(clicked()), this, SLOT(stopSimImport()));
+
+ QGraphicsLinearLayout *containerLayout1 = new QGraphicsLinearLayout(Qt::Horizontal);
+ containerLayout1->addItem(icon);
+ containerLayout1->addItem(simText);
+
+ QGraphicsWidget *containerWidget = new QGraphicsWidget;
+ containerLayout->addItem(containerLayout1);
+ containerLayout->addItem(progressBar);
+ containerLayout->addItem(stopButton);
+ containerWidget->setLayout(containerLayout);
+ mImportSimPopup->setContentWidget(containerWidget);
+ mSaveCount = 0;
+ mImportSimPopup->open();
+}
+
+void CntImportsView::showSimImportResults() const
+{
+ QString results;
+ results.append(hbTrId("txt_phob_dpophead_ln_contacts_imported", mSaveCount));
+ HbNotificationDialog::launchDialog(results);
+}
+
+void CntImportsView::fetchSDNContacts()
+{
+ if (mSdnStorePresent && mContactSimManagerSDN->error() == QContactManager::NoError)
+ {
+ mFetchRequestSDN->start();
+ }
+ else
+ {
+ // no SDN contacts to fetch
+ showSimImportResults();
+ mImportSimPopup->close();
+ // Importing finished, go back to NamesView
+ showPreviousView();
+ }
+}
+
+void CntImportsView::importFetchResultReceivedSDN()
+{
+ QList<QContact> simContactsListSDN = mFetchRequestSDN->contacts();
+ if (simContactsListSDN.isEmpty())
+ {
+ //No sdn contacts present
+ showSimImportResults();
+ mSaveSimContactsListSDN.clear();
+ mImportSimPopup->close();
+ // Importing finished, go back to NamesView
+ showPreviousView();
+ }
+ else
+ {
+ // SAVE SDN CONTACTS
+ int count = simContactsListSDN.count();
+ foreach(QContact contact, simContactsListSDN)
+ {
+ if (contact.localId() > 0)
+ {
+ //delete local id before saving to different storage
+ QScopedPointer<QContactId> contactId(new QContactId());
+ contactId->setLocalId(0);
+ contactId->setManagerUri(QString());
+ contact.setId(*contactId);
+
+ //custom label contains name information, save it to the first name
+ QList<QContactDetail> names = contact.details(QContactName::DefinitionName);
+ if (names.count() > 0)
+ {
+ QContactName name = static_cast<QContactName>(names.at(0));
+ name.setFirstName(name.customLabel());
+ name.setCustomLabel(QString());
+ contact.saveDetail(&name);
+ }
+
+ //update phone numbers to contain default subtype
+ QList<QContactDetail> numbers = contact.details(QContactPhoneNumber::DefinitionName);
+ for (int i = 0; i < numbers.count(); i++)
+ {
+ QContactPhoneNumber number = static_cast<QContactPhoneNumber>(numbers.at(i));
+ number.setSubTypes(QContactPhoneNumber::SubTypeMobile);
+ contact.saveDetail(&number);
+ }
+
+ //remove sync target details, it's read-only.
+ QList<QContactDetail> syncTargets = contact.details(QContactSyncTarget::DefinitionName);
+ for (int j = 0; j < syncTargets.count(); j++)
+ {
+ QContactSyncTarget syncTarget = static_cast<QContactSyncTarget>(syncTargets.at(j));
+ contact.removeDetail(&syncTarget);
+ }
+
+ contact.setType(QContactType::TypeContact);
+ mSaveSimContactsListSDN.append(contact);
+
+ }
+ }
+ // save the list synchronously because async cancelling of save request is
+ // not supported in symbian backend at the time of this implementation
+
+ if (!(mSaveSimContactsListSDN.isEmpty()))
+ {
+ // indicates that there is one or more SDN sim contact that has been fetched
+ QMap<int, QContactManager::Error> errorMap;
+ mContactSymbianManager->saveContacts(&mSaveSimContactsListSDN,&errorMap);
+ // check number of contacts really saved
+ mSaveCount = mSaveCount + mSaveSimContactsListSDN.count();
+ }
+
+ // no more SDN contacts to fetch
+ showSimImportResults();
+ mSaveSimContactsListSDN.clear();
+ mImportSimPopup->close();
+ // Importing finished, go back to NamesView
+ showPreviousView();
+ }
+}
+
+void CntImportsView::adnCacheStatusReady(SimUtility::CacheStatus& cacheStatus, int error)
+{
+ mWaitingForAdnCache = false;
+ //update ADN store info...
+ if (error != 0 || cacheStatus == SimUtility::ECacheFailed)
+ {
+ mAdnStorePresent = false;
+ mAdnEntriesPresent = false;
+ }
+ else
+ {
+ //check if there are ADN contacts
+ mAdnStorePresent = true;
+ mAdnEntriesPresent = false;
+ int getSimInfoError = -1;
+ SimUtility::SimInfo simInfo = mSimUtility->getSimInfo(getSimInfoError);
+ if (!getSimInfoError)
+ {
+ // sim entries are present
+ mAdnStoreEntries = simInfo.usedEntries;
+ if (mAdnStoreEntries > 0)
+ {
+ mAdnEntriesPresent = true;
+ }
+ }
+ }
+
+ //and start SIM contacts import, if user tapped "SIM import"
+ if(mImportSimPopup != NULL && mImportSimPopup->isActive())
+ {
+ if (!startSimImport())
+ {
+ //dismiss wait note
+ mImportSimPopup->close();
+ //and show error note
+ simInfoErrorMessage(KErrAccessDenied);
+ }
+ }
+}
+
+// EOF
--- a/phonebookui/pbkcommonui/src/cntmycardview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp Fri May 14 15:42:23 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "cntmycardview.h"
+#include "cntfetchcontactsview.h"
#include "qtpbkglobal.h"
#include <hbpushbutton.h>
#include <hbaction.h>
@@ -26,7 +27,8 @@
CntMyCardView::CntMyCardView() :
mContact(NULL),
- mViewManager(NULL)
+ mViewManager(NULL),
+ mFetchView(NULL)
{
bool ok = false;
mDocumentLoader.load(CNT_MYCARD_UI_XML, &ok);
@@ -51,6 +53,9 @@
delete mContact;
mContact = 0;
+
+ delete mFetchView;
+ mFetchView = NULL;
}
/*!
@@ -67,6 +72,8 @@
*/
void CntMyCardView::activate(CntAbstractViewManager* aMgr, const CntViewParameters aArgs)
{
+ mViewManager = aMgr;
+
if (mView->navigationAction() != mSoftkey)
mView->setNavigationAction(mSoftkey);
@@ -75,8 +82,6 @@
setOrientation(window->orientation());
mContact = new QContact(aArgs.value(ESelectedContact).value<QContact>());
- mViewManager = aMgr;
-
HbPushButton *newButton = static_cast<HbPushButton*>(mDocumentLoader.findWidget(QString("cnt_button_new")));
connect(newButton, SIGNAL(clicked()), this, SLOT(openNameEditor()));
@@ -91,6 +96,9 @@
{
chooseButton->setEnabled(false);
}
+
+ mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND ));
+ connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection()));
}
void CntMyCardView::deactivate()
@@ -117,13 +125,10 @@
*/
void CntMyCardView::openNameEditor()
{
- //create a new my card contact
- QContactManager* mgr = mViewManager->contactManager( SYMBIAN_BACKEND );
- mgr->saveContact(mContact);
- mgr->setSelfContactId(mContact->localId());
- //open the contact editor
CntViewParameters viewParameters;
viewParameters.insert(EViewId, editView);
+ viewParameters.insert(EMyCard, "myCard" );
+
QVariant var;
var.setValue(*mContact);
viewParameters.insert(ESelectedContact, var);
@@ -135,8 +140,27 @@
*/
void CntMyCardView::openMyCardSelectionView()
{
+ // Display a list of contacts to choose a mycard from.
+ mFetchView->setDetails(hbTrId("txt_phob_subtitle_my_card"),hbTrId("Save"));
+ QSet<QContactLocalId> emptyContactsSet;
+ mFetchView->displayContacts(CntFetchContacts::popup,
+ HbAbstractItemView::SingleSelection,
+ emptyContactsSet);
+}
+
+void CntMyCardView::handleMultiCardSelection()
+{
+ QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
+
+ QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
+
+ if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) {
+ QList<QContactLocalId> selectedContactsList = selectedContacts.values();
+ manager->setSelfContactId(selectedContactsList.front());
+ }
+
CntViewParameters viewParameters;
- viewParameters.insert(EViewId, myCardSelectionView);
+ viewParameters.insert(EViewId, namesView);
mViewManager->changeView(viewParameters);
}
--- a/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnamesview_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -17,6 +17,7 @@
#include "cntnamesview_p.h"
#include "cntaction.h"
+#include "cntfetchcontactsview.h"
#include "cntextensionmanager.h"
#include "qtpbkglobal.h"
@@ -43,11 +44,13 @@
#include <hbframebackground.h>
#include <hbstaticvkbhost.h>
#include <hbmessagebox.h>
+#include <hbparameterlengthlimiter.h>
#include <QGraphicsLinearLayout>
#include <QList>
const char *CNT_CONTACTLIST_XML = ":/xml/contacts_namelist.docml";
+static const int CNT_MIN_ROW_COUNT = 2;
CntNamesViewPrivate::CntNamesViewPrivate(CntExtensionManager &extensionManager) :
QObject(),
@@ -61,6 +64,8 @@
mLoader(NULL),
mLayout(NULL),
mMenuBuilder(NULL),
+ mHandledContactId(0),
+ mFetchView(NULL),
mIsDefault(true),
mId( namesView )
{
@@ -70,31 +75,32 @@
qFatal("Unable to read %S", CNT_CONTACTLIST_XML);
}
mView = static_cast<HbView*> (document()->findWidget("view"));
-
+
mVirtualKeyboard = new HbStaticVkbHost(mView);
connect(mVirtualKeyboard, SIGNAL(keypadOpened()), this, SLOT(handleKeypadOpen()));
connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(handleKeypadClose()));
mSoftkey = new HbAction(Hb::BackNaviAction, mView);
- HbAction* newContact = static_cast<HbAction*> (document()->findObject("cnt:newcontact"));
+ mNewContact = static_cast<HbAction*> (document()->findObject("cnt:newcontact"));
+ mMultipleDeleter = static_cast<HbAction*> (document()->findObject("cnt:delete"));
HbAction* findContacts = static_cast<HbAction*> (document()->findObject("cnt:find"));
HbAction* groups = static_cast<HbAction*> (document()->findObject("cnt:groups"));
- HbAction* importSim = static_cast<HbAction*> (document()->findObject("cnt:importsim"));
+ mImportSim = static_cast<HbAction*> (document()->findObject("cnt:importsim"));
HbAction* extension = static_cast<HbAction*> (document()->findObject("cnt:activity"));
connect(mSoftkey, SIGNAL(triggered()), this, SLOT(showPreviousView()));
- connect(newContact, SIGNAL(triggered()), this, SLOT(createNewContact()));
+ connect(mNewContact, SIGNAL(triggered()), this, SLOT(createNewContact()));
+ connect(mMultipleDeleter, SIGNAL(triggered()), this, SLOT(deleteMultipleContacts()));
connect(findContacts, SIGNAL(triggered()), this, SLOT(showFinder()));
connect(groups, SIGNAL(triggered()), this, SLOT(showCollectionView()));
- connect(importSim, SIGNAL(triggered()), this, SLOT(importSim()));
+ connect(mImportSim, SIGNAL(triggered()), this, SLOT(importSim()));
connect(extension, SIGNAL(triggered()), this, SLOT(handleExtensionAction()));
connect(list(), SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this,
SLOT(showContextMenu(HbAbstractViewItem*,QPointF)));
connect(list(), SIGNAL(activated (const QModelIndex&)), this,
SLOT(showContactView(const QModelIndex&)));
-
}
CntNamesViewPrivate::~CntNamesViewPrivate()
@@ -150,50 +156,52 @@
filter.setValue(typeContact);
mListModel = new MobCntModel(mViewManager->contactManager(SYMBIAN_BACKEND), filter, sortOrders);
+ list()->setModel(mListModel);
+
}
- list()->setModel(mListModel);
-
mMenuBuilder = new CntActionMenuBuilder( mListModel->myCardId() );
connect( mMenuBuilder, SIGNAL(deleteContact(QContact&)), this, SLOT(deleteContact(QContact&)) );
connect( mMenuBuilder, SIGNAL(editContact(QContact&)), this, SLOT(showContactEditorView(QContact&)) );
connect( mMenuBuilder, SIGNAL(openContact(QContact&)), this, SLOT(showContactView(QContact&)) );
connect( mMenuBuilder, SIGNAL(performContactAction(QContact&,QString)), this, SLOT(executeAction(QContact&,QString)));
-
+
if ( mView->navigationAction() != mSoftkey)
{
mView->setNavigationAction(mSoftkey);
}
QContactManager* contactManager = aMgr->contactManager( SYMBIAN_BACKEND );
- QString action = aArgs.value(ESelectedAction).toString();
- if ( action == "save" )
+ if ( aArgs.contains(ESelectedContact) )
{
- QString name = contactManager->synthesizedDisplayLabel( aArgs.value(ESelectedContact).value<QContact>() );
- HbNotificationDialog::launchDialog(qtTrId("Contact \"%1\" saved").arg(name));
-
- scrollTo( aArgs.value(ESelectedContact).value<QContact>() );
+ QContact selectedContact = aArgs.value(ESelectedContact).value<QContact>();
+ QString action = aArgs.value(ESelectedAction).toString();
+
+ if ( action == "save" )
+ {
+ QString name = contactManager->synthesizedDisplayLabel( selectedContact );
+ HbNotificationDialog::launchDialog(qtTrId("Contact \"%1\" saved").arg(name));
+ }
+
+ else if ( action == "delete" )
+ {
+ QString name = contactManager->synthesizedDisplayLabel( selectedContact );
+ HbNotificationDialog::launchDialog(qtTrId("%1 deleted").arg(name));
+ }
+ else if ( action == "failed")
+ {
+ HbNotificationDialog::launchDialog(qtTrId("SAVING FAILED!"));
+ }
}
-
- else if ( action == "delete" )
- {
- QString name = contactManager->synthesizedDisplayLabel( aArgs.value(ESelectedContact).value<QContact>() );
- HbNotificationDialog::launchDialog(qtTrId("%1 deleted").arg(name));
- }
- else if ( action == "failed")
- {
- HbNotificationDialog::launchDialog(qtTrId("SAVING FAILED!"));
- }
+
+ bool multipleContacts = mListModel->rowCount() >= CNT_MIN_ROW_COUNT;
+ mMultipleDeleter->setEnabled(multipleContacts);
}
void CntNamesViewPrivate::deactivate()
{
hideFinder();
- // Don't delete the model, default views will retain it between
- // activate/deactivate. do it in destructor.
- list()->setModel(NULL);
-
delete mMenuBuilder;
mMenuBuilder = NULL;
@@ -202,18 +210,6 @@
mSearchPanel = NULL;
}
-void CntNamesViewPrivate::scrollTo(const QContact &aContact)
-{
- if (mListModel)
- {
- QModelIndex index = mListModel->indexOfContact(aContact);
-
- if (index.isValid())
- {
- list()->scrollTo(index);
- }
- }
-}
void CntNamesViewPrivate::setFilter(const QString &filterString)
{
QStringList searchList = filterString.split(QRegExp("\\s+"), QString::SkipEmptyParts);
@@ -275,6 +271,10 @@
showBanner(hbTrId("txt_phob_subtitle_find_all_contacts"));
mView->toolBar()->hide();
+ mImportSim->setVisible(false);
+ mNewContact->setVisible(false);
+ mMultipleDeleter->setVisible(false);
+
setFilter(QString());
list()->setVisible(true);
@@ -304,6 +304,9 @@
mListModel->setFilterAndSortOrder(filter);
mListModel->showMyCard(true);
+ mNewContact->setVisible(true);
+ mImportSim->setVisible(true);
+ mMultipleDeleter->setVisible(true);
mView->toolBar()->show();
}
@@ -342,9 +345,60 @@
void CntNamesViewPrivate::createNewContact()
{
QContact newContact;
+ newContact.setType( QContactType::TypeContact );
+
showContactEditorView(newContact);
}
+void CntNamesViewPrivate::deleteContact(QContact& aContact)
+{
+ QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
+ QString name = manager->synthesizedDisplayLabel(aContact);
+
+ mHandledContactId = aContact.localId();
+
+ HbMessageBox::question(HbParameterLengthLimiter(hbTrId("txt_phob_info_delete_1")).arg(name), this, SLOT(handleDeleteContact(HbAction*)),
+ hbTrId("txt_phob_button_delete"), hbTrId("txt_common_button_cancel"));
+}
+
+void CntNamesViewPrivate::deleteMultipleContacts()
+{
+ if (!mFetchView) {
+ mFetchView = new CntFetchContacts(mViewManager->contactManager( SYMBIAN_BACKEND ));
+ connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleDeleteMultipleContacts()));
+ }
+
+ mFetchView->setDetails(hbTrId("txt_phob_opt_delete_contact"),hbTrId("txt_phob_button_delete"));
+ QSet<QContactLocalId> emptyContactsSet;
+
+ // Pop up a list of contacts for deletion
+ mFetchView->displayContacts(CntFetchContacts::popup,
+ HbAbstractItemView::MultiSelection,
+ emptyContactsSet);
+}
+
+void CntNamesViewPrivate::handleDeleteMultipleContacts()
+{
+ QSet<QContactLocalId> selectedContacts = mFetchView->getSelectedContacts();
+
+ QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
+ if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) {
+ QList<QContactLocalId> selectedContactsList = selectedContacts.values();
+ foreach (QContactLocalId id, selectedContactsList) {
+ QContact contact = manager->contact(id);
+
+ manager->removeContact(contact.localId());
+ }
+ }
+
+ if (mListModel->rowCount() < CNT_MIN_ROW_COUNT) {
+ mMultipleDeleter->setEnabled(false);
+ }
+
+ delete mFetchView;
+ mFetchView = NULL;
+}
+
void CntNamesViewPrivate::showContactView( const QModelIndex& aIndex )
{
QContact c = mListModel->contact(aIndex);
@@ -369,7 +423,10 @@
void CntNamesViewPrivate::showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint)
{
QContact contact = mListModel->contact(aItem->modelIndex());
- mMenuBuilder->execActionMenu( contact, aPoint );
+ HbMenu* menu = mMenuBuilder->actionMenu( contact );
+ menu->setPreferredPos( aPoint );
+ menu->setAttribute( Qt::WA_DeleteOnClose, true );
+ menu->open();
}
void CntNamesViewPrivate::executeAction( QContact& aContact, QString aAction )
@@ -384,25 +441,16 @@
aAction->deleteLater();
}
-void CntNamesViewPrivate::deleteContact(QContact& aContact)
+void CntNamesViewPrivate::handleDeleteContact( HbAction* aAction )
{
- QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND );
- QString name = manager->synthesizedDisplayLabel(aContact);
-
- HbMessageBox *note = new HbMessageBox(
- hbTrId("txt_phob_info_delete_1").arg(name),
- HbMessageBox::MessageTypeQuestion);
-
- note->setPrimaryAction(new HbAction(hbTrId("txt_phob_button_delete"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
-
- HbAction *selected = note->exec();
- if (selected == note->primaryAction())
+ HbMessageBox *note = static_cast<HbMessageBox*>(sender());
+
+ if (note && aAction == note->actions().first())
{
- manager->removeContact(aContact.localId());
- HbNotificationDialog::launchDialog(hbTrId("txt_phob_dpophead_1_deleted").arg(name));
+ mViewManager->contactManager( SYMBIAN_BACKEND )->removeContact(mHandledContactId);
}
- delete note;
+
+ mHandledContactId = 0;
}
void CntNamesViewPrivate::showContactEditorView(QContact& aContact)
@@ -426,54 +474,9 @@
void CntNamesViewPrivate::importSim()
{
- int copied(0);
- int failed(0);
- QContactManager* simManager = mViewManager->contactManager( SIM_BACKEND );
- QContactManager* symbianManager = mViewManager->contactManager( SYMBIAN_BACKEND );
-
- QList<QContactLocalId> contactIds = simManager->contactIds();
- if (contactIds.count() == 0) {
- HbMessageBox::information("Nothing to copy: SIM card is empty or not accessible.");
- return;
- }
-
- foreach(QContactLocalId id, contactIds) {
- QContact contact = simManager->contact(id);
- if (contact.localId() > 0) {
- //delete local id before saving to different storage
- QScopedPointer<QContactId> contactId(new QContactId());
- contactId->setLocalId(0);
- contactId->setManagerUri(QString());
- contact.setId(*contactId);
-
- // custom label contains name information, save it to the first name
- QList<QContactDetail> names = contact.details(QContactName::DefinitionName);
- if (names.count() > 0) {
- QContactName name = static_cast<QContactName>(names.at(0));
- name.setFirstName(name.customLabel());
- name.setCustomLabel(QString());
- contact.saveDetail(&name);
- }
-
- if (symbianManager->saveContact(&contact)) {
- copied++;
- }
- else {
- failed++;
- }
- }
- else {
- failed++;
- }
- }
-
- QString resultMessage;
- resultMessage.setNum(copied);
- resultMessage.append(" contact copied, ");
- resultMessage.append(QString().setNum(failed));
- resultMessage.append(" failed.");
-
- HbMessageBox::information(resultMessage);
+ CntViewParameters args;
+ args.insert(EViewId, importsView);
+ mViewManager->changeView(args);
}
@@ -488,6 +491,7 @@
mListView->setFrictionEnabled(true);
mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
mListView->listItemPrototype()->setGraphicsSize(HbListViewItem::Thumbnail);
+ mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
mListView->verticalScrollBar()->setInteractive(true);
HbFrameBackground frame;
@@ -500,6 +504,8 @@
HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView);
indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter);
indexFeedback->setItemView(mListView);
+
+ connect( mListView, SIGNAL(scrollPositionChanged(const QPointF&)), this, SLOT(handleScroll(const QPointF&)) );
}
return mListView;
}
--- a/phonebookui/pbkcommonui/src/cntnoteeditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnoteeditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -21,15 +21,8 @@
CntNoteEditorModel::CntNoteEditorModel( QContact* aContact ) :
CntDetailEditorModel( aContact )
{
- QList<QContactNote> noteList = mContact->details<QContactNote>();
- if ( noteList.isEmpty() )
- {
- QContactNote emptyNote;
- noteList.append( emptyNote );
- }
-
HbDataFormModelItem* root = invisibleRootItem();
- foreach ( QContactNote note, noteList )
+ foreach ( QContactNote note, mContact->details<QContactNote>() )
{
CntDetailModelItem* item = new CntDetailModelItem(note);
appendDataFormItem( item, root );
@@ -53,9 +46,12 @@
int count( root->childCount() );
for ( int i(0); i < count; i++ ) {
CntDetailModelItem* detail = static_cast<CntDetailModelItem*>( root->childAt(i) );
- QContactNote note = detail->detail();
- if ( note.note().length() > 0 ) {
- mContact->saveDetail( ¬e );
+ QContactDetail note = detail->detail();
+ mContact->saveDetail( ¬e );
+
+ if ( note.value(QContactNote::FieldNote).isEmpty() )
+ {
+ mContact->removeDetail( ¬e );
}
}
}
--- a/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnoteeditorviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -64,7 +64,7 @@
mEdit->setMinRows( CNT_NOTE_EDITOR_MIN_ROWCOUNT );
mEdit->setText( detail.note() );
- HbLabel* label = new HbLabel(hbTrId("Note"));
+ HbLabel* label = new HbLabel(hbTrId("txt_phob_formlabel_note"));
mLayout->addItem(label);
mLayout->addItem(mEdit);
widget->setLayout( mLayout );
--- a/phonebookui/pbkcommonui/src/cntphonenumbermodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntphonenumbermodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -35,10 +35,13 @@
// if there's no details, add
if ( all.isEmpty() )
{
- QContactPhoneNumber number;
- number.setSubTypes( QContactPhoneNumber::SubTypeMobile );
-
- all.append( number );
+ QContactPhoneNumber mobileNumber;
+ mobileNumber.setSubTypes( QContactPhoneNumber::SubTypeMobile );
+ all.append( mobileNumber );
+
+ QContactPhoneNumber landLineNumber;
+ landLineNumber.setSubTypes( QContactPhoneNumber::SubTypeLandline );
+ all.append( landLineNumber );
}
HbDataFormModelItem* root = invisibleRootItem();
@@ -54,7 +57,7 @@
{
QContactPhoneNumber number;
number.setSubTypes( QContactPhoneNumber::SubTypeMobile );
-
+
appendDataFormItem( new CntDetailModelItem(number), invisibleRootItem() );
}
@@ -65,25 +68,21 @@
for ( int i = 0; i < count; i++ ) {
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( root->childAt(i) );
QContactDetail detail = item->detail();
+ mContact->saveDetail( &detail );
if ( detail.definitionName() == QContactPhoneNumber::DefinitionName )
{
- QContactPhoneNumber phonenumber = detail;
- if ( phonenumber.number().length() > 0 ) {
- mContact->saveDetail( &phonenumber );
- }
+ if ( detail.value(QContactPhoneNumber::FieldNumber).isEmpty() )
+ mContact->removeDetail( &detail );
}
- else if ( detail.definitionName() == QContactOnlineAccount::DefinitionName )
+
+ if ( detail.definitionName() == QContactOnlineAccount::DefinitionName )
{
- QContactOnlineAccount account = detail;
- if ( account.accountUri().length() > 0 ) {
- mContact->saveDetail( &account );
+ if ( detail.value(QContactOnlineAccount::FieldAccountUri).isEmpty() )
+ {
+ mContact->removeDetail( &detail );
}
}
- else {
- /* should never be here */
- qWarning() << "Unknown: " << detail.definitionName();
- }
}
}
--- a/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntphonenumberviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -40,14 +40,12 @@
CntDetailViewItem( aParent ),
mBox(NULL),
mEdit(NULL),
-mFilter(NULL),
mLayout(NULL)
{
}
CntPhoneNumberViewItem::~CntPhoneNumberViewItem()
{
- delete mFilter;
}
HbAbstractViewItem* CntPhoneNumberViewItem::createItem()
@@ -118,8 +116,7 @@
HbWidget* widget = new HbWidget();
mBox = new HbComboBox();
mEdit = new HbLineEdit();
- mFilter = new HbEditorInterface( mEdit );
-
+
widget->setLayout( mLayout );
mLayout->addItem( mBox );
@@ -167,8 +164,7 @@
void CntPhoneNumberViewItem::constructPhoneNumber( CntDetailModelItem* aItem, QString aSubType, QStringList aContext )
{
- mFilter->setFilter( HbPhoneNumberFilter::instance() );
- mFilter->setUpAsPhoneNumberEditor();
+ mEdit->setInputMethodHints( Qt::ImhDialableCharactersOnly );
mEdit->setMaxLength( CNT_PHONENUMBER_EDITOR_MAXLENGTH );
QContactDetail detail = aItem->detail();
@@ -178,7 +174,7 @@
{
// also we need to remove the old online account and replace it
// with phonenumber
- CntDetailEditorModel* model = static_cast<CntDetailEditorModel*>( aItem->model() );
+ CntDetailEditorModel* model = static_cast<CntDetailEditorModel*>( itemView()->model() );
QContact* contact = model->contact();
contact->removeDetail( &detail );
@@ -199,9 +195,8 @@
void CntPhoneNumberViewItem::constructOnlineAccount( CntDetailModelItem* aItem, QString aSubType, QStringList aContext )
{
- mFilter->setFilter( HbEmailAddressFilter::instance() );
- mFilter->setUpAsCompletingEmailField();
mEdit->setMaxLength( CNT_ONLINEACCOUNT_EDITOR_MAXLENGTH );
+ mEdit->setInputMethodHints( Qt::ImhUrlCharactersOnly );
QContactDetail detail = aItem->detail();
// check if the detail type needs to changed
@@ -209,7 +204,7 @@
{
// also we need to remove the old phonenumber and replace it
// with online account
- CntDetailEditorModel* model = static_cast<CntDetailEditorModel*>( aItem->model() );
+ CntDetailEditorModel* model = static_cast<CntDetailEditorModel*>( itemView()->model() );
QContact* contact = model->contact();
contact->removeDetail( &detail );
@@ -270,20 +265,20 @@
model->appendRow(mobilework);
QStandardItem *land = new QStandardItem;
- land->setText(hbTrId("txt_phob_setlabel_val_phone"));
+ land->setText(hbTrId("txt_phob_dblist_phone"));
land->setData(subTypeLandline, DetailSubType);
land->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
model->appendRow(land);
QStandardItem *landhome = new QStandardItem;
- landhome->setText(hbTrId("txt_phob_setlabel_val_phone_home"));
+ landhome->setText(hbTrId("txt_phob_dblist_phone_home"));
landhome->setData(subTypeLandline, DetailSubType);
landhome->setData(contextHome, DetailContext);
landhome->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
model->appendRow(landhome);
QStandardItem *landwork = new QStandardItem;
- landwork->setText(hbTrId("txt_phob_setlabel_val_phone_work"));
+ landwork->setText(hbTrId("txt_phob_dblist_phone_work"));
landwork->setData(subTypeLandline, DetailSubType);
landwork->setData(contextWork, DetailContext);
landwork->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
@@ -310,19 +305,19 @@
model->appendRow(faxwork);
QStandardItem *pager = new QStandardItem;
- pager->setText(hbTrId("txt_phob_setlabel_val_pager"));
+ pager->setText(hbTrId("txt_phob_dblist_pager"));
pager->setData(subTypePager, DetailSubType);
pager->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
model->appendRow(pager);
QStandardItem *assistant = new QStandardItem;
- assistant->setText(hbTrId("txt_phob_setlabel_val_assistant"));
+ assistant->setText(hbTrId("txt_phob_dblist_assistant"));
assistant->setData(subTypeAssistant, DetailSubType);
assistant->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
model->appendRow(assistant);
QStandardItem *carPhone = new QStandardItem;
- carPhone->setText(hbTrId("txt_phob_setlabel_val_car"));
+ carPhone->setText(hbTrId("txt_phob_dblist_car"));
carPhone->setData(subTypeCarPhone, DetailSubType);
carPhone->setData(CNT_PHONENUMBER_EDITOR_MAXLENGTH, DetailMaxLength);
model->appendRow(carPhone);
--- a/phonebookui/pbkcommonui/src/cnturleditormodel.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnturleditormodel.cpp Fri May 14 15:42:23 2010 +0300
@@ -22,7 +22,7 @@
CntUrlEditorModel::CntUrlEditorModel(QContact* aContact) :
CntDetailEditorModel(aContact)
{
- QList<QContactUrl> urlList = mContact->details<QContactUrl> ();
+ QList<QContactUrl> urlList = mContact->details<QContactUrl>();
if (urlList.isEmpty()) {
QContactUrl url;
url.setSubType(QContactUrl::SubTypeHomePage);
@@ -43,7 +43,7 @@
{
QContactUrl url;
url.setSubType(QContactUrl::SubTypeHomePage);
-
+
appendDataFormItem( new CntDetailModelItem(url), invisibleRootItem() );
}
@@ -54,9 +54,12 @@
int count(root->childCount());
for (int i(0); i < count; i++) {
CntDetailModelItem* detail = static_cast<CntDetailModelItem*> (root->childAt(i));
- QContactUrl url = detail->detail();
- if (url.url().length() > 0) {
- mContact->saveDetail(&url);
+ QContactDetail url = detail->detail();
+ mContact->saveDetail( &url );
+
+ if ( url.value(QContactUrl::FieldUrl).isEmpty() )
+ {
+ mContact->removeDetail( &url );
}
}
}
--- a/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnturleditorviewitem.cpp Fri May 14 15:42:23 2010 +0300
@@ -69,8 +69,7 @@
CntDetailModelItem* item = static_cast<CntDetailModelItem*>( model->itemFromIndex(modelIndex()) );
QContactUrl detail = item->detail();
- HbEditorInterface editorInterface( mEdit );
- editorInterface.setFilter( HbUrlFilter::instance() );
+ mEdit->setInputMethodHints( Qt::ImhUrlCharactersOnly );
constructSubTypeModel( detail.contexts() );
--- a/phonebookui/phonebookservices/inc/cntserviceeditview.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntserviceeditview.h Fri May 14 15:42:23 2010 +0300
@@ -36,8 +36,8 @@
int viewId() const { return serviceEditView; }
private slots:
- void doContactUpdated();
- void doContactRemoved();
+ void doContactUpdated(bool aSuccess);
+ void doContactRemoved(bool aSuccess);
void doChangesDiscarded();
//public slots:
--- a/phonebookui/phonebookservices/inc/cntservicehandler.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/inc/cntservicehandler.h Fri May 14 15:42:23 2010 +0300
@@ -75,8 +75,8 @@
void launchAssignContactCard(QContact contact, QContactDetail detail);
private:
- void removeFields(QContact& contact);
- void removeDetails(QContact& contact);
+ void removeNotSupportedFields(QContact& contact);
+ void removeNotSupportedDetails(QContact& contact);
private:
int mCurrentRequestIndex;
--- a/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntservicecontactfetchview.cpp Fri May 14 15:42:23 2010 +0300
@@ -64,7 +64,7 @@
CntServicesContact servicesContact;
//get the name
- servicesContact.mDisplayName = mgr->synthesizedDisplayLabel(contact);
+ servicesContact.mDisplayName = contact.displayLabel();
//get the phonenumber
QList<QContactPhoneNumber> phonenumbers = contact.details<QContactPhoneNumber>();
--- a/phonebookui/phonebookservices/src/cntserviceeditview.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntserviceeditview.cpp Fri May 14 15:42:23 2010 +0300
@@ -22,8 +22,8 @@
CntServiceEditView::CntServiceEditView(CntServiceHandler *aServiceHandler ) : CntEditView(),
mServiceHandler(aServiceHandler)
{
- connect( this, SIGNAL(contactUpdated()), this, SLOT(doContactUpdated()) );
- connect( this, SIGNAL(contactRemoved()), this, SLOT(doContactRemoved()) );
+ connect( this, SIGNAL(contactUpdated(bool)), this, SLOT(doContactUpdated(bool)) );
+ connect( this, SIGNAL(contactRemoved(bool)), this, SLOT(doContactRemoved(bool)) );
connect( this, SIGNAL(changesDiscarded()), this, SLOT(doChangesDiscarded()) );
}
@@ -31,16 +31,18 @@
{
}
-void CntServiceEditView::doContactUpdated()
+void CntServiceEditView::doContactUpdated(bool aSuccess)
{
connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
- mServiceHandler->completeEdit(1);
+ int retValue = aSuccess ? 1 : 0;
+ mServiceHandler->completeEdit(retValue);
}
-void CntServiceEditView::doContactRemoved()
+void CntServiceEditView::doContactRemoved(bool aSuccess)
{
connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
- mServiceHandler->completeEdit(-1);
+ int retValue = aSuccess ? -1 : 0;
+ mServiceHandler->completeEdit(retValue);
}
void CntServiceEditView::doChangesDiscarded()
--- a/phonebookui/phonebookservices/src/cntservicehandler.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/src/cntservicehandler.cpp Fri May 14 15:42:23 2010 +0300
@@ -24,6 +24,7 @@
#include <QPixmap>
#include <QFile>
+#include <QUrl>
/* NOTE! THIS SERVICE WILL BE RENAMED TO com.nokia.services.phonebook.Services */
CntServiceHandler::CntServiceHandler(QObject *parent):
@@ -33,23 +34,22 @@
publishAll();
// Definition names supported in symbian back-end
- QString def("%1");
- m_definitionNames << def.arg(QContactName::DefinitionName);
- m_definitionNames << def.arg(QContactNickname::DefinitionName);
- m_definitionNames << def.arg(QContactPhoneNumber::DefinitionName);
- m_definitionNames << def.arg(QContactEmailAddress::DefinitionName);
- m_definitionNames << def.arg(QContactAddress::DefinitionName);
- m_definitionNames << def.arg(QContactUrl::DefinitionName);
- m_definitionNames << def.arg(QContactBirthday::DefinitionName);
- m_definitionNames << def.arg(QContactOrganization::DefinitionName);
- m_definitionNames << def.arg(QContactSyncTarget::DefinitionName);
- m_definitionNames << def.arg(QContactNote::DefinitionName);
- m_definitionNames << def.arg(QContactFamily::DefinitionName);
- m_definitionNames << def.arg(QContactAvatar::DefinitionName);
- m_definitionNames << def.arg(QContactAnniversary::DefinitionName);
- m_definitionNames << def.arg(QContactGeoLocation::DefinitionName);
- m_definitionNames << def.arg(QContactGender::DefinitionName);
- m_definitionNames << def.arg(QContactOnlineAccount::DefinitionName);
+ 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()
@@ -145,39 +145,35 @@
// Use the resulting document(s)...
QVersitContactImporter importer;
QList<QVersitDocument> versitDocuments = reader.results();
- if(versitDocuments.count() > 0)
- {
- contact = importer.importContacts(versitDocuments).first();
- }
+ if (versitDocuments.count() > 0
+ && importer.importDocuments(versitDocuments))
+ {
+ QList<QContact> contacts = importer.contacts();
+ if (contacts.count() > 0)
+ contact = contacts.first();
+ }
file.close();
- // Save photo to image file
- // image file used in phonebook to generate thumbnail
- QList<QContactAvatar> details = contact.details<QContactAvatar>();
- if (details.count() > 0)
+ // Save thumbnail images
+ QList<QContactThumbnail> details = contact.details<QContactThumbnail>();
+ for (int i = 0;i < details.count();i++)
+ {
+ if (!details.at(i).thumbnail().isNull())
{
- for (int i = 0;i < details.count();i++)
+ QString imagepath;
+ QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail());
+ if (imageUtility.createImage(pixmap,imagepath))
{
- if (details.at(i).subType() == QContactAvatar::SubTypeImage)
- {
- if(!details.at(i).pixmap().isNull())
- {
- int err;
- QString imagepath;
- QPixmap pixmap(details.at(i).pixmap());
- if(imageUtility.createImage(pixmap,imagepath,err))
- {
- // Update contact detail
- QContactAvatar detail=details.at(i);
- detail.setAvatar(imagepath);
- contact.saveDetail(&detail);
- }
- }
- }
+ // Update contact detail
+ QContactAvatar detail=details.at(i);
+ detail.setImageUrl(imagepath);
+ contact.saveDetail(&detail);
}
}
- removeDetails(contact);
- removeFields(contact);
+ }
+
+ removeNotSupportedDetails(contact);
+ removeNotSupportedFields(contact);
emit launchEditor(contact);
mCurrentRequestIndex = setCurrentRequestAsync();
@@ -186,245 +182,85 @@
/*
* Remove details not supported in symbian back-end.
*/
-void CntServiceHandler::removeDetails(QContact& contact)
+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::removeFields(QContact& contact)
+void CntServiceHandler::removeNotSupportedFields(QContact& contact)
{
- // Replace 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() == QContactBirthday::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactBirthday saveBod;
- QContactBirthday bodDetail = static_cast<QContactBirthday>(detail);
-
- if(!bodDetail.date().isNull())
- saveBod.setDate(bodDetail.date());
-
- contact.removeDetail(&bodDetail);
- contact.saveDetail(&saveBod);
- }
- else if(detail.definitionName() == QContactNickname::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactNickname saveName;
- QContactNickname nameDetail = static_cast<QContactNickname>(detail);
-
- if(!nameDetail.nickname().isEmpty())
- saveName.setNickname(nameDetail.nickname());
-
- contact.removeDetail(&nameDetail);
- contact.saveDetail(&saveName);
- }
- else if(detail.definitionName() == QContactNote::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactNote saveNote;
- QContactNote noteDetail = static_cast<QContactNote>(detail);
-
- if(!noteDetail.note().isEmpty())
- saveNote.setNote(noteDetail.note());
-
- contact.removeDetail(¬eDetail);
- contact.saveDetail(&saveNote);
- }
- else if(detail.definitionName() == QContactOrganization::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactOrganization saveOrg;
- QContactOrganization orgDetail = static_cast<QContactOrganization>(detail);
-
- if(!orgDetail.name().isEmpty())
- saveOrg.setName(orgDetail.name());
- if(!orgDetail.title().isEmpty())
- saveOrg.setTitle(orgDetail.title());
- if(!orgDetail.assistantName().isEmpty())
- saveOrg.setAssistantName(orgDetail.assistantName());
- if(!orgDetail.department().isEmpty())
- saveOrg.setDepartment(orgDetail.department());
-
- if(orgDetail.contexts().size() > 0
- && (orgDetail.contexts().contains(QContactDetail::ContextHome)
- || orgDetail.contexts().contains(QContactDetail::ContextWork)))
- {
- saveOrg.setContexts(orgDetail.contexts());
- }
-
- contact.removeDetail(&orgDetail);
- contact.saveDetail(&saveOrg);
- }
- else if(detail.definitionName() == QContactAddress::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactAddress saveAddr;
+ if (detail.definitionName() == QContactAddress::DefinitionName)
+ {
QContactAddress addrDetail = static_cast<QContactAddress>(detail);
- if(!addrDetail.street().isEmpty())
- saveAddr.setStreet(addrDetail.street());
- if(!addrDetail.locality().isEmpty())
- saveAddr.setLocality(addrDetail.locality());
- if(!addrDetail.region().isEmpty())
- saveAddr.setRegion(addrDetail.region());
- if(!addrDetail.postcode().isEmpty())
- saveAddr.setPostcode(addrDetail.postcode());
- if(!addrDetail.country().isEmpty())
- saveAddr.setCountry(addrDetail.country());
- if(!addrDetail.postOfficeBox().isEmpty())
- saveAddr.setPostOfficeBox(addrDetail.postOfficeBox());
-
- if(addrDetail.contexts().size() > 0
- && (addrDetail.contexts().contains(QContactDetail::ContextHome)
- || addrDetail.contexts().contains(QContactDetail::ContextWork)))
- {
- saveAddr.setContexts(addrDetail.contexts());
- }
-
- contact.removeDetail(&addrDetail);
- contact.saveDetail(&saveAddr);
- }
- else if(detail.definitionName() == QContactAnniversary::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactAnniversary saveAnniv;
+ // Sub-types not supported
+ if (detail.removeValue(QContactAddress::FieldSubTypes))
+ contact.saveDetail(&detail);
+ }
+ else if (detail.definitionName() == QContactAnniversary::DefinitionName)
+ {
QContactAnniversary annivDetail = static_cast<QContactAnniversary>(detail);
- if(!annivDetail.originalDate().isNull())
- saveAnniv.setOriginalDate(annivDetail.originalDate());
- if(!annivDetail.event().isEmpty())
- saveAnniv.setEvent(annivDetail.event());
-
- contact.removeDetail(&annivDetail);
- contact.saveDetail(&saveAnniv);
- }
- else if(detail.definitionName() == QContactGender::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactGender saveGender;
- QContactGender genderDetail = static_cast<QContactGender>(detail);
-
- if(!genderDetail.gender().isEmpty())
- saveGender.setGender(genderDetail.gender());
+ // Sub-types not supported
+ if (detail.removeValue(QContactAnniversary::FieldSubType))
+ contact.saveDetail(&detail);
- contact.removeDetail(&genderDetail);
- contact.saveDetail(&saveGender);
- }
- else if(detail.definitionName() == QContactGeoLocation::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactGeoLocation saveGeo;
- QContactGeoLocation geoDetail = static_cast<QContactGeoLocation>(detail);
-
- QString latitude,longitude;
- latitude.setNum(geoDetail.latitude());
- longitude.setNum(geoDetail.longitude());
-
- if(!latitude.isEmpty())
- saveGeo.setLatitude(geoDetail.latitude());
- if(!longitude.isEmpty())
- saveGeo.setLongitude(geoDetail.longitude());
-
- if(geoDetail.contexts().size() > 0
- && (geoDetail.contexts().contains(QContactDetail::ContextHome)
- || geoDetail.contexts().contains(QContactDetail::ContextWork)))
- {
- saveGeo.setContexts(geoDetail.contexts());
- }
-
- contact.removeDetail(&geoDetail);
- contact.saveDetail(&saveGeo);
- }
- else if(detail.definitionName() == QContactPhoneNumber::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactPhoneNumber savePhone;
+ // 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.number().isEmpty())
- savePhone.setNumber(phoneDetail.number());
-
- if(phoneDetail.subTypes().size() > 0)
- savePhone.setSubTypes(phoneDetail.subTypes());
-
- if(phoneDetail.contexts().size() > 0
- && (phoneDetail.contexts().contains(QContactDetail::ContextHome)
- || phoneDetail.contexts().contains(QContactDetail::ContextWork)))
- {
- savePhone.setContexts(phoneDetail.contexts());
- }
-
- contact.removeDetail(&phoneDetail);
- contact.saveDetail(&savePhone);
+ if (phoneDetail.subTypes().size() == 0)
+ {
+ // No Sub-type found, set as SubTypeMobile
+ phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile);
+ contact.saveDetail(&phoneDetail);
}
- else if(detail.definitionName() == QContactOnlineAccount::DefinitionName)
+ else if (phoneDetail.subTypes().size() > 0 )
{
- // Not all fields are supported in symbian back-end, replace
- QContactOnlineAccount saveOnlineAcc;
- QContactOnlineAccount onlineAccDetail = static_cast<QContactOnlineAccount>(detail);
-
- if(!onlineAccDetail.accountUri().isEmpty())
- saveOnlineAcc.setAccountUri(onlineAccDetail.accountUri());
- if(!onlineAccDetail.serviceProvider().isEmpty())
- saveOnlineAcc.setServiceProvider(onlineAccDetail.serviceProvider());
- if(!onlineAccDetail.presence().isEmpty())
- saveOnlineAcc.setPresence(onlineAccDetail.presence());
- if(!onlineAccDetail.statusMessage().isEmpty())
- saveOnlineAcc.setStatusMessage(onlineAccDetail.statusMessage());
-
- if(onlineAccDetail.subTypes().size() > 0)
- saveOnlineAcc.setSubTypes(onlineAccDetail.subTypes());
-
- if(onlineAccDetail.contexts().size() > 0
- && (onlineAccDetail.contexts().contains(QContactDetail::ContextHome)
- || onlineAccDetail.contexts().contains(QContactDetail::ContextWork)))
+ // Sub-types not supported
+ if (phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice)
+ || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable)
+ || phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVideo))
{
- saveOnlineAcc.setContexts(onlineAccDetail.contexts());
+ // Replace as SubTypeMobile
+ phoneDetail.setSubTypes(QContactPhoneNumber::SubTypeMobile);
+ contact.saveDetail(&phoneDetail);
}
-
- contact.removeDetail(&onlineAccDetail);
- contact.saveDetail(&saveOnlineAcc);
}
- else if(detail.definitionName() == QContactUrl::DefinitionName)
- {
- // Not all fields are supported in symbian back-end, replace
- QContactUrl saveUrl;
+ }
+ else if (detail.definitionName() == QContactUrl::DefinitionName)
+ {
QContactUrl urlDetail = static_cast<QContactUrl>(detail);
- if(!urlDetail.url().isEmpty())
- saveUrl.setUrl(urlDetail.url());
-
QString stype=QContactUrl::SubTypeHomePage;
- if(urlDetail.subType().compare(stype) == 0)
- {
- saveUrl.setSubType(stype);
- }
-
- if(urlDetail.contexts().size() > 0
- && (urlDetail.contexts().contains(QContactDetail::ContextHome)
- || urlDetail.contexts().contains(QContactDetail::ContextWork)))
- {
- saveUrl.setContexts(urlDetail.contexts());
- }
-
- contact.removeDetail(&urlDetail);
- contact.saveDetail(&saveUrl);
+ 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)
--- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp Fri May 14 15:42:23 2010 +0300
@@ -29,10 +29,10 @@
#include <QGraphicsLinearLayout>
#include <QDebug>
+
testPbkServices::testPbkServices(HbMainWindow *aParent)
{
- mSndFetch=0;
- mSndEdit=0;
+ mRequest=NULL;
mMainWindow=aParent;
setParent(aParent);
@@ -40,139 +40,178 @@
testPbkServices::~testPbkServices()
{
-
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
}
void testPbkServices::launchEditorNumber()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editCreateNew(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactPhoneNumber::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "1234567";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editCreateNew(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactPhoneNumber::DefinitionName.operator QVariant();
+ args << "1234567";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchEditorEmail()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editCreateNew(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactEmailAddress::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "email@mailprovider.com";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editCreateNew(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactEmailAddress::DefinitionName.operator QVariant();
+ args << "email@mailprovider.com";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchEditorOnlineAccount()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editCreateNew(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactOnlineAccount::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "account@provider.com";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editCreateNew(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactOnlineAccount::DefinitionName.operator QVariant();
+ args << "account@provider.com";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchEditorVCard()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editCreateNew(QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString filename("C:\\data\\Others\\testvcard.vcf");
- *mSndEdit << filename;
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editCreateNew(QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << "C:\\data\\Others\\testvcard.vcf";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchUpdateEditorNumber()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editUpdateExisting(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactPhoneNumber::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "1234567";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editUpdateExisting(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactPhoneNumber::DefinitionName.operator QVariant();
+ args << "1234567";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchUpdateEditorEmail()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editUpdateExisting(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactEmailAddress::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "email@mailprovider.com";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editUpdateExisting(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactEmailAddress::DefinitionName.operator QVariant();
+ args << "email@mailprovider.com";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchUpdateEditorOnlineAccount()
{
- if (mSndEdit)
- {
- delete mSndEdit;
- mSndEdit=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndEdit = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "editUpdateExisting(QString,QString)", false);
- connect(mSndEdit, SIGNAL(requestCompleted(QVariant)), this, SLOT(onEditCompleted(QVariant)));
-
- QString type = QContactOnlineAccount::DefinitionName;
- *mSndEdit << type;
- *mSndEdit << "account@provider.com";
-
- QVariant retValue;
- bool res=mSndEdit->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("editUpdateExisting(QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onEditCompleted(const QVariant&)));
+
+ args << QContactOnlineAccount::DefinitionName.operator QVariant();
+ args << "account@provider.com";
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::onEditCompleted(const QVariant& value)
@@ -197,84 +236,103 @@
void testPbkServices::launchFetch()
{
-
- if (mSndFetch)
- {
- delete mSndFetch;
- mSndFetch=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- //XQServiceRequest snd("com.nokia.services.hbserviceprovider.Dialer","dial(QString)",true);
- mSndFetch = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "fetch(QString,QString,QString)",false);
- connect(mSndFetch, SIGNAL(requestCompleted(QVariant)), this, SLOT(onRequestCompleted(QVariant)));
-
- *mSndFetch << "Non-filtered multi-fetch";
- *mSndFetch << KCntActionAll;
- *mSndFetch << KCntFilterDisplayAll;
-
- QVariant retValue;
- bool res=mSndFetch->send(retValue);
-
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("fetch(QString,QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&)));
+
+ args << "Non-filtered multi-fetch";
+ args << KCntActionAll;
+ args << KCntFilterDisplayAll;
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchSingleFetch()
{
- if (mSndFetch)
- {
- delete mSndFetch;
- mSndFetch=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- mSndFetch = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "Dofetch(QString,QString,QString,QString)",false);
- connect(mSndFetch, SIGNAL(requestCompleted(QVariant)), this, SLOT(onRequestCompleted(QVariant)));
-
- *mSndFetch << "Single-fetching";
- *mSndFetch << KCntActionAll;
- *mSndFetch << KCntFilterDisplayAll;
- *mSndFetch << KCntSingleSelectionMode;
-
- QVariant retValue;
- bool res=mSndFetch->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("Dofetch(QString,QString,QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&)));
+
+ args << "Single-fetching";
+ args << KCntActionAll;
+ args << KCntFilterDisplayAll;
+ args << KCntSingleSelectionMode;
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchSmsFilteredFetch()
{
-
- if (mSndFetch)
- {
- delete mSndFetch;
- mSndFetch=0;
- }
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- //XQServiceRequest snd("com.nokia.services.hbserviceprovider.Dialer","dial(QString)",true);
- mSndFetch = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "fetch(QString,QString,QString)",false);
- connect(mSndFetch, SIGNAL(requestCompleted(QVariant)), this, SLOT(onRequestCompleted(QVariant)));
-
- *mSndFetch << "Filtered multi-fetch";
- *mSndFetch << KCntActionSms;
- *mSndFetch << KCntFilterDisplayAll;
-
- QVariant retValue;
- bool res=mSndFetch->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("fetch(QString,QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&)));
+
+ args << "Filtered multi-fetch";
+ args << KCntActionSms;
+ args << KCntFilterDisplayAll;
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
void testPbkServices::launchEmailFilteredFetch()
{
+ if (mRequest)
+ {
+ delete mRequest;
+ mRequest=0;
+ }
- if (mSndFetch)
- {
- delete mSndFetch;
- mSndFetch=0;
- }
- mSndFetch = new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "fetch(QString,QString,QString)",false);
- connect(mSndFetch, SIGNAL(requestCompleted(QVariant)), this, SLOT(onRequestCompleted(QVariant)));
-
- *mSndFetch << "Filtered multi-fetch";
- *mSndFetch << KCntActionEmail;
- *mSndFetch << KCntFilterDisplayAll;
-
- QVariant retValue;
- bool res=mSndFetch->send(retValue);
+ QVariantList args;
+ QString serviceName("com.nokia.services.phonebookservices");
+ QString operation("fetch(QString,QString,QString)");
+ XQApplicationManager appMng;
+ mRequest = appMng.create(serviceName, "Fetch", operation, true); // embedded
+
+ // Result handlers
+ connect (mRequest, SIGNAL(requestOk(const QVariant&)), this, SLOT(onRequestCompleted(const QVariant&)));
+
+ args << "Filtered multi-fetch";
+ args << KCntActionEmail;
+ args << KCntFilterDisplayAll;
+
+ mRequest->setArguments(args);
+ mRequest->send();
}
--- a/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Mon May 03 12:24:20 2010 +0300
+++ b/phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.h Fri May 14 15:42:23 2010 +0300
@@ -22,7 +22,7 @@
#include <QVariant>
#include <qmobilityglobal.h> //defines Q_SFW_EXPORT
-#include <xqservicerequest.h>
+#include <xqappmgr.h>
class HbMainWindow;
@@ -51,9 +51,8 @@
private:
- XQServiceRequest *mSndFetch;
- XQServiceRequest *mSndEdit;
- HbMainWindow *mMainWindow;
+ XQAiwRequest *mRequest;
+ HbMainWindow *mMainWindow;
};
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/cntsymbiandatabase.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/cntsymbiandatabase.h Fri May 14 15:42:23 2010 +0300
@@ -89,11 +89,11 @@
QSet<QContactLocalId> groupMembersL(QContactLocalId groupId);
private:
- CContactDatabase* m_contactDatabase;
#ifndef SYMBIAN_BACKEND_USE_SQLITE
CContactChangeNotifier* m_contactChangeNotifier;
#endif
QContactManagerEngine *m_engine;
+ CContactDatabase* m_contactDatabase;
QList<QContactLocalId> m_contactsEmitted;
QContactLocalId m_currentOwnCardId;
QMap<QContactLocalId, QSet<QContactLocalId> > m_groupContents;
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/cntsymbianengine.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/cntsymbianengine.h Fri May 14 15:42:23 2010 +0300
@@ -71,6 +71,7 @@
class QContactAbstractRequest;
QTM_END_NAMESPACE
class CntSymbianDatabase;
+class CntSymbianSrvConnection;
class CntTransformContact;
class CntAbstractContactFilter;
class CntAbstractContactSorter;
@@ -165,16 +166,22 @@
bool cancelRequest(QContactAbstractRequest* req);
bool waitForRequestProgress(QContactAbstractRequest* req, int msecs);
bool waitForRequestFinished(QContactAbstractRequest* req, int msecs);
+
+ /* Delete contact image */
+ void deleteContactImage(const QString& filePath);
private slots:
void performAsynchronousOperation();
private:
CntSymbianDatabase *m_dataBase;
+ CntSymbianSrvConnection *m_srvConnection;
QString m_managerUri;
CntTransformContact *m_transformContact;
CntAbstractContactFilter *m_contactFilter;
+#ifndef SYMBIAN_BACKEND_USE_SQLITE
CntAbstractContactSorter *m_contactSorter;
+#endif
CntRelationship *m_relationship;
CntDisplayLabel *m_displayLabel;
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsqlsearch.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsqlsearch.h Fri May 14 15:42:23 2010 +0300
@@ -56,6 +56,9 @@
Q_OBJECT
public:
+
+enum SearchMethod { Undefinded, ZerosEndOfFirstToken };
+public:
CntSqlSearch();
QString CreatePredictiveSearch(const QString &pattern);
@@ -86,6 +89,9 @@
const QString& lower2,
const QString& upper2) const;
+ QString TwoDifferentTokensSearch(const QString& pattern,
+ const QStringList& tokens) const;
+
QString ExactMatch(const QString& pattern, QString table = "") const;
QString CreateJoinTableSearch(QString pattern, QStringList numbers) const;
@@ -97,6 +103,10 @@
QString UpperLimit( const QString &pattern ) const;
QString LowerLimit( const QString &pattern ) const;
+
+ QString ChangeStringPadings( const QString &pattern ) const;
+
+ bool TestPattern( const QString &pattern, SearchMethod searchMethod = Undefinded ) const;
QString Pad( const QString &pattern, char padChar ) const;
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsymbianfiltersql.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsymbianfiltersql.h Fri May 14 15:42:23 2010 +0300
@@ -56,7 +56,7 @@
class CntSymbianFilter : public CntAbstractContactFilter
{
public:
- CntSymbianFilter(QContactManagerEngine& manager, CContactDatabase& contactDatabase, const CntTransformContact &transformContact);
+ CntSymbianFilter(QContactManagerEngine& manager, CContactDatabase& contactDatabase, CntSymbianSrvConnection &srvConnection, const CntTransformContact &transformContact);
~CntSymbianFilter();
/* from CntAbstractContactFilter */
@@ -77,7 +77,7 @@
CContactDatabase& m_contactDatabase;
CntDbInfo* m_dbInfo;
const CntTransformContact &m_transformContact;
- CntSymbianSrvConnection* m_srvConnection;
+ CntSymbianSrvConnection& m_srvConnection;
QMap<QContactFilter::FilterType, CntAbstractContactFilter*> m_filterMap;
};
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsymbiansrvconnection.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/filtering/cntsymbiansrvconnection.h Fri May 14 15:42:23 2010 +0300
@@ -45,6 +45,7 @@
#include <e32std.h>
#include <cntdb.h>
#include <qcontactmanager.h>
+#include <qcontactmanagerengine.h>
// User includes
@@ -59,25 +60,30 @@
{
public:
/*Constructor and destructor*/
- CntSymbianSrvConnection();
+ CntSymbianSrvConnection(QContactManagerEngine* engine);
~CntSymbianSrvConnection();
public:
/* QT like functions */
QList<QContactLocalId> searchContacts(const QString& searchQuery,
- QContactManager::Error* error);
+ QContactManager::Error* error);
+ QContact searchContactName(QContactLocalId contactId,
+ QContactManager::Error* error);
+ QList<QContact> searchAllContactNames(QContactManager::Error* error);
private:
/* Symbian Leaving functions */
- QList<QContactLocalId> searchContactsL(const TDesC& aSearchQuery);
+ QList<QContactLocalId> searchContactIdsL(const TDesC& aSqlQuery);
+ QList<QContact> searchContactNamesL(const TDesC& aSqlQuery);
+ void readContactsToBufferL(const TDesC& aSqlQuery);
void ConnectSrvL();
void OpenDatabaseL();
TVersion Version() const;
TDes8& GetReceivingBufferL(TInt aSize=0);
- QList<QContactLocalId> UnpackCntIdArrayL();
private:
/* member varibles */
+ QContactManagerEngine* m_manager;
CBufFlat* m_buffer;
TInt m_maxBufferSize;
TPtr8 m_bufPtr;
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/transform/cnttransformcontact.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/transform/cnttransformcontact.h Fri May 14 15:42:23 2010 +0300
@@ -88,6 +88,7 @@
Address,
URL,
OnlineAccount,
+ Presence,
Birthday,
Organisation,
Avatar,
--- a/qtcontactsmobility/plugins/contacts/symbian/inc/transform/cnttransformonlineaccount.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/transform/cnttransformonlineaccount.h Fri May 14 15:42:23 2010 +0300
@@ -50,16 +50,6 @@
class CntTransformOnlineAccount : public CntTransformContactData
{
- enum TPresnceMap
- {
- EPresenceOffline,
- EPresenceAvailable,
- EPresenceHidden,
- EPresenceBusy,
- EPresenceAway,
- EPresenceExtendedAway,
- EPresenceUnknown
- };
public:
CntTransformOnlineAccount();
@@ -75,10 +65,6 @@
void reset();
private:
- quint32 encodePresence(QString aPresence);
- QString decodePresence(quint32 aPresence);
-
-private:
quint32 m_detailCounter;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qtcontactsmobility/plugins/contacts/symbian/inc/transform/cnttransformpresence.h Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifdef SYMBIAN_BACKEND_USE_SQLITE
+
+#ifndef TRANSFORMPRESENCE_H
+#define TRANSFORMPRESENCE_H
+
+#include "cnttransformcontactdata.h"
+
+QTM_USE_NAMESPACE
+
+class CntTransformPresence : public CntTransformContactData
+{
+public:
+ CntTransformPresence();
+
+protected:
+ QList<CContactItemField *> transformDetailL(const QContactDetail &detail);
+ QContactDetail *transformItemField(const CContactItemField& field, const QContact &contact);
+ bool supportsField(TUint32 fieldType) const;
+ bool supportsDetail(QString detailName) const;
+ QList<TUid> supportedSortingFieldTypes(QString detailFieldName) const;
+ bool supportsSubType(const QString& subType) const;
+ quint32 getIdForField(const QString& fieldName) const;
+ void detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const;
+ void reset();
+
+private:
+ QContactPresence::PresenceState decodePresence(QString presence);
+
+private:
+ quint32 m_detailCounter;
+};
+
+#endif // TRANSFORMPRESENCE_H
+
+#endif // SYMBIAN_BACKEND_USE_SQLITE
--- a/qtcontactsmobility/plugins/contacts/symbian/src/cntsymbianengine.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/cntsymbianengine.cpp Fri May 14 15:42:23 2010 +0300
@@ -40,12 +40,17 @@
****************************************************************************/
#include <QFileSystemWatcher>
#include <QFile>
+#include <QDir>
#include <QUuid>
#include <QTimer>
#include <QDebug>
+#include <pathinfo.h>
+#include <driveinfo.h>
+
#include <qtcontacts.h>
+#include <qcontactname.h>
#include "cntsymbianengine.h"
#include "qcontactchangeset.h"
@@ -57,10 +62,13 @@
#include "cntsymbiansorterdbms.h"
#include "cntrelationship.h"
#include "cntdisplaylabel.h"
+#include "cntsymbiansrvconnection.h"
typedef QList<QContactLocalId> QContactLocalIdList;
typedef QPair<QContactLocalId, QContactLocalId> QOwnCardPair;
+const char* CNT_IMAGES_FOLDER = "Data\\20022EF9\\";
+
// NOTE: There is a bug with RVCT compiler which causes the local stack
// variable to corrupt if the called function leaves. As a workaround we are
// reserving the objects from heap so it will not get corrupted.
@@ -79,17 +87,18 @@
*error = QContactManager::NoError;
m_dataBase = new CntSymbianDatabase(this, error);
-
- //Database opened successfully
- if(*error == QContactManager::NoError) {
+
+ // Database opened successfully
+ if (*error == QContactManager::NoError) {
m_managerUri = QContactManager::buildUri(CNT_SYMBIAN_MANAGER_NAME, parameters);
m_transformContact = new CntTransformContact;
+ m_srvConnection = new CntSymbianSrvConnection(this);
#ifdef SYMBIAN_BACKEND_USE_SQLITE
- m_contactFilter = new CntSymbianFilter(*this, *m_dataBase->contactDatabase(), *m_transformContact);
+ m_contactFilter = new CntSymbianFilter(*this, *m_dataBase->contactDatabase(), *m_srvConnection, *m_transformContact);
#else
m_contactFilter = new CntSymbianFilter(*m_dataBase->contactDatabase());
+ m_contactSorter = new CntSymbianSorterDbms(*m_dataBase->contactDatabase(), *m_transformContact);
#endif
- m_contactSorter = new CntSymbianSorterDbms(*m_dataBase->contactDatabase(), *m_transformContact);
m_relationship = new CntRelationship(m_dataBase->contactDatabase(), m_managerUri);
m_displayLabel = new CntDisplayLabel();
}
@@ -99,8 +108,11 @@
{
delete m_contactFilter; // needs to be deleted before database
delete m_dataBase;
+ delete m_srvConnection;
delete m_transformContact;
+#ifndef SYMBIAN_BACKEND_USE_SQLITE
delete m_contactSorter;
+#endif
delete m_relationship;
delete m_displayLabel;
}
@@ -120,7 +132,7 @@
bool filterSupported(true);
result = m_contactFilter->contacts(filter, sortOrders, filterSupported, error);
-
+
#ifdef SYMBIAN_BACKEND_USE_SQLITE
// Remove possible false positives
@@ -150,48 +162,24 @@
return result;
}
-#if 0
-// These functions are not used anymore - there is always a filter (which may be the default filter)
-QList<QContactLocalId> CntSymbianEngine::contactIds(const QList<QContactSortOrder>& sortOrders, QContactManager::Error* error) const
-{
- // Check if sorting is supported by backend
- if(m_contactSorter->sortOrderSupported(sortOrders))
- return m_contactSorter->contacts(sortOrders,error);
-
- // Backend does not support this sorting.
- // Fall back to slow QContact-level sorting method.
-
- // Get unsorted contact ids
- QList<QContactSortOrder> noSortOrders;
- QList<QContactLocalId> unsortedIds = m_contactSorter->contacts(noSortOrders, error);
- if (*error != QContactManager::NoError)
- return QList<QContactLocalId>();
-
- // Sort contacts
- return slowSort(unsortedIds, sortOrders, error);
-}
-
-QList<QContact> CntSymbianEngine::contacts(const QList<QContactSortOrder>& sortOrders, const QStringList& definitionRestrictions, QContactManager::Error* error) const
-{
- *error = QContactManager::NoError;
- QList<QContact> contacts;
- QList<QContactLocalId> contactIds = this->contactIds(sortOrders, error);
- if (*error == QContactManager::NoError ) {
- foreach (QContactLocalId id, contactIds) {
- QContact contact = this->contact(id, definitionRestrictions, error);
- if (*error != QContactManager::NoError) {
- return QList<QContact>(); // return empty list if error occurred
- }
- contacts.append(contact);
- }
- }
- return contacts;
-}
-#endif
-
QList<QContact> CntSymbianEngine::contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, const QContactFetchHint& fh, QContactManager::Error* error) const
{
*error = QContactManager::NoError;
+
+ // special case: use optimized fetch if
+ // * only display labels are requested
+ // * the filter is a detail filter for QContactType's TypeContact
+ // * there are no sort orders
+ QStringList detailRestrictions = fh.detailDefinitionsHint();
+ if (detailRestrictions.count() == 1 &&
+ detailRestrictions.at(0) == QContactDisplayLabel::DefinitionName &&
+ filter.type() == QContactFilter::ContactDetailFilter &&
+ QContactDetailFilter(filter).detailDefinitionName() == QContactType::DefinitionName &&
+ QContactDetailFilter(filter).value().toString() == QContactType::TypeContact &&
+ sortOrders.isEmpty()) {
+ return m_srvConnection->searchAllContactNames(error);
+ }
+
QList<QContact> contacts;
QList<QContactLocalId> contactIds = this->contactIds(filter, sortOrders, error);
if (*error == QContactManager::NoError ) {
@@ -203,6 +191,7 @@
contacts.append(contact);
}
}
+
return contacts;
}
@@ -216,8 +205,15 @@
*/
QContact CntSymbianEngine::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint, QContactManager::Error* error) const
{
+ // special case: use optimized fetch if only display label is requested
+ QStringList detailRestrictions = fetchHint.detailDefinitionsHint();
+ if (detailRestrictions.count() == 1 &&
+ detailRestrictions.at(0) == QContactDisplayLabel::DefinitionName) {
+ return m_srvConnection->searchContactName(contactId, error);
+ }
+
QContact* contact = new QContact();
- TRAPD(err, *contact = fetchContactL(contactId, fetchHint.detailDefinitionsHint()));
+ TRAPD(err, *contact = fetchContactL(contactId, detailRestrictions));
CntSymbianTransformError::transformError(err, error);
if(*error == QContactManager::NoError) {
@@ -567,6 +563,20 @@
TContactItemId cId = static_cast<TContactItemId>(id);
//TODO: add code to remove all relationships.
+
+ // Read the contact from the CContactDatabase
+ CContactItem* contactItem = m_dataBase->contactDatabase()->ReadContactL(cId);
+ CleanupStack::PushL(contactItem);
+ QContact contact = m_transformContact->transformContactL(*contactItem);
+
+ // Delete contact images
+ QList<QContactAvatar> details = contact.details<QContactAvatar>();
+ for (int i = 0;i < details.count();i++) {
+ if (!details.at(i).imageUrl().isEmpty()) {
+ deleteContactImage(details.at(i).imageUrl().toString());
+ }
+ }
+ CleanupStack::PopAndDestroy(contactItem);
m_dataBase->contactDatabase()->DeleteContactL(cId);
#ifdef SYMBIAN_BACKEND_S60_VERSION_32
@@ -732,6 +742,42 @@
return returnValue;
}
+void CntSymbianEngine::deleteContactImage(const QString& filePath)
+{
+ RFs fsSession;
+ int drive;
+ int err = KErrNone;
+
+ // Connect to file session
+ err= fsSession.Connect();
+ if(err!=KErrNone)
+ return;
+
+ // Get the drive/volume details
+ TVolumeInfo vInfo;
+ err = DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, drive);
+ if (KErrNone==err) {
+ err = fsSession.Volume(vInfo, drive);
+ }
+
+ // Delete image saved in contacts images folder
+ // Folder <Drive>:/Data/20022EF9
+ if(KErrNone==err) {
+ // Get the root path
+ TFileName tPath;
+ PathInfo::GetRootPath(tPath, drive);
+ QString basePath = QString::fromUtf16(tPath.Ptr(), tPath.Length());
+
+ QDir dir(basePath);
+ if (dir.cd(CNT_IMAGES_FOLDER)) {
+ basePath=QDir::toNativeSeparators(dir.path());
+ if(filePath.startsWith(basePath)) {
+ dir.remove(filePath);
+ }
+ }
+ }
+ fsSession.Close();
+}
QMap<QString, QContactDetailDefinition> CntSymbianEngine::detailDefinitions(const QString& contactType, QContactManager::Error* error) const
{
--- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntdbinfo.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntdbinfo.cpp Fri May 14 15:42:23 2010 +0300
@@ -150,7 +150,7 @@
// Default sort order
QString col;
if(s.caseSensitivity() == Qt::CaseInsensitive)
- col= ' ' + columnName + ' ' + "COLLATE NOCASE ASC";
+ col= ' ' + columnName + ' ' + "COLLATE CompareC3";
else
col= ' ' + columnName + ' ' + "ASC";
list.append(col);
--- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsqlsearch.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsqlsearch.cpp Fri May 14 15:42:23 2010 +0300
@@ -41,6 +41,8 @@
#include <QStringList>
#include "cntsqlsearch.h"
+#include <QHash>
+#include <QLocale>
const char KLimitLength = 15;
const int KTwoTokens = 2;
@@ -48,6 +50,7 @@
const char KLowerLimitPadding = '0';
const char KUpperLimitPadding = 'F';
const int KMinimumSearchPatternLength = 1;
+const int KHexadecimalBase = 16;
#define ORDER_BY_FIRSTNAME_LASTNAME " ORDER BY first_name, last_name ASC;"
@@ -62,6 +65,13 @@
const QString KColumn3 = "nbr3";
const QString KColumn4 = "nbr4";
+// Special handling for characters that originate from * and # keys
+const QChar KStarChar('*');
+const QChar KPlusChar('+');
+const QChar KPChar('p');
+const QChar KWChar('w');
+const QChar KHashChar('#');
+
CntSqlSearch::CntSqlSearch()
{
@@ -100,15 +110,16 @@
QString CntSqlSearch::CreatePredictiveSearch(const QString &pattern)
{
int len = pattern.length();
+ QString newPattern = ChangeStringPadings(pattern);
// For best performance, handle 1 digit case first
if (len == KMinimumSearchPatternLength)
{
// Case 1
- return SELECT_CONTACT_ID + SelectTable(pattern) + ORDER_BY_FIRSTNAME_LASTNAME;
+ return SELECT_CONTACT_ID + SelectTable(newPattern) + ORDER_BY_FIRSTNAME_LASTNAME;
}
if (len <= KLimitLength && len > KMinimumSearchPatternLength)
{
- return CreateQuery(pattern);
+ return CreateQuery(newPattern);
}
return QString(""); // Invalid pattern
@@ -116,68 +127,86 @@
QString CntSqlSearch::SelectTable(const QString &pattern) const
{
- QString predictivesearch;
- if (pattern.length() == 0)
- {
- return "";
- }
- switch (pattern.at(0).digitValue())
- {
- case 0:
- {
- predictivesearch = QString("predictivesearch0");
- }
- break;
- case 1:
+ QString predictivesearch;
+ QStringList tokens = GetTokens(pattern);
+ bool ok;
+ if (pattern.length() == 0)
+ {
+ return "";
+ }
+ QString firstNumber(pattern.at(0));
+ uint hex = firstNumber.toUInt(&ok, 16);
+ if (!ok)
{
- predictivesearch = QString("predictivesearch1");
- }
- break;
- case 2:
- {
- predictivesearch = QString("predictivesearch2");
- }
- break;
- case 3:
- {
- predictivesearch = QString("predictivesearch3");
- }
- break;
- case 4:
- {
- predictivesearch = QString("predictivesearch4");
+ // TODO: handle error (=invalid characters in pattern)
}
- break;
- case 5:
+ switch (hex)
{
- predictivesearch = QString("predictivesearch5");
- }
- break;
- case 6:
- {
- predictivesearch = QString("predictivesearch6");
- }
- break;
- case 7:
- {
- predictivesearch = QString("predictivesearch7");
+ case 0:
+ {
+ predictivesearch = QString("predictivesearch0");
+ }
+ break;
+ case 1:
+ {
+ predictivesearch = QString("predictivesearch1");
+ }
+ break;
+ case 2:
+ {
+ predictivesearch = QString("predictivesearch2");
+ }
+ break;
+ case 3:
+ {
+ predictivesearch = QString("predictivesearch3");
+ }
+ break;
+ case 4:
+ {
+ predictivesearch = QString("predictivesearch4");
+ }
+ break;
+ case 5:
+ {
+ predictivesearch = QString("predictivesearch5");
+ }
+ break;
+ case 6:
+ {
+ predictivesearch = QString("predictivesearch6");
+ }
+ break;
+ case 7:
+ {
+ predictivesearch = QString("predictivesearch7");
+ }
+ break;
+ case 8:
+ {
+ predictivesearch = QString("predictivesearch8");
+ }
+ break;
+ case 9:
+ {
+ predictivesearch = QString("predictivesearch9");
+ }
+ break;
+ case 10:
+ {
+ predictivesearch = QString("predictivesearch10");
+ }
+ break;
+ case 11:
+ {
+ predictivesearch = QString("predictivesearch11");
+ }
+ break;
+ default: // error
+ predictivesearch = "";
+ break;
}
- break;
- case 8:
- {
- predictivesearch = QString("predictivesearch8");
- }
- break;
- case 9:
- {
- predictivesearch = QString("predictivesearch9");
- }
- break;
- default: // error
- predictivesearch = "";
- break;
- }
- return predictivesearch;
+ return predictivesearch;
}
// Even if there are over 2 tokens, make 2 tokens.
@@ -186,7 +215,7 @@
// E.g. "0010230" results tokens "001" and "230" and
// "001230045067800900" tokens "00123" and "45067800900".
QStringList CntSqlSearch::GetTokens(const QString& pattern) const
- {
+ {
const QChar KZero('0');
QStringList tokens = pattern.split(KZero, QString::SkipEmptyParts);
if (tokens.count() < KTwoTokens)
@@ -212,17 +241,17 @@
}
twoTokens.append(pattern.mid(i));
return twoTokens;
- }
+ }
// pattern length is between KMinimumSearchPatternLength...KLimitLength
QString CntSqlSearch::CreateQuery(const QString& pattern) const
{
- QStringList tokens = GetTokens(pattern);
+ QStringList tokens = GetTokens(pattern);
if (tokens.count() < KTwoTokens)
{
- if( tokens.count() == KOneToken && !tokens.at(0).contains("0") && !pattern.startsWith('0') && pattern.endsWith('0'))
+ if( TestPattern(pattern, CntSqlSearch::ZerosEndOfFirstToken))
{
- return IdenticalTokensSearch(pattern, tokens) + Order(tokens); // Case 6
+ return TwoDifferentTokensSearch(pattern, tokens); // Case 6
}
else
{
@@ -316,7 +345,7 @@
// and Y means: (value > lower-limit-2 AND value < upper-limit-2)
QString CntSqlSearch::SearchTokensFromOneTable(const QString& pattern,
const QStringList& tokens) const
- {
+ {
QString token = tokens.at(0);
QString lower = LowerLimit(token);
QString upper = UpperLimit(token);
@@ -363,6 +392,26 @@
return query;
}
+
+QString CntSqlSearch::TwoDifferentTokensSearch(const QString& pattern, const QStringList& tokens) const
+ {
+ QString token = tokens.at(0);
+ QString sortPatern = pattern;
+ sortPatern.truncate(pattern.length()-1);
+#if defined(USE_DEMORGAN)
+ QString query(SELECT_CONTACT_ID + SelectTable(pattern) + " WHERE NOT(NOT" +
+ ExactMatch(sortPatern) +
+ " AND NOT" + ExactMatch(pattern) + ")");
+#else
+ QString query(SELECT_CONTACT_ID + SelectTable(pattern) + " WHERE (" +
+ ExactMatch(sortPatern) + // exact match (e.g. "2")
+ ") OR " + ExactMatch(pattern)); // exact match (e.g. "20")
+#endif
+ query += Order(tokens);
+ return query;
+ }
+
+
// Put individual AND / OR operations in such order that in most cases there is
// no need to evaluate all arguments of the AND / OR.
// In case of AND, put the less likely condition on the left side of AND.
@@ -547,24 +596,27 @@
}
QString CntSqlSearch::ExactMatchColumns(QStringList numbers) const
- {
-
- QString firstColumn = numbers.at(0);
- QString secondColumn = numbers.at(1);
+ {
+ const int KFirstColumn = 0;
+ const int KSecondColumn = 1;
+ QString firstColumn = numbers.at(KFirstColumn);
+ QString secondColumn = numbers.at(KSecondColumn);
- if( firstColumn.count() > 1 && secondColumn.count() > 1)
- {
- return "(" + ExactMatch(numbers.at(0), SelectTable(numbers.at(0))) + " AND " + ExactMatch(numbers.at(1), SelectTable(numbers.at(1))) + ")";
- }
- else if(firstColumn.count() > 1)
- {
- return ExactMatch(numbers.at(0), SelectTable(numbers.at(0)));
- }
- else
- {
- return ExactMatch(numbers.at(1), SelectTable(numbers.at(1)));
- }
+ if( firstColumn.count() > 1 && secondColumn.count() > 1)
+ {
+ return "(" + ExactMatch(numbers.at(KFirstColumn), SelectTable(numbers.at(KFirstColumn)))
+ + " AND " +
+ ExactMatch(numbers.at(KSecondColumn), SelectTable(numbers.at(KSecondColumn))) + ")";
}
+ else if(firstColumn.count() > 1)
+ {
+ return ExactMatch(numbers.at(KFirstColumn), SelectTable(numbers.at(KFirstColumn)));
+ }
+ else
+ {
+ return ExactMatch(numbers.at(KSecondColumn), SelectTable(numbers.at(KSecondColumn)));
+ }
+ }
QString CntSqlSearch::Order(QStringList tokens) const
{
@@ -576,6 +628,46 @@
return QString(ORDER_BY_FIRSTNAME_LASTNAME);
}
+QString CntSqlSearch::ChangeStringPadings( const QString &pattern ) const
+ {
+ QString newPattern = pattern;
+ if (QLocale::system().language() == QLocale::Thai)
+ {
+ newPattern.remove(KStarChar, Qt::CaseInsensitive);
+ newPattern.remove(KPlusChar, Qt::CaseInsensitive);
+ newPattern.remove(KPChar, Qt::CaseInsensitive);
+ newPattern.remove(KWChar, Qt::CaseInsensitive);
+ newPattern.remove(KHashChar, Qt::CaseInsensitive);
+ }
+ else
+ {
+ newPattern.replace(KStarChar, 'A');
+ newPattern.replace(KPlusChar, 'A');
+ newPattern.replace(KPChar, 'A');
+ newPattern.replace(KWChar, 'A');
+ newPattern.replace(KHashChar, 'B');
+ }
+ return newPattern;
+ }
+
+bool CntSqlSearch::TestPattern( const QString &pattern, SearchMethod searchMethod ) const
+ {
+ QStringList tokens = GetTokens(pattern);
+ if (!tokens.isEmpty() && !pattern.isEmpty())
+ {
+ if (CntSqlSearch::ZerosEndOfFirstToken == searchMethod)
+ {
+ if( tokens.count() == KOneToken && !tokens.at(0).contains("0")
+ && !pattern.startsWith('0') && pattern.count('0') == 1
+ && pattern.endsWith('0'))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
QString CntSqlSearch::Pad( const QString &pattern, char padChar ) const
{
int padCount = KLimitLength - pattern.length();
@@ -592,7 +684,6 @@
result.append(padChar);
}
}
- const int KHexadecimalBase = 16;
bool ok;
// Use signed int to prevent underflow when replaced is "00...00"
qint64 value = result.toLongLong(&ok, KHexadecimalBase);
--- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbianfiltersql.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbianfiltersql.cpp Fri May 14 15:42:23 2010 +0300
@@ -61,37 +61,31 @@
#include <cntdb.h>
-CntSymbianFilter::CntSymbianFilter(QContactManagerEngine& /*manager*/, CContactDatabase& contactDatabase, const CntTransformContact &transformContact):
+CntSymbianFilter::CntSymbianFilter(QContactManagerEngine& /*manager*/, CContactDatabase& contactDatabase, CntSymbianSrvConnection &srvConnection, const CntTransformContact &transformContact):
m_contactDatabase(contactDatabase),
- m_transformContact(transformContact)
+ m_transformContact(transformContact),
+ m_srvConnection(srvConnection)
{
- m_srvConnection = new CntSymbianSrvConnection();
m_dbInfo = new CntDbInfo();
initializeFilters();
-
}
void CntSymbianFilter::initializeFilters()
- {
- m_filterMap.insert(QContactFilter::ContactDetailFilter, new CntFilterDetail(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::DefaultFilter, new CntFilterDefault(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::IntersectionFilter, new CntFilterIntersection(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::UnionFilter, new CntFilterUnion(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::RelationshipFilter, new CntFilterRelationship(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::InvalidFilter, new CntFilterInvalid(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::ContactDetailRangeFilter, new CntFilterdetailrange(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::ChangeLogFilter, new CntFilterChangeLog(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::ActionFilter, new CntFilterAction(m_contactDatabase,*m_srvConnection,*m_dbInfo));
- m_filterMap.insert(QContactFilter::LocalIdFilter, new CntFilterLocalId(m_contactDatabase,*m_srvConnection,*m_dbInfo));
-
- }
-
-
+{
+ m_filterMap.insert(QContactFilter::ContactDetailFilter, new CntFilterDetail(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::DefaultFilter, new CntFilterDefault(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::IntersectionFilter, new CntFilterIntersection(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::UnionFilter, new CntFilterUnion(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::RelationshipFilter, new CntFilterRelationship(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::InvalidFilter, new CntFilterInvalid(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::ContactDetailRangeFilter, new CntFilterdetailrange(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::ChangeLogFilter, new CntFilterChangeLog(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::ActionFilter, new CntFilterAction(m_contactDatabase,m_srvConnection,*m_dbInfo));
+ m_filterMap.insert(QContactFilter::LocalIdFilter, new CntFilterLocalId(m_contactDatabase,m_srvConnection,*m_dbInfo));
+}
CntSymbianFilter::~CntSymbianFilter()
{
-
-
//delete the all filters from the map
QMap<QContactFilter::FilterType, CntAbstractContactFilter*>::iterator itr;
@@ -102,7 +96,6 @@
value = 0;
}
- delete m_srvConnection;
delete m_dbInfo;
}
--- a/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbiansrvconnection.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntsymbiansrvconnection.cpp Fri May 14 15:42:23 2010 +0300
@@ -41,6 +41,9 @@
//system includes
#include <e32base.h>
#include <s32mem.h>
+#include <qcontact.h>
+#include <qcontactname.h>
+#include <qcontactorganization.h>
//user includes
#include "cntsymbiansrvconnection.h"
@@ -48,7 +51,7 @@
// Constants
// To be removed. Should be defined in a header file
-#define KCntSearchResultIdLists 99
+#define KCntSearchResultList 99
#define KCntOpenDataBase 100 // = KCapabilityReadUserData
_LIT(KCntServerExe,"CNTSRV.EXE"); // Name of the exe for the Contacts server.
@@ -69,7 +72,8 @@
/*!
* The constructor
*/
-CntSymbianSrvConnection::CntSymbianSrvConnection() :
+CntSymbianSrvConnection::CntSymbianSrvConnection(QContactManagerEngine* manager) :
+ m_manager(manager),
m_buffer(0),
m_bufPtr(0,0,0),
m_isInitialized(false)
@@ -93,22 +97,140 @@
* \return the list of matched contact ids
*/
QList<QContactLocalId> CntSymbianSrvConnection::searchContacts(const QString& sqlQuery,
- QContactManager::Error* error)
+ QContactManager::Error* error)
{
QList<QContactLocalId> list;
TPtrC queryPtr(reinterpret_cast<const TUint16*>(sqlQuery.utf16()));
- TRAPD(err, list = searchContactsL(queryPtr));
+ TRAPD(err, list = searchContactIdsL(queryPtr));
+ CntSymbianTransformError::transformError(err, error);
+ return list;
+}
+
+/*!
+ * Fetches all contact names from the database. If there are more than 3000 contacts,
+ * only the first (by id) 3000 contacts will be fetched due to RAM restrictions.
+ *
+ * \a error On return, contains the possible error.
+ * \return the list of contact names (stored in QContact objects)
+ */
+QList<QContact> CntSymbianSrvConnection::searchAllContactNames(QContactManager::Error* error)
+{
+ QList<QContact> list;
+ TRAPD(err, list = searchContactNamesL(_L("SELECT contact_id, first_name, last_name, company_name FROM contact WHERE (type_flags>>24)=0")));
CntSymbianTransformError::transformError(err, error);
return list;
}
/*!
+ * Query the SQL database
+ *
+ * \a id Id of the contact whose name to search
+ * \a error On return, contains the possible error.
+ * \return the list of matched contact ids
+ */
+QContact CntSymbianSrvConnection::searchContactName(QContactLocalId id,
+ QContactManager::Error* error)
+{
+ QList<QContact> list;
+
+ // Fetch results from the server
+ TBuf<100> sqlQuery;
+ sqlQuery.Format(_L("SELECT contact_id, first_name, last_name, company_name FROM contact WHERE contact_id = %d"), id);
+ TRAPD(err, list = searchContactNamesL(sqlQuery));
+ CntSymbianTransformError::transformError(err, error);
+
+ if (list.size() == 0) {
+ *error = QContactManager::DoesNotExistError;
+ return QContact();
+ }
+
+ return list.at(0);
+}
+
+/*!
+ * The leaving function that queries the SQL database
+ *
+ * \a aSqlQuery An SQL query
+ * \return the list of matched contact ids
+ */
+QList<QContactLocalId> CntSymbianSrvConnection::searchContactIdsL(const TDesC& aSqlQuery)
+{
+ readContactsToBufferL(aSqlQuery);
+
+ RBufReadStream readStream;
+ QList<QContactLocalId> list;
+ TInt item;
+
+ readStream.Open(*m_buffer);
+ while ((item = readStream.ReadInt32L()) != 0) {
+ list << item;
+ }
+
+ return list;
+}
+
+/*!
* The leaving function that queries the SQL database
*
* \a aSqlQuery An SQL query
* \return the list of matched contact ids
*/
-QList<QContactLocalId> CntSymbianSrvConnection::searchContactsL(const TDesC& aSqlQuery)
+QList<QContact> CntSymbianSrvConnection::searchContactNamesL(const TDesC& aSqlQuery)
+{
+ readContactsToBufferL(aSqlQuery);
+
+ RBufReadStream readStream;
+ QList<QContact> contacts;
+ TInt id;
+ TBuf<256> firstName;
+ TBuf<256> lastName;
+ TBuf<256> company;
+
+ readStream.Open(*m_buffer);
+ while ((id = readStream.ReadInt32L()) != 0) {
+ readStream >> firstName;
+ readStream >> lastName;
+ readStream >> company;
+
+ QContact contact, tempContact;
+
+ QContactName name;
+ name.setFirstName(QString::fromUtf16(firstName.Ptr(), firstName.Length()));
+ name.setLastName(QString::fromUtf16(lastName.Ptr(), lastName.Length()));
+ tempContact.saveDetail(&name);
+
+ QContactOrganization organization;
+ organization.setName(QString::fromUtf16(company.Ptr(), company.Length()));
+ tempContact.saveDetail(&organization);
+
+ QContactManager::Error error(QContactManager::NoError);
+ QString label = m_manager->synthesizedDisplayLabel(tempContact, &error);
+ if (error != QContactManager::NoError) {
+ continue;
+ }
+ tempContact.clearDetails();
+
+ m_manager->setContactDisplayLabel(&contact, label);
+
+ QContactId contactId;
+ contactId.setLocalId(id);
+ contactId.setManagerUri(m_manager->managerUri());
+ contact.setId(contactId);
+
+ contacts << contact;
+ }
+
+ return contacts;
+}
+
+
+/*!
+ * The leaving function that queries the SQL database
+ *
+ * \a id database id of the contact
+ * \return the list of matched contact names
+ */
+void CntSymbianSrvConnection::readContactsToBufferL(const TDesC& sqlQuery)
{
// Initialize connection if it is not initialized yet.
if (!m_isInitialized) {
@@ -116,24 +238,20 @@
OpenDatabaseL();
m_isInitialized = true;
}
-
- // Fetch results from the server
+
TIpcArgs args;
args.Set(0, &GetReceivingBufferL());
- args.Set(1, &aSqlQuery);
- TInt newBuffSize = SendReceive(KCntSearchResultIdLists, args);
+ args.Set(1, &sqlQuery);
+ TInt newBuffSize = SendReceive(KCntSearchResultList, args);
User::LeaveIfError(newBuffSize);
- if (newBuffSize > 0)
- {
+ if (newBuffSize > 0) {
args.Set(0, &GetReceivingBufferL(newBuffSize));
- args.Set(1,&aSqlQuery);
- User::LeaveIfError(newBuffSize = SendReceive(KCntSearchResultIdLists, args));
- }
-
- // Unpack the contact ids into an list
- return UnpackCntIdArrayL();
+ args.Set(1, &sqlQuery);
+ User::LeaveIfError(SendReceive(KCntSearchResultList, args));
+ }
}
+
/*!
* Connect to / create a cntsrv server session
*/
@@ -217,23 +335,3 @@
m_bufPtr.Set(m_buffer->Ptr(0));
return m_bufPtr;
}
-
-/*!
- * Unpack results from a buffer stream and store in a list
- *
- * \return list of matched contact ids
- */
-QList<QContactLocalId> CntSymbianSrvConnection::UnpackCntIdArrayL()
-{
- RBufReadStream readStream;
- QList<QContactLocalId> list;
- TContactItemId item;
-
- readStream.Open(*m_buffer);
- int count = readStream.ReadInt32L();
- for (int i=0; i<count; i++) {
- readStream >> item;
- list.append(item);
- }
- return list;
-}
--- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformavatar.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformavatar.cpp Fri May 14 15:42:23 2010 +0300
@@ -99,8 +99,9 @@
bool CntTransformAvatar::supportsField(TUint32 fieldType) const
{
bool ret = false;
- if (fieldType == KUidContactFieldCodImage.iUid)
+ if (fieldType == KUidContactFieldCodImage.iUid) {
ret = true;
+ }
return ret;
}
@@ -128,7 +129,6 @@
*/
bool CntTransformAvatar::supportsSubType(const QString& /*subType*/) const
{
- // XXX todo
return false;
}
@@ -138,10 +138,12 @@
* \a fieldName The name of the supported field
* \return fieldId for the fieldName, 0 if not supported
*/
-quint32 CntTransformAvatar::getIdForField(const QString& /*fieldName*/) const
+quint32 CntTransformAvatar::getIdForField(const QString& fieldName) const
{
- // XXX todo
- return 0;
+ if (QContactAvatar::FieldImageUrl == fieldName)
+ return 0;
+ else
+ return 0;
}
/*!
--- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformcontact.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformcontact.cpp Fri May 14 15:42:23 2010 +0300
@@ -49,6 +49,7 @@
#include "cnttransformaddress.h"
#include "cnttransformbirthday.h"
#include "cnttransformonlineaccount.h"
+#include "cnttransformpresence.h"
#include "cnttransformorganisation.h"
#include "cnttransformavatar.h"
#include "cnttransformringtone.h"
@@ -125,6 +126,9 @@
// 3.2.3 and 5.0 releases), it may be safer not to include online account
// at all.
m_transformContactData.insert(OnlineAccount, new CntTransformOnlineAccount);
+
+ // not supported on pre-10.1
+ m_transformContactData.insert(Presence, new CntTransformPresence);
#else
// Empty transform class for removing unsupported detail definitions
--- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformonlineaccount.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformonlineaccount.cpp Fri May 14 15:42:23 2010 +0300
@@ -119,37 +119,14 @@
// Transform Service Provider Text
TPtrC ServiceProviderText(reinterpret_cast<const TUint16*>(onlineAccount.serviceProvider().utf16()));
- if(ServiceProviderText.Length()) {
- CContactItemField* serviceProviderField = CContactItemField::NewLC(KStorageTypeText);
- serviceProviderField->TextStorage()->SetTextL(ServiceProviderText);
- serviceProviderField->AddFieldTypeL(KUidContactFieldServiceProvider);
- serviceProviderField->SetUserFlags(m_detailCounter);
- fieldList.append(serviceProviderField);
- CleanupStack::Pop(serviceProviderField);
- }
-
- //FIXME:no presence in onlineaccount anymore..
-// // Transform presence informaiton
-// TPtrC presenceText(reinterpret_cast<const TUint16*>(onlineAccount.presence().utf16()));
-// if(presenceText.Length()) {
-// QString presence = QString::number(encodePresence(onlineAccount.presence()));
-// CContactItemField* presenceField = CContactItemField::NewLC(KStorageTypeText);
-// TPtrC presenceEncodedText(reinterpret_cast<const TUint16*>(presence.utf16()));
-// presenceField->TextStorage()->SetTextL(presenceEncodedText);
-// presenceField->AddFieldTypeL(KUidContactFieldPresence);
-// fieldList.append(presenceField);
-// CleanupStack::Pop(presenceField);
-// }
-
-// // Transform statusMessage
-// TPtrC statusMsgText(reinterpret_cast<const TUint16*>(onlineAccount.statusMessage().utf16()));
-// if(statusMsgText.Length()) {
-// CContactItemField* statusMsgField = CContactItemField::NewLC(KStorageTypeText);
-// statusMsgField->TextStorage()->SetTextL(statusMsgText);
-// statusMsgField->AddFieldTypeL(KUidContactFieldStatusMsg);
-// fieldList.append(statusMsgField);
-// CleanupStack::Pop(statusMsgField);
-// }
+ if(ServiceProviderText.Length()) {
+ CContactItemField* serviceProviderField = CContactItemField::NewLC(KStorageTypeText);
+ serviceProviderField->TextStorage()->SetTextL(ServiceProviderText);
+ serviceProviderField->AddFieldTypeL(KUidContactFieldServiceProvider);
+ serviceProviderField->SetUserFlags(m_detailCounter);
+ fieldList.append(serviceProviderField);
+ CleanupStack::Pop(serviceProviderField);
+ }
}
if(fieldList.count() > 0) {
@@ -201,15 +178,6 @@
else if (field.ContentType().FieldType(i) == KUidContactFieldServiceProvider) {
onlineAccount->setServiceProvider(onlineAccountString);
}
- //Presence
- else if (field.ContentType().FieldType(i) == KUidContactFieldPresence) {
- QString presenceInfo = decodePresence(onlineAccountString.toInt());
-// onlineAccount->setPresence(presenceInfo);
- }
- //Status Message
- else if (field.ContentType().FieldType(i) == KUidContactFieldStatusMsg) {
-// onlineAccount->setStatusMessage(onlineAccountString);
- }
}
// set context
@@ -225,9 +193,7 @@
bool ret = false;
if (fieldType == KUidContactFieldSIPID.iUid ||
fieldType == KUidContactFieldIMPP.iUid ||
- fieldType == KUidContactFieldServiceProvider.iUid ||
- fieldType == KUidContactFieldPresence.iUid ||
- fieldType == KUidContactFieldStatusMsg.iUid )
+ fieldType == KUidContactFieldServiceProvider.iUid )
{
ret = true;
}
@@ -328,55 +294,6 @@
m_detailCounter = 0;
}
-/*!
- * Encode the presence information.
- * \a aPresence
- */
-quint32 CntTransformOnlineAccount::encodePresence(QString aPresence)
-{
- //FIXME:presence
-// if (QContactPresence::PresenceAvailable == aPresence)
-// return CntTransformOnlineAccount::EPresenceAvailable;
-// else if (QContactPresence::PresenceHidden == aPresence)
-// return CntTransformOnlineAccount::EPresenceHidden;
-// else if (QContactPresence::PresenceBusy == aPresence)
-// return CntTransformOnlineAccount::EPresenceBusy;
-// else if (QContactPresence::PresenceAway == aPresence)
-// return CntTransformOnlineAccount::EPresenceAway;
-// else if (QContactPresence::PresenceExtendedAway == aPresence)
-// return CntTransformOnlineAccount::EPresenceExtendedAway;
-// else if (QContactPresence::PresenceUnknown == aPresence)
-// return CntTransformOnlineAccount::EPresenceUnknown;
-// else
- return CntTransformOnlineAccount::EPresenceOffline;
-}
-
-
-
-/*!
- * Decode the presence information.
- * \a aPresence
- */
-QString CntTransformOnlineAccount::decodePresence(quint32 aPresence)
-{
- //FIXME:presence
-// if (CntTransformOnlineAccount::EPresenceAvailable == aPresence)
-// return QContactPresence::PresenceAvailable;
-// else if (CntTransformOnlineAccount::EPresenceHidden == aPresence)
-// return QContactPresence::PresenceHidden;
-// else if (CntTransformOnlineAccount::EPresenceBusy == aPresence)
-// return QContactPresence::PresenceBusy;
-// else if ( CntTransformOnlineAccount::EPresenceAway == aPresence)
-// return QContactPresence::PresenceAway;
-// else if ( CntTransformOnlineAccount::EPresenceExtendedAway == aPresence)
-// return QContactPresence::PresenceExtendedAway;
-// else if ( CntTransformOnlineAccount::EPresenceUnknown == aPresence)
-// return QContactPresence::PresenceUnknown;
-// else
-// return QContactPresence::PresenceOffline;
- return QString();
-}
-
#endif // SYMBIAN_BACKEND_USE_SQLITE
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformpresence.cpp Fri May 14 15:42:23 2010 +0300
@@ -0,0 +1,251 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifdef SYMBIAN_BACKEND_USE_SQLITE
+
+#include "cnttransformpresence.h"
+#include "cntmodelextuids.h"
+
+CntTransformPresence::CntTransformPresence() :
+m_detailCounter(0)
+{
+}
+
+QList<CContactItemField *> CntTransformPresence::transformDetailL(const QContactDetail &detail)
+{
+ if(detail.definitionName() != QContactPresence::DefinitionName)
+ User::Leave(KErrArgument);
+
+ QList<CContactItemField *> fieldList;
+
+ //cast to presence
+ const QContactPresence &presenceDetail(static_cast<const QContactPresence&>(detail));
+
+ // Transform presence informaiton
+ if(presenceDetail.presenceState() != QContactPresence::PresenceUnknown) {
+ QString presence = QString::number(presenceDetail.presenceState());
+ CContactItemField* presenceField = CContactItemField::NewLC(KStorageTypeText);
+ TPtrC presenceEncodedText(reinterpret_cast<const TUint16*>(presence.utf16()));
+ presenceField->TextStorage()->SetTextL(presenceEncodedText);
+ presenceField->AddFieldTypeL(KUidContactFieldPresence);
+ presenceField->SetUserFlags(m_detailCounter);
+ fieldList.append(presenceField);
+ CleanupStack::Pop(presenceField);
+ }
+
+ // Transform statusMessage
+ TPtrC statusMsgText(reinterpret_cast<const TUint16*>(presenceDetail.presenceStateText().utf16()));
+ if(statusMsgText.Length()) {
+ CContactItemField* statusMsgField = CContactItemField::NewLC(KStorageTypeText);
+ statusMsgField->TextStorage()->SetTextL(statusMsgText);
+ statusMsgField->AddFieldTypeL(KUidContactFieldStatusMsg);
+ statusMsgField->SetUserFlags(m_detailCounter);
+ fieldList.append(statusMsgField);
+ CleanupStack::Pop(statusMsgField);
+ }
+
+ if(fieldList.count() > 0) {
+ m_detailCounter++;
+ }
+
+ return fieldList;
+}
+
+QContactDetail *CntTransformPresence::transformItemField(const CContactItemField& field, const QContact &contact)
+{
+ QList<QContactDetail> presenceDetails = contact.details(QContactPresence::DefinitionName);
+ //check what presence detail the provided field belongs to. if there is no such detail yet,
+ //let's create it.
+ if (presenceDetails.count() <= field.UserFlags()) {
+ for (int i = presenceDetails.count(); i <= field.UserFlags(); i++) {
+ QContactPresence *presence = new QContactPresence();
+ QContact& currentContact = const_cast<QContact&>(contact);
+ currentContact.saveDetail(presence);
+ }
+ presenceDetails = contact.details(QContactPresence::DefinitionName);
+ }
+ QContactPresence *presenceDetail = new QContactPresence(presenceDetails.at(field.UserFlags()));
+
+ CContactTextField* storage = field.TextStorage();
+ QString presenceString = QString::fromUtf16(storage->Text().Ptr(), storage->Text().Length());
+
+ for (int i = 0; i < field.ContentType().FieldTypeCount(); i++) {
+ //Presence
+ if (field.ContentType().FieldType(i) == KUidContactFieldPresence) {
+ QContactPresence::PresenceState presenceState = decodePresence(presenceString);
+ presenceDetail->setPresenceState(presenceState);
+ }
+ //Status Message
+ else if (field.ContentType().FieldType(i) == KUidContactFieldStatusMsg) {
+ presenceDetail->setPresenceStateText(presenceString);
+ }
+ }
+
+ // set context
+ for (int i = 0; i < field.ContentType().FieldTypeCount(); i++) {
+ setContexts(field.ContentType().FieldType(i), *presenceDetail);
+ }
+
+ return presenceDetail;
+}
+
+bool CntTransformPresence::supportsField(TUint32 fieldType) const
+{
+ bool ret = false;
+ if (fieldType == KUidContactFieldPresence.iUid ||
+ fieldType == KUidContactFieldStatusMsg.iUid )
+ {
+ ret = true;
+ }
+ return ret;
+}
+
+bool CntTransformPresence::supportsDetail(QString detailName) const
+{
+ bool ret = false;
+ if (detailName == QContactPresence::DefinitionName) {
+ ret = true;
+ }
+ return ret;
+}
+
+QList<TUid> CntTransformPresence::supportedSortingFieldTypes(QString /*detailFieldName*/) const
+{
+ // Sorting not supported
+ return QList<TUid>();
+}
+
+
+/*!
+ * Checks whether the subtype is supported
+ *
+ * \a subType The subtype to be checked
+ * \return True if this subtype is supported
+ */
+bool CntTransformPresence::supportsSubType(const QString& /*subType*/) const
+{
+ return false;
+}
+
+/*!
+ * Returns the filed id corresponding to a field
+ *
+ * \a fieldName The name of the supported field
+ * \return fieldId for the fieldName, 0 if not supported
+ */
+quint32 CntTransformPresence::getIdForField(const QString& fieldName) const
+{
+ if (QContactPresence::FieldPresenceState == fieldName)
+ return KUidContactFieldPresence.iUid;
+ if (QContactPresence::FieldPresenceStateText == fieldName)
+ return KUidContactFieldStatusMsg.iUid;
+ else
+ return 0;
+}
+
+/*!
+ * Modifies the detail definitions. The default detail definitions are
+ * queried from QContactManagerEngine::schemaDefinitions and then modified
+ * with this function in the transform leaf classes.
+ *
+ * \a definitions The detail definitions to modify.
+ * \a contactType The contact type the definitions apply for.
+ */
+void CntTransformPresence::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
+{
+ Q_UNUSED(contactType);
+
+ if(definitions.contains(QContactPresence::DefinitionName)) {
+ QContactDetailDefinition d = definitions.value(QContactPresence::DefinitionName);
+ QMap<QString, QContactDetailFieldDefinition> fields = d.fields();
+ QContactDetailFieldDefinition f;
+
+ // Don't support "ContextOther"
+ f.setDataType(QVariant::StringList);
+ f.setAllowableValues(QVariantList()
+ << QLatin1String(QContactDetail::ContextHome)
+ << QLatin1String(QContactDetail::ContextWork));
+ fields[QContactDetail::FieldContext] = f;
+ d.setFields(fields);
+
+ // Replace original definitions
+ definitions.insert(d.name(), d);
+ }
+}
+
+/*!
+ * Reset internal variables.
+ */
+void CntTransformPresence::reset()
+{
+ m_detailCounter = 0;
+}
+
+/*!
+ * Decode the presence information.
+ * \a aPresence
+ */
+QContactPresence::PresenceState CntTransformPresence::decodePresence(QString presence)
+{
+ bool ok = false;
+ int presenceInt = presence.toInt(&ok);
+ if (!ok){
+ return QContactPresence::PresenceUnknown;
+ }
+
+ if (presenceInt == QContactPresence::PresenceAvailable)
+ return QContactPresence::PresenceAvailable;
+ else if (presenceInt == QContactPresence::PresenceHidden)
+ return QContactPresence::PresenceHidden;
+ else if (presenceInt == QContactPresence::PresenceBusy)
+ return QContactPresence::PresenceBusy;
+ else if (presenceInt == QContactPresence::PresenceAway)
+ return QContactPresence::PresenceAway;
+ else if (presenceInt == QContactPresence::PresenceExtendedAway)
+ return QContactPresence::PresenceExtendedAway;
+ else if (presenceInt == QContactPresence::PresenceOffline)
+ return QContactPresence::PresenceOffline;
+ else
+ return QContactPresence::PresenceUnknown;
+}
+
+#endif // SYMBIAN_BACKEND_USE_SQLITE
+
+// End of file
--- a/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformringtone.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/src/transform/cnttransformringtone.cpp Fri May 14 15:42:23 2010 +0300
@@ -71,7 +71,6 @@
{
QContactRingtone *ringtone = new QContactRingtone(contact.detail<QContactRingtone>());
- // XXX ringtone can have multiple values from different fields glommed together
CContactTextField* storage = field.TextStorage();
QString ringtoneString = QString::fromUtf16(storage->Text().Ptr(), storage->Text().Length());
@@ -82,8 +81,6 @@
ringtone->setVideoRingtoneUrl(ringtoneString);
}
- // XXX need to remove old one somehow
-
return ringtone;
}
@@ -121,7 +118,6 @@
*/
bool CntTransformRingtone::supportsSubType(const QString& /*subType*/) const
{
- // XXX todo
return false;
}
@@ -131,10 +127,14 @@
* \a fieldName The name of the supported field
* \return fieldId for the fieldName, 0 if not supported
*/
-quint32 CntTransformRingtone::getIdForField(const QString& /*fieldName*/) const
+quint32 CntTransformRingtone::getIdForField(const QString& fieldName) const
{
- // XXX todo
- return 0;
+ if (QContactRingtone::FieldAudioRingtoneUrl == fieldName)
+ return 0;
+ else if (QContactRingtone::FieldVideoRingtoneUrl == fieldName)
+ return 0;
+ else
+ return 0;
}
/*!
--- a/qtcontactsmobility/plugins/contacts/symbian/symbian.pro Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbian/symbian.pro Fri May 14 15:42:23 2010 +0300
@@ -40,6 +40,7 @@
inc/transform/cnttransformurl.h \
inc/transform/cnttransformbirthday.h \
inc/transform/cnttransformonlineaccount.h \
+ inc/transform/cnttransformpresence.h \
inc/transform/cnttransformorganisation.h \
inc/transform/cnttransformringtone.h \
inc/transform/cnttransformthumbnail.h \
@@ -85,6 +86,7 @@
src/transform/cnttransformurl.cpp \
src/transform/cnttransformbirthday.cpp \
src/transform/cnttransformonlineaccount.cpp \
+ src/transform/cnttransformpresence.cpp \
src/transform/cnttransformorganisation.cpp \
src/transform/cnttransformringtone.cpp \
src/transform/cnttransformthumbnail.cpp \
@@ -136,7 +138,8 @@
-lfbscli \
-limageconversion \
-lbitmaptransforms \
- -lbafl
+ -lbafl \
+ -lplatformenv
target.path = /sys/bin
INSTALLS += target
--- a/qtcontactsmobility/plugins/contacts/symbiansim/src/cntsimstoreprivate.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/plugins/contacts/symbiansim/src/cntsimstoreprivate.cpp Fri May 14 15:42:23 2010 +0300
@@ -82,8 +82,8 @@
convertStoreNameL(storeName);
// SDN store is always read only
- if (m_storeName == KParameterValueSimStoreNameSdn)
- m_readOnlyAccess = true;
+ //if (m_storeName == KParameterValueSimStoreNameSdn)
+ // m_readOnlyAccess = true;
// Open etel server
User::LeaveIfError(m_etelServer.Connect());
@@ -432,7 +432,7 @@
QString nameString = QString::fromUtf16(bufPtr.Ptr(), bufPtr.Length());
name.setCustomLabel(nameString);
if (m_readOnlyAccess)
- m_engine.setReadOnlyAccessConstraint(&name);
+ m_engine.setReadOnlyAccessConstraint(&name);
currentContact.saveDetail(&name);
QContactManager::Error error(QContactManager::NoError);
m_engine.setContactDisplayLabel(¤tContact, m_engine.synthesizedDisplayLabel(currentContact, &error));
--- a/qtcontactsmobility/src/contacts/qcontactmanagerengine.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/contacts/qcontactmanagerengine.cpp Fri May 14 15:42:23 2010 +0300
@@ -560,7 +560,6 @@
f.setFilters(filters);
return canonicalizedFilter(f);
}
- break;
case QContactFilter::IntersectionFilter:
{
@@ -589,7 +588,6 @@
f.setFilters(filters);
return f;
}
- break;
case QContactFilter::UnionFilter:
{
@@ -618,7 +616,6 @@
f.setFilters(filters);
return f;
}
- break;
case QContactFilter::LocalIdFilter:
{
--- a/qtcontactsmobility/src/versit/qversitcontactexporter_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitcontactexporter_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -257,7 +257,12 @@
const QContactDetail& detail)
{
QContactPhoneNumber phoneNumber = static_cast<QContactPhoneNumber>(detail);
- encodeParameters(property, phoneNumber.contexts(), phoneNumber.subTypes());
+ QStringList subTypes = phoneNumber.subTypes();
+ encodeParameters(property, phoneNumber.contexts(), subTypes);
+ if (subTypes.contains(QContactPhoneNumber::SubTypeAssistant))
+ property.setName(QLatin1String("X-ASSISTANT-TEL"));
+ else
+ property.setName(QLatin1String("TEL"));
property.setValue(phoneNumber.number());
}
--- a/qtcontactsmobility/src/versit/qversitcontactimporter_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitcontactimporter_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -248,6 +248,8 @@
QContactPhoneNumber phone;
phone.setNumber(property.value());
phone.setSubTypes(extractSubTypes(property));
+ if (property.name() == QLatin1String("X-ASSISTANT-TEL"))
+ phone.setSubTypes(QContactPhoneNumber::SubTypeAssistant);
saveDetailWithContext(contact, &phone, extractContexts(property));
return true;
--- a/qtcontactsmobility/src/versit/qversitdefs_p.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitdefs_p.h Fri May 14 15:42:23 2010 +0300
@@ -135,6 +135,8 @@
""},
{"X-ASSISTANT", QContactOrganization::DefinitionName.latin1(),
QContactOrganization::FieldAssistantName.latin1()},
+ {"X-ASSISTANT-TEL", QContactPhoneNumber::DefinitionName.latin1(),
+ QContactPhoneNumber::SubTypeAssistant.latin1()},
{"X-CHILDREN", QContactFamily::DefinitionName.latin1(),
QContactFamily::FieldChildren.latin1()},
{"X-EPOCSECONDNAME",QContactNickname::DefinitionName.latin1(),
--- a/qtcontactsmobility/src/versit/qversitproperty.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitproperty.cpp Fri May 14 15:42:23 2010 +0300
@@ -120,10 +120,19 @@
/*! Returns true if this is equal to \a other; false otherwise. */
bool QVersitProperty::operator==(const QVersitProperty& other) const
{
- return d->mGroups == other.d->mGroups &&
+ bool equal = d->mGroups == other.d->mGroups &&
d->mName == other.d->mName &&
d->mParameters == other.d->mParameters &&
- d->mValue == other.d->mValue;
+ d->mValueType == other.d->mValueType;
+ if (!equal)
+ return false;
+
+ // QVariant doesn't support == on QVersitDocuments - do it manually
+ if (d->mValue.userType() == qMetaTypeId<QVersitDocument>())
+ return other.d->mValue.userType() == qMetaTypeId<QVersitDocument>()
+ && d->mValue.value<QVersitDocument>() == other.d->mValue.value<QVersitDocument>();
+ else
+ return d->mValue == other.d->mValue;
}
/*! Returns true if this is not equal to \a other; false otherwise. */
--- a/qtcontactsmobility/src/versit/qversitreader_p.cpp Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitreader_p.cpp Fri May 14 15:42:23 2010 +0300
@@ -242,6 +242,14 @@
QVersitProperty::ListType);
mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("CATEGORIES")),
QVersitProperty::ListType);
+ mValueTypeMap.insert(qMakePair(QVersitDocument::VCard21Type, QString::fromAscii("X-CHILDREN")),
+ QVersitProperty::ListType);
+ mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("X-CHILDREN")),
+ QVersitProperty::ListType);
+ mValueTypeMap.insert(qMakePair(QVersitDocument::VCard21Type, QString::fromAscii("X-NICKNAME")),
+ QVersitProperty::ListType);
+ mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("X-NICKNAME")),
+ QVersitProperty::ListType);
}
/*! Destroy a reader. */
@@ -422,6 +430,11 @@
QVersitProperty property;
property.setGroups(groupsAndName.first);
property.setName(groupsAndName.second);
+ // set the propertyValueType
+ QPair<QVersitDocument::VersitType, QString> key =
+ qMakePair(versitType, property.name());
+ if (mValueTypeMap.contains(key))
+ property.setValueType(mValueTypeMap.value(key));
if (versitType == QVersitDocument::VCard21Type)
parseVCard21Property(cursor, property, lineReader);
@@ -440,8 +453,7 @@
property.setParameters(extractVCard21PropertyParams(cursor, lineReader.codec()));
QByteArray value = extractPropertyValue(cursor);
- if (mValueTypeMap.value(qMakePair(QVersitDocument::VCard21Type, property.name()))
- == QVersitProperty::VersitDocumentType) {
+ if (property.valueType() == QVersitProperty::VersitDocumentType) {
// Hack to handle cases where start of document is on the same or next line as "AGENT:"
bool foundBegin = false;
if (value == "BEGIN:VCARD") {
@@ -462,9 +474,10 @@
QVariant valueVariant(decodeCharset(value, property, lineReader.codec(), &codec));
bool isBinary = unencode(valueVariant, cursor, property, codec, lineReader);
property.setValue(valueVariant);
- if (!isBinary) {
- splitStructuredValue(QVersitDocument::VCard21Type, property, false);
- }
+ if (isBinary)
+ property.setValueType(QVersitProperty::BinaryType);
+ else
+ splitStructuredValue(property, false);
}
}
@@ -481,8 +494,7 @@
QTextCodec* codec;
QString valueString(decodeCharset(value, property, lineReader.codec(), &codec));
- if (mValueTypeMap.value(qMakePair(QVersitDocument::VCard30Type, property.name()))
- == QVersitProperty::VersitDocumentType) {
+ if (property.valueType() == QVersitProperty::VersitDocumentType) {
removeBackSlashEscaping(valueString);
// Make a line reader from the value of the property.
QByteArray subDocumentValue(codec->fromUnicode(valueString));
@@ -501,8 +513,10 @@
QVariant valueVariant(valueString);
bool isBinary = unencode(valueVariant, cursor, property, codec, lineReader);
property.setValue(valueVariant);
- if (!isBinary) {
- bool isList = splitStructuredValue(QVersitDocument::VCard30Type, property, true);
+ if (isBinary) {
+ property.setValueType(QVersitProperty::BinaryType);
+ } else {
+ bool isList = splitStructuredValue(property, true);
// Do backslash unescaping
if (isList) {
QStringList list = property.value<QStringList>();
@@ -868,23 +882,19 @@
* exit).
*/
bool QVersitReaderPrivate::splitStructuredValue(
- QVersitDocument::VersitType type, QVersitProperty& property,
+ QVersitProperty& property,
bool hasEscapedBackslashes) const
{
QVariant variant = property.variantValue();
- QPair<QVersitDocument::VersitType,QString> key = qMakePair(type, property.name());
- if (mValueTypeMap.contains(key)) {
- if (mValueTypeMap.value(key) == QVersitProperty::CompoundType) {
- variant.setValue(splitValue(variant.toString(), QLatin1Char(';'),
- QString::KeepEmptyParts, hasEscapedBackslashes));
- property.setValue(variant);
- property.setValueType(QVersitProperty::CompoundType);
- } else if (mValueTypeMap.value(key) == QVersitProperty::ListType) {
- variant.setValue(splitValue(variant.toString(), QLatin1Char(','),
- QString::SkipEmptyParts, hasEscapedBackslashes));
- property.setValue(variant);
- property.setValueType(QVersitProperty::ListType);
- }
+ if (property.valueType() == QVersitProperty::CompoundType) {
+ variant.setValue(splitValue(variant.toString(), QLatin1Char(';'),
+ QString::KeepEmptyParts, hasEscapedBackslashes));
+ property.setValue(variant);
+ return true;
+ } else if (property.valueType() == QVersitProperty::ListType) {
+ variant.setValue(splitValue(variant.toString(), QLatin1Char(','),
+ QString::SkipEmptyParts, hasEscapedBackslashes));
+ property.setValue(variant);
return true;
}
return false;
--- a/qtcontactsmobility/src/versit/qversitreader_p.h Mon May 03 12:24:20 2010 +0300
+++ b/qtcontactsmobility/src/versit/qversitreader_p.h Fri May 14 15:42:23 2010 +0300
@@ -206,8 +206,7 @@
QString paramName(const QByteArray& parameter, QTextCodec* codec) const;
QString paramValue(const QByteArray& parameter, QTextCodec* codec) const;
static bool containsAt(const QByteArray& text, const QByteArray& ba, int index);
- bool splitStructuredValue(QVersitDocument::VersitType type,
- QVersitProperty& property,
+ bool splitStructuredValue(QVersitProperty& property,
bool hasEscapedBackslashes) const;
static QStringList splitValue(const QString& string,
const QChar& sep,
--- a/qtcontactsmobility/tests/auto/qversit/testdata/gmail.vcf Mon May 03 12:24:20 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-BEGIN:VCARD
-VERSION:3.0
-FN:Test Contact
-N:Contact;Test;;;
-EMAIL;TYPE=INTERNET;TYPE=HOME:a@b.com
-TEL;TYPE=CELL:1234
-ADR;TYPE=HOME:;address;;;;;
-ORG:company
-TITLE:title
-BDAY:1900-01-01
-URL;TYPE=HOME:website
-END:VCARD
-BEGIN:VCARD
-VERSION:3.0
-FN:Test Contact 2
-N:2;Test;Contact;;
-EMAIL;TYPE=INTERNET;TYPE=HOME:a@b.com
-TEL;TYPE=CELL:1234
-ADR;TYPE=HOME:;address;;;;;
-ORG:ノキア
-TITLE:title
-BDAY:1900-01-01
-URL;TYPE=HOME:website
-END:VCARD